@snapcall/stream-ui 1.24.0 → 1.24.1

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.
@@ -303,7 +303,7 @@ to {
303
303
  * Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */function(e){var t=0,r=!1,n=!1;try{var o=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,o)}catch(e){}var i=function(e){var r=e.target,n=window.innerWidth/window.document.documentElement.clientWidth;if(!(e.touches.length>1)&&1===n){for(;r!==document.body&&r!==document;){var o=window.getComputedStyle(r);if(!o)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var i=o.getPropertyValue("-webkit-overflow-scrolling"),a=o.getPropertyValue("overflow-y"),s=parseInt(o.getPropertyValue("height"),10),l="touch"===i&&("auto"===a||"scroll"===a),d=r.scrollHeight>r.offsetHeight;if(l&&d){var c=e.touches?e.touches[0].screenY:e.screenY,u=t<=c&&0===r.scrollTop,h=t>=c&&r.scrollHeight-r.scrollTop===s;(u||h)&&e.preventDefault();return}r=r.parentNode}e.preventDefault()}},a=function(e){t=e.touches?e.touches[0].screenY:e.screenY},s=function(){window.addEventListener("touchstart",a,!!n&&{passive:!1}),window.addEventListener("touchmove",i,!!n&&{passive:!1}),r=!0},l=document.createElement("div");document.documentElement.appendChild(l),l.style.WebkitOverflowScrolling="touch";var d="getComputedStyle"in window&&"touch"===window.getComputedStyle(l)["-webkit-overflow-scrolling"];document.documentElement.removeChild(l),d&&s();var c={enable:s,disable:function(){window.removeEventListener("touchstart",a,!1),window.removeEventListener("touchmove",i,!1),r=!1},isEnabled:function(){return r},isScrollSupported:d};(I_&&(I_=c),"function"==typeof e.define)?(0,e.define)("iNoBounce",[],function(){return c}):e.iNoBounce=c}(I_);let IR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class IH{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||IR,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new IH(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new IH(this.logger,e)}}var Iz=new IH;class IE{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[t,n]=e;for(let e=0;e<n;e++)t(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(t=>{let[n,o]=t;for(let t=0;t<o;t++)n.apply(n,[e,...r])})}}function IV(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r}function IW(e){return null==e?"":""+e}let IT=/###/g;function ID(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(IT,"."):e}function o(){return!e||"string"==typeof e}let i="string"!=typeof t?t:t.split("."),a=0;for(;a<i.length-1;){if(o())return{};let t=n(i[a]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return o()?{}:{obj:e,k:n(i[a])}}function IO(e,t,r){let{obj:n,k:o}=ID(e,t,Object);if(void 0!==n||1===t.length){n[o]=r;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=ID(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,(s=ID(e,a=a.slice(0,a.length-1),Object))&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=r}function II(e,t){let{obj:r,k:n}=ID(e,t);if(r)return r[n]}function IA(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var IZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function IB(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>IZ[e]):e}let IF=[" ",",","?","!",";"],Iq=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20);function IU(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let n=t.split(r),o=e;for(let e=0;e<n.length;){let t;if(!o||"object"!=typeof o)return;let i="";for(let a=e;a<n.length;++a)if(a!==e&&(i+=r),i+=n[a],void 0!==(t=o[i])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}o=t}return o}function I$(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class IY extends IE{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?n=e.split("."):(n=[e,t],r&&(Array.isArray(r)?n.push(...r):"string"==typeof r&&i?n.push(...r.split(i)):n.push(r)));let s=II(this.data,n);return(!s&&!t&&!r&&e.indexOf(".")>-1&&(e=n[0],t=n[1],r=n.slice(2).join(".")),s||!a||"string"!=typeof r)?s:IU(this.data&&this.data[e]&&this.data[e][t],r,i)}addResource(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];r&&(a=a.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),IO(this.data,a,n),o.silent||this.emit("added",e,t,r,n)}addResources(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let n in r)("string"==typeof r[n]||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=II(this.data,a)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?function e(t,r,n){for(let o in r)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||t[o]instanceof String||"string"==typeof r[o]||r[o]instanceof String?n&&(t[o]=r[o]):e(t[o],r[o],n):t[o]=r[o]);return t}(s,r,o):s={...s,...r},IO(this.data,a,s),i.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var IX={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,r,n,o))}),t}};let IG={};class IK extends IE{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,r){e.forEach(e=>{t[e]&&(r[e]=t[e])})}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Iz.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let r=this.resolve(e,t);return r&&void 0!==r.res}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,r){t=t||"",r=r||"";let n=IF.filter(e=>0>t.indexOf(e)&&0>r.indexOf(e));if(0===n.length)return!0;let o=Iq.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(r);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,r,n);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};let i=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(n)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,r){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let n=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],l=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(d){let e=t.nsSeparator||this.options.nsSeparator;return n?{res:`${s}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${i}`}return n?{res:i,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:i}let c=this.resolve(e,t),u=c&&c.res,h=c&&c.usedKey||i,p=c&&c.exactUsedKey||i,f=Object.prototype.toString.apply(u),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,g="string"!=typeof u&&"boolean"!=typeof u&&"number"!=typeof u;if(C&&u&&g&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(f)&&!("string"==typeof m&&Array.isArray(u))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,u,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return n?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){let e=Array.isArray(u),r=e?[]:{},n=e?p:h;for(let e in u)if(Object.prototype.hasOwnProperty.call(u,e)){let i=`${n}${o}${e}`;r[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),r[e]===i&&(r[e]=u[e])}u=r}}else if(C&&"string"==typeof m&&Array.isArray(u))(u=u.join(m))&&(u=this.extendTranslation(u,e,t,r));else{let n=!1,a=!1,d=void 0!==t.count&&"string"!=typeof t.count,h=IK.hasDefaultValue(t),p=d?this.pluralResolver.getSuffix(l,t.count,t):"",f=t.ordinal&&d?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",m=d&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),C=m&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${f}`]||t.defaultValue;!this.isValidLookup(u)&&h&&(n=!0,u=C),this.isValidLookup(u)||(a=!0,u=i);let g=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,w=h&&C!==u&&this.options.updateMissing;if(a||n||w){if(this.logger.log(w?"updateKey":"missingKey",l,s,i,w?C:u),o){let e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],r=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&r&&r[0])for(let t=0;t<r.length;t++)e.push(r[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);let n=(e,r,n)=>{let o=h&&n!==u?n:g;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,r,o,w,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,r,o,w,t),this.emit("missingKey",e,s,r,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&d?e.forEach(e=>{let r=this.pluralResolver.getSuffixes(e,t);m&&t[`defaultValue${this.options.pluralSeparator}zero`]&&0>r.indexOf(`${this.options.pluralSeparator}zero`)&&r.push(`${this.options.pluralSeparator}zero`),r.forEach(r=>{n([e],i+r,t[`defaultValue${r}`]||C)})}):n(e,i,C))}u=this.extendTranslation(u,e,t,c,r),a&&u===i&&this.options.appendNamespaceToMissingKey&&(u=`${s}:${i}`),(a||n)&&this.options.parseMissingKeyHandler&&(u="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,n?u:void 0):this.options.parseMissingKeyHandler(u))}return n?(c.res=u,c.usedParams=this.getUsedParamsDetails(t),c):u}extendTranslation(e,t,r,n,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let a;r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});let s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){let t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(r.nest=!1)}!r.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(r.lng=n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,n=Array(e),a=0;a<e;a++)n[a]=arguments[a];return o&&o[0]===n[0]&&!r.context?(i.logger.warn(`It seems you are nesting recursively key: ${n[0]} in key: ${t[0]}`),null):i.translate(...n,t)},r)),r.interpolation&&this.interpolator.reset()}let a=r.postProcess||this.options.postProcess,s="string"==typeof a?[a]:a;return null!=e&&s&&s.length&&!1!==r.applyPostProcessor&&(e=IX.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let t,r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let s=this.extractFromKey(e,a),l=s.key;r=l;let d=s.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));let c=void 0!==a.count&&"string"!=typeof a.count,u=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);d.forEach(e=>{this.isValidLookup(t)||(i=e,!IG[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(IG[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{let i;if(this.isValidLookup(t))return;o=r;let s=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(r,a.count,a));let t=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(s.push(l+e),a.ordinal&&0===e.indexOf(n)&&s.push(l+e.replace(n,this.options.pluralSeparator)),u&&s.push(l+t)),h){let r=`${l}${this.options.contextSeparator}${a.context}`;s.push(r),c&&(s.push(r+e),a.ordinal&&0===e.indexOf(n)&&s.push(r+e.replace(n,this.options.pluralSeparator)),u&&s.push(r+t))}}for(;i=s.pop();)this.isValidLookup(t)||(n=i,t=this.getResource(r,e,i,a))}))})}),{res:t,usedKey:r,exactUsedKey:n,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&"string"!=typeof e.replace,r=t?e.replace:e;if(t&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){let t="defaultValue";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}function IQ(e){return e.charAt(0).toUpperCase()+e.slice(1)}class IJ{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Iz.create("languageUtils")}getScriptPartFromCode(e){if(!(e=I$(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=I$(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map(e=>e.toLowerCase()):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=IQ(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=IQ(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=IQ(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(0>e.indexOf("-")&&0>r.indexOf("-"))&&(e.indexOf("-")>0&&0>r.indexOf("-")&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],o=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach(e=>{0>n.indexOf(e)&&o(this.formatLanguageCode(e))}),n}}let I1=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],I2={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},I0=["v1","v2","v3"],I3=["v4"],I9={zero:0,one:1,two:2,few:3,many:4,other:5};class I5{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Iz.create("pluralResolver"),(!this.options.compatibilityJSON||I3.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){let e={};return I1.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:I2[t.fc]}})}),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(I$("dev"===e?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((e,t)=>I9[e]-I9[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):r.numbers.map(r=>this.getSuffix(e,r,t)):[]}getSuffix(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:this.getSuffixRetroCompatible(n,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));let o=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!I0.includes(this.options.compatibilityJSON)}}function I6(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=function(e,t,r){let n=II(e,r);return void 0!==n?n:II(t,r)}(e,t,r);return!i&&o&&"string"==typeof r&&void 0===(i=IU(e,r,n))&&(i=IU(t,r,n)),i}class I4{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Iz.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:r,useRawValueToEscape:n,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:d,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:m,maxReplaces:C,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:IB,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=o?IA(o):i||"{{",this.suffix=a?IA(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=d?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=u?IA(u):h||IA("$t("),this.nestingSuffix=p?IA(p):f||IA(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=C||1e3,this.alwaysFormat=void 0!==g&&g,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,r,n){let o,i,a;let s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}let d=e=>{if(0>e.indexOf(this.formatSeparator)){let o=I6(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,r,{...n,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(I6(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:i})};this.resetRegExp();let c=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,u=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>l(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?l(this.escape(e)):l(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){let r=o[1].trim();if(void 0===(i=d(r))){if("function"==typeof c){let t=c(e,o,n);i="string"==typeof t?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))i="";else if(u){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=IW(i));let s=t.safeValue(i);if(e=e.replace(o[0],s),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t){let r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){let r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;let n=e.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;e=n[0];let a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e}for(;r=this.nestingRegexp.exec(e);){let s=[];(o=(o={...i}).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){let e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),s=e,l=!0}if((n=t(a.call(this,r[1].trim(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=IW(n)),n||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),n=""),l&&(n=s.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:r[1].trim()}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}function I8(e){let t={};return function(r,n,o){let i=n+JSON.stringify(o),a=t[i];return a||(a=e(I$(n),o),t[i]=a),a(r)}}class I7{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Iz.create("formatter"),this.options=e,this.formats={number:I8((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:I8((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:I8((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:I8((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:I8((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=I8(t)}format(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce((e,t)=>{let{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let o=n[1].substring(0,n[1].length-1);"currency"===t&&0>o.indexOf(":")?r.currency||(r.currency=o.trim()):"relativetime"===t&&0>o.indexOf(":")?r.range||(r.range=o.trim()):o.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();r[i]||(r[i]=o),"false"===o&&(r[i]=!1),"true"===o&&(r[i]=!0),isNaN(o)||(r[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:r}}(t);if(this.formats[o]){let t=e;try{let a=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[o](e,s,{...i,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class Ae extends IE{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=Iz.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,n.backend,n)}queueLoad(e,t,r,n){let o={},i={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,n=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){let n=e.split("|"),o=n[0],i=n[1];t&&this.emit("failedLoading",o,i,t),r&&this.store.addResourceBundle(o,i,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;let a={};this.queue.forEach(r=>{(function(e,t,r,n){let{obj:o,k:i}=ID(e,t,Object);o[i]=o[i]||[],o[i].push(r)})(r.loaded,[o],i),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:o,callback:i});return}this.readingCalls++;let a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(a&&s&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*o,i)},o);return}i(a,s)},s=this.backend[r].bind(this.backend);if(2===s.length){try{let r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let o=this.queueLoad(e,t,r,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),n=r[0],o=r[1];this.read(n,o,"read",void 0,void 0,(r,i)=>{r&&this.logger.warn(`${t}loading namespace ${o} for language ${n} failed`,r),!r&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${n}`,i),this.loaded(e,r,i)})}saveMissing(e,t,r,n,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=r&&""!==r){if(this.backend&&this.backend.create){let s={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;(o=5===l.length?l(e,t,r,n,s):l(e,t,r,n))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}function At(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ar(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function An(){}class Ao extends IE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Ar(e),this.services={},this.logger=Iz,this.modules={external:[]},!function(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})}(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let n=At();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...n,...this.options,...Ar(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?Iz.init(o(this.modules.logger),this.options):Iz.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=I7);let r=new IJ(this.options);this.store=new IY(this.options.resources,this.options);let i=this.services;i.logger=Iz,i.resourceStore=this.store,i.languageUtils=r,i.pluralResolver=new I5(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new I4(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Ae(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit(t,...n)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new IK(this.services,this.options),this.translator.on("*",function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,r||(r=An),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let i=IV(),a=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),r(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:An,r=t,n="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,r){let n=IV();return e||(e=this.languages),t||(t=this.options.ns),r||(r=An),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&IX.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var r=this;this.isLanguageChangingTo=e;let n=IV();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve(function(){return r.t(...arguments)}),t&&t(e,function(){return r.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);let r="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);r&&(this.language||o(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(r)),this.loadResources(r,e=>{i(e,r)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}getFixedT(e,t,r){var n=this;let o=function(e,t){let i,a;if("object"!=typeof t){for(var s=arguments.length,l=Array(s>2?s-2:0),d=2;d<s;d++)l[d-2]=arguments[d];i=n.options.overloadTranslationOptionHandler([e,t].concat(l))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,i.keyPrefix=i.keyPrefix||r||o.keyPrefix;let c=n.options.keySeparator||".";return a=i.keyPrefix&&Array.isArray(e)?e.map(e=>`${i.keyPrefix}${c}${e}`):i.keyPrefix?`${i.keyPrefix}${c}${e}`:e,n.t(a,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let i=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||2===r};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,e)&&(!n||i(o,e)))}loadNamespaces(e,t){let r=IV();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=IV();"string"==typeof e&&(e=[e]);let n=this.options.preload||[],o=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=n.concat(o),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){return(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf((this.services&&this.services.languageUtils||new IJ(At())).getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Ao(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:An,r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},o=new Ao(n);return(void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new IY(this.store.data,n),o.services.resourceStore=o.store),o.translator=new IK(o.services,n),o.translator.on("*",function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o.emit(e,...r)}),o.init(n,t),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let Ai=Ao.createInstance();Ai.createInstance=Ao.createInstance,Ai.createInstance,Ai.dir,Ai.init,Ai.loadResources,Ai.reloadResources,Ai.use,Ai.changeLanguage,Ai.getFixedT,Ai.t,Ai.exists,Ai.setDefaultNamespace,Ai.hasLoadedNamespace,Ai.loadNamespaces,Ai.loadLanguages;var p4=(hO("85Hg2"),hO("85Hg2")),Aa={};Aa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};var As=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Al(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=e.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(t.name=r[1],(hW(Aa)[r[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var n=e.indexOf("-->");return{type:"comment",comment:-1!==n?e.slice(4,n):""}}for(var o=new RegExp(As),i=null;null!==(i=o.exec(e));)if(i[0].trim()){if(i[1]){var a=i[1].trim(),s=[a,""];a.indexOf("=")>-1&&(s=a.split("=")),t.attrs[s[0]]=s[1],o.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1))}return t}var Ad=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Ac=/^\s*$/,Au=Object.create(null),Ah={parse:function(e,t){t||(t={}),t.components||(t.components=Au);var r,n=[],o=[],i=-1,a=!1;if(0!==e.indexOf("<")){var s=e.indexOf("<");n.push({type:"text",content:-1===s?e:e.substring(0,s)})}return e.replace(Ad,function(s,l){if(a){if(s!=="</"+r.name+">")return;a=!1}var d,c="/"!==s.charAt(1),u=s.startsWith("<!--"),h=l+s.length,p=e.charAt(h);if(u){var f=Al(s);return i<0?n.push(f):(d=o[i]).children.push(f),n}if(c&&(i++,"tag"===(r=Al(s)).type&&t.components[r.name]&&(r.type="component",a=!0),r.voidElement||a||!p||"<"===p||r.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),0===i&&n.push(r),(d=o[i-1])&&d.children.push(r),o[i]=r),(!c||r.voidElement)&&(i>-1&&(r.voidElement||r.name===s.slice(2,-1))&&(r=-1==--i?n:o[i]),!a&&"<"!==p&&p)){d=-1===i?n:o[i].children;var m=e.indexOf("<",h),C=e.slice(h,-1===m?void 0:m);Ac.test(C)&&(C=" "),(m>-1&&i+d.length>=0||" "!==C)&&d.push({type:"text",content:C})}}),n}};function Ap(){if(console&&console.warn){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}let Af={};function Am(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&Af[t[0]]||("string"==typeof t[0]&&(Af[t[0]]=new Date),Ap(...t))}let AC=(e,t)=>()=>{if(e.isInitialized)t();else{let r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}};function Ag(e,t,r){e.loadNamespaces(t,AC(e,r))}function Aw(e,t,r,n){"string"==typeof r&&(r=[r]),r.forEach(t=>{0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,AC(e,n))}let Av=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ay={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ax=e=>Ay[e],Ab={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Av,Ax)};function Ak(e,t){if(!e)return!1;let r=e.props?e.props.children:e.children;return t?r.length>0:!!r}function AM(e){if(!e)return[];let t=e.props?e.props.children:e.children;return e.props&&e.props.i18nIsDynamicList?Aj(t):t}function Aj(e){return Array.isArray(e)?e:[e]}var p4=hO("85Hg2");let AL=(0,p4.createContext)();class AN{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function AS(e){let{children:t,count:n,parent:o,i18nKey:i,context:a,tOptions:s={},values:l,defaults:d,components:c,ns:u,i18n:h,t:p,shouldUnescape:f,...m}=e,{i18n:C,defaultNS:g}=(0,p4.useContext)(AL)||{},w=h||C||r,v=p||w&&w.t.bind(w);return function(e){let{children:t,count:n,parent:o,i18nKey:i,context:a,tOptions:s={},values:l,defaults:d,components:c,ns:u,i18n:h,t:p,shouldUnescape:f,...m}=e,C=h||r;if(!C)return Am("You will need to pass in an i18next instance by using i18nextReactModule"),t;let g=p||C.t.bind(C)||(e=>e),w={...Ab,...C.options&&C.options.react},v=u||g.ns||C.options&&C.options.defaultNS;v="string"==typeof v?[v]:v||["translation"];let y=function e(t,r){if(!t)return"";let n="",o=Aj(t),i=r.transSupportBasicHtmlNodes&&r.transKeepBasicHtmlNodesFor?r.transKeepBasicHtmlNodesFor:[];return o.forEach((t,o)=>{if("string"==typeof t)n+=`${t}`;else if((0,p4.isValidElement)(t)){let a=Object.keys(t.props).length,s=i.indexOf(t.type)>-1,l=t.props.children;if(!l&&s&&0===a)n+=`<${t.type}/>`;else if(l||s&&0===a){if(t.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(s&&1===a&&"string"==typeof l)n+=`<${t.type}>${l}</${t.type}>`;else{let t=e(l,r);n+=`<${o}>${t}</${o}>`}}else n+=`<${o}></${o}>`}else if(null===t)Ap("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"==typeof t){let{format:e,...r}=t,o=Object.keys(r);if(1===o.length){let t=e?`${o[0]}, ${e}`:o[0];n+=`{{${t}}}`}else Ap("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",t)}else Ap("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",t)}),n}(t,w),x=d||y||w.transEmptyNodeValue||i,{hashTransKey:b}=w,k=i||(b?b(y||x):y||x);C.options&&C.options.interpolation&&C.options.interpolation.defaultVariables&&(l=l&&Object.keys(l).length>0?{...l,...C.options.interpolation.defaultVariables}:{...C.options.interpolation.defaultVariables});let M={...s,context:a||s.context,count:n,...l,defaultValue:x,ns:v},j=k?g(k,M):x;c&&Object.keys(c).forEach(e=>{let t=c[e];"function"==typeof t.type||!t.props||!t.props.children||0>j.indexOf(`${e}/>`)&&0>j.indexOf(`${e} />`)||(c[e]=(0,p4.createElement)(function(){return(0,p4.createElement)(p4.Fragment,null,t)}))});let L=function(e,t,r,n,o,i){if(""===t)return[];let a=n.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(a.map(e=>`<${e}`).join("|")).test(t);if(!e&&!s&&!i)return[t];let l={};!function e(t){Aj(t).forEach(t=>{"string"==typeof t||(Ak(t)?e(AM(t)):"object"!=typeof t||(0,p4.isValidElement)(t)||Object.assign(l,t))})}(e);let d=Ah.parse(`<0>${t}</0>`),c={...l,...o};function u(e,t,r){let n=AM(e),o=p(n,t.children,r);return"[object Array]"===Object.prototype.toString.call(n)&&n.every(e=>(0,p4.isValidElement)(e))&&0===o.length||e.props&&e.props.i18nIsDynamicList?n:o}function h(e,t,r,n,o){e.dummy?(e.children=t,r.push((0,p4.cloneElement)(e,{key:n},o?void 0:t))):r.push(...(0,p4.Children).map([e],e=>{let r={...e.props};return delete r.i18nIsDynamicList,(0,p4.createElement)(e.type,{...r,key:n,ref:e.ref},o?null:t)}))}function p(t,o,l){let d=Aj(t);return Aj(o).reduce((t,o,f)=>{let m=o.children&&o.children[0]&&o.children[0].content&&r.services.interpolator.interpolate(o.children[0].content,c,r.language);if("tag"===o.type){let i=d[parseInt(o.name,10)];1!==l.length||i||(i=l[0][o.name]),i||(i={});let C=0!==Object.keys(o.attrs).length?function(e,t){let r={...t};return r.props=Object.assign(e.props,t.props),r}({props:o.attrs},i):i,g=(0,p4.isValidElement)(C),w=g&&Ak(o,!0)&&!o.voidElement,v=s&&"object"==typeof C&&C.dummy&&!g,y="object"==typeof e&&null!==e&&Object.hasOwnProperty.call(e,o.name);if("string"==typeof C){let e=r.services.interpolator.interpolate(C,c,r.language);t.push(e)}else if(Ak(C)||w){let e=u(C,o,l);h(C,e,t,f)}else if(v)h(C,p(d,o.children,l),t,f);else if(Number.isNaN(parseFloat(o.name))){if(y){let e=u(C,o,l);h(C,e,t,f,o.voidElement)}else if(n.transSupportBasicHtmlNodes&&a.indexOf(o.name)>-1){if(o.voidElement)t.push((0,p4.createElement)(o.name,{key:`${o.name}-${f}`}));else{let e=p(d,o.children,l);t.push((0,p4.createElement)(o.name,{key:`${o.name}-${f}`},e))}}else if(o.voidElement)t.push(`<${o.name} />`);else{let e=p(d,o.children,l);t.push(`<${o.name}>${e}</${o.name}>`)}}else if("object"!=typeof C||g)h(C,m,t,f,1!==o.children.length||!m);else{let e=o.children[0]?m:null;e&&t.push(e)}}else if("text"===o.type){let e=n.transWrapTextNodes,a=i?n.unescape(r.services.interpolator.interpolate(o.content,c,r.language)):r.services.interpolator.interpolate(o.content,c,r.language);e?t.push((0,p4.createElement)(e,{key:`${o.name}-${f}`},a)):t.push(a)}return t},[])}return AM(p([{dummy:!0,children:e||[]}],d,Aj(e||[]))[0])}(c||t,j,C,w,M,f),N=void 0!==o?o:w.defaultTransParent;return N?(0,p4.createElement)(N,m,L):L}({children:t,count:n,parent:o,i18nKey:i,context:a,tOptions:s,values:l,defaults:d,components:c,ns:u||v&&v.ns||g||w&&w.options&&w.options.defaultNS,i18n:w,t:p,shouldUnescape:f,...m})}var p4=hO("85Hg2");let AP=(e,t)=>{let r=(0,p4.useRef)();return(0,p4.useEffect)(()=>{r.current=t?r.current:e},[e,t]),r.current};function A_(e,t,r,n){return e.getFixedT(t,r,n)}function AR(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{i18n:i}=o,{i18n:a,defaultNS:s}=(0,p4.useContext)(AL)||{},l=i||a||r;if(l&&!l.reportNamespaces&&(l.reportNamespaces=new AN),!l){Am("You will need to pass in an i18next instance by using initReactI18next");let e=(e,t)=>"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}l.options.react&&void 0!==l.options.react.wait&&Am("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");let d={...Ab,...l.options.react,...o},{useSuspense:c,keyPrefix:u}=d,h=e||s||l.options&&l.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],l.reportNamespaces.addUsedNamespaces&&l.reportNamespaces.addUsedNamespaces(h);let p=(l.isInitialized||l.initializedStoreOnce)&&h.every(e=>(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:r.lng,precheck:(t,n)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;let a=(e,r)=>{let n=t.services.backendConnector.state[`${e}|${r}`];return -1===n||2===n};return(!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1)||!t.services.backendConnector.backend||!t.isLanguageChangingTo||!!a(t.isLanguageChangingTo,e))&&!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(n,e)&&(!o||a(i,e)))}(e,t,r):(Am("i18n.languages were undefined or empty",t.languages),!0)})(e,l,d)),f=(t=o.lng||null,n="fallback"===d.nsMode?h:h[0],(0,p4.useCallback)(A_(l,t,n,u),[l,t,n,u])),m=()=>f,C=()=>A_(l,o.lng||null,"fallback"===d.nsMode?h:h[0],u),[g,w]=(0,p4.useState)(m),v=h.join();o.lng&&(v=`${o.lng}${v}`);let y=AP(v),x=(0,p4.useRef)(!0);(0,p4.useEffect)(()=>{let{bindI18n:e,bindI18nStore:t}=d;function r(){x.current&&w(C)}return x.current=!0,p||c||(o.lng?Aw(l,o.lng,h,()=>{x.current&&w(C)}):Ag(l,h,()=>{x.current&&w(C)})),p&&y&&y!==v&&x.current&&w(C),e&&l&&l.on(e,r),t&&l&&l.store.on(t,r),()=>{x.current=!1,e&&l&&e.split(" ").forEach(e=>l.off(e,r)),t&&l&&t.split(" ").forEach(e=>l.store.off(e,r))}},[l,v]),(0,p4.useEffect)(()=>{x.current&&p&&w(m)},[l,u,p]);let b=[g,l,p];if(b.t=g,b.i18n=l,b.ready=p,p||!p&&!c)return b;throw new Promise(e=>{o.lng?Aw(l,o.lng,h,()=>e()):Ag(l,h,()=>e())})}var p4=(hO("85Hg2"),hO("85Hg2"),hO("85Hg2"),hO("85Hg2"));let AH=()=>{try{let e=localStorage.getItem("stream_ui_language");if(e)return e;return"en"}catch(e){return console.warn(e),"en"}};var Az={};Az=JSON.parse('{"header":{"free":"Free version"},"loader":{"connection":"Connecting..."},"common":{"new":"new"},"notifications":{"screensharingError":"An error occured when trying to toggle screensharing","microphoneError":"An error occured when trying to toggle the microphone","cameraError":"An error occured when trying to toggle the camera","cameraRotateError":"An error occured when trying to rotate the camera","noCamera":"No camera available","blockedMicrophonePopupTitle":"Camera and microphone are blocked","blockedMicrophonePopup":"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser\'s address bar.","reload":"Reload","criticalError":"A critical error has occurred (error {{code}}).","agentJoinError":"An error occured while trying to join the room as an agent","close":"Close","connectedTo":"Connected to {{name}}","recording":"Recording in progress","invitationSentToFailed":"Sent to {{ name }} failed.","uploadError":"An error occured during the upload, please try again later."},"recordingPopup":{"recordingStartTitle":"Recording about to start.","recordingStartText":"This call will be recorded shortly. If you’d rather not be recorded, you’re welcome to leave the call at this time.","dismiss":"Dismiss"},"requestAccess":{"wantToJoin":"<bold>{{name}}</bold> wants to join!","deny":"Deny","admit":"Admit","defaultName":"An user"},"endView":{"goBack":"Go back to call","tooLate":"You arrived too late","callIsOver":"The call is over or deleted","callEnded":"The call is now ended","callLeft":"You left the call","full":"You can\'t join this call","fullDescription":"The room is full. Please try to join the call later."},"menu":{"title":"Menu","new":"NEW","openNewTab":"Open new tab","quickConnect":"Quick Connect","pictureInPicture":"Picture-in-Picture","screenSharing":"Screen sharing","stopRecord":"Stop record","startRecord":"Record call"},"blockedFeature":{"titleConnected":"Upgrade to Pro","titleGuest":"Feature not available","descriptionConnected":"On a free plan, you can\'t use this feature. Upgrade your plan to enjoy all in-call features.","descriptionGuest":"You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.","dismissGuest":"Okay","dismissConnected":"Upgrade to Pro"},"copyLink":{"title":"Copy link","description":"Copy link into clipboard","error":"An error occured when trying to copy to clipboard","copied":"Link copied to clipboard","copy":"Copy"},"quickConnect":{"title":"Quick Connect","scanTitle":"Scan QR Code","scan":"Scan this QR code with your phone camera to open the call."},"settings":{"title":"Settings","preferences":"Preferences","language":"Language","devices":"Devices","help":"Help","helpCenter":"Go to help center"},"audioMenu":{"title":"Audio","blockedMicrophone":"Microphone is blocked.","microphonePermissions":"Please accept microphone sharing before accessing these options."},"videoMenu":{"title":"Video","lowDef":"Low definition (240p)","standardDef":"Standard definition (480p)","highDef":"High definition (720p)","blockedCamera":"Camera is blocked.","cameraPermissions":"Please accept camera sharing before accessing these options.","sendResolution":"Send Resolution (maximum)"},"shareLink":{"title":"Share link","title2":"Share a link","invalid":"Invalid link","sentToUsers":"Link sent to users","sentToUser":"Link sent to {{user}}","failed":"Failed to send link","poweredBy":"Powered by","invoice":"{{user}} sent you an invoice.","pay":"Pay"},"invitePeople":{"PublicLink":"Public link","invitePeople":"Invite people","joinTheCall":"Join the call","inviteRecordClip":"Invite to record clip","inviteRecordVideo":"Record a video","inviteRecordAudio":"Record an audio","inviteRecordScreen":"Record a screen","inviteRecordPhoto":"Take a photo","inviteCall":"Invite to join call","sharePublicLink":"Share public link","inviteByEmail":"Invite by email","inviteByEmailOrNumber":"Invite by email or sms","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","addEmailToInvite":"Add an email to invite.","email":"Email","emailPlaceholder":"Eg. john@acme.com","invite":"Invite","linkToJoinCall":"Link to join the call","linkToRecordAClip":"Link to record a clip","invalidEmail":"Invalid email format.","invalidEmailOrNumber":"Invalid email or number format.","addEmails":"Add emails...","invitationSentTo_one":"Sent to {{ name }}","invitationSentTo_other":"Sent to {{ name }} and {{ otherEmailsCount }}+","error":"Failed to send, please try again later.","inviteCallDefaultMessage":"Hey! You\'re invited to join our video call. Click the link to connect instantly.","inviteClipDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","message":"Message"},"youtube":{"title":"Watch Together","url":"YOUTUBE URL","invalid":"Invalid YouTube URL","share":"Watch now"},"sharedHistory":{"shared":"Shared with you"},"snapshot":{"title":"Snapshot","shared":"Snapshot shared.","sentToUsers":"Snapshot sent to users.","sentToUser":"Snapshot sent to {{user}}","save":"Save photo","error":"An error occured when trying to send the snapshot"},"gdpr":{"recordedWarning":"To improve the quality of our service, this call will be recorded."},"requestDevice":{"requestInput":"Request input devices","request":"{{user}} would like you to share your {{device}}","timedOut":"Your request has timed out.","declined":"Your request has been declined.","userDeclined":"{{user}} has declined your request."},"leave":{"title":"Leave","leaveCall":"Leave call","endCall":"End call for all"},"virtualBackground":{"title":"Virtual Background","setBackground":"Set Background"},"misc":{"someone":"Someone","camera":"Camera","microphone":"Microphone","photo":"Photo","video":"Video","screen":"Screen","screenshot":"Screenshot","speaker":"Speaker","user":"User","open":"Open","from":"From","accept":"Accept","decline":"Decline","you":"You","cancel":"Cancel","confirm":"Confirm","remove":"Remove","proceed":"Proceed","audio":"Audio"},"greeting":{"mainTitle":"Welcome to SnapCall","sideTitle":"Hold tight, you\'re next!","sideDescription":"Please enter your name and adjust your camera and microphone","namePlaceholder":"Eg. Lucy or Peter","nameSubmit":"Join Conversation","footerTitle":"Powered by SnapCall","footerDescription":"Meet SnapCall, the easiest way to add real-time video to platform, product or service.","cameraDisabled":"Camera is Off","microphoneDisabled":"Microphone is Off","cameraEnabled":"Camera is On","microphoneEnabled":"Microphone is On","scheduleACall":"Schedule a call","requestACall":"Request a call","name":"Name","nameDescription":"This name will be displayed to all participants in the call.","setting":"Settings","askToJoin":"Ask to join","youWillJoinWhenSomeoneLetsYou":"You will join the call when someone from {{ companyName }} lets you in.","cantJoinCall":"You can’t join this call","someoneDenied":"Someone in the call denied your request to join.","askingLetIn":"Asking to be let in...","takeFewMinute":"This may take a few minutes depending on the availability of the participants.","cantWait":"Can\'t wait?","whatYouCanDo":"Here’s what you can do","leaveMessage":"Leave a message","cantWaitLeaveMessage":"Can’t wait? You can leave a message and you will be contacted as soon as possible.","recordVideo":"Record video","recordVoice":"Record voice","canceledCallRequest":"The call request will be canceled and you will be redirected to the call scheduling page.","mediaDenied":"Microphone and camera access denied","clickOnLock":"Click on the <1></1> lock icon in your browser\'s bar."},"recorder":{"addMore":"Add more","addNewClip":"Add new clip","limit":"Video recording limited to 5 min.","replyAttached":"Your reply has been attached","elementRecordedAndAttached":"Your clip has been sent and attached to the thread.","goBackToTicket":"Go back to ticket","openThread":"Open thread","clipSubmissionTitle_one":"Your clip has been sent","clipSubmissionTitle_other":"Your clips have been sent","clipSubmissionDescription":"Thank you for using SnapCall.","submissionTitle":"Thank you for your submission!","submissionDescription":"Your photo/video has been successfully submitted. We will review it and get back to you shortly.","confirmRemovalTitle":"Confirm deletion","confirmRemovalDescription":"Are you sure you want to delete this photo/video? This action cannot be undone.","elementBeingProcessed":"Please wait while your {{ type }} is being processed...","waitVideo":"A video may take up to 15 seconds to be ready.","elementCaptureSuccess":"{{ type }} captured successfully","takeNewElement":"Capture a new {{ type }}","send":"Send","sendElements_one":"Send {{ type }}","sendElements_other":"Send {{ count }} elements","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","attachElements_one":"Attach {{ type }} to ticket","attachElements_other":"Attach {{ count }} elements","allowAccess":"Allow access","okay":"Okay","allowCamMicAccess":"Allow access to cam/mic","allowScreenShareAccess":"Allow access to screen sharing","permissionDeniedTitle":"Something went wrong!","permissionDeniedDescription":"Without access to the camera and microphone, you won\'t be able to capture photos or videos to share with the support team. Please grant access in your browser settings.","photoInstructionsTitle":"Ready to snap a photo?","videoInstructionsTitle":"Ready to record a video?","screenShareInstructionsTitle":"Ready to share your screen?","audioInstructionsTitle":"Ready to record a voice message?","instructions":{"selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","allowAccessOnPrompt":"When prompted, <bold>allow access</bold> to camera and microphone.","multiplePhotos":"Take a <bold>photo or multiple</bold> for detail, then review.","reviewAndSendPhotos":"<bold>Validate your photos</bold>, and they will be sent to us automatically.","tapVideoButton":"<bold>Tap the record button</bold> to begin and feel free to provide commentary.","videoSpeech":"You can <bold>talk during</bold> the recording to provide additional information.","tapStopVideoButton":"<bold>Tap stop</bold> when you are done.","reviewAndSendVideos":"<bold>Review your videos</bold>, and they will be sent to us automatically.","screenShareInstruction":"Select the screen or window you wish to record.","privacyPolicy":"By proceeding, you agree to our <bold>Privacy Policy</bold>.","tapAudioButton":"<bold>Tap the record button</bold> to start recording your audio message.","speakClearly":"<bold>Speak clearly</bold> and say what you need to convey.","reviewAndSendAudios":"<bold>Review your audios</bold>, and they will be sent to us automatically."},"switchToMobileTitle":"Switch to your mobile device","switchToMobileDescription":"Experience greater convenience by using your phone to take photos and record videos.","useDesktopVersion":"Use the desktop version","scanQRCode":"Scan this QR code with a compatible device.","startScreenShareButton":"Record my screen","stopScreenShareButton":"Stop recording","screenTitle":"Ready to capture your screen?","loggedAs":"Logged as","logIn":"Log in","audioLevelNotification":{"shortVideo":{"title":"Short video.","description":"This video is too short to get context."},"noSound":{"title":"No sound detected.","description":"Make sure your microphone is activated."},"spokenWordsQuestion":{"title":"Spoken words.","description":"Does your video include enough spoken details?"},"spokenWordsWarning":{"title":"No spoken words.","description":"The clip includes barely any spoken words."}},"audioLevelToast":{"continueSpeaking":"Continue speaking for clearer context.","rememberSpeaking":"Remember to speak to provide context.","noSound":"No sound detected."},"chooseWhatYouWantToShare":"Choose what you want to share","startScreenRecording":"Start screen recording","noCameraAndMicrophoneAccess":"No camera & microphone access","noCameraAccess":"No camera access","noMicrophoneAccess":"No microphone access","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","showQrCode":"Show QR code","upload":"Upload"}}');var AE={};AE=JSON.parse('{"audioMenu":{"blockedMicrophone":"Microphone is blocked.","microphonePermissions":"Please accept microphone sharing before accessing these options.","title":"Audio"},"blockedFeature":{"descriptionConnected":"On a free plan, you can\'t use this feature. Upgrade your plan to enjoy all in-call features.","descriptionGuest":"You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.","dismissConnected":"Upgrade to Pro","dismissGuest":"Okay","titleConnected":"Upgrade to Pro","titleGuest":"Feature not available"},"common":{"new":"new"},"copyLink":{"copied":"Link copied to clipboard","copy":"Copy","description":"Copy link into clipboard","error":"An error occured when trying to copy to clipboard","title":"Copy link"},"endView":{"callEnded":"The call is now ended","callIsOver":"The call is over or deleted","callLeft":"You left the call","full":"You can\'t join this call","fullDescription":"The room is full. Please try to join the call later.","goBack":"Go back to call","tooLate":"You arrived too late"},"gdpr":{"recordedWarning":"To improve the quality of our service, this call will be recorded."},"greeting":{"askToJoin":"Ask to join","askingLetIn":"Asking to be let in...","cameraDisabled":"Camera is Off","cameraEnabled":"Camera is On","canceledCallRequest":"The call request will be canceled and you will be redirected to the call scheduling page.","cantJoinCall":"You can’t join this call","cantWait":"Can\'t wait?","cantWaitLeaveMessage":"Can’t wait? You can leave a message and you will be contacted as soon as possible.","clickOnLock":"Click on the <1></1> lock icon in your browser\'s bar.","footerDescription":"Meet SnapCall, the easiest way to add real-time video to platform, product or service.","footerTitle":"Powered by SnapCall","leaveMessage":"Leave a message","mainTitle":"Welcome to SnapCall","mediaDenied":"Microphone and camera access denied","microphoneDisabled":"Microphone is Off","microphoneEnabled":"Microphone is On","name":"Name","nameDescription":"This name will be displayed to all participants in the call.","namePlaceholder":"Eg. Lucy or Peter","nameSubmit":"Join Conversation","recordVideo":"Record video","recordVoice":"Record voice","requestACall":"Request a call","scheduleACall":"Schedule a call","setting":"Settings","sideDescription":"Please enter your name and adjust your camera and microphone","sideTitle":"Hold tight, you\'re next!","someoneDenied":"Someone in the call denied your request to join.","takeFewMinute":"This may take a few minutes depending on the availability of the participants.","whatYouCanDo":"Here’s what you can do","youWillJoinWhenSomeoneLetsYou":"You will join the call when someone from {{ companyName }} lets you in."},"header":{"free":"Free version"},"invitePeople":{"PublicLink":"Public link","addEmailToInvite":"Add an email to invite.","addEmails":"Add emails...","copyCallLinkDescription":"Copy this link and send it to anyone you wish to invite to join the call.","copyClipLinkDescription":"Copy this link and send it to anyone you wish to invite to record a clip.","email":"Email","emailPlaceholder":"Eg. john@acme.com","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","error":"Failed to send, please try again later.","invalidEmail":"Invalid email format.","invalidEmailOrNumber":"Invalid email or number format.","invitationSentTo_one":"Sent to {{ name }}","invitationSentTo_other":"Sent to {{ name }} and {{ otherEmailsCount }}+","invite":"Invite","inviteByEmail":"Invite by email","inviteByEmailOrNumber":"Invite by email or sms","inviteCall":"Invite to join call","inviteCallDefaultMessage":"Hey! You\'re invited to join our video call. Click the link to connect instantly.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipDefaultMessage":"Hey! Please record your video clip now and provide us with more context to assist you better.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","invitePeople":"Invite people","inviteRecordAudio":"Record an audio","inviteRecordClip":"Invite to record clip","inviteRecordPhoto":"Take a photo","inviteRecordScreen":"Record a screen","inviteRecordVideo":"Record a video","joinTheCall":"Join the call","linkToJoinCall":"Link to join the call","linkToRecordAClip":"Link to record a clip","message":"Message","sharePublicLink":"Share public link"},"leave":{"endCall":"End call for all","leaveCall":"Leave call","title":"Leave"},"loader":{"connection":"Connecting..."},"menu":{"new":"NEW","openNewTab":"Open new tab","pictureInPicture":"Picture-in-Picture","quickConnect":"Quick Connect","screenSharing":"Screen sharing","startRecord":"Record call","stopRecord":"Stop record","title":"Menu"},"misc":{"accept":"Accept","audio":"Audio","camera":"Camera","cancel":"Cancel","confirm":"Confirm","decline":"Decline","from":"From","microphone":"Microphone","open":"Open","photo":"Photo","proceed":"Proceed","remove":"Remove","screen":"Screen","screenshot":"Screenshot","someone":"Someone","speaker":"Speaker","user":"User","video":"Video","you":"You"},"notifications":{"agentJoinError":"An error occured while trying to join the room as an agent","blockedMicrophonePopup":"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser\'s address bar.","blockedMicrophonePopupTitle":"Camera and microphone are blocked","cameraError":"An error occured when trying to toggle the camera","cameraRotateError":"An error occured when trying to rotate the camera","close":"Close","connectedTo":"Connected to {{name}}","criticalError":"A critical error has occurred (error {{code}}).","invitationSentToFailed":"Sent to {{ name }} failed.","microphoneError":"An error occured when trying to toggle the microphone","noCamera":"No camera available","recording":"Recording in progress","reload":"Reload","screensharingError":"An error occured when trying to toggle screensharing","uploadError":"An error occured during the upload, please try again later."},"quickConnect":{"scan":"Scan this QR code with your phone camera to open the call.","scanTitle":"Scan QR Code","title":"Quick Connect"},"recorder":{"addMore":"Add more","addNewClip":"Add new clip","allowAccess":"Allow access","allowCamMicAccess":"Allow access to cam/mic","allowScreenShareAccess":"Allow access to screen sharing","attachElements_one":"Attach {{ type }} to ticket","attachElements_other":"Attach {{ count }} elements","audioInstructionsTitle":"Ready to record a voice message?","audioLevelNotification":{"noSound":{"description":"Make sure your microphone is activated.","title":"No sound detected."},"shortVideo":{"description":"This video is too short to get context.","title":"Short video."},"spokenWordsQuestion":{"description":"Does your video include enough spoken details?","title":"Spoken words."},"spokenWordsWarning":{"description":"The clip includes barely any spoken words.","title":"No spoken words."}},"audioLevelToast":{"continueSpeaking":"Continue speaking for clearer context.","noSound":"No sound detected.","rememberSpeaking":"Remember to speak to provide context."},"chooseWhatYouWantToShare":"Choose what you want to share","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","clipSubmissionDescription":"Thank you for using SnapCall.","clipSubmissionTitle_one":"Your clip has been sent","clipSubmissionTitle_other":"Your clips have been sent","confirmRemovalDescription":"Are you sure you want to delete this photo/video? This action cannot be undone.","confirmRemovalTitle":"Confirm deletion","elementBeingProcessed":"Please wait while your {{ type }} is being processed...","elementCaptureSuccess":"{{ type }} captured successfully","elementRecordedAndAttached":"Your clip has been sent and attached to the thread.","goBackToTicket":"Go back to ticket","instructions":{"allowAccessOnPrompt":"When prompted, <bold>allow access</bold> to camera and microphone.","multiplePhotos":"Take a <bold>photo or multiple</bold> for detail, then review.","privacyPolicy":"By proceeding, you agree to our <bold>Privacy Policy</bold>.","reviewAndSendAudios":"<bold>Review your audios</bold>, and they will be sent to us automatically.","reviewAndSendPhotos":"<bold>Validate your photos</bold>, and they will be sent to us automatically.","reviewAndSendVideos":"<bold>Review your videos</bold>, and they will be sent to us automatically.","screenShareInstruction":"Select the screen or window you wish to record.","selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakClearly":"<bold>Speak clearly</bold> and say what you need to convey.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","tapAudioButton":"<bold>Tap the record button</bold> to start recording your audio message.","tapStopVideoButton":"<bold>Tap stop</bold> when you are done.","tapVideoButton":"<bold>Tap the record button</bold> to begin and feel free to provide commentary.","videoSpeech":"You can <bold>talk during</bold> the recording to provide additional information."},"limit":"Video recording limited to 5 min.","logIn":"Log in","loggedAs":"Logged as","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","noCameraAccess":"No camera access","noCameraAndMicrophoneAccess":"No camera & microphone access","noMicrophoneAccess":"No microphone access","okay":"Okay","openThread":"Open thread","permissionDeniedDescription":"Without access to the camera and microphone, you won\'t be able to capture photos or videos to share with the support team. Please grant access in your browser settings.","permissionDeniedTitle":"Something went wrong!","photoInstructionsTitle":"Ready to snap a photo?","replyAttached":"Your reply has been attached","scanQRCode":"Scan this QR code with a compatible device.","screenShareInstructionsTitle":"Ready to share your screen?","screenTitle":"Ready to capture your screen?","send":"Send","sendElements_one":"Send {{ type }}","sendElements_other":"Send {{ count }} elements","showQrCode":"Show QR code","startScreenRecording":"Start screen recording","startScreenShareButton":"Record my screen","stopScreenShareButton":"Stop recording","submissionDescription":"Your photo/video has been successfully submitted. We will review it and get back to you shortly.","submissionTitle":"Thank you for your submission!","switchToMobileDescription":"Experience greater convenience by using your phone to take photos and record videos.","switchToMobileTitle":"Switch to your mobile device","takeNewElement":"Capture a new {{ type }}","upload":"Upload","useDesktopVersion":"Use the desktop version","videoInstructionsTitle":"Ready to record a video?","waitVideo":"A video may take up to 15 seconds to be ready."},"recordingPopup":{"dismiss":"Dismiss","recordingStartText":"This call will be recorded shortly. If you’d rather not be recorded, you’re welcome to leave the call at this time.","recordingStartTitle":"Recording about to start."},"requestAccess":{"admit":"Admit","defaultName":"An user","deny":"Deny","wantToJoin":"<bold>{{name}}</bold> wants to join!"},"requestDevice":{"declined":"Your request has been declined.","request":"{{user}} would like you to share your {{device}}","requestInput":"Request input devices","timedOut":"Your request has timed out.","userDeclined":"{{user}} has declined your request."},"settings":{"devices":"Devices","help":"Help","helpCenter":"Go to help center","language":"Language","preferences":"Preferences","title":"Settings"},"shareLink":{"failed":"Failed to send link","invalid":"Invalid link","invoice":"{{user}} sent you an invoice.","pay":"Pay","poweredBy":"Powered by","sentToUser":"Link sent to {{user}}","sentToUsers":"Link sent to users","title":"Share link","title2":"Share a link"},"sharedHistory":{"shared":"Shared with you"},"snapshot":{"error":"An error occured when trying to send the snapshot","save":"Save photo","sentToUser":"Snapshot sent to {{user}}","sentToUsers":"Snapshot sent to users.","shared":"Snapshot shared.","title":"Snapshot"},"videoMenu":{"blockedCamera":"Camera is blocked.","cameraPermissions":"Please accept camera sharing before accessing these options.","highDef":"High definition (720p)","lowDef":"Low definition (240p)","sendResolution":"Send Resolution (maximum)","standardDef":"Standard definition (480p)","title":"Video"},"virtualBackground":{"setBackground":"Set Background","title":"Virtual Background"},"youtube":{"invalid":"Invalid YouTube URL","share":"Watch now","title":"Watch Together","url":"YOUTUBE URL"}}');var AV={};AV=JSON.parse('{"audioMenu":{"blockedMicrophone":"Votre micro est bloqué.","microphonePermissions":"Please accept microphone sharing before accessing these options.","title":"Audio"},"blockedFeature":{"descriptionConnected":"Vous n\'avez pas accès à cette fonctionnalité. Souscrivez au plan Pro pour débloquer toutes les fonctionnalités de SnapCall.","descriptionGuest":"Vous participez à un appel créé avec la version gratuite de SnapCall. Cette fonctionnalité n\'est disponible qu\'avec une version Pro.","dismissConnected":"Souscrire à Pro","dismissGuest":"D\'accord","titleConnected":"Souscrire au plan Pro","titleGuest":"Fonctionnalité non disponible"},"common":{"new":"new"},"copyLink":{"copied":"Lien copié dans le presse-papier","copy":"Copier","description":"Copier le lien dans le presse-papiers","error":"Une erreur est survenue pendant la copie du lien dans le presse-papier","title":"Copier le lien"},"endView":{"callEnded":"Cet appel est terminé","callIsOver":"Cet appel est terminé ou supprimé","callLeft":"Vous avez quitté l\'appel","full":"Impossible de rejoindre l\'appel","fullDescription":"Limite d\'utilisateurs atteinte. Merci de rejoindre l\'appel ultérieurement.","goBack":"Retourner dans l\'appel","tooLate":"Vous êtes arrivé trop tard"},"gdpr":{"recordedWarning":"Pour améliorer la qualité de notre service, cet appel va être enregistré."},"greeting":{"askToJoin":"Demander à rejoindre","askingLetIn":"Demande de participation...","cameraDisabled":"Caméra désactivée","cameraEnabled":"Caméra activée","canceledCallRequest":"La demande d\'appel sera annulée et vous serez redirigé vers la page de planification des appels.","cantJoinCall":"Vous ne pouvez pas rejoindre cet appel","cantWait":"Vous ne souhaitez pas attendre ?","cantWaitLeaveMessage":"Vous ne pouvez pas attendre ? Vous pouvez laisser un message et vous serez contacté dans les plus brefs délais.","clickOnLock":"Cliquez sur l\'icône de verrouillage <1></1> dans la barre de votre navigateur.","footerDescription":"Découvrez SnapCall, ajoutez de la vidéo en temps réel à n\'importe quelle plateforme, produit ou service.","footerTitle":"Propulsé par SnapCall","leaveMessage":"Laisser un message","mainTitle":"Bienvenue sur SnapCall","mediaDenied":"Accès au microphone et à la caméra refusé","microphoneDisabled":"Microphone désactivé","microphoneEnabled":"Microphone activé","name":"Nom","nameDescription":"Ce nom sera affiché à tous les participants","namePlaceholder":"Ex. Lucie ou Pierre","nameSubmit":"Rejoindre la conversation","recordVideo":"Enregistrer une vidéo","recordVoice":"Enregistrer un message vocal","requestACall":"Solliciter un appel maintenant","scheduleACall":"Planifier un appel","setting":"Paramètres","sideDescription":"Veuillez entrer votre nom et configurer votre caméra et microphone.","sideTitle":"C\'est bientôt votre tour !","someoneDenied":"Quelqu\'un lors de l\'appel a refusé votre demande de participation.","takeFewMinute":"Cela peut prendre quelques minutes selon la disponibilité des participants.","whatYouCanDo":"Voici ce que vous pouvez faire","youWillJoinWhenSomeoneLetsYou":"Votre accès à l\'appel sera autorisé par un membre de l\'équipe {{ companyName }}."},"header":{"free":"Version gratuite"},"invitePeople":{"PublicLink":"Public link","addEmailToInvite":"Ajoutez un e-mail pour inviter.","addEmails":"Ajouter des e-mails...","copyCallLinkDescription":"Copiez ce lien et envoyez-le à toute personne que vous souhaitez inviter à rejoindre l\'appel.","copyClipLinkDescription":"Copiez ce lien et envoyez-le à toute personne que vous souhaitez inviter à enregistrer un clip.","email":"Email","emailPlaceholder":"Ex. jean@acme.com","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","error":"Échec de l\'envoi, veuillez réessayer plus tard.","invalidEmail":"Format d\'email invalide.","invalidEmailOrNumber":"Invalid email or number format.","invitationSentTo_one":"Envoyé à {{ name }}","invitationSentTo_other":"Envoyé à {{ name }} et {{ otherEmailsCount }}+","invite":"Inviter","inviteByEmail":"Inviter par email","inviteByEmailOrNumber":"Invite by email or sms","inviteCall":"Inviter à rejoindre l\'appel","inviteCallDefaultMessage":"Vous êtes invité à rejoindre notre appel vidéo. Cliquez sur le lien pour vous connecter instantanément.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipDefaultMessage":"Veuillez enregistrer votre clip vidéo maintenant et nous fournir plus de contexte pour mieux vous aider.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","invitePeople":"Invite people","inviteRecordAudio":"Record an audio","inviteRecordClip":"Inviter à enregistrer un clip","inviteRecordPhoto":"Take a photo","inviteRecordScreen":"Record a screen","inviteRecordVideo":"Record a video","joinTheCall":"Join the call","linkToJoinCall":"Lien pour rejoindre l\'appel","linkToRecordAClip":"Lien pour enregistrer un clip","message":"Message","sharePublicLink":"Partager le lien public"},"leave":{"endCall":"Terminer l\'appel","leaveCall":"Quitter l\'appel","title":"Quitter"},"loader":{"connection":"Connexion..."},"menu":{"new":"NOUVEAU","openNewTab":"Ouvrir un nouvel onglet","pictureInPicture":"Picture-in-Picture","quickConnect":"Quick Connect","screenSharing":"Partage d\'écran","startRecord":"Enregistrer l\'appel","stopRecord":"Arrêter l\'enregistrement","title":"Menu"},"misc":{"accept":"Accepter","audio":"Audio","camera":"Caméra","cancel":"Annuler","confirm":"Confirmer","decline":"Décliner","from":"Depuis","microphone":"Micro","open":"Ouvrir","photo":"Photo","proceed":"Procéder","remove":"Enlever","screen":"Écran","screenshot":"Capture d\'écran","someone":"Quelqu\'un","speaker":"Haut-parleur","user":"Utilisateur","video":"Vidéo","you":"Vous"},"notifications":{"agentJoinError":"Une erreur est survenue en essayant de rejoindre la salle en tant qu\'agent","blockedMicrophonePopup":"SnapCall a besoin d\'accéder à votre caméra et micro. Cliquez sur l\'icône de caméra bloquée dans la barre d\'adresse du navigateur.","blockedMicrophonePopupTitle":"Votre caméra et micro sont bloqués","cameraError":"Une erreur est survenue pendant l\'activation de la caméra","cameraRotateError":"Une erreur est survenue pendant la rotation de la caméra","close":"Fermer","connectedTo":"Connecté à {{name}}","criticalError":"Une erreur critique est survenue (erreur {{code}}).","invitationSentToFailed":"Sent to {{ name }} failed.","microphoneError":"Une erreur est survenue pendant l\'activation du micro","noCamera":"Aucune caméra disponible","recording":"Enregistrement en cours","reload":"Recharger","screensharingError":"Une erreur est survenue pendant l\'activation du partage d\'écran","uploadError":"An error occured during the upload, please try again later."},"quickConnect":{"scan":"Scannez ce QR code avec votre téléphone pour ouvrir l\'appel.","scanTitle":"Scannez le QR Code","title":"Quick Connect"},"recorder":{"addMore":"Ajouter plus","addNewClip":"Ajouter un nouveau clip","allowAccess":"Autoriser l\'accès","allowCamMicAccess":"Autoriser accès caméra/micro","allowScreenShareAccess":"Autoriser l\'accès au partage d\'écran","attachElements_one":"Joindre {{ type }} au ticket","attachElements_other":"Joindre {{ count }} éléments","audioInstructionsTitle":"Prêt à enregistrer un message vocal ?","audioLevelNotification":{"noSound":{"description":"Assurez-vous que votre microphone est activé.","title":"Aucun son détecté."},"shortVideo":{"description":"Cette vidéo semble assez courte, ne fournit pas assez de détails.","title":"Vidéo courte."},"spokenWordsQuestion":{"description":"Votre vidéo offre-t-elle une explication détaillée et claire ?","title":"Avez-vous tout expliqué ?"},"spokenWordsWarning":{"description":"La vidéo ne comprend pratiquement aucun mot prononcé.","title":"Aucun mot prononcé."}},"audioLevelToast":{"continueSpeaking":"Continuez à parler pour expliquer.","noSound":"Aucun son détecté.","rememberSpeaking":"Veuillez parler à voix-haute."},"chooseWhatYouWantToShare":"Choose what you want to share","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","clipSubmissionDescription":"Merci d\'utiliser SnapCall.","clipSubmissionTitle_one":"Votre clip a été envoyé","clipSubmissionTitle_other":"Vos clips ont été envoyés","confirmRemovalDescription":"Voulez-vous vraiment supprimer cette photo/vidéo ? Cette action ne peut pas être annulée.","confirmRemovalTitle":"Confirmer la suppression","elementBeingProcessed":"Veuillez patienter un moment pendant que votre {{ type }} est en cours de traitement...","elementCaptureSuccess":"{{ type }} capturé(e) avec succès","elementRecordedAndAttached":"Votre clip a été envoyé et joint au fil de discussion.","goBackToTicket":"Revenir au billet","instructions":{"allowAccessOnPrompt":"<bold>Autorisez l\'accès</bold> à la caméra et au micro lorsque demandé.","multiplePhotos":"Prenez <bold>une ou plusieurs photos</bold> pour donner plus de détails.","privacyPolicy":"En continuant, vous acceptez notre <bold>Politique de confidentialité</bold>.","reviewAndSendAudios":"<bold>Vérifiez vos audios</bold>, et ils seront envoyés automatiquement à nous.","reviewAndSendPhotos":"<bold>Validez vos photos</bold>, et elles nous seront envoyées automatiquement.","reviewAndSendVideos":"<bold>Validez vos vidéos</bold>, et elles nous seront envoyées automatiquement.","screenShareInstruction":"Sélectionnez l\'écran ou la fenêtre que vous souhaitez enregistrer.","selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakClearly":"<bold>Parlez clairement</bold> et dites ce que vous devez transmettre.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","tapAudioButton":"<bold>Appuyez sur le bouton d\'enregistrement</bold> pour commencer à enregistrer votre message audio.","tapStopVideoButton":"<bold>Appuyez sur Arrêt</bold> lorsque vous avez terminé.","tapVideoButton":"<bold>Appuyez sur Enregistrer</bold>. Pensez à commenter.","videoSpeech":"Vous pouvez <bold>parler pendant</bold> l\'enregistrement pour ajouter des détails."},"limit":"Enregistrement vidéo limité à 5 min.","logIn":"Se connecter","loggedAs":"Connecté en tant que","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","noCameraAccess":"No camera access","noCameraAndMicrophoneAccess":"No camera & microphone access","noMicrophoneAccess":"No microphone access","okay":"D\'accord","openThread":"Ouvrir le fil de discussion","permissionDeniedDescription":"Sans accès à la caméra et au microphone, vous ne pouvez pas prendre de photos ou de vidéos à partager avec l\'équipe d\'assistance. Veuillez accorder l\'accès dans les paramètres de votre navigateur.","permissionDeniedTitle":"Quelque chose s\'est mal passé !","photoInstructionsTitle":"Prêt à prendre une photo ?","replyAttached":"Votre réponse a été jointe","scanQRCode":"Scannez ce code QR avec un appareil compatible.","screenShareInstructionsTitle":"Prêt à partager votre écran ?","screenTitle":"Prêt à capturer votre écran ?","send":"Envoyer","sendElements_one":"Envoyer la {{ type }}","sendElements_other":"Envoyer {{ count }} éléments","showQrCode":"Show QR code","startScreenRecording":"Start screen recording","startScreenShareButton":"Enregistrer écran","stopScreenShareButton":"Stop enregistrement","submissionDescription":"Votre photo/vidéo a été envoyée avec succès. Nous l\'examinerons et reviendrons vers vous bientôt.","submissionTitle":"Merci pour votre soumission !","switchToMobileDescription":"Profitez d\'une expérience encore plus pratique en utilisant votre téléphone pour prendre des photos et enregistrer des vidéos.","switchToMobileTitle":"Passez sur votre mobile","takeNewElement":"Prendre une nouvelle {{ type }}","upload":"Upload","useDesktopVersion":"Continuer","videoInstructionsTitle":"Prêt à enregistrer une vidéo ?","waitVideo":"Cela peut prendre jusqu\'à 15 secondes pour qu\'une vidéo soit prête."},"recordingPopup":{"dismiss":"Fermer","recordingStartText":"Cet appel sera enregistré sous peu. Si vous préférez ne pas être enregistré, vous êtes libre de quitter l\'appel à tout moment.","recordingStartTitle":"L\'enregistrement va commencer."},"requestAccess":{"admit":"Accepter","defaultName":"Un utilisateur","deny":"Refuser","wantToJoin":"{{name}} souhaite rejoindre!"},"requestDevice":{"declined":"Votre requête a été refusé.","request":"{{user}} voudrait que vous partagiez votre {{device}}","requestInput":"Demander l\'activation","timedOut":"Votre requête n\'a pas eu de réponse","userDeclined":"{{user}} a décliné votre requête."},"settings":{"devices":"Appareils","help":"Aide","helpCenter":"Accéder au centre d\'aide","language":"Langage","preferences":"Préférences","title":"Paramètres"},"shareLink":{"failed":"Une erreur est survenue pendant l\'envoi du lien","invalid":"Lien invalide","invoice":"{{user}} vous a envoyé une facture.","pay":"Payer","poweredBy":"Proposé par","sentToUser":"Lien envoyé à {{user}}","sentToUsers":"Lien envoyé aux participants","title":"Partager un lien","title2":"Partager un lien"},"sharedHistory":{"shared":"Partagé avec vous"},"snapshot":{"error":"Une erreur est survenue pendant l\'envoi du snapshot","save":"Sauvegarder l\'image","sentToUser":"Snapshot envoyé à {{user}}","sentToUsers":"Snapshot envoyé aux participants.","shared":"Snapshot envoyé.","title":"Snapshot"},"videoMenu":{"blockedCamera":"Votre caméra est bloqué.","cameraPermissions":"Please accept camera sharing before accessing these options.","highDef":"Haute définition (720p)","lowDef":"Basse définition (240p)","sendResolution":"Résolution envoyée (max)","standardDef":"Définition standard (480p)","title":"Video"},"virtualBackground":{"setBackground":"Mettre l\'arrière plan","title":"Arrière plan virtuel"},"youtube":{"invalid":"URL YouTube invalide","share":"Regarder maintenant","title":"Regardons Ensemble","url":"URL YOUTUBE"}}');var AW={};AW=JSON.parse('{"audioMenu":{"blockedMicrophone":"Il tuo microfono è bloccato.","microphonePermissions":"Si prega di accettare la condivisione del microfono prima di accedere a queste opzioni.","title":"Audio"},"blockedFeature":{"descriptionConnected":"Su un piano gratuito, non puoi utilizzare questa funzione. Aggiorna il tuo piano per usufruire di tutte le funzionalità in chiamata.","descriptionGuest":"Stai partecipando a una chiamata creata con una versione gratuita di SnapCall. Questa funzione è disponibile solo con una versione Pro.","dismissConnected":"L\'aggiornamento a Pro","dismissGuest":"Okay","titleConnected":"L\'aggiornamento a Pro","titleGuest":"Funzione non disponibile"},"common":{"new":"new"},"copyLink":{"copied":"Link copiato negli Appunti","copy":"Copia","description":"Copia il link negli appunti","error":"Si è verificato un errore durante la copia negli Appunti","title":"Copia il link"},"endView":{"callEnded":"Questa chiamata è finita","callIsOver":"Questa chiamata è finita o è stata eliminata","callLeft":"Hai lasciato la chiamata","full":"Impossibile partecipare alla chiamata","fullDescription":"Limite d\'uso attenente.","goBack":"Torna alla chiamata","tooLate":"Sei arrivato troppo tardi"},"gdpr":{"recordedWarning":"Per migliorare la qualità del nostro servizio, questa chiamata verrà registrata."},"greeting":{"askToJoin":"Chiedi di partecipare","askingLetIn":"Chiedo di essere fatto entrare...","cameraDisabled":"Fotocamera è spenta","cameraEnabled":"Fotocamera è accesa","canceledCallRequest":"La richiesta di chiamata verrà annullata e verrai reindirizzato alla pagina di pianificazione delle chiamate","cantJoinCall":"Non puoi partecipare a questa chiamata","cantWait":"Non vedo l\'ora?","cantWaitLeaveMessage":"Non vedi l\'ora? Puoi lasciare un messaggio e sarai contattato il prima possibile.","clickOnLock":"Fai clic sull\'icona del lucchetto <1></1> nella barra del browser.","footerDescription":"Incontrare SnapCall, il modo più semplice per aggiungere video in tempo reale a piattaforma, prodotto o servizio.","footerTitle":"Offerto da SnapCall","leaveMessage":"Lascia un messaggio","mainTitle":"Benvenuto a SnapCall","mediaDenied":"Accesso al microfono e alla fotocamera negato","microphoneDisabled":"Microfono è spento","microphoneEnabled":"Microfono è acceso","name":"Nome","nameDescription":"Questo nome verrà visualizzato a tutti i partecipanti alla chiamata.","namePlaceholder":"Per esempio. Lucia o Pietro","nameSubmit":"Partecipa alla conversazione","recordVideo":"Registra video","recordVoice":"Registra voce","requestACall":"Richiedi una chiamata","scheduleACall":"Pianifica una chiamata","setting":"Impostazioni","sideDescription":"Inserisci il tuo nome e regola la fotocamera e il microfono","sideTitle":"Tieni duro, il prossimo sei tu!","someoneDenied":"Qualcuno nella chiamata ha rifiutato la tua richiesta di partecipazione.","takeFewMinute":"L\'operazione potrebbe richiedere alcuni minuti a seconda della disponibilità dei partecipanti.","whatYouCanDo":"Ecco cosa puoi fare","youWillJoinWhenSomeoneLetsYou":"Parteciperai alla chiamata quando qualcuno di {{ companyName }} ti farà entrare."},"header":{"free":"Versione gratuita"},"invitePeople":{"PublicLink":"Public link","addEmailToInvite":"Aggiungi un\'e-mail per invitare.","addEmails":"Aggiungi email...","copyCallLinkDescription":"Copia questo link e invialo a chiunque desideri invitare a partecipare alla chiamata.","copyClipLinkDescription":"Copia questo collegamento e invialo a chiunque desideri invitare a registrare una clip.","email":"Email","emailPlaceholder":"Es. john@acme.com","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","error":"Impossibile inviare, riprova più tardi.","invalidEmail":"Formato email non valido.","invalidEmailOrNumber":"Invalid email or number format.","invitationSentTo_one":"Inviato a {{ name }}","invitationSentTo_other":"Inviato a {{ name }} e {{ otherEmailsCount }}+","invite":"Invita","inviteByEmail":"Invita via email","inviteByEmailOrNumber":"Invite by email or sms","inviteCall":"Invita a partecipare alla chiamata","inviteCallDefaultMessage":"Sei invitato a partecipare alla nostra videochiamata. Fare clic sul collegamento per connettersi immediatamente.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipDefaultMessage":"Registra subito il tuo videoclip e forniscici più contesto per assisterti meglio.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","invitePeople":"Invite people","inviteRecordAudio":"Record an audio","inviteRecordClip":"Invita a registrare la clip","inviteRecordPhoto":"Take a photo","inviteRecordScreen":"Record a screen","inviteRecordVideo":"Record a video","joinTheCall":"Join the call","linkToJoinCall":"Link per partecipare alla chiamata","linkToRecordAClip":"Collegamento per registrare una clip","message":"Messaggio","sharePublicLink":"Condividi link"},"leave":{"endCall":"Termina la chiamata per tutti","leaveCall":"Lascia la chiamata","title":"Lasciare"},"loader":{"connection":"Connessione..."},"menu":{"new":"NUOVO","openNewTab":"Apri una nuova scheda","pictureInPicture":"Immagine nell\'immagine","quickConnect":"Connessione Rapida","screenSharing":"Condivisione dello schermo","startRecord":"Registra chiamata","stopRecord":"Interrompere la registrazione","title":"Menù"},"misc":{"accept":"Accettare","audio":"Audio","camera":"Telecamera","cancel":"Annulla","confirm":"Confermare","decline":"Declinare","from":"Da","microphone":"Microfono","open":"Aprire","photo":"Foto","proceed":"Procedere","remove":"Rimuovere","screen":"Schermo","screenshot":"Schermata","someone":"Qualcuno","speaker":"Altoparlante","user":"Utente","video":"Video","you":"Voi"},"notifications":{"agentJoinError":"Si è verificato un errore cercando di entrare nella conversazione come agente","blockedMicrophonePopup":"SnapCall ha bisogno di accedere alla fotocamera e al microfono. Fare clic sull\'icona della fotocamera bloccata nella barra degli indirizzi del browser.","blockedMicrophonePopupTitle":"La tua fotocamera e il tuo microfono sono bloccati","cameraError":"Si è verificato un errore durante l\'attivazione della fotocamera","cameraRotateError":"Si è verificato un errore durante la rotazione della fotocamera","close":"Chiudere","connectedTo":"Connesso a {{name}}","criticalError":"Si è verificato un errore critico (errore {{code}}).","invitationSentToFailed":"Sent to {{ name }} failed.","microphoneError":"Si è verificato un errore durante l\'attivazione del microfono","noCamera":"Nessuna fotocamera disponibile","recording":"Registrazione in corso","reload":"Ricaricare","screensharingError":"Si è verificato un errore durante l\'attivazione della condivisione dello schermo","uploadError":"An error occured during the upload, please try again later."},"quickConnect":{"scan":"Scansiona questo codice QR con il telefono per aprire la chiamata.","scanTitle":"Scansiona il codice QR","title":"Connessione Rapida"},"recorder":{"addMore":"Aggiungere altro","addNewClip":"Aggiungi una nuova clip","allowAccess":"Consenti accesso","allowCamMicAccess":"Consenti l\'accesso a cam/mic","allowScreenShareAccess":"Consenti accesso alla condivisione dello schermo","attachElements_one":"Allega {{ type }} al biglietto","attachElements_other":"Allega {{ count }} elementi","audioInstructionsTitle":"Pronti per registrare un messaggio vocale?","audioLevelNotification":{"noSound":{"description":"Assicurati che il microfono sia attivato.","title":"Nessun suono rilevato."},"shortVideo":{"description":"Questo video è troppo breve per avere un contesto.","title":"Breve video."},"spokenWordsQuestion":{"description":"Il tuo video include abbastanza dettagli parlati?","title":"Parole pronunciate."},"spokenWordsWarning":{"description":"La clip include a malapena parole pronunciate.","title":"Nessuna parola detta."}},"audioLevelToast":{"continueSpeaking":"Continua a parlare per un contesto più chiaro.","noSound":"Nessun suono rilevato.","rememberSpeaking":"Ricordati di parlare per fornire il contesto."},"chooseWhatYouWantToShare":"Choose what you want to share","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","clipSubmissionDescription":"Grazie per aver utilizzato SnapCall.","clipSubmissionTitle_one":"La tua clip è stata inviata","clipSubmissionTitle_other":"I tuoi clip sono stati inviati","confirmRemovalDescription":"Sei sicuro di voler rimuovere questa foto/video? Questa azione non può essere annullata.","confirmRemovalTitle":"Conferma rimozione","elementBeingProcessed":"Attendi un momento mentre il tuo {{ type }} viene elaborato...","elementCaptureSuccess":"{{ type }} catturato con successo","elementRecordedAndAttached":"La tua clip è stata inviata e allegata al thread.","goBackToTicket":"Torna al biglietto","instructions":{"allowAccessOnPrompt":"<bold>Consenti l\'accesso</bold> alla fotocamera e al microfono.","multiplePhotos":"Scatta <bold>una foto o più</bold> di una per i dettagli.","privacyPolicy":"Procedendo, accetti la nostra <bold>Politica sulla Privacy.</bold>","reviewAndSendAudios":"<bold>Rivedi i tuoi audio</bold> e verranno inviati automaticamente a noi.","reviewAndSendPhotos":"<bold>Convalida le tue foto</bold> e verranno inviate automaticamente a noi.","reviewAndSendVideos":"<bold>Convalida i tuoi video</bold> e verranno inviati automaticamente a noi.","screenShareInstruction":"Seleziona lo schermo o la finestra che desideri registrare.","selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakClearly":"<bold>Parla chiaramente</bold> e dì ciò che devi comunicare.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","tapAudioButton":"<bold>Premi il pulsante di registrazione</bold> per iniziare a registrare il tuo messaggio vocale.","tapStopVideoButton":"<bold>Premi Stop</bold> quando hai finito.","tapVideoButton":"<bold>Premi Registra</bold>. Ricordati di commentare.","videoSpeech":"Puoi <bold>parlare durante</bold> la registrazione per aggiungere dettagli."},"limit":"Registrazione video limitata a 5 min.","logIn":"Login","loggedAs":"Registrato come","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","noCameraAccess":"No camera access","noCameraAndMicrophoneAccess":"No camera & microphone access","noMicrophoneAccess":"No microphone access","okay":"Okay","openThread":"Apri il thread","permissionDeniedDescription":"Senza l\'accesso alla fotocamera e al microfono, non è possibile scattare foto o registrare video da condividere con il team di supporto. Si prega di concedere l\'accesso nelle impostazioni del browser.","permissionDeniedTitle":"Qualcosa è andato storto!","photoInstructionsTitle":"Pronto a scattare una foto?","replyAttached":"La tua risposta è stata allegata","scanQRCode":"Scansiona questo codice QR con un dispositivo compatibile.","screenShareInstructionsTitle":"Pronto a condividere il tuo schermo?","screenTitle":"Pronto a catturare il tuo schermo?","send":"Invia","sendElements_one":"Invia {{ type }}","sendElements_other":"Invia {{ count }} elementi","showQrCode":"Show QR code","startScreenRecording":"Start screen recording","startScreenShareButton":"Registra il mio schermo","stopScreenShareButton":"Ferma registrazione","submissionDescription":"La tua foto/video è stata inviata con successo. La esamineremo e ti risponderemo al più presto.","submissionTitle":"Grazie per il tuo invio!","switchToMobileDescription":"Goditi un\'esperienza ancora più pratica utilizzando il tuo telefono per scattare foto e registrare video.","switchToMobileTitle":"Passa al tuo dispositivo mobile","takeNewElement":"Cattura un nuovo {{ type }}","upload":"Upload","useDesktopVersion":"Usa la versione desktop","videoInstructionsTitle":"Pronto a registrare un video?","waitVideo":"Potrebbero essere necessari fino a 15 secondi affinché un video sia pronto."},"recordingPopup":{"dismiss":"Chiudi","recordingStartText":"Questa chiamata verrà registrata a breve. Se preferisci non essere registrato, sei libero di lasciare la chiamata in questo momento.","recordingStartTitle":"Registrazione in procinto di iniziare."},"requestAccess":{"admit":"Ammettere","defaultName":"Un utente","deny":"Negare","wantToJoin":"<bold>{{name}}</bold> vuole unirsi!"},"requestDevice":{"declined":"La tua richiesta è stata rifiutata.","request":"{{user}} vorrebbe condividere il tuo {{device}}","requestInput":"Richiesta di attivazione","timedOut":"La tua richiesta non ha ricevuto risposta","userDeclined":"{{user}} ha rifiutato la tua richiesta"},"settings":{"devices":"Dispositivi","help":"Aiuto","helpCenter":"Accedi all\'Assistenza","language":"Linguaggio","preferences":"Preferenze","title":"Impostazioni"},"shareLink":{"failed":"Si è verificato un errore durante l\'invio del link","invalid":"Collegamento non valido","invoice":"{{user}} ti ha inviato una fattura.","pay":"Paga","poweredBy":"Proposto da","sentToUser":"Link inviato a {{user}}","sentToUsers":"Link inviato ai partecipanti","title":"Condividi un link","title2":"Condividi un link"},"sharedHistory":{"shared":"Condiviso con te"},"snapshot":{"error":"Si è verificato un errore durante l\'invio della schermata","save":"Salva l\'immagine","sentToUser":"Schermata inviata a {{user}}","sentToUsers":"Schermanta inviata ai partecipanti","shared":"Schermata inviata","title":"Schermata"},"videoMenu":{"blockedCamera":"La fotocamera è bloccata.","cameraPermissions":"Si prega di accettare la condivisione della fotocamera prima di accedere a queste opzioni.","highDef":"Alta definizione (720p)","lowDef":"Definizione bassa (240p)","sendResolution":"Risoluzione inviata (max)","standardDef":"Definizione standard (480p)","title":"Video"},"virtualBackground":{"setBackground":"Imposta sfondo","title":"Sfondo virtuale"},"youtube":{"invalid":"URL YouTube non valido","share":"Guarda ora","title":"Vedere Assieme","url":"URL YOUTUBE"}}');var AT={};AT=JSON.parse('{"audioMenu":{"blockedMicrophone":"El micrófono está bloqueado.","microphonePermissions":"Please accept microphone sharing before accessing these options.","title":"Audio"},"blockedFeature":{"descriptionConnected":"On a free plan, you can\'t use this feature. Upgrade your plan to enjoy all in-call features.","descriptionGuest":"You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.","dismissConnected":"Upgrade to Pro","dismissGuest":"Okay","titleConnected":"Upgrade to Pro","titleGuest":"Feature not available"},"common":{"new":"new"},"copyLink":{"copied":"Link copied to clipboard","copy":"Copy","description":"Copy link into clipboard","error":"An error occured when trying to copy to clipboard","title":"Copy link"},"endView":{"callEnded":"The call is now ended","callIsOver":"The call is over or deleted","callLeft":"You left the call","full":"You can\'t join this call","fullDescription":"The room is full. Please try to join the call later.","goBack":"Go back to call","tooLate":"You arrived too late"},"gdpr":{"recordedWarning":"To improve the quality of our service, this call will be recorded."},"greeting":{"askToJoin":"Ask to join","askingLetIn":"Asking to be let in...","cameraDisabled":"Camera is Off","cameraEnabled":"Camera is On","canceledCallRequest":"The call request will be canceled and you will be redirected to the call scheduling page.","cantJoinCall":"You can’t join this call","cantWait":"Can\'t wait?","cantWaitLeaveMessage":"Can’t wait? You can leave a message and you will be contacted as soon as possible.","clickOnLock":"Click on the <1></1> lock icon in your browser\'s bar.","footerDescription":"Meet SnapCall, the easiest way to add real-time video to platform, product or service.","footerTitle":"Powered by SnapCall","leaveMessage":"Leave a message","mainTitle":"Welcome to SnapCall","mediaDenied":"Microphone and camera access denied","microphoneDisabled":"Microphone is Off","microphoneEnabled":"Microphone is On","name":"Name","nameDescription":"This name will be displayed to all participants in the call.","namePlaceholder":"Eg. Lucy or Peter","nameSubmit":"Join Conversation","recordVideo":"Record video","recordVoice":"Record voice","requestACall":"Request a call","scheduleACall":"Schedule a call","setting":"Settings","sideDescription":"Please enter your name and adjust your camera and microphone","sideTitle":"Hold tight, you\'re next!","someoneDenied":"Someone in the call denied your request to join.","takeFewMinute":"This may take a few minutes depending on the availability of the participants.","whatYouCanDo":"Here’s what you can do","youWillJoinWhenSomeoneLetsYou":"You will join the call when someone from {{ companyName }} lets you in."},"header":{"free":"Free version"},"invitePeople":{"PublicLink":"Public link","addEmailToInvite":"Add an email to invite.","addEmails":"Add emails...","copyCallLinkDescription":"Copy this link and send it to anyone you wish to invite to join the call.","copyClipLinkDescription":"Copy this link and send it to anyone you wish to invite to record a clip.","email":"Email","emailPlaceholder":"Eg. john@acme.com","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","error":"Failed to send, please try again later.","invalidEmail":"Invalid email format.","invalidEmailOrNumber":"Invalid email or number format.","invitationSentTo_one":"Sent to {{ name }}","invitationSentTo_other":"Sent to {{ name }} and {{ otherEmailsCount }}+","invite":"Invite","inviteByEmail":"Invite by email","inviteByEmailOrNumber":"Invite by email or sms","inviteCall":"Invite to join call","inviteCallDefaultMessage":"Hey! You\'re invited to join our video call. Click the link to connect instantly.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","invitePeople":"Invite people","inviteRecordAudio":"Record an audio","inviteRecordClip":"Invite to record clip","inviteRecordPhoto":"Take a photo","inviteRecordScreen":"Record a screen","inviteRecordVideo":"Record a video","joinTheCall":"Join the call","linkToJoinCall":"Link to join the call","linkToRecordAClip":"Link to record a clip","message":"Message","sharePublicLink":"Share public link"},"leave":{"endCall":"End call for all","leaveCall":"Leave call","title":"Leave"},"loader":{"connection":"Connecting..."},"menu":{"new":"NEW","openNewTab":"Open new tab","pictureInPicture":"Picture-in-Picture","quickConnect":"Quick Connect","screenSharing":"Screen sharing","startRecord":"Record call","stopRecord":"Stop record","title":"Menu"},"misc":{"accept":"Accept","audio":"Audio","camera":"Camera","cancel":"Cancel","confirm":"Confirm","decline":"Decline","from":"From","microphone":"Microphone","open":"Open","photo":"Photo","proceed":"Proceed","remove":"Remove","screen":"Screen","screenshot":"Screenshot","someone":"Someone","speaker":"Speaker","user":"User","video":"Video","you":"You"},"notifications":{"agentJoinError":"An error occured while trying to join the room as an agent","blockedMicrophonePopup":"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser\'s address bar.","blockedMicrophonePopupTitle":"Camera and microphone are blocked","cameraError":"An error occured when trying to toggle the camera","cameraRotateError":"An error occured when trying to rotate the camera","close":"Close","connectedTo":"Connected to {{name}}","criticalError":"A critical error has occurred (error {{code}}).","invitationSentToFailed":"Sent to {{ name }} failed.","microphoneError":"An error occured when trying to toggle the microphone","noCamera":"No camera available","recording":"Recording in progress","reload":"Reload","screensharingError":"An error occured when trying to toggle screensharing","uploadError":"An error occured during the upload, please try again later."},"quickConnect":{"scan":"Scan this QR code with your phone camera to open the call.","scanTitle":"Scan QR Code","title":"Quick Connect"},"recorder":{"addMore":"Add more","addNewClip":"Add new clip","allowAccess":"Allow access","allowCamMicAccess":"Allow access to cam/mic","allowScreenShareAccess":"Allow access to screen sharing","attachElements_one":"Attach {{ type }} to ticket","attachElements_other":"Attach {{ count }} elements","audioInstructionsTitle":"Ready to record a voice message?","audioLevelNotification":{"noSound":{"description":"Make sure your microphone is activated.","title":"No sound detected."},"shortVideo":{"description":"This video is too short to get context.","title":"Short video."},"spokenWordsQuestion":{"description":"Does your video include enough spoken details?","title":"Spoken words."},"spokenWordsWarning":{"description":"The clip includes barely any spoken words.","title":"No spoken words."}},"audioLevelToast":{"continueSpeaking":"Continue speaking for clearer context.","noSound":"No sound detected.","rememberSpeaking":"Remember to speak to provide context."},"chooseWhatYouWantToShare":"Choose what you want to share","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","clipSubmissionDescription":"Thank you for using SnapCall.","clipSubmissionTitle_one":"Your clip has been sent","clipSubmissionTitle_other":"Your clips have been sent","confirmRemovalDescription":"Are you sure you want to delete this photo/video? This action cannot be undone.","confirmRemovalTitle":"Confirm deletion","elementBeingProcessed":"Please wait while your {{ type }} is being processed...","elementCaptureSuccess":"{{ type }} captured successfully","elementRecordedAndAttached":"Your clip has been sent and attached to the thread.","goBackToTicket":"Go back to ticket","instructions":{"allowAccessOnPrompt":"When prompted, <bold>allow access</bold> to camera and microphone.","multiplePhotos":"Take a <bold>photo or multiple</bold> for detail, then review.","privacyPolicy":"By proceeding, you agree to our <bold>Privacy Policy</bold>.","reviewAndSendAudios":"<bold>Review your audios</bold>, and they will be sent to us automatically.","reviewAndSendPhotos":"<bold>Validate your photos</bold>, and they will be sent to us automatically.","reviewAndSendVideos":"<bold>Review your videos</bold>, and they will be sent to us automatically.","screenShareInstruction":"Select the screen or window you wish to record.","selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakClearly":"<bold>Speak clearly</bold> and say what you need to convey.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","tapAudioButton":"<bold>Tap the record button</bold> to start recording your audio message.","tapStopVideoButton":"<bold>Tap stop</bold> when you are done.","tapVideoButton":"<bold>Tap the record button</bold> to begin and feel free to provide commentary.","videoSpeech":"You can <bold>talk during</bold> the recording to provide additional information."},"limit":"Video recording limited to 5 min.","logIn":"Log in","loggedAs":"Logged as","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","noCameraAccess":"No camera access","noCameraAndMicrophoneAccess":"No camera & microphone access","noMicrophoneAccess":"No microphone access","okay":"Okay","openThread":"Open thread","permissionDeniedDescription":"Without access to the camera and microphone, you won\'t be able to capture photos or videos to share with the support team. Please grant access in your browser settings.","permissionDeniedTitle":"Something went wrong!","photoInstructionsTitle":"Ready to snap a photo?","replyAttached":"Your reply has been attached","scanQRCode":"Scan this QR code with a compatible device.","screenShareInstructionsTitle":"Ready to share your screen?","screenTitle":"Ready to capture your screen?","send":"Send","sendElements_one":"Send {{ type }}","sendElements_other":"Send {{ count }} elements","showQrCode":"Show QR code","startScreenRecording":"Start screen recording","startScreenShareButton":"Record my screen","stopScreenShareButton":"Stop recording","submissionDescription":"Your photo/video has been successfully submitted. We will review it and get back to you shortly.","submissionTitle":"Thank you for your submission!","switchToMobileDescription":"Experience greater convenience by using your phone to take photos and record videos.","switchToMobileTitle":"Switch to your mobile device","takeNewElement":"Capture a new {{ type }}","upload":"Upload","useDesktopVersion":"Use the desktop version","videoInstructionsTitle":"Ready to record a video?","waitVideo":"A video may take up to 15 seconds to be ready."},"recordingPopup":{"dismiss":"Dismiss","recordingStartText":"This call will be recorded shortly. If you’d rather not be recorded, you’re welcome to leave the call at this time.","recordingStartTitle":"Recording about to start."},"requestAccess":{"admit":"Admit","defaultName":"An user","deny":"Deny","wantToJoin":"<bold>{{name}}</bold> wants to join!"},"requestDevice":{"declined":"Your request has been declined.","request":"{{user}} would like you to share your {{device}}","requestInput":"Request input devices","timedOut":"Your request has timed out.","userDeclined":"{{user}} has declined your request."},"settings":{"devices":"Devices","help":"Help","helpCenter":"Go to help center","language":"Language","preferences":"Preferences","title":"Settings"},"shareLink":{"failed":"Failed to send link","invalid":"Invalid link","invoice":"{{user}} sent you an invoice.","pay":"Pay","poweredBy":"Powered by","sentToUser":"Link sent to {{user}}","sentToUsers":"Link sent to users","title":"Share link","title2":"Share a link"},"sharedHistory":{"shared":"Shared with you"},"snapshot":{"error":"An error occured when trying to send the snapshot","save":"Save photo","sentToUser":"Snapshot sent to {{user}}","sentToUsers":"Snapshot sent to users.","shared":"Snapshot shared.","title":"Snapshot"},"videoMenu":{"blockedCamera":"Camera is blocked.","cameraPermissions":"Please accept camera sharing before accessing these options.","highDef":"High definition (720p)","lowDef":"Low definition (240p)","sendResolution":"Send Resolution (maximum)","standardDef":"Standard definition (480p)","title":"Video"},"virtualBackground":{"setBackground":"Set Background","title":"Virtual Background"},"youtube":{"invalid":"Invalid YouTube URL","share":"Watch now","title":"Watch Together","url":"YOUTUBE URL"}}');var AD={};AD=JSON.parse('{"audioMenu":{"blockedMicrophone":"Mikrofon jest zablokowany.","microphonePermissions":"Please accept microphone sharing before accessing these options.","title":"Audio"},"blockedFeature":{"descriptionConnected":"On a free plan, you can\'t use this feature. Upgrade your plan to enjoy all in-call features.","descriptionGuest":"You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.","dismissConnected":"Upgrade to Pro","dismissGuest":"Okay","titleConnected":"Upgrade to Pro","titleGuest":"Feature not available"},"common":{"new":"new"},"copyLink":{"copied":"Link copied to clipboard","copy":"Copy","description":"Copy link into clipboard","error":"An error occured when trying to copy to clipboard","title":"Copy link"},"endView":{"callEnded":"The call is now ended","callIsOver":"The call is over or deleted","callLeft":"You left the call","full":"You can\'t join this call","fullDescription":"The room is full. Please try to join the call later.","goBack":"Go back to call","tooLate":"You arrived too late"},"gdpr":{"recordedWarning":"To improve the quality of our service, this call will be recorded."},"greeting":{"askToJoin":"Ask to join","askingLetIn":"Asking to be let in...","cameraDisabled":"Camera is Off","cameraEnabled":"Camera is On","canceledCallRequest":"The call request will be canceled and you will be redirected to the call scheduling page.","cantJoinCall":"You can’t join this call","cantWait":"Can\'t wait?","cantWaitLeaveMessage":"Can’t wait? You can leave a message and you will be contacted as soon as possible.","clickOnLock":"Click on the <1></1> lock icon in your browser\'s bar.","footerDescription":"Meet SnapCall, the easiest way to add real-time video to platform, product or service.","footerTitle":"Powered by SnapCall","leaveMessage":"Leave a message","mainTitle":"Welcome to SnapCall","mediaDenied":"Microphone and camera access denied","microphoneDisabled":"Microphone is Off","microphoneEnabled":"Microphone is On","name":"Name","nameDescription":"This name will be displayed to all participants in the call.","namePlaceholder":"Eg. Lucy or Peter","nameSubmit":"Join Conversation","recordVideo":"Record video","recordVoice":"Record voice","requestACall":"Request a call","scheduleACall":"Schedule a call","setting":"Settings","sideDescription":"Please enter your name and adjust your camera and microphone","sideTitle":"Hold tight, you\'re next!","someoneDenied":"Someone in the call denied your request to join.","takeFewMinute":"This may take a few minutes depending on the availability of the participants.","whatYouCanDo":"Here’s what you can do","youWillJoinWhenSomeoneLetsYou":"You will join the call when someone from {{ companyName }} lets you in."},"header":{"free":"Free version"},"invitePeople":{"PublicLink":"Public link","addEmailToInvite":"Add an email to invite.","addEmails":"Add emails...","copyCallLinkDescription":"Copy this link and send it to anyone you wish to invite to join the call.","copyClipLinkDescription":"Copy this link and send it to anyone you wish to invite to record a clip.","email":"Email","emailPlaceholder":"Eg. john@acme.com","emailsOrNumberPlaceholder":"Eg. john@acme.com or +33612345678","error":"Failed to send, please try again later.","invalidEmail":"Invalid email format.","invalidEmailOrNumber":"Invalid email or number format.","invitationSentTo_one":"Sent to {{ name }}","invitationSentTo_other":"Sent to {{ name }} and {{ otherEmailsCount }}+","invite":"Invite","inviteByEmail":"Invite by email","inviteByEmailOrNumber":"Invite by email or sms","inviteCall":"Invite to join call","inviteCallDefaultMessage":"Hey! You\'re invited to join our video call. Click the link to connect instantly.","inviteClipAudioDefaultMessage":"Hey! Please record an audio message now and provide us with more context to assist you better.","inviteClipDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","inviteClipPhotoDefaultMessage":"Hey! Please take a photo and provide us with more context to assist you better.","inviteClipScreenDefaultMessage":"Hey! Please record your screen now and provide us with more context to assist you better.","inviteClipVideoDefaultMessage":"Hey! Please record your video now and provide us with more context to assist you better.","invitePeople":"Invite people","inviteRecordAudio":"Record an audio","inviteRecordClip":"Invite to record clip","inviteRecordPhoto":"Take a photo","inviteRecordScreen":"Record a screen","inviteRecordVideo":"Record a video","joinTheCall":"Join the call","linkToJoinCall":"Link to join the call","linkToRecordAClip":"Link to record a clip","message":"Message","sharePublicLink":"Share public link"},"leave":{"endCall":"End call for all","leaveCall":"Leave call","title":"Leave"},"loader":{"connection":"Connecting..."},"menu":{"new":"NEW","openNewTab":"Open new tab","pictureInPicture":"Picture-in-Picture","quickConnect":"Quick Connect","screenSharing":"Screen sharing","startRecord":"Record call","stopRecord":"Stop record","title":"Menu"},"misc":{"accept":"Accept","audio":"Audio","camera":"Camera","cancel":"Cancel","confirm":"Confirm","decline":"Decline","from":"From","microphone":"Microphone","open":"Open","photo":"Photo","proceed":"Proceed","remove":"Remove","screen":"Screen","screenshot":"Screenshot","someone":"Someone","speaker":"Speaker","user":"User","video":"Video","you":"You"},"notifications":{"agentJoinError":"An error occured while trying to join the room as an agent","blockedMicrophonePopup":"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser\'s address bar.","blockedMicrophonePopupTitle":"Camera and microphone are blocked","cameraError":"An error occured when trying to toggle the camera","cameraRotateError":"An error occured when trying to rotate the camera","close":"Close","connectedTo":"Connected to {{name}}","criticalError":"A critical error has occurred (error {{code}}).","invitationSentToFailed":"Sent to {{ name }} failed.","microphoneError":"An error occured when trying to toggle the microphone","noCamera":"No camera available","recording":"Recording in progress","reload":"Reload","screensharingError":"An error occured when trying to toggle screensharing","uploadError":"An error occured during the upload, please try again later."},"quickConnect":{"scan":"Scan this QR code with your phone camera to open the call.","scanTitle":"Scan QR Code","title":"Quick Connect"},"recorder":{"addMore":"Add more","addNewClip":"Add new clip","allowAccess":"Allow access","allowCamMicAccess":"Allow access to cam/mic","allowScreenShareAccess":"Allow access to screen sharing","attachElements_one":"Attach {{ type }} to ticket","attachElements_other":"Attach {{ count }} elements","audioInstructionsTitle":"Ready to record a voice message?","audioLevelNotification":{"noSound":{"description":"Make sure your microphone is activated.","title":"No sound detected."},"shortVideo":{"description":"This video is too short to get context.","title":"Short video."},"spokenWordsQuestion":{"description":"Does your video include enough spoken details?","title":"Spoken words."},"spokenWordsWarning":{"description":"The clip includes barely any spoken words.","title":"No spoken words."}},"audioLevelToast":{"continueSpeaking":"Continue speaking for clearer context.","noSound":"No sound detected.","rememberSpeaking":"Remember to speak to provide context."},"chooseWhatYouWantToShare":"Choose what you want to share","clipCount_one":"{{ count }} clip","clipCount_other":"{{ count }} clips","clipSubmissionDescription":"Thank you for using SnapCall.","clipSubmissionTitle_one":"Your clip has been sent","clipSubmissionTitle_other":"Your clips have been sent","confirmRemovalDescription":"Are you sure you want to delete this photo/video? This action cannot be undone.","confirmRemovalTitle":"Confirm deletion","elementBeingProcessed":"Please wait while your {{ type }} is being processed...","elementCaptureSuccess":"{{ type }} captured successfully","elementRecordedAndAttached":"Your clip has been sent and attached to the thread.","goBackToTicket":"Go back to ticket","instructions":{"allowAccessOnPrompt":"When prompted, <bold>allow access</bold> to camera and microphone.","multiplePhotos":"Take a <bold>photo or multiple</bold> for detail, then review.","privacyPolicy":"By proceeding, you agree to our <bold>Privacy Policy</bold>.","reviewAndSendAudios":"<bold>Review your audios</bold>, and they will be sent to us automatically.","reviewAndSendPhotos":"<bold>Validate your photos</bold>, and they will be sent to us automatically.","reviewAndSendVideos":"<bold>Review your videos</bold>, and they will be sent to us automatically.","screenShareInstruction":"Select the screen or window you wish to record.","selectScreenshare":"Tap Record my screen and select the screen or window you want to record.","speakClearly":"<bold>Speak clearly</bold> and say what you need to convey.","speakDuringRecord":"You can speak while recording to add details.","stopScreenOnFinish":"Press the Stop button when finished. The video will be sent to us automatically.","tapAudioButton":"<bold>Tap the record button</bold> to start recording your audio message.","tapStopVideoButton":"<bold>Tap stop</bold> when you are done.","tapVideoButton":"<bold>Tap the record button</bold> to begin and feel free to provide commentary.","videoSpeech":"You can <bold>talk during</bold> the recording to provide additional information."},"limit":"Video recording limited to 5 min.","logIn":"Log in","loggedAs":"Logged as","mediaCount_one":"{{ count }} media","mediaCount_other":"{{ count }} media","mediaSent_one":"Your media has been sent","mediaSent_other":"Your media has been sent","noCameraAccess":"No camera access","noCameraAndMicrophoneAccess":"No camera & microphone access","noMicrophoneAccess":"No microphone access","okay":"Okay","openThread":"Open thread","permissionDeniedDescription":"Without access to the camera and microphone, you won\'t be able to capture photos or videos to share with the support team. Please grant access in your browser settings.","permissionDeniedTitle":"Something went wrong!","photoInstructionsTitle":"Ready to snap a photo?","replyAttached":"Your reply has been attached","scanQRCode":"Scan this QR code with a compatible device.","screenShareInstructionsTitle":"Ready to share your screen?","screenTitle":"Ready to capture your screen?","send":"Send","sendElements_one":"Send {{ type }}","sendElements_other":"Send {{ count }} elements","showQrCode":"Show QR code","startScreenRecording":"Start screen recording","startScreenShareButton":"Record my screen","stopScreenShareButton":"Stop recording","submissionDescription":"Your photo/video has been successfully submitted. We will review it and get back to you shortly.","submissionTitle":"Thank you for your submission!","switchToMobileDescription":"Experience greater convenience by using your phone to take photos and record videos.","switchToMobileTitle":"Switch to your mobile device","takeNewElement":"Capture a new {{ type }}","upload":"Upload","useDesktopVersion":"Use the desktop version","videoInstructionsTitle":"Ready to record a video?","waitVideo":"A video may take up to 15 seconds to be ready."},"recordingPopup":{"dismiss":"Dismiss","recordingStartText":"This call will be recorded shortly. If you’d rather not be recorded, you’re welcome to leave the call at this time.","recordingStartTitle":"Recording about to start."},"requestAccess":{"admit":"Admit","defaultName":"An user","deny":"Deny","wantToJoin":"<bold>{{name}}</bold> wants to join!"},"requestDevice":{"declined":"Your request has been declined.","request":"{{user}} would like you to share your {{device}}","requestInput":"Request input devices","timedOut":"Your request has timed out.","userDeclined":"{{user}} has declined your request."},"settings":{"devices":"Devices","help":"Help","helpCenter":"Go to help center","language":"Language","preferences":"Preferences","title":"Settings"},"shareLink":{"failed":"Failed to send link","invalid":"Invalid link","invoice":"{{user}} sent you an invoice.","pay":"Pay","poweredBy":"Powered by","sentToUser":"Link sent to {{user}}","sentToUsers":"Link sent to users","title":"Share link","title2":"Share a link"},"sharedHistory":{"shared":"Shared with you"},"snapshot":{"error":"An error occured when trying to send the snapshot","save":"Save photo","sentToUser":"Snapshot sent to {{user}}","sentToUsers":"Snapshot sent to users.","shared":"Snapshot shared.","title":"Snapshot"},"videoMenu":{"blockedCamera":"Camera is blocked.","cameraPermissions":"Please accept camera sharing before accessing these options.","highDef":"High definition (720p)","lowDef":"Low definition (240p)","sendResolution":"Send Resolution (maximum)","standardDef":"Standard definition (480p)","title":"Video"},"virtualBackground":{"setBackground":"Set Background","title":"Virtual Background"},"youtube":{"invalid":"Invalid YouTube URL","share":"Watch now","title":"Watch Together","url":"YOUTUBE URL"}}');let AO={dev:{name:"dev",translation:hW(Az)},en:{name:"English",translation:hW(AE)},fr:{name:"Français",translation:hW(AV)},it:{name:"Italiano",translation:hW(AW)},es:{name:"Español",translation:hW(AT)},pl:{name:"Polski",translation:hW(AD)}};Ai.use({type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ab={...Ab,...e}}(e.options.react),r=e}}).init({lng:AH(),fallbackLng:"dev",resources:AO,interpolation:{escapeValue:!1}});var p4=(hO("85Hg2"),hO("85Hg2"),hO("85Hg2"));function AI(e){let[t,r]=function(e,t,r){let[n,o]=(0,p4.useState)(e||t),i=(0,p4.useRef)(void 0!==e),a=void 0!==e;(0,p4.useEffect)(()=>{let e=i.current;e!==a&&console.warn(`WARN: A component changed from ${e?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}.`),i.current=a},[a]);let s=a?e:n,l=(0,p4.useCallback)((e,...t)=>{let n=(e,...t)=>{r&&!Object.is(s,e)&&r(e,...t),a||(s=e)};"function"==typeof e?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),o((r,...o)=>{let i=e(a?s:r,...o);return(n(i,...t),a)?r:i})):(a||o(e),n(e,...t))},[a,s,r]);return[s,l]}(e.isOpen,e.defaultOpen||!1,e.onOpenChange),n=(0,p4.useCallback)(()=>{r(!0)},[r]),o=(0,p4.useCallback)(()=>{r(!1)},[r]),i=(0,p4.useCallback)(()=>{r(!t)},[r,t]);return{isOpen:t,setOpen:r,open:n,close:o,toggle:i}}var AA={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let AZ=new Uint8Array(16),AB=[];for(let e=0;e<256;++e)AB.push((e+256).toString(16).slice(1));var AF=function(e,t,r){if(AA.randomUUID&&!t&&!e)return AA.randomUUID();let o=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(AZ)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return function(e,t=0){return AB[e[t+0]]+AB[e[t+1]]+AB[e[t+2]]+AB[e[t+3]]+"-"+AB[e[t+4]]+AB[e[t+5]]+"-"+AB[e[t+6]]+AB[e[t+7]]+"-"+AB[e[t+8]]+AB[e[t+9]]+"-"+AB[e[t+10]]+AB[e[t+11]]+AB[e[t+12]]+AB[e[t+13]]+AB[e[t+14]]+AB[e[t+15]]}(o)};JSON.parse('{"name":"protoo-client","version":"4.0.6","description":"protoo JavaScript client module","author":"Iñaki Baz Castillo <ibc@aliax.net>","homepage":"https://protoo.versatica.com","license":"MIT","repository":{"type":"git","url":"https://github.com/ibc/protoo.git"},"main":"lib/index.js","keywords":["nodejs","browser","websocket"],"engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint -c .eslintrc.js lib"},"dependencies":{"debug":"^4.3.1","events":"^3.2.0","retry":"^0.12.0"},"devDependencies":{"eslint":"^5.16.0"},"optionalDependencies":{"websocket":"^1.0.33"}}').version;var Aq={},AU={},A$=hO("hZG0u");let AY="protoo-client";AU=class{constructor(e){e?(this._debug=A$(`${AY}:${e}`),this._warn=A$(`${AY}:WARN:${e}`),this._error=A$(`${AY}:ERROR:${e}`)):(this._debug=A$(AY),this._warn=A$(`${AY}:WARN`),this._error=A$(`${AY}:ERROR`)),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}};var AX={},AG=hO("3oV8N").EventEmitter;AX=class extends AG{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new AU("EnhancedEventEmitter")}safeEmit(e,...t){try{this.emit(e,...t)}catch(t){this._logger.error("safeEmit() | event listener threw an error [event:%s]:%o",e,t)}}async safeEmitAsPromise(e,...t){return new Promise((r,n)=>{this.safeEmit(e,...t,r,n)})}};var AK={};ub=function(){return Math.round(1e7*Math.random())};let AQ=new AU("Message");AK=class{static parse(e){let t;let r={};try{t=JSON.parse(e)}catch(e){AQ.error("parse() | invalid JSON: %s",e);return}if("object"!=typeof t||Array.isArray(t)){AQ.error("parse() | not an object");return}if(t.request){if(r.request=!0,"string"!=typeof t.method){AQ.error("parse() | missing/invalid method field");return}if("number"!=typeof t.id){AQ.error("parse() | missing/invalid id field");return}r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id){AQ.error("parse() | missing/invalid id field");return}r.id=t.id,t.ok?(r.ok=!0,r.data=t.data||{}):(r.ok=!1,r.errorCode=t.errorCode,r.errorReason=t.errorReason)}else if(t.notification){if(r.notification=!0,"string"!=typeof t.method){AQ.error("parse() | missing/invalid method field");return}r.method=t.method,r.data=t.data||{}}else{AQ.error("parse() | missing request/response field");return}return r}static createRequest(e,t){return{request:!0,id:ub(),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,r){return{response:!0,id:e.id,ok:!1,errorCode:t,errorReason:r}}static createNotification(e,t){return{notification:!0,method:e,data:t||{}}}};let AJ=new AU("Peer");Aq=class extends AX{constructor(e){super(AJ),AJ.debug("constructor()"),this._closed=!1,this._transport=e,this._connected=!1,this._data={},this._sents=new Map,this._handleTransport()}get closed(){return this._closed}get connected(){return this._connected}get data(){return this._data}set data(e){throw Error("cannot override data object")}close(){if(!this._closed){for(let e of(AJ.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close(),this._sents.values()))e.close();this.safeEmit("close")}}async request(e,t){let r=AK.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise((e,t)=>{let n=1500*(15+.1*this._sents.size),o={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(o.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(o.timer),t(e))},timer:setTimeout(()=>{this._sents.delete(r.id)&&t(Error("request timeout"))},n),close:()=>{clearTimeout(o.timer),t(Error("peer closed"))}};this._sents.set(r.id,o)})}async notify(e,t){let r=AK.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed){this._closed=!0,setTimeout(()=>{this._closed||(this._connected=!1,this.safeEmit("close"))});return}this._transport.on("open",()=>{this._closed||(AJ.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))}),this._transport.on("disconnected",()=>{this._closed||(AJ.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))}),this._transport.on("failed",e=>{this._closed||(AJ.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))}),this._transport.on("close",()=>{this._closed||(this._closed=!0,AJ.debug('emit "close"'),this._connected=!1,this.safeEmit("close"))}),this._transport.on("message",e=>{e.request?this._handleRequest(e):e.response?this._handleResponse(e):e.notification&&this._handleNotification(e)})}_handleRequest(e){try{this.emit("request",e,t=>{let r=AK.createSuccessResponse(e,t);this._transport.send(r).catch(()=>{})},(t,r)=>{t instanceof Error?(r=t.message,t=500):"number"==typeof t&&r instanceof Error&&(r=r.message);let n=AK.createErrorResponse(e,t,r);this._transport.send(n).catch(()=>{})})}catch(r){let t=AK.createErrorResponse(e,500,String(r));this._transport.send(t).catch(()=>{})}}_handleResponse(e){let t=this._sents.get(e.id);if(!t){AJ.error("received response does not match any sent request [id:%s]",e.id);return}if(e.ok)t.resolve(e.data);else{let r=Error(e.errorReason);r.code=e.errorCode,t.reject(r)}}_handleNotification(e){this.safeEmit("notification",e)}};var A1={};if("object"==typeof globalThis)uk=globalThis;else try{uk=hO("jCEG4")}catch(e){}finally{if(uk||"undefined"==typeof window||(uk=window),!uk)throw Error("Could not determine global this")}var A2=uk.WebSocket||uk.MozWebSocket,A0={};function A3(e,t){return t?new A2(e,t):new A2(e)}hO("kUMHr").version,A2&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(A3,e,{get:function(){return A2[e]}})});var A9=A2?A3:null,A5={};A5=hO("jxXWz");let A6={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},A4=new AU("WebSocketTransport");function A8(e){return e&&e.Math==Math?e:void 0}A1=class extends AX{constructor(e,t){super(A4),A4.debug("constructor() [url:%s, options:%o]",e,t),this._closed=!1,this._url=e,this._options=t||{},this._ws=null,this._runWebSocket()}get closed(){return this._closed}close(){if(!this._closed){A4.debug("close()"),this._closed=!0,this.safeEmit("close");try{this._ws.onopen=null,this._ws.onclose=null,this._ws.onerror=null,this._ws.onmessage=null,this._ws.close()}catch(e){A4.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw A4.warn("send() failed:%o",e),e}}_runWebSocket(){let e=A5.operation(this._options.retry||A6),t=!1;e.attempt(r=>{if(this._closed){e.stop();return}A4.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new A9(this._url,"protoo",this._options.origin,this._options.headers,this._options.requestOptions,this._options.clientConfig),this._ws.onopen=()=>{this._closed||(t=!0,this.safeEmit("open"))},this._ws.onclose=n=>{if(!this._closed){if(A4.warn('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]',n.wasClean,n.code,n.reason),4e3!==n.code){if(t){if(e.stop(),this.safeEmit("disconnected"),this._closed)return;this._runWebSocket();return}if(this.safeEmit("failed",r),this._closed||e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||A4.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;let t=AK.parse(e.data);if(t){if(0===this.listenerCount("message")){A4.error('no listeners for WebSocket "message" event, ignoring received message');return}this.safeEmit("message",t)}}})}},uy=Aq,ux=A1;let A7="object"==typeof globalThis&&A8(globalThis)||"object"==typeof window&&A8(window)||"object"==typeof self&&A8(self)||"object"==typeof hV&&A8(hV)||function(){return this}()||{};function Ze(e,t,r){let n=r||A7,o=n.__SENTRY__=n.__SENTRY__||{};return o[e]||(o[e]=t())}let Zt=Object.prototype.toString;function Zr(e){return"[object Object]"===Zt.call(e)}function Zn(e){return!!(e&&e.then&&"function"==typeof e.then)}let Zo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Zi=["debug","info","warn","error","log","assert","trace"],Za={};function Zs(e){if(!("console"in A7))return e();let t=A7.console,r={},n=Object.keys(Za);n.forEach(e=>{let n=Za[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}let Zl=function(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Zo?Zi.forEach(r=>{t[r]=(...t)=>{e&&Zs(()=>{A7.console[r](`Sentry Logger [${r}]:`,...t)})}}):Zi.forEach(e=>{t[e]=()=>void 0}),t}();function Zd(){return Date.now()/1e3}let Zc=function(){let{performance:e}=A7;if(!e||!e.now)return Zd;let t=Date.now()-e.now(),r=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function Zu(e){return function e(t,r){if(function(e){if(!Zr(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(t)){let n=r.get(t);if(void 0!==n)return n;let o={};for(let n of(r.set(t,o),Object.keys(t)))void 0!==t[n]&&(o[n]=e(t[n],r));return o}if(Array.isArray(t)){let n=r.get(t);if(void 0!==n)return n;let o=[];return r.set(t,o),t.forEach(t=>{o.push(e(t,r))}),o}return t}(e,new Map)}function Zh(){let e=A7.crypto||A7.msCrypto,t=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>{let t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(e){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&t())>>e/4).toString(16))}(()=>{let{performance:e}=A7;if(!e||!e.now)return;let t=e.now(),r=Date.now(),n=e.timeOrigin?Math.abs(e.timeOrigin+t-r):36e5,o=e.timing&&e.timing.navigationStart,i="number"==typeof o?Math.abs(o+t-r):36e5;if(n<36e5||i<36e5)return n<=i?e.timeOrigin:void 0})();let Zp="production",Zf="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;(g=uM||(uM={}))[g.PENDING=0]="PENDING",g[g.RESOLVED=1]="RESOLVED",g[g.REJECTED=2]="REJECTED";class Zm{constructor(e){Zm.prototype.__init.call(this),Zm.prototype.__init2.call(this),Zm.prototype.__init3.call(this),Zm.prototype.__init4.call(this),this._state=uM.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Zm((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Zm((t,r)=>{let n,o;return this.then(t=>{o=!1,n=t,e&&e()},t=>{o=!0,n=t,e&&e()}).then(()=>{if(o){r(n);return}t(n)})})}__init(){this._resolve=e=>{this._setResult(uM.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(uM.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===uM.PENDING){if(Zn(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===uM.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===uM.RESOLVED&&e[1](this._value),this._state===uM.REJECTED&&e[2](this._value),e[0]=!0)})}}}function ZC(e,t={}){if(!t.user||(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Zc(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Zh()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Zg(e){return e.transaction}function Zw(e){return"function"==typeof e.getSpanJSON?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");class Zv{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Zy()}static clone(e){return e?e.clone():new Zv}clone(){let e=new Zv;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&ZC(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){let t=e(this);return t instanceof Zv?t:this}return e instanceof Zv?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Zr(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Zy(),this}addBreadcrumb(e,t){let r="number"==typeof t?t:100;if(r<=0)return this;let n={timestamp:Zd(),...e},o=this._breadcrumbs;return o.push(n),this._breadcrumbs=o.length>r?o.slice(-r):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){let{_breadcrumbs:e,_attachments:t,_contexts:r,_tags:n,_extra:o,_user:i,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:d,_sdkProcessingMetadata:c,_transactionName:u,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:r,tags:n,extra:o,user:i,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:d,sdkProcessingMetadata:c,transactionName:u,span:h}}applyToEvent(e,t={},r=[]){return!function(e,t){var r;let{fingerprint:n,span:o,breadcrumbs:i,sdkProcessingMetadata:a,propagationContext:s}=t;(function(e,t){let{extra:r,tags:n,user:o,contexts:i,level:a,transactionName:s}=t,l=Zu(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});let d=Zu(n);d&&Object.keys(d).length&&(e.tags={...d,...e.tags});let c=Zu(o);c&&Object.keys(c).length&&(e.user={...c,...e.user});let u=Zu(i);u&&Object.keys(u).length&&(e.contexts={...u,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)})(e,t),o&&function(e,t){e.contexts={trace:function(e){let{spanId:t,traceId:r}=e.spanContext(),{data:n,op:o,parent_span_id:i,status:a,tags:s,origin:l}=Zw(e);return Zu({data:n,op:o,parent_span_id:i,span_id:t,status:a,tags:s,trace_id:r,origin:l})}(t),...e.contexts};let r=Zg(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:function(e){let t=Zj().getClient();if(!t)return{};let r=function(e,t,r){let n=t.getOptions(),{publicKey:o}=t.getDsn()||{},{segment:i}=r&&r.getUser()||{},a=Zu({environment:n.environment||Zp,release:n.release,user_segment:i,public_key:o,trace_id:e});return t.emit&&t.emit("createDsc",a),a}(Zw(e).trace_id||"",t,Zj().getScope()),n=Zg(e);if(!n)return r;let o=n&&n._frozenDynamicSamplingContext;if(o)return o;let{sampleRate:i,source:a}=n.metadata;null!=i&&(r.sample_rate=`${i}`);let s=Zw(n);return a&&"url"!==a&&(r.transaction=s.description),r.sampled=String(function(e){let{traceFlags:t}=e.spanContext();return!!(1&t)}(n)),t.emit&&t.emit("createDsc",r),r}(t),...e.sdkProcessingMetadata};let n=Zw(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,o),e.fingerprint=e.fingerprint?Array.isArray(r=e.fingerprint)?r:[r]:[],n&&(e.fingerprint=e.fingerprint.concat(n)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint,function(e,t){let r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}(e,i),e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...a,propagationContext:s}}(e,this.getScopeData()),function e(t,r,n,o=0){return new Zm((i,a)=>{let s=t[o];if(null===r||"function"!=typeof s)i(r);else{let l=s({...r},n);Zf&&s.id&&null===l&&Zl.log(`Event processor "${s.id}" dropped event`),Zn(l)?l.then(r=>e(t,r,n,o+1).then(i)).then(null,a):e(t,l,n,o+1).then(i).then(null,a)}})}([...r,...Ze("globalEventProcessors",()=>[]),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let r=t&&t.event_id?t.event_id:Zh();if(!this._client)return Zl.warn("No client configured on scope - will not capture exception!"),r;let n=Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){let n=r&&r.event_id?r.event_id:Zh();if(!this._client)return Zl.warn("No client configured on scope - will not capture message!"),n;let o=Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...r,event_id:n},this),n}captureEvent(e,t){let r=t&&t.event_id?t.event_id:Zh();return this._client?this._client.captureEvent(e,{...t,event_id:r},this):Zl.warn("No client configured on scope - will not capture event!"),r}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Zy(){return{traceId:Zh(),spanId:Zh().substring(16)}}let Zx=parseFloat("7.94.1");class Zb{constructor(e,t,r,n=Zx){let o,i;this._version=n,t?o=t:(o=new Zv).setClient(e),r?i=r:(i=new Zv).setClient(e),this._stack=[{scope:o}],e&&this.bindClient(e),this._isolationScope=i}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){let t;let r=this.pushScope();try{t=e(r)}catch(e){throw this.popScope(),e}return Zn(t)?t.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),t)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let r=this._lastEventId=t&&t.event_id?t.event_id:Zh(),n=Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:n,...t,event_id:r}),r}captureMessage(e,t,r){let n=this._lastEventId=r&&r.event_id?r.event_id:Zh(),o=Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:o,...r,event_id:n}),n}captureEvent(e,t){let r=t&&t.event_id?t.event_id:Zh();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...t,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:r,client:n}=this.getStackTop();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=100}=n.getOptions&&n.getOptions()||{};if(i<=0)return;let a={timestamp:Zd(),...e},s=o?Zs(()=>o(a,t)):a;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,i))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){let{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){let t=ZM(this);try{e(this)}finally{ZM(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return Zf&&Zl.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let r=this._callExtensionMethod("startTransaction",e,t);return Zf&&!r&&(this.getClient()?Zl.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
304
304
  Sentry.addTracingExtensions();
305
305
  Sentry.init({...});
306
- `):Zl.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();if(t){let e;e={},"ok"===t.status&&(e={status:"exited"}),ZC(t,e)}this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:r}=this.getStackTop(),{release:n,environment:o=Zp}=r&&r.getOptions()||{},{userAgent:i}=A7.navigator||{},a=function(e){let t=Zc(),r={sid:Zh(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Zu({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:"number"==typeof r.did||"string"==typeof r.did?`${r.did}`:void 0,duration:r.duration,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})};return e&&ZC(r,e),r}({release:n,environment:o,user:t.getUser(),...i&&{userAgent:i},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&ZC(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_callExtensionMethod(e,...t){let r=Zk().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Zf&&Zl.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Zk(){return A7.__SENTRY__=A7.__SENTRY__||{extensions:{},hub:void 0},A7}function ZM(e){let t=Zk(),r=ZL(t);return ZN(t,e),r}function Zj(){let e=Zk();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Zk()){return(!(e&&e.__SENTRY__&&e.__SENTRY__.hub)||ZL(e).isOlderThan(Zx))&&ZN(e,new Zb),ZL(e)}(e)}function ZL(e){return Ze("hub",()=>new Zb,e)}function ZN(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function ZS(e,t){Zj().addBreadcrumb(e,t)}new WeakMap;let ZP={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"},Z_=Number(2),ZR=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class ZH{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){let o=`[ ${ZR.format(new Date)} ][ ${ZP[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Z_)?t(o,...n):ZS({type:"debug",level:ZP[e],category:"console",data:{head:o,arguments:n}})}debug(e,...t){this.print(5,console.debug,e,...t)}error(e,...t){this.print(1,console.error,e,...t)}info(e,...t){this.print(3,console.info,e,...t)}log(e,...t){this.print(4,console.log,e,...t)}warn(e,...t){this.print(2,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Z_=e}setLogLevel(e){this.customLogLevel=e}}let Zz=new ZH("AudioLevels.ts"),ZE=window.AudioContext||window.webkitAudioContext;class ZV{constructor(e,t){this.speakStartEventTime=0,this.speakStopEventTime=0,this.speaking=!1,this.audioMedianInterval=-1,this.audioLevelInterval=-1,this.audioLevelAverageInterval=-1,this.audioLevelAverage={count:0,average:0},this.audioLevels=[],this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new ZE,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=512,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){let{length:e}=this.audioLevels;return this.audioLevels.reduce((e,t)=>e+t,0)/e}getCurrentAudioLevel(){let{length:e}=this.audioLevels;return e?this.audioLevels[e-1]:0}audioMuteDetection(){0===this.getAudioLevelMedian()&&this.audioLevels.length>0&&this.listener?.onMuteDetection?.(this.id)}detectSpeakingChange(e){e<20&&!this.speakStopEventTime&&(this.speakStartEventTime=0,this.speakStopEventTime=Date.now()),e>=20&&!this.speakStartEventTime&&(this.speakStartEventTime=Date.now(),this.speakStopEventTime=0);let t=this.speakStartEventTime||this.speakStopEventTime,r=!!this.speakStartEventTime;(Date.now()-t>500&&r||Date.now()-t>300&&!r)&&this.speaking!==r&&(this.speaking=r,r?this.listener?.onStartSpeak():this.listener?.onStopSpeak())}computeRMS(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r]*e[r];return Math.sqrt(t/=e.length)}getInstantAudioLevel(){let e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);let t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){let e=this.getInstantAudioLevel();this.audioLevels=this.audioLevels.splice(-59),this.detectSpeakingChange(e),this.audioLevels.push(e),this.listener?.onAudioLevel?.(e,this.id)}analyse(){this.audioLevelInterval=window.setInterval(()=>this.loopCalcul(),1e3/60),this.audioMedianInterval=window.setInterval(()=>this.audioMuteDetection(),2e3)}startAverageAnalysis(){this.audioLevelAverage={count:0,average:0},clearInterval(this.audioLevelAverageInterval),this.audioLevelAverageInterval=window.setInterval(()=>{let{count:e,average:t}=this.audioLevelAverage,r=(t*e+this.getAudioLevelMedian())/(e+1);this.audioLevelAverage={count:e+1,average:r}},1e3)}stopAverageAnalysis(){return clearInterval(this.audioLevelAverageInterval),this.audioLevelAverage.average}getFrequencyData(){let e=new Uint8Array(this.analyser.frequencyBinCount);return this.analyser.getByteFrequencyData(e),e}clearListeners(){clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.audioLevels=[]}release(){this.listener=void 0,this.clearListeners(),this.stream.getTracks().forEach(e=>{this.stream.removeTrack(e)});try{this.audioStreamSource.disconnect(this.analyser)}catch(e){Zz.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch(e=>{Zz.error("release","audioContext failed to close",e)})}static isAPIAvailable(){return!!ZE}}let ZW=new ZH("AudioRenderer.ts");var ZT=class{constructor({consumerId:e}){this.consumerId=e,this.audio=new Audio,this.audio.id=e,this.audio.autoplay=!0,document.body.appendChild(this.audio)}destroy(){this.audio.pause(),this.audio.srcObject=null,document.body.removeChild(this.audio)}setSource(e){this.audio.srcObject=e}async setSink(e){await this.audio.setSinkId?.(e)}getSink(){return this.audio.sinkId}async play(){await this.audio.play().catch(e=>{ZW.warn("play","failed to play"),setTimeout(()=>{this.play()},1e3)})}};let ZD=async e=>{let{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",o="portrait"===n?t:r,i="landscape"===n?r:t,a=document.createElement("canvas"),s=a.getContext("2d"),l=window.devicePixelRatio||1;return a.width=o*l,a.height=i*l,s?.scale(l,l),s?.drawImage(e,"landscape"===n?(t-o)/2:0,"portrait"===n?(r-i)/2:0,o,i,0,0,a.width/l,a.height/l),a.toDataURL("image/jpeg")},ZO=async e=>{let t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");let n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();let o=document.createElement("canvas"),i=o.getContext("2d");return o.height=t.height,o.width=t.width,i?.drawImage(t,0,0),o.toDataURL("image/jpeg")};var ZI=hO("eEB2e"),ZA={},ZZ=ZA&&ZA.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ZB=ZA&&ZA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ZF=ZA&&ZA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ZZ(t,e,r);return ZB(t,e),t},Zq=ZA&&ZA.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ZA,"__esModule",{value:!0}),ZA.debug=ZA.parseScalabilityMode=ZA.detectDevice=ZA.Device=ZA.version=ZA.types=void 0;let ZU=Zq(hO("hZG0u"));ZA.debug=ZU.default;var Z$=hO("1ZHQC");Object.defineProperty(ZA,"Device",{enumerable:!0,get:function(){return Z$.Device}}),Object.defineProperty(ZA,"detectDevice",{enumerable:!0,get:function(){return Z$.detectDevice}});let ZY=ZF(hO("cQumC"));ZA.types=ZY,ZA.version="3.7.8";var ZX=hO("fT1lN");Object.defineProperty(ZA,"parseScalabilityMode",{enumerable:!0,get:function(){return ZX.parse}});let ZG=new ZH("StreamerMediasoup");class ZK{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){let r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter(e=>"urn:3gpp:video-orientation"!==e.uri);let n=function(){try{return new ZA.Device}catch(e){return ZG.error("failed to detects device from mediasoup, fallback on auto detection",e),function(){try{var e;let t=navigator.userAgent,r=hY.getParser(t);e="DeviceDetectionForced",Zj().setTag(e,!0),ZS({type:"debug",category:"browser",data:r.getResult()});let n=r.getOS();if("Safari"===r.getBrowserName()&&"iOS"===n.name&&Number(n.version)>=14.3)return new ZA.Device({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){ZG.error("deviceAutoDetection",e)}return new ZA.Device({handlerName:"Chrome74"})}()}}();return n.load({routerRtpCapabilities:r}),new ZK(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){let t=await e.request("createWebRtcTransport");return{id:t.id,iceParameters:t.iceParameters,iceCandidates:t.iceCandidates,dtlsParameters:{...t.dtlsParameters,role:"auto"},sctpParameters:t.sctpParameters,iceServers:this.config.iceServers,proprietaryConstraints:{optional:[{googDscp:!0}]},additionalSettings:{encodedInsertableStreams:!1}}}async createSendTransport(e){let t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",({dtlsParameters:r},n,o)=>{ZG.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(o)}),t.on("produce",async({kind:r,rtpParameters:n,appData:o},i,a)=>{try{let{id:a}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:o});i({id:a}),ZG.log("producerTransport: ",t)}catch(e){a(e)}}),t}async createRecvTransport(e){let t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",({dtlsParameters:r},n,o)=>{ZG.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(o)}),t}async createTransport(e,t){return"send"===t?await this.createSendTransport(e):await this.createRecvTransport(e)}async produceAudio(e,t,r){return await e.produce({track:t,codecOptions:{opusStereo:!0,opusDtx:!0},appData:r})}async produceVideo(e,t,r){return await e.produce({track:t,encodings:void 0,codecOptions:{videoGoogleStartBitrate:1e3},appData:r})}}var ZQ={};(function(){function e(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var t,r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e},n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof hV&&hV];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var o=n;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in o))break e;o=o[a]}(t=t(i=o[e=e[e.length-1]]))!=i&&null!=t&&r(o,e,{configurable:!0,writable:!0,value:t})}}function i(t){var r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}function a(e){if(!(e instanceof Array)){e=i(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}o("Symbol",function(e){function t(e,t){this.h=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.h};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(r){if(this instanceof e)throw TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+o++,r)}}),o("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<o.length;i++){var a=n[o[i]];"function"==typeof a&&"function"!=typeof a.prototype[t]&&r(a.prototype,t,{configurable:!0,writable:!0,value:function(){var t;return(t={next:t=e(this)})[Symbol.iterator]=function(){return this},t}})}return t});var s="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};o("Object.assign",function(e){return e||s});var l,d,c="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{e:{var u={};try{u.__proto__={a:!0},Q=u.a;break e}catch(e){}Q=!1}d=Q?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw TypeError(e+" is not extensible");return e}:null}var h=d;function p(e,t){if(e.prototype=c(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var r in t)if("prototype"!=r){if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r]}e.za=t.prototype}function f(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function m(e){if(e.m)throw TypeError("Generator is already running");e.m=!0}function C(e,t){e.l={ma:t,na:!0},e.h=e.s||e.v}function g(e,t,r){return e.h=r,{value:t}}function w(e){this.h=new f,this.i=e}function v(e,t,r,n){try{var o=t.call(e.h.j,r);if(!(o instanceof Object))throw TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.h.m=!1,o;var i=o.value}catch(t){return e.h.j=null,C(e.h,t),y(e)}return e.h.j=null,n.call(e.h,i),y(e)}function y(e){for(;e.h.h;)try{var t=e.i(e.h);if(t)return e.h.m=!1,{value:t.value,done:!1}}catch(t){e.h.i=void 0,C(e.h,t)}if(e.h.m=!1,e.h.l){if(t=e.h.l,e.h.l=null,t.na)throw t.ma;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function x(e){this.next=function(t){return m(e.h),e.h.j?t=v(e,e.h.j.next,t,e.h.u):(e.h.u(t),t=y(e)),t},this.throw=function(t){return m(e.h),e.h.j?t=v(e,e.h.j.throw,t,e.h.u):(C(e.h,t),t=y(e)),t},this.return=function(t){var r;return m(e.h),(r=e.h.j)?v(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.h.return):(e.h.return(t),y(e))},this[Symbol.iterator]=function(){return this}}function b(e){return function(e){function t(t){return e.next(t)}function r(t){return e.throw(t)}return new Promise(function(n,o){!function e(i){i.done?n(i.value):Promise.resolve(i.value).then(t,r).then(e,o)}(e.next())})}(new x(new w(e)))}function k(e){return e||Array.prototype.fill}f.prototype.u=function(e){this.i=e},f.prototype.return=function(e){this.l={return:e},this.h=this.v},o("Promise",function(e){function t(e){this.i=0,this.j=void 0,this.h=[],this.u=!1;var t=this.l();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.h=null}function o(e){return e instanceof t?e:new t(function(t){t(e)})}if(e)return e;r.prototype.i=function(e){if(null==this.h){this.h=[];var t=this;this.j(function(){t.m()})}this.h.push(e)};var a=n.setTimeout;r.prototype.j=function(e){a(e,0)},r.prototype.m=function(){for(;this.h&&this.h.length;){var e=this.h;this.h=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.l(e)}}}this.h=null},r.prototype.l=function(e){this.j(function(){throw e})},t.prototype.l=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.I),reject:e(this.m)}},t.prototype.I=function(e){if(e===this)this.m(TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.L(e);else{switch(typeof e){case"object":var r=null!=e;break;case"function":r=!0;break;default:r=!1}r?this.F(e):this.s(e)}},t.prototype.F=function(e){var t=void 0;try{t=e.then}catch(e){this.m(e);return}"function"==typeof t?this.M(t,e):this.s(e)},t.prototype.m=function(e){this.v(2,e)},t.prototype.s=function(e){this.v(1,e)},t.prototype.v=function(e,t){if(0!=this.i)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.i);this.i=e,this.j=t,2===this.i&&this.K(),this.H()},t.prototype.K=function(){var e=this;a(function(){if(e.D()){var t=n.console;void 0!==t&&t.error(e.j)}},1)},t.prototype.D=function(){if(this.u)return!1;var e=n.CustomEvent,t=n.Event,r=n.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=n.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.j,r(e))},t.prototype.H=function(){if(null!=this.h){for(var e=0;e<this.h.length;++e)s.i(this.h[e]);this.h=null}};var s=new r;return t.prototype.L=function(e){var t=this.l();e.T(t.resolve,t.reject)},t.prototype.M=function(e,t){var r=this.l();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t(function(e,t){o=e,i=t});return this.T(n(e,o),n(r,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.T=function(e,t){function r(){switch(n.i){case 1:e(n.j);break;case 2:t(n.j);break;default:throw Error("Unexpected state: "+n.i)}}var n=this;null==this.h?s.i(r):this.h.push(r),this.u=!0},t.resolve=o,t.reject=function(e){return new t(function(t,r){r(e)})},t.race=function(e){return new t(function(t,r){for(var n=i(e),a=n.next();!a.done;a=n.next())o(a.value).T(t,r)})},t.all=function(e){var r=i(e),n=r.next();return n.done?o([]):new t(function(e,t){var i=[],a=0;do i.push(void 0),a++,o(n.value).T(function(t){return function(r){i[t]=r,0==--a&&e(i)}}(i.length-1),t),n=r.next();while(!n.done)})},t}),o("Array.prototype.keys",function(e){return e||function(){var e,t,r,n,o;return e=this,t=function(e){return e},e instanceof String&&(e+=""),r=0,n=!1,(o={next:function(){if(!n&&r<e.length){var o=r++;return{value:t(o,e[o]),done:!1}}return n=!0,{done:!0,value:void 0}}})[Symbol.iterator]=function(){return o},o}}),o("Array.prototype.fill",function(e){return e||function(e,t,r){var n=this.length||0;for(0>t&&(t=Math.max(0,n+t)),(null==r||r>n)&&(r=n),0>(r=Number(r))&&(r=Math.max(0,n+r)),t=Number(t||0);t<r;t++)this[t]=e;return this}}),o("Int8Array.prototype.fill",k),o("Uint8Array.prototype.fill",k),o("Uint8ClampedArray.prototype.fill",k),o("Int16Array.prototype.fill",k),o("Uint16Array.prototype.fill",k),o("Int32Array.prototype.fill",k),o("Uint32Array.prototype.fill",k),o("Float32Array.prototype.fill",k),o("Float64Array.prototype.fill",k),o("Object.is",function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}}),o("Array.prototype.includes",function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length;for(0>(t=t||0)&&(t=Math.max(t+n,0));t<n;t++){var o=r[t];if(o===e||Object.is(o,e))return!0}return!1}}),o("String.prototype.includes",function(e){return e||function(e,t){if(null==this)throw TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw TypeError("First argument to String.prototype.includes must not be a regular expression");return -1!==this.indexOf(e,t||0)}});var M=this||self;function j(e,t){e=e.split(".");var r,n=M;for((e[0]in n)||void 0===n.execScript||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||void 0===t?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t}function L(e){var t;return(t=M.navigator)&&(t=t.userAgent)||(t=""),-1!=t.indexOf(e)}var N=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var r=e.length,n=Array(r),o="string"==typeof e?e.split(""):e,i=0;i<r;i++)i in o&&(n[i]=t.call(void 0,o[i],i,e));return n},S={},P=null;function _(){if(!P){P={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));S[r]=n;for(var o=0;o<n.length;o++){var i=n[o];void 0===P[i]&&(P[i]=o)}}}}var R="undefined"!=typeof Uint8Array,H=!(L("Trident")||L("MSIE"))&&"function"==typeof M.btoa;function z(e){if(!H){var t;void 0===t&&(t=0),_(),t=S[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],l=e[o+2],d=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|l>>6],l=t[63&l],r[i++]=d+a+s+l}switch(d=0,l=n,e.length-o){case 2:l=t[(15&(d=e[o+1]))<<2]||n;case 1:e=e[o],r[i]=t[e>>2]+t[(3&e)<<4|d>>4]+l+n}return r.join("")}for(t="";10240<e.length;)t+=String.fromCharCode.apply(null,e.subarray(0,10240)),e=e.subarray(10240);return btoa(t+=String.fromCharCode.apply(null,e))}var E=RegExp("[-_.]","g");function V(e){switch(e){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function W(e){if(!H){var t,r,n,o,i;return(n=3*(r=(t=e).length)/4)%3?n=Math.floor(n):-1!="=.".indexOf(t[r-1])&&(n=-1!="=.".indexOf(t[r-2])?n-2:n-1),o=new Uint8Array(n),i=0,function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),o=P[r];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}_();for(var n=0;;){var o=r(-1),i=r(0),a=r(64),s=r(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(t,function(e){o[i++]=e}),i!==n?o.subarray(0,i):o}E.test(e)&&(e=e.replace(E,V)),e=atob(e);for(var a=new Uint8Array(e.length),s=0;s<e.length;s++)a[s]=e.charCodeAt(s);return a}function T(){return J||(J=new Uint8Array(0))}var D={},O="function"==typeof Uint8Array.prototype.slice,I=0,A=0;function Z(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/4294967296),t&&(t=(r=i(F(r,e))).next().value,e=r.next().value,r=t),I=r>>>0,A=e>>>0}var B="function"==typeof BigInt;function F(e,t){return t=~t,e?e=~e+1:t+=1,[e,t]}function q(e,t){this.i=e>>>0,this.h=t>>>0}function U(e){if(!e)return ee||(ee=new q(0,0));if(!/^-?\d+$/.test(e))return null;if(16>e.length)Z(Number(e));else if(B)I=Number((e=BigInt(e))&BigInt(4294967295))>>>0,A=Number(e>>BigInt(32)&BigInt(4294967295));else{var t=+("-"===e[0]);A=I=0;for(var r=e.length,n=t,o=(r-t)%6+t;o<=r;n=o,o+=6)n=Number(e.slice(n,o)),A*=1e6,4294967296<=(I=1e6*I+n)&&(A+=I/4294967296|0,I%=4294967296);t&&(e=(t=i(F(I,A))).next().value,t=t.next().value,I=e,A=t)}return new q(I,A)}function $(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function Y(){return Error("Failed to read varint, encoding is invalid.")}function X(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function G(){throw Error("Invalid UTF8")}function K(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Q,J,ee,et,er,en=void 0,eo="undefined"!=typeof TextDecoder,ei="undefined"!=typeof TextEncoder;function ea(e){if(e!==D)throw Error("illegal external caller")}function es(e,t){if(ea(t),this.V=e,null!=e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}function el(){return ez||(ez=new es(null,D))}function ed(e){ea(D);var t=e.V;return null==(t=null==t||R&&null!=t&&t instanceof Uint8Array?t:"string"==typeof t?W(t):null)?t:e.V=t}function ec(e,t){this.i=null,this.m=!1,this.h=this.j=this.l=0,eu(this,e,t)}function eu(e,t,r){r=void 0===r?{}:r,e.S=void 0!==r.S&&r.S,t&&(t=function(e){if("string"==typeof e)return{buffer:W(e),C:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),C:!1};if(e.constructor===Uint8Array)return{buffer:e,C:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),C:!1};if(e.constructor===es)return{buffer:ed(e)||T(),C:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),C:!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")}(t),e.i=t.buffer,e.m=t.C,e.l=0,e.j=e.i.length,e.h=e.l)}function eh(e,t){if(e.h=t,t>e.j)throw X(e.j,t)}function ep(e){var t=e.i,r=e.h,n=t[r++],o=127&n;if(128&n&&(o|=(127&(n=t[r++]))<<7,128&n&&(o|=(127&(n=t[r++]))<<14,128&n&&(o|=(127&(n=t[r++]))<<21,128&n&&(o|=(n=t[r++])<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Y();return eh(e,r),o}function ef(e,t){if(0>t)throw Error("Tried to read a negative byte length: "+t);var r=e.h,n=r+t;if(n>e.j)throw X(t,e.j-r);return e.h=n,r}ec.prototype.reset=function(){this.h=this.l};var em=[];function eC(){this.h=[]}function eg(e,t,r){for(;0<r||127<t;)e.h.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.h.push(t)}function ew(e,t){for(;127<t;)e.h.push(127&t|128),t>>>=7;e.h.push(t)}function ev(e,t){if(em.length){var r=em.pop();eu(r,e,t),e=r}else e=new ec(e,t);this.h=e,this.j=this.h.h,this.i=this.l=-1,this.setOptions(t)}function ey(e){var t=e.h;if(t.h==t.j)return!1;e.j=e.h.h;var r=ep(e.h)>>>0;if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw $(r,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.l=t,e.i=r,!0}eC.prototype.length=function(){return this.h.length},eC.prototype.end=function(){var e=this.h;return this.h=[],e},ev.prototype.setOptions=function(e){e=void 0===e?{}:e,this.ca=void 0!==e.ca&&e.ca},ev.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var ex=[];function eb(){this.j=[],this.i=0,this.h=new eC}function ek(e,t){0!==t.length&&(e.j.push(t),e.i+=t.length)}var eM="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function ej(e,t){return eM?e[eM]|=t:void 0!==e.A?e.A|=t:(Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}}),t)}function eL(e,t){eM?e[eM]&&(e[eM]&=~t):void 0!==e.A&&(e.A&=~t)}function eN(e){var t;return null==(t=eM?e[eM]:e.A)?0:t}function eS(e,t){eM?e[eM]=t:void 0!==e.A?e.A=t:Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}})}function eP(e,t){eS(t,(0|e)&-51)}function e_(e,t){eS(t,(18|e)&-41)}var eR={};function eH(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var ez,eE,eV=[];function eW(e){if(2&eN(e.o))throw Error("Cannot mutate an immutable Message")}function eT(e){var t=e.length;(t=t?e[t-1]:void 0)&&eH(t)?t.g=1:(t={},e.push((t.g=1,t)))}function eD(e){var t=e.i+e.G;return e.B||(e.B=e.o[t]={})}function eO(e,t){return -1===t?null:t>=e.i?e.B?e.B[t]:void 0:e.o[t+e.G]}function eI(e,t,r,n){eW(e),eA(e,t,r,n)}function eA(e,t,r,n){e.j&&(e.j=void 0),t>=e.i||n?eD(e)[t]=r:(e.o[t+e.G]=r,(e=e.B)&&t in e&&delete e[t])}function eZ(e,t,r,n){var o=eO(e,t);Array.isArray(o)||(o=eE);var i=eN(o);if(1&i||ej(o,1),n)2&i||ej(o,2),1&r||Object.freeze(o);else{n=!(2&r);var a,s=2&i;1&r||!s?n&&16&i&&!s&&eL(o,16):(ej(a=Array.prototype.slice.call(o),1),eA(e,t,o=a))}return o}function eB(e,t){var r=eO(e,t),n=null==r?r:"number"==typeof r||"NaN"===r||"Infinity"===r||"-Infinity"===r?Number(r):void 0;return null!=n&&n!==r&&eA(e,t,n),n}function eF(e,t,r,n,o){e.h||(e.h={});var i=e.h[r],a=eZ(e,r,3,o);if(!i){var s=a;i=[];var l=!!(16&eN(e.o));a=!!(2&eN(s));var d=s;!o&&a&&(s=Array.prototype.slice.call(s));for(var c=a,u=0;u<s.length;u++){var h=s[u],p=t,f=!1;if(void 0!==(h=Array.isArray(h)?new p(h):f?new p:void 0)){var m=f=eN(p=h.o);a&&(m|=2),l&&(m|=16),m!=f&&eS(p,m),p=m,c=c||!!(2&p),i.push(h)}}return e.h[r]=i,t=33|(l=eN(s)),l!=(t=c?-9&t:8|t)&&(Object.isFrozen(c=s)&&(c=Array.prototype.slice.call(c)),eS(c,t),s=c),d!==s&&eA(e,r,s),(o||n&&a)&&ej(i,2),n&&Object.freeze(i),i}return o||(o=Object.isFrozen(i),n&&!o?Object.freeze(i):!n&&o&&(i=Array.prototype.slice.call(i),e.h[r]=i)),i}function eq(e,t,r){var n=!!(2&eN(e.o));if(t=eF(e,t,r,n,n),e=eZ(e,r,3,n),!(n||8&eN(e))){for(n=0;n<t.length;n++){if(2&eN((r=t[n]).o)){var o=e2(r,!1);o.j=r}else o=r;r!==o&&(t[n]=o,e[n]=o.o)}ej(e,8)}return t}function eU(e,t,r){if(null!=r&&"number"!=typeof r)throw Error("Value of float/double field must be a number|null|undefined, found "+typeof r+": "+r);eI(e,t,r)}function e$(e,t,r,n,o){eW(e);var i=eF(e,r,t,!1,!1);return r=null!=n?n:new r,e=eZ(e,t,2,!1),void 0!=o?(i.splice(o,0,r),e.splice(o,0,r.o)):(i.push(r),e.push(r.o)),r.C()&&eL(e,8),r}function eY(e,t){return null==e?t:e}function eX(e,t,r){return r=void 0===r?0:r,eY(eB(e,t),r)}function eG(e,t,r,n){var o=eN(e);n=n?!!(16&o):void 0,e=Array.prototype.slice.call(e);for(var i=0;i<e.length;i++)e[i]=function e(t,r,n,o){if(null!=t){if(Array.isArray(t))t=eG(t,r,n,void 0!==o);else if(eH(t)){var i,a={};for(i in t)a[i]=e(t[i],r,n,o);t=a}else t=r(t,o);return t}}(e[i],t,r,n);return r(o,e),e}function eK(e){return e.ja===eR?e.toJSON():function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e){if(Array.isArray(e)){if(0!=(128&eN(e)))return eT(e=Array.prototype.slice.call(e)),e}else{if(R&&null!=e&&e instanceof Uint8Array)return z(e);if(e instanceof es){var t=e.V;return null==t?"":"string"==typeof t?t:e.V=z(t)}}}}return e}(e)}function eQ(e,t){128&e&&eT(t)}function eJ(e,t,r,n,o,i,a){if(e=e.h&&e.h[r]){var s;if(2&(n=eN(e))?n=e:(e_(n,i=N(e,e1)),Object.freeze(i),n=i),eW(t),a=null==n?eE:(ej(s=[],1),s),null!=n){for(e=0,i=!!n.length;e<n.length;e++){var l=n[e];i=i&&!(2&eN(l.o)),a[e]=l.o}i=(i?8:0)|1,((e=eN(a))&i)!==i&&(Object.isFrozen(a)&&(a=Array.prototype.slice.call(a)),eS(a,e|i)),t.h||(t.h={}),t.h[r]=n}else t.h&&(t.h[r]=void 0);eA(t,r,a,o)}else eI(t,r,function e(t,r,n){if(n=void 0===n?e_:n,null!=t){if(R&&t instanceof Uint8Array)return t.length?new es(new Uint8Array(t),D):el();if(Array.isArray(t)){var o=eN(t);return 2&o||(r&&!(32&o)&&(16&o||0===o)?eS(t,2|o):4&(r=eN(t=eG(t,e,4&o?e_:n,!0)))&&2&r&&Object.freeze(t)),t}return t.ja===eR?e1(t):t}}(n,i,a),o)}function e1(e){return 2&eN(e.o)||ej((e=e2(e,!0)).o,2),e}function e2(e,r){var n=e.o,o=[];ej(o,16);var i=e.constructor.h;if(i&&o.push(i),i=e.B){o.length=n.length,o.fill(void 0,o.length,n.length);var a={};o[o.length-1]=a}0!=(128&eN(n))&&eT(o),r=r||e.C()?e_:eP,a=e.constructor,t=o,o=new a(o),t=void 0,e.R&&(o.R=e.R.slice()),a=!!(16&eN(n));for(var s=i?n.length-1:n.length,l=0;l<s;l++)eJ(e,o,l-e.G,n[l],!1,a,r);if(i)for(var d in i)eJ(e,o,+d,i[d],!0,a,r);return o}function e0(e,r,n){null==e&&(e=t),t=void 0;var o,i=this.constructor.i||0,a=0<i,s=this.constructor.h,l=!1;if(null==e){var d=48,c=!0;a&&(i=0,d|=128),eS(e=s?[s]:[],d)}else{if(!Array.isArray(e)||s&&s!==e[0])throw Error();var u=d=ej(e,0);if((c=0!=(16&u))&&((l=0!=(32&u))||(u|=32)),a){if(128&u)i=0;else if(0<e.length){var h=e[e.length-1];if(eH(h)&&"g"in h){i=0,u|=128,delete h.g;var p,f=!0;for(p in h){f=!1;break}f&&e.pop()}}}else if(128&u)throw Error();d!==u&&eS(e,u)}this.G=(s?0:-1)-i,this.h=void 0,this.o=e;e:{if(i=(s=this.o.length)-1,s&&eH(s=this.o[i])){this.B=s,this.i=i-this.G;break e}void 0!==r&&-1<r?(this.i=Math.max(r,i+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE}if(!a&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(n)for(r=c&&!l&&!0,a=this.i,c=0;c<n.length;c++)(l=n[c])<a?(l+=this.G,(i=e[l])?e3(i,r):e[l]=eE):(o||(o=eD(this)),(i=o[l])?e3(i,r):o[l]=eE)}function e3(e,t){if(Array.isArray(e)){var r=eN(e),n=1;!t||2&r||(n|=16),(r&n)!==n&&eS(e,r|n)}}function e9(e,t,r){if(r){var n,o={};for(n in r){var i=r[n],a=i.ra;a||(o.J=i.xa||i.oa.W,i.ia?(o.aa=tt(i.ia),a=function(e){return function(t,r,n){return e.J(t,r,n,e.aa)}}(o)):i.ka?(o.Z=tr(i.da.P,i.ka),a=function(e){return function(t,r,n){return e.J(t,r,n,e.Z)}}(o)):a=o.J,i.ra=a),a(t,e,i.da),o={J:o.J,aa:o.aa,Z:o.Z}}}!function(e,t){if(t=t.R){ek(e,e.h.end());for(var r=0;r<t.length;r++)ek(e,ed(t[r])||T())}}(t,e)}eS(eV,23),eE=Object.freeze(eV),e0.prototype.toJSON=function(){return eG(this.o,eK,eQ)},e0.prototype.C=function(){return!!(2&eN(this.o))},e0.prototype.ja=eR,e0.prototype.toString=function(){return this.o.toString()};var e5=Symbol();function e6(e,t,r){return e[e5]||(e[e5]=function(e,n){return t(e,n,r)})}function e4(e){var t=e[e5];if(!t){var r=tf(e);t=function(e,t){return tm(e,t,r)},e[e5]=t}return t}function e8(e,t){var r=e[t];return"function"==typeof r&&0===r.length&&(r=r(),e[t]=r),Array.isArray(r)&&(td in r||tn in r||0<r.length&&"function"==typeof r[0])?r:void 0}function e7(e,t,r,n,o,i){t.P=e[0];var a=1;if(e.length>a&&"number"!=typeof e[a]){var s=e[a++];r(t,s)}for(;a<e.length;){r=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;switch(s=e[a++],l-=a){case 0:n(t,r,s);break;case 1:(l=e8(e,a))?(a++,o(t,r,s,l)):n(t,r,s,e[a++]);break;case 2:o(t,r,s,l=e8(e,l=a++),e[a++]);break;case 3:i(t,r,s,e[a++],e[a++],e[a++]);break;case 4:i(t,r,s,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var te=Symbol();function tt(e){var t=e[te];if(!t){var r=tl(e);t=function(e,t){return tC(e,t,r)},e[te]=t}return t}function tr(e,t){var r=e[te];return r||(r=function(e,r){return e9(e,r,t)},e[te]=r),r}var tn=Symbol();function to(e,t){e.push(t)}function ti(e,t,r){e.push(t,r.W)}function ta(e,t,r,n){var o=tt(n),i=tl(n).P,a=r.W;e.push(t,function(e,t,r){return a(e,t,r,i,o)})}function ts(e,t,r,n,o,i){var a=tr(n,i),s=r.W;e.push(t,function(e,t,r){return s(e,t,r,n,a)})}function tl(e){var t=e[tn];return t||(t=e7(e,e[tn]=[],to,ti,ta,ts),td in e&&tn in e&&(e.length=0)),t}var td=Symbol();function tc(e,t){e[0]=t}function tu(e,t,r,n){var o=r.U;e[t]=n?function(e,t,r){return o(e,t,r,n)}:o}function th(e,t,r,n,o){var i=r.U,a=e4(n),s=tf(n).P;e[t]=function(e,t,r){return i(e,t,r,s,a,o)}}function tp(e,t,r,n,o,i,a){var s=r.U,l=e6(n,o,i);e[t]=function(e,t,r){return s(e,t,r,n,l,a)}}function tf(e){var t=e[td];return t||(t=e7(e,e[td]={},tc,tu,th,tp),td in e&&tn in e&&(e.length=0)),t}function tm(e,t,r){for(;ey(t)&&4!=t.i;){var n=t.l,o=r[n];if(!o){var i=r[0];i&&(i=i[n])&&(o=r[n]=function(e){var t,r=(t=e.ia)?e4(t):(t=e.wa)?e6(e.da.P,t,e.ka):void 0,n=e.da,o=e.oa.U;return r?function(e,t){return o(e,t,n,r)}:function(e,t){return o(e,t,n)}}(i))}if(!o||!o(t,e,n)){o=t,n=e,i=o.j,function e(t){switch(t.i){case 0:if(0!=t.i)e(t);else e:{t=t.h;for(var r=t.h,n=r+10,o=t.i;r<n;)if(0==(128&o[r++])){eh(t,r);break e}throw Y()}break;case 1:eh(t=t.h,t.h+8);break;case 2:2!=t.i?e(t):(r=ep(t.h)>>>0,eh(t=t.h,t.h+r));break;case 5:eh(t=t.h,t.h+4);break;case 3:for(r=t.l;;){if(!ey(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=r)throw Error("Unmatched end-group tag");break}e(t)}break;default:throw $(t.i,t.j)}}(o);var a=o;if(!a.ca){if(o=a.h.h-i,a.h.h=i,a=a.h,0==o)o=el();else{if(i=ef(a,o),a.S&&a.m)o=a.i.subarray(i,i+o);else{a=a.i;var s=i;o=s===(o=i+o)?T():O?a.slice(s,o):new Uint8Array(a.subarray(s,o))}o=0==o.length?el():new es(o,D)}(i=n.R)?i.push(o):n.R=[o]}}}return e}function tC(e,t,r){for(var n=r.length,o=1==n%2,i=o?1:0;i<n;i+=2)(0,r[i+1])(t,e,r[i]);e9(e,t,o?r[0]:void 0)}function tg(e,t){return{U:e,W:t}}var tw=tg(function(e,t,r){if(5!==e.i)return!1;var n=(e=e.h).i,o=e.h,i=n[o],a=n[o+1],s=n[o+2];return n=n[o+3],eh(e,e.h+4),e=2*((a=(i<<0|a<<8|s<<16|n<<24)>>>0)>>31)+1,i=a>>>23&255,a&=8388607,eI(t,r,255==i?a?NaN:1/0*e:0==i?1401298464324817e-60*e*a:e*Math.pow(2,i-150)*(a+8388608)),!0},function(e,t,r){if(null!=(t=eB(t,r))){ew(e.h,8*r+5),e=e.h;var n=+t;0===n?0<1/n?I=A=0:(A=0,I=2147483648):isNaN(n)?(A=0,I=2147483647):34028234663852886e22<(n=(r=0>n?-2147483648:0)?-n:n)?(A=0,I=(2139095040|r)>>>0):11754943508222875e-54>n?(A=0,I=(r|(n=Math.round(n/1401298464324817e-60)))>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),16777216<=(n=Math.round(8388608*n))&&++t,A=0,I=(r|t+127<<23|8388607&n)>>>0),r=I,e.h.push(r>>>0&255),e.h.push(r>>>8&255),e.h.push(r>>>16&255),e.h.push(r>>>24&255)}}),tv=tg(function(e,t,r){if(0!==e.i)return!1;var n=e.h,o=0,i=e=0,a=n.i,s=n.h;do{var l=a[s++];o|=(127&l)<<i,i+=7}while(32>i&&128&l)for(32<i&&(e|=(127&l)>>4),i=3;32>i&&128&l;i+=7)e|=(127&(l=a[s++]))<<i;if(eh(n,s),128>l)n=o>>>0,(e=2147483648&(l=e>>>0))&&(l=~l>>>0,0==(n=~n+1>>>0)&&(l=l+1>>>0)),n=4294967296*l+(n>>>0);else throw Y();return eI(t,r,e?-n:n),!0},function(e,t,r){null!=(t=eO(t,r))&&("string"==typeof t&&U(t),null!=t&&(ew(e.h,8*r),"number"==typeof t?(e=e.h,Z(t),eg(e,I,A)):(r=U(t),eg(e.h,r.i,r.h))))}),ty=tg(function(e,t,r){return 0===e.i&&(eI(t,r,ep(e.h)),!0)},function(e,t,r){if(null!=(t=eO(t,r))&&null!=t){if(ew(e.h,8*r),e=e.h,0<=(r=t))ew(e,r);else{for(t=0;9>t;t++)e.h.push(127&r|128),r>>=7;e.h.push(1)}}}),tx=tg(function(e,t,r){if(2!==e.i)return!1;var n=ep(e.h)>>>0,o=ef(e=e.h,n);if(e=e.i,eo){var i,a=e;(i=et)||(i=et=new TextDecoder("utf-8",{fatal:!0})),e=o+n,a=0===o&&e===a.length?a:a.subarray(o,e);try{var s=i.decode(a)}catch(e){if(void 0===en){try{i.decode(new Uint8Array([128]))}catch(e){}try{i.decode(new Uint8Array([97])),en=!0}catch(e){en=!1}}throw en||(et=void 0),e}}else{n=(s=o)+n,o=[];for(var l,d,c=null;s<n;)128>(l=e[s++])?o.push(l):224>l?s>=n?G():(d=e[s++],194>l||128!=(192&d)?(s--,G()):o.push((31&l)<<6|63&d)):240>l?s>=n-1?G():128!=(192&(d=e[s++]))||224===l&&160>d||237===l&&160<=d||128!=(192&(a=e[s++]))?(s--,G()):o.push((15&l)<<12|(63&d)<<6|63&a):244>=l?s>=n-2?G():128!=(192&(d=e[s++]))||0!=(l<<28)+(d-144)>>30||128!=(192&(a=e[s++]))||128!=(192&(i=e[s++]))?(s--,G()):(l=((7&l)<<18|(63&d)<<12|(63&a)<<6|63&i)-65536,o.push((l>>10&1023)+55296,(1023&l)+56320)):G(),8192<=o.length&&(c=K(c,o),o.length=0);s=K(c,o)}return eI(t,r,s),!0},function(e,t,r){if(null!=(t=eO(t,r))){if(ei)t=(er||(er=new TextEncoder)).encode(t);else{for(var n=0,o=new Uint8Array(3*t.length),i=0;i<t.length;i++){var a=t.charCodeAt(i);if(128>a)o[n++]=a;else{if(2048>a)o[n++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<t.length){var s=t.charCodeAt(++i);if(56320<=s&&57343>=s){a=1024*(a-55296)+s-56320+65536,o[n++]=a>>18|240,o[n++]=a>>12&63|128,o[n++]=a>>6&63|128,o[n++]=63&a|128;continue}i--}a=65533}o[n++]=a>>12|224,o[n++]=a>>6&63|128}o[n++]=63&a|128}}t=n===o.length?o:o.subarray(0,n)}ew(e.h,8*r+2),ew(e.h,t.length),ek(e,e.h.end()),ek(e,t)}}),tb=tg(function(e,t,r,n,o){if(2!==e.i)return!1;t=e$(t,r,n),r=e.h.j,n=ep(e.h)>>>0;var i=e.h.h+n,a=i-r;if(0>=a&&(e.h.j=i,o(t,e,void 0,void 0,void 0),a=i-e.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+n+" bytes, instead read "+(n-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.h.h=i,e.h.j=r,!0},function(e,t,r,n,o){if(null!=(t=eq(t,n,r)))for(n=0;n<t.length;n++){var i=e;ew(i.h,8*r+2);var a=i.h.end();ek(i,a),a.push(i.i),i=a,o(t[n],e),a=e;var s=i.pop();for(s=a.i+a.h.length()-s;127<s;)i.push(127&s|128),s>>>=7,a.i++;i.push(s),a.i++}});function tk(e){return function(t,r){e:{if(ex.length){var n=ex.pop();n.setOptions(r),eu(n.h,t,r),t=n}else t=new ev(t,r);try{var o=tf(e),i=tm(new o.P,t,o);break e}finally{(o=t.h).i=null,o.m=!1,o.l=0,o.j=0,o.h=0,o.S=!1,t.l=-1,t.i=-1,100>ex.length&&ex.push(t)}i=void 0}return i}}function tM(e){return function(){var t=new eb;tC(this,t,tl(e)),ek(t,t.h.end());for(var r=new Uint8Array(t.i),n=t.j,o=n.length,i=0,a=0;a<o;a++){var s=n[a];r.set(s,i),i+=s.length}return t.j=[r],r}}function tj(e){e0.call(this,e)}p(tj,e0);var tL=[tj,1,ty,2,tw,3,tx,4,tx];function tN(e){e0.call(this,e,-1,tS)}tj.prototype.l=tM(tL),p(tN,e0),tN.prototype.addClassification=function(e,t){return e$(this,1,tj,e,t),this};var tS=[1],tP=tk([tN,1,tb,tL]);function t_(e){e0.call(this,e)}p(t_,e0);var tR=[t_,1,tw,2,tw,3,tw,4,tw,5,tw];function tH(e){e0.call(this,e,-1,tz)}t_.prototype.l=tM(tR),p(tH,e0);var tz=[1],tE=tk([tH,1,tb,tR]);function tV(e){e0.call(this,e)}p(tV,e0);var tW=[tV,1,tw,2,tw,3,tw,4,tw,5,tw,6,tv],tT=tk(tW);function tD(e,t,r){if(r=e.createShader(0===r?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(r));return r}function tO(e){return{x:eX(e,1),y:eX(e,2),z:eX(e,3),visibility:null!=eB(e,4)?eX(e,4):void 0}}function tI(e,t){this.i=e,this.h=t,this.m=0}function tA(e,t,r){return(function(e,t){var r=e.h;if(void 0===e.s){var n=tD(r,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),o=tD(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,o),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(i));n=e.s=i,r.useProgram(n),o=r.getUniformLocation(n,"sampler0"),e.l={O:r.getAttribLocation(n,"aVertex"),N:r.getAttribLocation(n,"aTex"),ya:o},e.v=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.v),r.enableVertexAttribArray(e.l.O),r.vertexAttribPointer(e.l.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),e.u=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.u),r.enableVertexAttribArray(e.l.N),r.vertexAttribPointer(e.l.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(o,0)}n=e.l,r.useProgram(e.s),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.i.bindTexture2d(t.glName),r.enableVertexAttribArray(n.O),r.bindBuffer(r.ARRAY_BUFFER,e.v),r.vertexAttribPointer(n.O,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,e.u),r.vertexAttribPointer(n.N,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.O),r.disableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,null),e.i.bindTexture2d(0)}(e,t),"function"==typeof e.h.canvas.transferToImageBitmap)?Promise.resolve(e.h.canvas.transferToImageBitmap()):r?Promise.resolve(e.h.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.h.canvas):(void 0===e.j&&(e.j=document.createElement("canvas")),new Promise(function(t){e.j.height=e.h.canvas.height,e.j.width=e.h.canvas.width,e.j.getContext("2d",{}).drawImage(e.h.canvas,0,0,e.h.canvas.width,e.h.canvas.height),t(e.j)}))}function tZ(e){this.h=e}tV.prototype.l=tM(tW);var tB=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function tF(e,t){return t+e}function tq(e){if(this.h=e,this.listeners={},this.l={},this.L={},this.s={},this.v={},this.M=this.u=this.ga=!0,this.I=Promise.resolve(),this.fa="",this.D={},this.locateFile=e&&e.locateFile||tF,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!=typeof location)t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.ha=t,e.options){t=i(Object.keys(e.options));for(var r=t.next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.l[r]="function"==typeof n?n():n)}}}function tU(e,t){var r;return b(function(n){return t in e.L?n.return(e.L[t]):(r=fetch(e.locateFile(t,"")).then(function(e){return e.arrayBuffer()}),e.L[t]=r,n.return(r))})}function t$(e){return(void 0===e&&(e=0),1===e)?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function tY(e){var t=this;e=e||{},this.h=new tq({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:t$(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){var r,n,o;return b(function(i){return 1==i.h?(n="third_party/mediapipe/modules/selfie_segmentation/"+(r=t$(e)),g(i,tU(t.h,r),2)):(o=i.i,t.h.overrideFile(n,o),i.return(!0))})}}}})}(l=tq.prototype).close=function(){return this.j&&this.j.delete(),Promise.resolve()},l.reset=function(){var e=this;return b(function(t){e.j&&(e.j.reset(),e.s={},e.v={}),t.h=0})},l.setOptions=function(e,t){var r=this;if(t=t||this.h.options){for(var n=[],o=[],a={},s=i(Object.keys(e)),l=s.next();!l.done;a={X:a.X,Y:a.Y},l=s.next())if(!((l=l.value)in this.l&&this.l[l]===e[l])){this.l[l]=e[l];var d=t[l];void 0!==d&&(d.onChange&&(a.X=d.onChange,a.Y=e[l],n.push(function(e){return function(){return b(function(t){if(1==t.h)return g(t,e.X(e.Y),2);!0===t.i&&(r.u=!0),t.h=0})}}(a))),d.graphOptionXref&&(l=Object.assign({},{calculatorName:"",calculatorIndex:0},d.graphOptionXref,{valueNumber:1===d.type?e[l]:0,valueBoolean:0===d.type&&e[l],valueString:2===d.type?e[l]:""}),o.push(l)))}(0!==n.length||0!==o.length)&&(this.u=!0,this.H=(void 0===this.H?[]:this.H).concat(o),this.F=(void 0===this.F?[]:this.F).concat(n))}},l.initialize=function(){var e=this;return b(function(t){var r,n,o,s,l,d,c,u,h,p,f,m,C,w,v,y,x,k,M,j,L,N,S,P;return 1==t.h?g(t,b(function(t){switch(t.h){case 1:if(!e.ga)return t.return();return r=void 0===e.h.files?[]:"function"==typeof e.h.files?e.h.files(e.l):e.h.files,g(t,b(function(e){switch(e.h){case 1:return e.s=2,g(e,WebAssembly.instantiate(tB),4);case 4:e.h=3,e.s=0;break;case 2:return e.s=0,e.l=null,e.return(!1);case 3:return e.return(!0)}}),2);case 2:if(n=t.i,"object"==typeof window){var i,m;return i={locateFile:e.locateFile},window.createMediapipeSolutionsWasm=i,m={locateFile:e.locateFile},window.createMediapipeSolutionsPackedAssets=m,d=r.filter(function(e){return void 0!==e.data}),c=r.filter(function(e){return void 0===e.data}),u=Promise.all(d.map(function(t){var r=tU(e,t.url);if(void 0!==t.path){var n=t.path;r=r.then(function(t){return e.overrideFile(n,t),Promise.resolve(t)})}return r})),h=Promise.all(c.map(function(t){var r,o;return void 0===t.simd||t.simd&&n||!t.simd&&!n?(r=e.locateFile(t.url,e.ha),(o=document.createElement("script")).setAttribute("src",r),o.setAttribute("crossorigin","anonymous"),new Promise(function(e){o.addEventListener("load",function(){e()},!1),o.addEventListener("error",function(){e()},!1),document.body.appendChild(o)})):Promise.resolve()})).then(function(){var t,r,n;return b(function(o){if(1==o.h)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,n=e,g(o,t(r),2);n.i=o.i,o.h=0})}),p=b(function(t){return e.h.graph&&e.h.graph.url?t=g(t,tU(e,e.h.graph.url),0):(t.h=0,t=void 0),t}),g(t,Promise.all([h,u,p]),7)}if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter(function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n}).map(function(t){return e.locateFile(t.url,e.ha)}),importScripts.apply(null,a(o)),s=e,g(t,createMediapipeSolutionsWasm(Module),6);case 6:s.i=t.i,e.m=new OffscreenCanvas(1,1),e.i.canvas=e.m,l=e.i.GL.createContext(e.m,{antialias:!1,alpha:!1,va:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.i.GL.makeContextCurrent(l),t.h=4;break;case 7:if(e.m=document.createElement("canvas"),!(f=e.m.getContext("webgl2",{}))&&!(f=e.m.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();e.K=f,e.i.canvas=e.m,e.i.createContext(e.m,!0,!0,{});case 4:e.j=new e.i.SolutionWasm,e.ga=!1,t.h=0}}),2):3!=t.h?g(t,b(function(t){if(1==t.h){if(e.h.graph&&e.h.graph.url&&e.fa===e.h.graph.url)return t.return();if(e.u=!0,!e.h.graph||!e.h.graph.url){t.h=2;return}return e.fa=e.h.graph.url,g(t,tU(e,e.h.graph.url),3)}for(2!=t.h&&(m=t.i,e.j.loadGraph(m)),w=(C=i(Object.keys(e.D))).next();!w.done;w=C.next())v=w.value,e.j.overrideFile(v,e.D[v]);if(e.D={},e.h.listeners)for(x=(y=i(e.h.listeners)).next();!x.done;x=y.next())(function(e,t){for(var r=t.name||"$",n=[].concat(a(t.wants)),o=new e.i.StringList,s=i(t.wants),l=s.next();!l.done;l=s.next())o.push_back(l.value);s=e.i.PacketListener.implement({onResults:function(o){for(var a,s,l,d,c,u,h,p,f,m,C,w,v,y,x={},k=0;k<t.wants.length;++k)x[n[k]]=o.get(k);var M=e.listeners[r];M&&(e.I=(a=t.outs,b(function(t){switch(t.h){case 1:if(!a)return t.return(x);for(s={},l=0,c=(d=i(Object.keys(a))).next();!c.done;c=d.next())"string"!=typeof(u=a[c.value])&&"texture"===u.type&&void 0!==x[u.stream]&&++l;1<l&&(e.M=!1),c=(h=i(Object.keys(a))).next();case 2:if(c.done){t.h=4;break}if("string"==typeof(f=a[p=c.value]))return v=s,y=p,g(t,function(e,t,r){var n;return b(function(o){return"number"==typeof r||r instanceof Uint8Array||r instanceof e.i.Uint8BlobList?o.return(r):r instanceof e.i.Texture2dDataOut?((n=e.v[t])||(n=new tI(e.i,e.K),e.v[t]=n),o.return(tA(n,r,e.M))):o.return(void 0)})}(e,p,x[f]),14);if(m=x[f.stream],"detection_list"===f.type){if(m){for(var r=m.getRectList(),n=m.getLandmarksList(),o=m.getClassificationsList(),k=[],M=0;M<r.size();++M){var j=tT(r.get(M)),L=eX(j,1),N=eX(j,2),S=eX(j,3),P=eX(j,4),_=eX(j,5,0),R=void 0;R=void 0===R?0:R,j={la:{sa:L,ta:N,height:S,width:P,rotation:_,pa:eY(eO(j,6),R)},ea:eq(tE(n.get(M)),t_,1).map(tO),ba:eq(tP(o.get(M)),tj,1).map(function(e){var t=eO(e,1);return{index:null==t?0:t,qa:eX(e,2),label:null!=eO(e,3)?eY(eO(e,3),""):void 0,displayName:null!=eO(e,4)?eY(eO(e,4),""):void 0}})},k.push(j)}r=k}else r=[];s[p]=r,t.h=7;break}if("proto_list"===f.type){if(m){for(n=0,r=Array(m.size());n<m.size();n++)r[n]=m.get(n);m.delete()}else r=[];s[p]=r,t.h=7;break}if(void 0===m){t.h=3;break}if("float_list"===f.type||"proto"===f.type){s[p]=m,t.h=7;break}if("texture"!==f.type)throw Error("Unknown output config type: '"+f.type+"'");return(C=e.v[p])||(C=new tI(e.i,e.K),e.v[p]=C),g(t,tA(C,m,e.M),13);case 13:w=t.i,s[p]=w;case 7:f.transform&&s[p]&&(s[p]=f.transform(s[p])),t.h=3;break;case 14:v[y]=t.i;case 3:c=h.next(),t.h=2;break;case 4:return t.return(s)}})).then(function(r){r=M(r);for(var o=0;o<t.wants.length;++o){var i=x[n[o]];"object"==typeof i&&i.hasOwnProperty&&i.hasOwnProperty("delete")&&i.delete()}r&&(e.I=r)}))}}),e.j.attachMultiListener(o,s),o.delete()})(e,x.value);k=e.l,e.l={},e.setOptions(k),t.h=0}),3):g(t,b(function(t){switch(t.h){case 1:if(!e.u)return t.return();if(!e.F){t.h=2;break}j=(M=i(e.F)).next();case 3:if(j.done){t.h=5;break}return g(t,(0,j.value)(),4);case 4:j=M.next(),t.h=3;break;case 5:e.F=void 0;case 2:if(e.H){for(L=new e.i.GraphOptionChangeRequestList,S=(N=i(e.H)).next();!S.done;S=N.next())P=S.value,L.push_back(P);e.j.changeOptions(L),L.delete(),e.H=void 0}e.u=!1,t.h=0}}),0)})},l.overrideFile=function(e,t){this.j?this.j.overrideFile(e,t):this.D[e]=t},l.clearOverriddenFiles=function(){this.D={},this.j&&this.j.clearOverriddenFiles()},l.send=function(e,t){var r,n,o,a,s,l,d,c,u,h=this;return b(function(p){switch(p.h){case 1:if(!h.h.inputs)return p.return();return r=1e3*(null==t?performance.now():t),g(p,h.I,2);case 2:return g(p,h.initialize(),3);case 3:for(n=new h.i.PacketDataList,a=(o=i(Object.keys(e))).next();!a.done;a=o.next())if(s=a.value,l=h.h.inputs[s]){e:{var f=e[s];switch(l.type){case"video":var m=h.s[l.stream];if(m||(m=new tI(h.i,h.K),h.s[l.stream]=m),0===m.m&&(m.m=m.i.createTexture()),"undefined"!=typeof HTMLVideoElement&&f instanceof HTMLVideoElement)var C=f.videoWidth,w=f.videoHeight;else"undefined"!=typeof HTMLImageElement&&f instanceof HTMLImageElement?(C=f.naturalWidth,w=f.naturalHeight):(C=f.width,w=f.height);w={glName:m.m,width:C,height:w},(C=m.h).canvas.width=w.width,C.canvas.height=w.height,C.activeTexture(C.TEXTURE0),m.i.bindTexture2d(m.m),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,f),m.i.bindTexture2d(0),m=w;break e;case"detections":for((m=h.s[l.stream])||(m=new tZ(h.i),h.s[l.stream]=m),m.data||(m.data=new m.h.DetectionListData),m.data.reset(f.length),w=0;w<f.length;++w){C=f[w];var v=m.data,y=v.setBoundingBox,x=w,b=C.la,k=new tV;if(eU(k,1,b.sa),eU(k,2,b.ta),eU(k,3,b.height),eU(k,4,b.width),eU(k,5,b.rotation),eI(k,6,b.pa),b=k.l(),y.call(v,x,b),C.ea)for(v=0;v<C.ea.length;++v){k=C.ea[v],x=(y=m.data).addNormalizedLandmark,b=w,k=Object.assign({},k,{visibility:k.visibility?k.visibility:0});var M=new t_;eU(M,1,k.x),eU(M,2,k.y),eU(M,3,k.z),k.visibility&&eU(M,4,k.visibility),k=M.l(),x.call(y,b,k)}if(C.ba)for(v=0;v<C.ba.length;++v)x=(y=m.data).addClassification,b=w,k=C.ba[v],eU(M=new tj,2,k.qa),k.index&&eI(M,1,k.index),k.label&&eI(M,3,k.label),k.displayName&&eI(M,4,k.displayName),k=M.l(),x.call(y,b,k)}m=m.data;break e;default:m={}}}switch(d=m,c=l.stream,l.type){case"video":n.pushTexture2d(Object.assign({},d,{stream:c,timestamp:r}));break;case"detections":(u=d).stream=c,u.timestamp=r,n.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.j.send(n),g(p,h.I,4);case 4:n.delete(),p.h=0}})},l.onResults=function(e,t){this.listeners[t||"$"]=e},j("Solution",tq),j("OptionType",{BOOL:0,NUMBER:1,ua:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(l=tY.prototype).close=function(){return this.h.close(),Promise.resolve()},l.onResults=function(e){this.h.onResults(e)},l.initialize=function(){var e=this;return b(function(t){return g(t,e.h.initialize(),0)})},l.reset=function(){this.h.reset()},l.send=function(e){var t=this;return b(function(r){return g(r,t.h.send(e),0)})},l.setOptions=function(e){this.h.setOptions(e)},j("SelfieSegmentation",tY),j("VERSION","0.1.1675465747")}).call(ZQ);let ZJ=new ZH("MediaPipe"),Z1="https://stream-assets.snapcall.io",Z2=!1,Z0=new ZQ.SelfieSegmentation({locateFile:(e,t)=>{if(ZJ.debug("selfieSegmentation",e,t),Z1)return`${Z1}/mediapipe/${e}`;let r=window.location.href.split("/").slice(0,-1).join("/");return`${r}/mediapipe/${e}`}});var Z3={},Z9={};Z9=function(e,t,r){if(t===self.location.origin)return e;var n=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))};var Z5=hO("4qOVI");let Z6=Z5.getBundleURL("adfgW")+"timer.ed477f04.js";Z3=Z9(Z6,Z5.getOrigin(Z6),!1);class Z4{constructor(e,t){this.fillColor="#000000",this.type="blur",this.live=!1,this.fps=24,this.blurLevel=10,this.timerWorker=new Worker(Z3,{name:"VirtualBackgroundTimerWorker"}),this.stream=e,this.image=document.createElement("video"),this.image.style.display="none",this.image.setAttribute("autoplay",""),this.image.setAttribute("playsinline",""),this.image.setAttribute("muted",""),this.canvas=document.createElement("canvas"),this.canvas.style.display="none",t&&this.setOptions(t)}setOptions(e){this.setType(e.type),this.setFillColor(e.fillColor||this.fillColor),this.setVideoBackground(e.background),this.setBlurLevel(e.blurLevel||this.blurLevel)}setType(e){this.type=e}setBlurLevel(e){this.blurLevel=e}setVideoBackground(e){this.background=e}setFillColor(e){this.fillColor=e}drawWithBlur(e,t){e.save(),e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.filter=`blur(${this.blurLevel}px)`,e.globalCompositeOperation="destination-over",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}drawWithBackground(e,t){e.clearRect(0,0,this.canvas.width,this.canvas.height),e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="source-out",e.fillStyle=this.fillColor,this.background?e.drawImage(this.background,0,0,this.canvas.width,this.canvas.height):e.fillRect(0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}onFrame(e){this.canvas.width=e.image.width,this.canvas.height=e.image.height;let t=this.canvas.getContext("2d");if(t)switch(this.type){case"blur":default:this.drawWithBlur(t,e);break;case"background":this.drawWithBackground(t,e)}}runWithFrameCallback(){this.live&&this.image.requestVideoFrameCallback(()=>{Z0.send({image:this.image}),this.runWithFrameCallback()})}async createStream(){try{Z0.setOptions({selfieMode:!1,modelSelection:0}),ZJ.log("selfie segmentation initialized"),Z2||(await Z0.initialize(),Z2=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Z0.onResults(e=>{this.onFrame(e)}),this.timerWorker.onmessage=()=>{Z0.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){ZJ.error("createStream:play",e)}}}catch(e){console.error("createStream",e)}return this.canvas.captureStream()}clean(){return new Promise(e=>{this.live=!1,clearInterval(this.runInterval),this.image.srcObject=null,this.stream.getTracks().forEach(e=>{e.stop(),this.stream.removeTrack(e)}),this.timerWorker.terminate(),e()})}}let Z8=window.AudioContext||window.webkitAudioContext;class Z7{constructor(){this.audioSources={},this.tracks={},this.audioContext=new Z8,this.audioDestination=this.audioContext.createMediaStreamDestination()}getSetting(e){return this.tracks[e]?.getSettings()}removeTrack(e){let t=this.tracks[e];t&&(this.audioSources[e]?.disconnect(),delete this.tracks[e],delete this.audioSources[e],t.stop())}addTrack(e,t){if("audio"===t.kind){this.removeTrack(e);let r=new MediaStream([t]),n=this.audioContext.createMediaStreamSource(r);this.audioSources[e]=n,this.tracks[e]=t,this.audioDestination&&n.connect(this.audioDestination)}}getFinalTrack(){return this.audioDestination.stream.getTracks()[0]}removeAll(){Object.keys(this.tracks).forEach(e=>{this.removeTrack(e)})}}uj=function(e){var t,r,n=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}(e),o=n[0],i=n[1],a=new Br((o+i)*3/4-i),s=0,l=i>0?o-4:o;for(r=0;r<l;r+=4)t=Bt[e.charCodeAt(r)]<<18|Bt[e.charCodeAt(r+1)]<<12|Bt[e.charCodeAt(r+2)]<<6|Bt[e.charCodeAt(r+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===i&&(t=Bt[e.charCodeAt(r)]<<2|Bt[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===i&&(t=Bt[e.charCodeAt(r)]<<10|Bt[e.charCodeAt(r+1)]<<4|Bt[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a},uL=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,a=r-n;i<a;i+=16383)o.push(function(e,t,r){for(var n,o=[],i=t;i<r;i+=3)o.push(Be[(n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+Be[n>>12&63]+Be[n>>6&63]+Be[63&n]);return o.join("")}(e,i,i+16383>a?a:i+16383));return 1===n?o.push(Be[(t=e[r-1])>>2]+Be[t<<4&63]+"=="):2===n&&o.push(Be[(t=(e[r-2]<<8)+e[r-1])>>10]+Be[t>>4&63]+Be[t<<2&63]+"="),o.join("")};for(var Be=[],Bt=[],Br="undefined"!=typeof Uint8Array?Uint8Array:Array,Bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bo=0,Bi=Bn.length;Bo<Bi;++Bo)Be[Bo]=Bn[Bo],Bt[Bn.charCodeAt(Bo)]=Bo;Bt["-".charCodeAt(0)]=62,Bt["_".charCodeAt(0)]=63,uN=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,d=l>>1,c=-7,u=r?o-1:0,h=r?-1:1,p=e[t+u];for(u+=h,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+u],u+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+u],u+=h,c-=8);if(0===i)i=1-d;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=d}return(p?-1:1)*a*Math.pow(2,i-n)},uS=function(e,t,r,n,o,i){var a,s,l,d=8*i-o-1,c=(1<<d)-1,u=c>>1,h=23===o?5960464477539062e-23:0,p=n?0:i-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=h/l:t+=h*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,o),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=f,s/=256,o-=8);for(a=a<<o|s,d+=o;d>0;e[r+p]=255&a,p+=f,a/=256,d-=8);e[r+p-f]|=128*m};let Ba="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function Bs(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,Bl.prototype),t}function Bl(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return Bu(e)}return Bd(e,t,r)}function Bd(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!Bl.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|Bm(e,t),n=Bs(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(BD(e,Uint8Array)){let t=new Uint8Array(e);return Bp(t.buffer,t.byteOffset,t.byteLength)}return Bh(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(BD(e,ArrayBuffer)||e&&BD(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(BD(e,SharedArrayBuffer)||e&&BD(e.buffer,SharedArrayBuffer)))return Bp(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Bl.from(n,t,r);let o=function(e){var t;if(Bl.isBuffer(e)){let t=0|Bf(e.length),r=Bs(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?Bs(0):Bh(e):"Buffer"===e.type&&Array.isArray(e.data)?Bh(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Bl.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Bc(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function Bu(e){return Bc(e),Bs(e<0?0:0|Bf(e))}function Bh(e){let t=e.length<0?0:0|Bf(e.length),r=Bs(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function Bp(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Bl.prototype),n}function Bf(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function Bm(e,t){if(Bl.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||BD(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return BV(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return BW(e).length;default:if(o)return n?-1:BV(e).length;t=(""+t).toLowerCase(),o=!0}}function BC(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=BO[e[n]];return o}(this,t,r);case"utf8":case"utf-8":return By(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}(this,t,r);case"base64":var o,i;return o=t,i=r,0===o&&i===this.length?uL(this):uL(this.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Bg(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function Bw(e,t,r,n,o){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(i=r=+r)!=i&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return -1;r=e.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof t&&(t=Bl.from(t,n)),Bl.isBuffer(t))return 0===t.length?-1:Bv(e,t,r,n,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Bv(e,[t],r,n,o);throw TypeError("val must be string, number or Buffer")}function Bv(e,t,r,n,o){let i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(d(e,i)===d(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*a}else -1!==n&&(i-=i-n),n=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(d(e,i+n)!==d(t,n)){r=!1;break}if(r)return i}return -1}function By(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o<r;){let t=e[o],i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:(192&(r=e[o+1]))==128&&(l=(31&t)<<6|63&r)>127&&(i=l);break;case 3:r=e[o+1],n=e[o+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(i=l);break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],(192&r)==128&&(192&n)==128&&(192&s)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&l<1114112&&(i=l)}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function Bx(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function Bb(e,t,r,n,o,i){if(!Bl.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function Bk(e,t,r,n,o){BR(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function BM(e,t,r,n,o){BR(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function Bj(e,t,r,n,o,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function BL(e,t,r,n,o){return t=+t,r>>>=0,o||Bj(e,t,r,4,34028234663852886e22,-34028234663852886e22),uS(e,t,r,n,23,4),r+4}function BN(e,t,r,n,o){return t=+t,r>>>=0,o||Bj(e,t,r,8,17976931348623157e292,-17976931348623157e292),uS(e,t,r,n,52,8),r+8}Bl.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Bl.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Bl.prototype,"parent",{enumerable:!0,get:function(){if(Bl.isBuffer(this))return this.buffer}}),Object.defineProperty(Bl.prototype,"offset",{enumerable:!0,get:function(){if(Bl.isBuffer(this))return this.byteOffset}}),Bl.poolSize=8192,Bl.from=function(e,t,r){return Bd(e,t,r)},Object.setPrototypeOf(Bl.prototype,Uint8Array.prototype),Object.setPrototypeOf(Bl,Uint8Array),Bl.alloc=function(e,t,r){return(Bc(e),e<=0)?Bs(e):void 0!==t?"string"==typeof r?Bs(e).fill(t,r):Bs(e).fill(t):Bs(e)},Bl.allocUnsafe=function(e){return Bu(e)},Bl.allocUnsafeSlow=function(e){return Bu(e)},Bl.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Bl.prototype},Bl.compare=function(e,t){if(BD(e,Uint8Array)&&(e=Bl.from(e,e.offset,e.byteLength)),BD(t,Uint8Array)&&(t=Bl.from(t,t.offset,t.byteLength)),!Bl.isBuffer(e)||!Bl.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},Bl.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Bl.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Bl.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=Bl.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){let t=e[r];if(BD(t,Uint8Array))o+t.length>n.length?(Bl.isBuffer(t)||(t=Bl.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else if(Bl.isBuffer(t))t.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=t.length}return n},Bl.byteLength=Bm,Bl.prototype._isBuffer=!0,Bl.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)Bg(this,t,t+1);return this},Bl.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)Bg(this,t,t+3),Bg(this,t+1,t+2);return this},Bl.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)Bg(this,t,t+7),Bg(this,t+1,t+6),Bg(this,t+2,t+5),Bg(this,t+3,t+4);return this},Bl.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?By(this,0,e):BC.apply(this,arguments)},Bl.prototype.toLocaleString=Bl.prototype.toString,Bl.prototype.equals=function(e){if(!Bl.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===Bl.compare(this,e)},Bl.prototype.inspect=function(){let e="";return e=this.toString("hex",0,50).replace(/(.{2})/g,"$1 ").trim(),this.length>50&&(e+=" ... "),"<Buffer "+e+">"},Ba&&(Bl.prototype[Ba]=Bl.prototype.inspect),Bl.prototype.compare=function(e,t,r,n,o){if(BD(e,Uint8Array)&&(e=Bl.from(e,e.offset,e.byteLength)),!Bl.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,a=r-t,s=Math.min(i,a),l=this.slice(n,o),d=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==d[e]){i=l[e],a=d[e];break}return i<a?-1:a<i?1:0},Bl.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},Bl.prototype.indexOf=function(e,t,r){return Bw(this,e,t,r,!0)},Bl.prototype.lastIndexOf=function(e,t,r){return Bw(this,e,t,r,!1)},Bl.prototype.write=function(e,t,r,n){var o,i,a,s,l,d,c,u;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let o;r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let a=t.length;for(n>a/2&&(n=a/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(n!=n)break;e[r+o]=n}return o}(this,e,t,r);case"utf8":case"utf-8":return o=t,i=r,BT(BV(e,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return a=t,s=r,BT(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return l=t,d=r,BT(BW(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,u=r,BT(function(e,t){let r,n;let o=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(e,this.length-c),this,c,u);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},Bl.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Bl.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,Bl.prototype),n},Bl.prototype.readUintLE=Bl.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},Bl.prototype.readUintBE=Bl.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},Bl.prototype.readUint8=Bl.prototype.readUInt8=function(e,t){return e>>>=0,t||Bx(e,1,this.length),this[e]},Bl.prototype.readUint16LE=Bl.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Bx(e,2,this.length),this[e]|this[e+1]<<8},Bl.prototype.readUint16BE=Bl.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Bx(e,2,this.length),this[e]<<8|this[e+1]},Bl.prototype.readUint32LE=Bl.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Bl.prototype.readUint32BE=Bl.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Bl.prototype.readBigUInt64LE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Bz(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],o=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),Bl.prototype.readBigUInt64BE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Bz(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],o=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),Bl.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},Bl.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},Bl.prototype.readInt8=function(e,t){return(e>>>=0,t||Bx(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},Bl.prototype.readInt16LE=function(e,t){e>>>=0,t||Bx(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Bl.prototype.readInt16BE=function(e,t){e>>>=0,t||Bx(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Bl.prototype.readInt32LE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Bl.prototype.readInt32BE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Bl.prototype.readBigInt64LE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Bz(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),Bl.prototype.readBigInt64BE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Bz(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+r)}),Bl.prototype.readFloatLE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),uN(this,e,!0,23,4)},Bl.prototype.readFloatBE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),uN(this,e,!1,23,4)},Bl.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Bx(e,8,this.length),uN(this,e,!0,52,8)},Bl.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Bx(e,8,this.length),uN(this,e,!1,52,8)},Bl.prototype.writeUintLE=Bl.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;Bb(this,e,t,r,n,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},Bl.prototype.writeUintBE=Bl.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;Bb(this,e,t,r,n,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},Bl.prototype.writeUint8=Bl.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,1,255,0),this[t]=255&e,t+1},Bl.prototype.writeUint16LE=Bl.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Bl.prototype.writeUint16BE=Bl.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Bl.prototype.writeUint32LE=Bl.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Bl.prototype.writeUint32BE=Bl.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Bl.prototype.writeBigUInt64LE=BI(function(e,t=0){return Bk(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),Bl.prototype.writeBigUInt64BE=BI(function(e,t=0){return BM(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),Bl.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);Bb(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},Bl.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);Bb(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},Bl.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Bl.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Bl.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Bl.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Bl.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Bl.prototype.writeBigInt64LE=BI(function(e,t=0){return Bk(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Bl.prototype.writeBigInt64BE=BI(function(e,t=0){return BM(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Bl.prototype.writeFloatLE=function(e,t,r){return BL(this,e,t,!0,r)},Bl.prototype.writeFloatBE=function(e,t,r){return BL(this,e,t,!1,r)},Bl.prototype.writeDoubleLE=function(e,t,r){return BN(this,e,t,!0,r)},Bl.prototype.writeDoubleBE=function(e,t,r){return BN(this,e,t,!1,r)},Bl.prototype.copy=function(e,t,r,n){if(!Bl.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},Bl.prototype.fill=function(e,t,r,n){let o;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!Bl.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{let i=Bl.isBuffer(e)?e:Bl.from(e,n),a=i.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};let BS={};function BP(e,t,r){BS[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B_(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function BR(e,t,r,n,o,i){if(e>r||e<t){let n;let o="bigint"==typeof t?"n":"";throw n=i>3?0===t||t===BigInt(0)?`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:`>= ${t}${o} and <= ${r}${o}`,new BS.ERR_OUT_OF_RANGE("value",n,e)}BH(o,"offset"),(void 0===n[o]||void 0===n[o+i])&&Bz(o,n.length-(i+1))}function BH(e,t){if("number"!=typeof e)throw new BS.ERR_INVALID_ARG_TYPE(t,"number",e)}function Bz(e,t,r){if(Math.floor(e)!==e)throw BH(e,r),new BS.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new BS.ERR_BUFFER_OUT_OF_BOUNDS;throw new BS.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}BP("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),BP("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),BP("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=B_(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=B_(o)),o+="n"),n+=` It must be ${t}. Received ${o}`},RangeError);let BE=/[^+/0-9A-Za-z-_]/g;function BV(e,t){let r;t=t||1/0;let n=e.length,o=null,i=[];for(let a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function BW(e){return uj(function(e){if((e=(e=e.split("=")[0]).trim().replace(BE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function BT(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length)&&!(o>=e.length);++o)t[o+r]=e[o];return o}function BD(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let BO=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function BI(e){return"undefined"==typeof BigInt?BA:e}function BA(){throw Error("BigInt not supported")}let BZ=async(e,{token:t,base64Image:r,session_id:n,user_id:o,peer_id:i,stepToken:a})=>{let s=`${AF()}.jpeg`,l=Bl.from(String(r).replace(/^data:image\/\w+;base64,/,""),"base64"),{url:d,headers:c}=await fetch(`${e}/streams/${t}/snapshot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:s,contentLength:l.length})}).then(e=>e.json());await fetch(d,{method:"PUT",headers:{...c,"Content-Type":"image/*","Content-Length":l.length},body:l});let u=await fetch(`${e}/public/streams/${t}/snapshot-event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepToken:a,filename:s,peer_id:i,session_id:n,user_id:o})}).then(e=>e.json());return{url:u.url,assetId:u.id}},BB=(e,t=300)=>{let r,n,o;return function(){let i=this,a=arguments;r?(clearTimeout(n),n=setTimeout(()=>{Date.now()-o>=t&&(e.apply(i,a),o=Date.now())},Math.max(t-(Date.now()-o),0))):(e.apply(i,a),o=Date.now(),r=!0)}},BF=new ZH("StreamerClient"),Bq={WEBRTC_FAILED:"WRTC1",WEBRTC_RECOVER_ERROR:"WRTC2",CREATE_TRANSPORT_FAILED:"TRANS1",CONSUME_ERROR:"CONS1",SOCKET_LOST:"SOCK1",USER_LIMIT:"USERLIMIT"},BU={qvga:{width:{ideal:320},height:{ideal:240},qualityIndex:3},vga:{width:{ideal:640},height:{ideal:480},qualityIndex:2},hd:{width:{ideal:1280},height:{ideal:720},qualityIndex:1}};class B$ extends CustomEvent{constructor(e,t){super(e,t)}}let BY=EventTarget,BX={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10},BG=new class extends BY{constructor(){super(),this.mediasoupTransport={},this.mediaPipeOption=BX,this.useVideoBackground=!1,this.waitingRoomAccess=!1,this.pendingDeviceRequest={},this.joinOptions={},this.devicesList=[],this.plan=void 0,this.permissions=[],this.onAudioLevel=BB(e=>{let t=new B$("audioLevel",{cancelable:!0,bubbles:!0,detail:{audioLevel:e}});this.dispatchEvent(t)},1e3),navigator.mediaDevices.addEventListener("devicechange",()=>this.onDeviceChange()),this.config={streamApiURL:String("https://apistream.snapcall.io"),apiUrl:String("https://api.snapcall.io/v2"),streamerServer:String("wss://g.snapcall.io/stream"),streamerApi:String("https://g.snapcall.io/stream"),iceServers:[{urls:"turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp,turn:t.snapcall.io:80?transport=tcp,turn:t2.snapcall.io:80?transport=tcp,turn:t.snapcall.io:80?transport=udp,turn:t2.snapcall.io:80?transport=udp".split(",")||[],username:"test",credential:"test"}]},this.peers=new Map,this.consumers=new Map,this.webcams=new Map,this.webcam={device:null,resolution:"hd"},this.webcamTrack=null,this.webcamZoom={available:!1,min:0,max:0},this.muted=!1,this.roomId="",this.companyId=0,this.peerId="",this.clientId=this.setClientId(),this.webcamProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){let e=[];return this.peers.forEach((t,r)=>{let n={microphone:{enabled:!1,muted:!1},camera:{enabled:!1},screenshare:{enabled:!1}};t.producersData.forEach(e=>{"microphone"===e.deviceType?n.microphone.enabled=!0:"screen"===e.deviceType?n.screenshare.enabled=!0:"webcam"===e.deviceType&&(n.camera.enabled=!0)}),e.push({peerId:r,profile:t.profile,deviceState:n})}),{roomId:this.roomId,waitingRoomAccess:this.waitingRoomAccess,companyId:this.companyId,company:this.company,plan:this.plan,permissions:this.permissions,peerId:this.peerId,profile:this.profile,joinOptions:this.joinOptions,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){let e=new B$("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e)}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){let e=new B$("localStopSpeak",{detail:{}});this.dispatchEvent(e)}}onCriticalError(e){let t=new B$("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){let t=this.config.streamerApi,{token:r}=await fetch(`${t}/stream`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({bid:e})}).then(e=>e.json());return r}setClientId(){let e="stream-ui-client-id";try{let t=localStorage.getItem(e);if(t)return t;let r=AF();return localStorage.setItem(e,r),r}catch(e){return console.warn(e),AF()}}async init(e=this.roomId,t=this.joinOptions){let r,n;let o={flow:void 0,flowV0:void 0};if(this.roomId=e,this.peerId=AF(),this.joinOptions=t,!this.roomId)throw Error("Missing room ID");try{let n=new URLSearchParams;t.flowToken&&(n.append("flowToken",t.flowToken),t.languageCode&&n.append("languageCode",t.languageCode));let{streamer_instance:i,plan:{permissions:a,name:s},flow:l,flow_v0:d,recordings:c,company_id:u,company:h,defaultPublicPage:p}=await fetch(`${this.config.apiUrl}/streams/${e}/info?${n}`,{method:"get",headers:{"Content-Type":"application/json"}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid room ID")});d&&(o.flowV0=d),l&&l.steps.length>0&&(t.recorder=!0,this.joinOptions.recorder=!0,o.flow=l),this.companyId=u,this.company=h,this.permissions=a,this.defaultPublicPage=p,(c?.headless===!0||c?.video===!0)&&a.push("record_video_on_demand"),this.plan=s;let f=new URLSearchParams({peerId:this.peerId,clientId:this.clientId,roomId:e});t.authKey&&f.append("authKey",t.authKey);let m=this.joinOptions.recorder?"/recorder":"";r=`${this.config.streamerServer}/${i}/v2/${m}?${f}`}catch(t){console.error("init",t);let e=new B$("invalidRoom",{detail:{}});this.dispatchEvent(e)}if(!r)throw Error("Invalid socket URL");this.protooTransport=new ux(r,{retry:{retries:0}}),this.protoo=new uy(this.protooTransport);let i=!1,a=e=>{};return this.protoo.on("open",async()=>{if(this.joinOptions.apiKey&&await this.setAgentIdentity({apiKey:this.joinOptions.apiKey,email:this.joinOptions.email}).catch(e=>{BF.error("onOpen","failed auth",e)}),i=!0,a(),this.joinOptions.recorder){await this.joinRecorder();return}}),this.protoo.on("failed",()=>{n=Error("failure"),a(n),BF.error("protoo.on","failed"),this.onCriticalError(Bq.SOCKET_LOST)}),this.protoo.on("disconnected",()=>{BF.error("protoo.on","disconnected"),this.onCriticalError(Bq.SOCKET_LOST)}),this.protoo.on("close",()=>BF.log("protoo.on","close :(")),this.protoo.on("notification",async e=>{if(BF.log("notification",e),"error"===e.method)e.data?.reason==="reached user limit"&&this.onCriticalError(Bq.USER_LIMIT);else if("newPeer"===e.method){let{id:t,profile:r,muted:n}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,muted:n,producersData:[]});let o=new B$("newPeer",{detail:{peerId:t,displayName:r.name,profile:r,muted:n}});this.dispatchEvent(o)}else if("newProducer"===e.method){let{peerId:t,producerId:r,deviceType:n,paused:o}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:o})}else if("peerClosed"===e.method){let{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach(e=>{this.onConsumerClose({consumerId:e.id})});let n=new B$("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){let{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("recordStopped"===e.method)this.dispatchEvent(new B$("recordStopped",{detail:e.data}));else if("displayName"===e.method){let{peerId:t,displayName:r}=e.data,n=new B$("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){let{peerId:t,profile:r}=e.data,n=new CustomEvent("profileUpdate",{detail:{peerId:t,profile:r}});this.dispatchEvent(n)}else if("requestDevice"===e.method){this.pendingDeviceRequest[e.data.requestId]=e.data;let t=new B$("requestDevice",{detail:e.data});this.dispatchEvent(t)}else if("startSpeak"===e.method);else if("stopSpeak"===e.method);else if("producerPaused"===e.method||"producerResumed"===e.method){let{peerId:t,producerId:r,deviceType:n}=e.data;if(e.data?.deviceType==="microphone"){let n=this.peers.get(t)?.producersData.find(e=>r===e.producerId);n&&(n.paused="producerPaused"===e.method)}let o=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){o=e.mediaSoupConsumer.id;break}let i=new B$("producerPaused"===e.method?"mediaPause":"mediaResume",{detail:{mediaId:o,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(i)}else if("mute"===e.method){let{peerId:t,device:r}=e.data,n=new B$("mediaPause",{detail:{peerId:t,deviceType:r,paused:!0}});this.dispatchEvent(n)}else if("unmute"===e.method){let{peerId:t,device:r}=e.data,n=new B$("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestAccessResult"===e.method){e.data.success&&this.onEnterRoom();let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("cancelAccessRequest"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("accessRequest"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("requestDeviceResult"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("videoRecordingStarted"===e.method||"videoRecordingStopped"===e.method||"videoRecordingRequested"===e.method){let t=new B$(e.method,{detail:{}});this.dispatchEvent(t)}else if("customMessage"===e.method){let{messageId:t,chunk:r,chunkIndex:n,totalChunks:o}=e.data.event,i=this.customMessages.get(t);i?i.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:o});let a=this.customMessages.get(t);if(a&&a.totalChunks===a.chunks.length){let r=JSON.parse(a.chunks.sort((e,t)=>e.index-t.index).reduce((e,t)=>e+t.data,"")),n=new B$("customMessage",{detail:{...e.data,event:r}});this.dispatchEvent(n),this.customMessages.delete(t)}}}),await new Promise((e,t)=>{a=r=>{if(a=()=>{},r)return t(r);e()},i&&a(n)}),o}closeWebrtcTransport(e){let t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup||!this.protoo)throw Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{let n=this.streamerMediasoup.createTransport(this.protoo,t);r={disconnectTimeout:void 0,kind:e,createPromise:n},this.mediasoupTransport[`${e}-${t}`]=r,r.transport=await n,r.transport&&this.listenWebRTCTransportStates(r)}catch(e){throw this.onCriticalError(Bq.CREATE_TRANSPORT_FAILED),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",t=>{if(e.transport&&!e.transport.closed){if(BF.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout(()=>{BF.log("listenWebRTCTransportStats",`trying to restart transport for ${e.kind}`),e.transport&&this.restartIce(e.transport)},5e3);else if("connected"===t)clearTimeout(e.disconnectTimeout);else if("failed"===t){let t=Error(`webRTC transport state failed for ${e.kind}`);BF.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Bq.WEBRTC_FAILED)}}})}async setAgentIdentity({apiKey:e,email:t}){if(e){this.joinOptions.apiKey=e,this.joinOptions.email=t;try{e&&t?this.agentIdentity=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(this.agentIdentity=await this.fetchUserInfo({apiKey:e})),await this.protoo?.request("authenticate",{apiKey:e,email:t}),this.agentIdentity&&this.dispatchEvent(new B$("agentIdentity",{detail:{success:!0,email:this.agentIdentity.email,name:this.agentIdentity.name,avatarUrl:this.agentIdentity.settings?.avatar_url}}))}catch(e){BF.warn("setAgentIdentity",e),this.dispatchEvent(new B$("agentIdentity",{detail:{success:!1}}))}}}async acceptAccessRequest(e){if(!this.protoo)throw Error("not connected");await this.protoo.request("acceptAccessRequest",{id:e})}async setStep(e){if(!this.protoo)throw Error("not connected");this.stepToken=e,await this.protoo.request("step",{token:e})}async denyAccessRequest(e){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("denyAccessRequest",{id:e})}async requestRoomAccess(){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("requestAccess"),this.waitingRoomAccess=!0}async joinRoom(){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("join"),await this.onEnterRoom(),this.agentIdentity&&this.dispatchEvent(new B$("agentIdentity",{detail:{success:!0,email:this.agentIdentity.email,name:this.agentIdentity.name,avatarUrl:this.agentIdentity.settings?.avatar_url}}))}async getRoomPeers(){if(!this.protoo)throw Error("stream client not initiated");return await this.protoo.request("getRoomPeers")}async onEnterRoom(){if(!this.protoo)throw Error("stream client not initiated");this.streamerMediasoup=await ZK.create(this.protoo,this.config);let{peers:e,videoRecordStarted:t,videoRecording:r,waitingRequests:n}=await this.protoo.request("getRoomPeers");this.peers=new Map(e.map(e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}]));let o=await this.getCallId();this.dispatchEvent(new B$("enterRoom",{detail:{waitingRequests:n,videoRecording:r,videoRecordStarted:t,peerId:this.peerId,peers:e.map(e=>({...e,peerId:e.id||e.peerId})),callId:o,plan:this.plan,permissions:this.permissions}})),BF.log("joinRoom","peers",e),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),e.forEach(e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})})}async joinRecorder(){if(!this.protoo)throw Error("stream client not initiated");this.streamerMediasoup=await ZK.create(this.protoo,this.config);let e=await this.getCallId();this.joinOptions.apiKey&&this.setAgentIdentity({apiKey:this.joinOptions.apiKey}),this.dispatchEvent(new B$("enterRoom",{detail:{videoRecording:{started:!1,requested:!1},videoRecordStarted:!1,peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions,waitingRequests:[]}}))}async switchMicrophone(e){try{BF.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.audioMedia?.removeTrack("mic"),this.micProducer?.track?.stop(),BF.log("switchMicrophone","stopping previous track"));let t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new ZV(t,this),this.audioLevel.analyse(),this.audioMedia=this.audioMedia||new Z7;let r=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",r),await this.micProducer?.replaceTrack({track:r}),BF.log("switchMicrophone","switched Microphone")}catch(e){BF.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){let e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;let t=new B$("microphoneMute",{detail:{}});this.dispatchEvent(t),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){BF.log("onDeviceChange","detecting device change");let e=new B$("devicesListChange",{detail:{}});if(this.dispatchEvent(e),this.protoo&&!this.protoo.closed&&this.micProducer){let e=await navigator.mediaDevices.enumerateDevices(),t=e.filter(e=>"audioinput"===e.kind);if(0===t.length){BF.warn("onDeviceChange","no audio input device"),await this.closeMicrophoneProducer();return}let r=t.find(e=>"default"===e.deviceId);if(r){let t=e.filter(e=>!this.devicesList.find(t=>t.deviceId===e.deviceId&&t.label===e.label));BF.log("onDeviceChange",t),this.devicesList=e;let n=!!t.find(e=>"audioinput"===e.kind);if(0!==t.length&&!1===n){BF.warn("onDeviceChange","no audio input change");return}if(BF.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){let e=new B$("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),BF.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone({deviceId:e}={}){if(!this.micProducer||this.micProducer?.closed){let t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();let r=await this.getTransport("audio","send");this.audioLevel=new ZV(t,this),this.audioLevel.analyse(),this.audioMedia=this.audioMedia||new Z7;let n=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",n);let o=await r.produce({track:this.audioMedia.getFinalTrack(),codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:"microphone"}});o.on("transportclose",()=>{BF.log("enableMicrophone","micproducer transportclose")}),n.addEventListener("ended",()=>{BF.log("enableMicrophone","track ended!")}),o.on("trackended",async()=>{BF.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()}),this.micProducer=o,this.muted=!1;let i=new B$("microphoneEnabled",{detail:{}});this.dispatchEvent(i)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0,this.protoo?.notify("mute",{device:"microphone"});let e=new B$("microphoneMute",{detail:{}});this.dispatchEvent(e)}}unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),this.muted=!1,this.protoo?.notify("unmute",{device:"microphone"});let e=new B$("microphoneUnmute",{detail:{}});this.dispatchEvent(e)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){for(let e in BF.log("release"),this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=void 0),this.audioMedia?.removeAll(),this.audioMedia=void 0,this.webcamTrack?.stop(),this.webcamTrack=null,this.protooTransport?.close(),this.protoo?.close(),this.micProducer?.close(),this.screenshareVideoProducer?.close(),this.webcamProducer?.close(),this.consumers.forEach(e=>{e.mediaSoupConsumer.close()}),this.consumers.clear(),this.audioLevel?.release()}endCall(){this.release();let e=new B$("leaveRoom",{detail:{}});this.dispatchEvent(e);let t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){if(!this.protoo)throw Error("stream client not initiated");this.protoo.request("terminateRoom")}async updateWebcams(){for(let e of(this.webcams=new Map,await navigator.mediaDevices.enumerateDevices()))"videoinput"===e.kind&&this.webcams.set(e.deviceId,e);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);let e=new B$("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(e)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach(n=>{let o=this.pendingDeviceRequest[n];e===o.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo?.notify("requestDeviceResult",{result:!!t,failure:r,...o}))})}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,!!r,n?.name),n)throw n;return r}}async restartIce(e){if(BF.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed&&this.protoo)try{let t=await this.protoo.request("restartIce",{transportId:e.id});BF.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(e){this.onCriticalError(Bq.WEBRTC_RECOVER_ERROR),BF.log("restartIce","restartIceFailed",e)}}scaleVideoMediasConstraintsParameter(e){let t=BU.hd;2===e?t=BU.vga:e>2&&(t=BU.qvga),(!this.webcam.resolution||BU[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(BF.log("scaleVideoMediasConstraintsParameter",`scaling video by ${e}`,t),this.webcamProducer?.track?.applyConstraints(t))}scaleVideoEncodingsParameter(){if(!this.useVideoBackground)try{let e=0;this.consumers.forEach(t=>{"video"===t.mediaSoupConsumer.kind&&e++}),this.screenshareVideoProducer&&!this.screenshareVideoProducer.closed&&e++;let t={scaleResolutionDownBy:1};if(e>=3&&(t={scaleResolutionDownBy:2}),e>=9&&(t={scaleResolutionDownBy:4}),!ZI.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(BF.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch(e=>{BF.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)}))}catch(e){BF.error("scaleVideoEncodingsParameter","scaleVideo error",e)}}setVideoBackground(e){this.mediaPipe?.setOptions(e),this.mediaPipeOption=e}async initVideoBackground(){if(!this.permissions.find(e=>"virtual_background"===e))throw Error("feature not allowed");!0!==this.useVideoBackground&&(this.useVideoBackground=!0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async stopVideoBackground(){!1!==this.useVideoBackground&&(this.useVideoBackground=!1,await this.mediaPipe?.clean(),this.mediaPipe=void 0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async switchWebcam({device:e,resolution:t,rotate:r,frameRate:n,facingMode:o}){if(!this.webcam.device)throw Error("no webcam devices");let i={};if(r){if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",i.facingMode=this.webcam.facingMode;else{let e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknown",r=e.indexOf(t);r<e.length-1?r++:r=0;let n=this.webcams.get(e[r]);if(!n)throw Error("no webcam device");this.webcam.device=n,i.deviceId={ideal:this.webcam.device?.deviceId}}}else o?(this.webcam.facingMode=o,i.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,i.deviceId={ideal:this.webcam.device.deviceId});this.webcam.resolution=t||this.webcam.resolution||"hd",this.webcam.framerate=n||this.webcam.framerate;let a=BU[t||this.webcam.resolution];this.useVideoBackground&&(a={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await this.webcamProducer?.replaceTrack?.({track:null}).catch(e=>{BF.error("switchCamera","clean track failed",e)});let s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{...i,...a}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Z4(s,this.mediaPipeOption));let l=await this.mediaPipe?.createStream()||s;if(!await this.getTransport("video","send"))throw Error("video transport not found, can not switch");let d=l.getVideoTracks()[0];this.webcamTrack=d,await this.webcamProducer?.replaceTrack?.({track:d});let c=await d.getCapabilities?.()||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:!!c?.zoom,min:c?.zoom?.min||0,max:c?.zoom?.max||0};let u=new B$("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(u)}async enableVideo(e){await this.updateWebcams();let t={};if(e?.facingMode?(t.facingMode=e.facingMode,this.webcam.facingMode=e.facingMode):(e?.device&&(this.webcam.device=e.device),t.deviceId={ideal:this.webcam.device?.deviceId}),!this.webcam.device)throw Error("no webcam devices");this.webcam.resolution=e?.resolution||this.webcam.resolution||"hd",this.webcam.framerate=e?.frameRate||this.webcam.framerate;let r=BU[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(r={width:{ideal:560},height:{ideal:400},qualityIndex:2});let n=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:e?.frameRate,...t,...r}}));if(e?.facingMode)try{let e=n.getVideoTracks()[0].getCapabilities();if(!e?.facingMode||0===e.facingMode.length)throw Error("no facing mod")}catch{this.webcam.device=this.webcams.values().next().value,this.webcam.facingMode=void 0}this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Z4(n,this.mediaPipeOption));let o=await this.mediaPipe?.createStream()||n;await this.updateWebcams();let i=await this.getTransport("video","send"),a=o.getVideoTracks()[0];this.webcamTrack=a;let s=await a.getCapabilities?.()||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:!!s?.zoom,min:s?.zoom?.min||0,max:s?.zoom?.max||0},s.focusMode&&a.applyConstraints({advanced:[{focusMode:"continuous"}]}),this.webcamProducer=await i.produce({track:a,encodings:void 0,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",()=>{this.webcamProducer=null}),this.webcamProducer.on("trackended",()=>{this.disableVideo().catch(()=>{})});let l=new B$("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(l)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw Error("Webcam zoom is not available");if(!this.webcamTrack)throw Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw Error("Webcam zoom is not available");if(!this.webcamTrack)throw Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:this.webcamZoom.min}]})}async disableVideo(){if(!this.webcamProducer)return;this.webcamProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;let e=new B$("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(e={audioTransportOption:"classic"}){if(!this.permissions.find(e=>"screen_sharing"===e))throw Error("feature not allowed");if("mix"===e.audioTransportOption&&!this.micProducer)throw Error("microphone not activated and audio mix transport requested");let t=e.mediaStream;if(t||(t=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:"none"!==e.audioTransportOption,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}))),!t)return;let r="screen",n=await this.getTransport("audio","send"),o=t.getAudioTracks()[0];if(o){if("classic"===e.audioTransportOption)this.screenshareAudioProducer=await this.streamerMediasoup?.produceAudio(n,o,{deviceType:r,share:!0}),this.screenshareVideoProducer?.on("transportclose",()=>{this.screenshareVideoProducer=void 0});else if("mix"===e.audioTransportOption){this.audioMedia=this.audioMedia||new Z7,this.audioMedia.addTrack("screen",o);let e=this.audioMedia.getFinalTrack();e&&this.micProducer&&this.micProducer.replaceTrack({track:e})}}let i=t.getVideoTracks()[0],a=await this.getTransport("video","send");this.screenshareVideoProducer=await this.streamerMediasoup?.produceVideo(a,i,{deviceType:r,share:!0}),this.screenshareVideoProducer?.on("transportclose",()=>{this.screenshareVideoProducer=void 0}),this.screenshareVideoProducer?.on("trackended",()=>{this.disableScreenshare().catch(()=>{})});let s=new B$("screenshareEnabled",{detail:{}});this.dispatchEvent(s)}async disableScreenshare(){this.screenshareVideoProducer&&(this.screenshareVideoProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareVideoProducer.id}),this.screenshareVideoProducer=void 0),this.audioMedia?.removeTrack("screen"),this.screenshareAudioProducer&&(this.screenshareAudioProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareAudioProducer.id}),this.screenshareAudioProducer=void 0);let e=new B$("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){let t=this.consumers.get(e);if(t){let r=t.mediaSoupConsumer.producerId;this.peers.forEach(e=>{let t=e.producersData.findIndex(e=>e.producerId===r);-1!==t&&e.producersData.splice(t,1)}),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();let n=new B$("mediaStop",{detail:{mediaId:e,peerId:String(t.mediaSoupConsumer.appData.peerId),deviceType:t.deviceType,paused:!1}});"microphone"===t.deviceType&&this.deleteAudioRenderer(e),this.dispatchEvent(n)}}requestVideo({mediaId:e,element:t}){BF.info("requestVideo");let r=this.consumers.get(e);if(r){let e=new MediaStream;e.onremovetrack=()=>BF.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>BF.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else BF.error("requestVideo",`Video consumer ${r} not found`)}async saveCapture(e){return BZ(this.config.apiUrl,{token:this.roomId,base64Image:e,peer_id:this.peerId,user_id:this.agentIdentity?.id,stepToken:this.stepToken})}async deleteCapture(e){return await this.protoo?.request("deleteCapture",{assetId:e})}async captureVideo(e){if(this.permissions.find(e=>"instant_picture"===e)){let t;if(e)t=await ZD(e);else if(this.webcamProducer&&this.webcamProducer.track)t=await ZO(this.webcamProducer.track);else throw Error("no video to capture");return t}throw Error("feature not allowed")}requestLocalVideo(e){if(BF.info("requestLocalVideo"),this.webcamProducer){let t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;let r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareVideoProducer){let t=new MediaStream;t.addTrack(this.screenshareVideoProducer.track),e.srcObject=t}else BF.log("requestLocalScreenshare","screenshare producer not available yet")}consumePeer({peerId:e,producersData:t}){t.forEach(t=>{this.consumeProducer({peerId:e,producerId:t.producerId,deviceType:t.deviceType,paused:t.paused})})}async consumeProducer({peerId:e,producerId:t,deviceType:r,paused:n}){try{let o="microphone"===r?"audio":"video",i=await this.getTransport(o,"recv"),a=await this.protoo?.request("consume",{peerId:e,producerId:t,transportId:i.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});let{producerId:l,id:d,kind:c,rtpParameters:u,appData:h}=a;BF.log("consumeProducer","Data: ",a);let p=await i.consume({id:d,producerId:l,kind:c,rtpParameters:u,appData:{...h,peerId:e}});BF.log("transport",i),BF.log("consumer",p),this.consumers.set(p.id,{mediaSoupConsumer:p,deviceType:r}),this.scaleVideoEncodingsParameter();let f=new B$("mediaStart",{detail:{peerId:e,mediaId:p.id,deviceType:r,paused:!!s&&s.muted}});if(this.dispatchEvent(f),"audio"===p.kind){let e=this.createAudioRenderer(p.id),t=new MediaStream;t.addTrack(p.track),e.setSource(t),e.play()}"video"===p.kind&&await this.protoo?.request("resumeConsumer",{consumerId:p.id})}catch(e){this.onCriticalError(Bq.CONSUME_ERROR),BF.error("consumeProducer","newConsumer request failed",e)}}async setDisplayName(e){await this.setProfile({name:e});let t=new B$("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){let t=await this.protoo?.request("setProfile",e);this.joinOptions.profile=e,this.profile={...t};let r=new B$("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){if(!this.permissions.find(e=>"request_input"===e))throw Error("feature not allowed");return this.protoo?.request("requestPeerDevice",{remotePeerId:e,deviceType:t})}denyDeviceRequest(e){this.resolvePendingDeviceRequest(e,!1,"user denied permission")}async getCallId(){try{let{callId:e}=await this.protoo?.request("getCallId");return e}catch(e){throw BF.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){let e=!!this.micProducer&&!this.micProducer.closed,t=!!this.webcamProducer&&!this.webcamProducer.closed,r=!!this.screenshareVideoProducer&&!this.screenshareVideoProducer.closed;return{microphone:{enabled:e,muted:this.muted},camera:{enabled:t},screenshare:{enabled:r}}}getCustomMessageEventChunks(e){let t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e+=9e4)r.push(t.substring(e,e+9e4));return r}async sendCustomMessageToAll(e){let t=AF(),r=this.getCustomMessageEventChunks(e),n=r.map((e,n)=>this.protoo?.notify("customMessageToAllPeers",{messageId:t,chunkIndex:n,chunk:e,totalChunks:r.length}));await Promise.all(n)}async sendCustomMessage(e,t){let r=AF(),n=this.getCustomMessageEventChunks(t),o=n.map((t,o)=>this.protoo?.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:o,chunk:t,totalChunks:n.length}}));await Promise.all(o)}async listAudioDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind||"audiooutput"===e.kind)}async listVideoDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter(e=>"videoinput"===e.kind)}isListDevicesSupported(){return!!navigator.mediaDevices?.enumerateDevices}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.audioMedia?.getSetting("mic")||this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){let e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){let e=t.getSink();if(e)return e}return"default"}async setWebcamResolution(e){if(this.webcam.device)await this.switchWebcam({resolution:e});else{this.webcam.resolution=e;let t=new B$("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){let t=new ZT({consumerId:e});return this.audioRenderers[e]=t,t}deleteAudioRenderer(e){this.audioRenderers[e]?.destroy(),delete this.audioRenderers[e]}async playAudioRenderer(e){await this.audioRenderers[e]?.play()}async setAudioSink(e){let t=Object.keys(this.audioRenderers).map(t=>this.audioRenderers[t].setSink(e).catch(e=>BF.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)));await Promise.allSettled(t)}dispatchEvent(e){let t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){let r=this.config.apiUrl;return await fetch(`${r}/agents/${t}`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid agent info")})}async fetchUserInfo({apiKey:e}){let t=this.config.apiUrl;return await fetch(`${t}/users/me`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid user info")})}setConfig(e){this.config={...this.config,...e}}getPermissions(){return this.permissions}async startRecord(){await this.protoo?.request("startRecord")}async stopRecord(){await this.protoo?.request("stopRecord")}async getPublicPage(e){return(await fetch(`${this.config.apiUrl}/public/public-pages/${e}`,{method:"get",headers:{"Content-Type":"application/json"}})).json()}};var p4=hO("85Hg2");let BK=(0,p4.createContext)({});var p4=hO("85Hg2");(w=uP||(uP={}))[w.SET_STREAMS=0]="SET_STREAMS",w[w.ADD_STREAM=1]="ADD_STREAM",w[w.REMOVE_STREAM=2]="REMOVE_STREAM",w[w.DEVICE_UPDATE=3]="DEVICE_UPDATE",w[w.MUTE=4]="MUTE",w[w.UNMUTE=5]="UNMUTE",w[w.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",w[w.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",w[w.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",w[w.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";let BQ={streams:[],highlightedTile:null},BJ=(e,t)=>{switch(t.type){case 0:return{...e,streams:t.payload};case 1:if(e.streams.find(e=>e.id===t.payload.id))return e;return{...e,streams:[...e.streams,t.payload]};case 2:return{...e,streams:[...e.streams.filter(e=>e.id!==t.payload.id)]};case 3:{let{streamId:r,mediaId:n,device:o,available:i,paused:a}=t.payload;return{...e,streams:e.streams.map(e=>{if(e.id===r){let t=e.muted;return"microphone"===o&&(t=a),{...e,[o]:i?n:null,muted:t}}return e})}}case 4:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,muted:!0}:e)};case 5:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,muted:!1}:e)};case 6:return{...e,highlightedTile:t.payload};case 7:return{...e,highlightedTile:null};case 8:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e)};case 9:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e)};default:return e}},B1=(0,p4.createContext)(void 0),B2=({children:e})=>{let[t,r]=(0,p4.useReducer)(BJ,BQ);return(0,hA.jsx)(B1.Provider,{value:{state:t,dispatch:r},children:e})},B0=()=>{let e=(0,p4.useContext)(B1);if(void 0===e)throw Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}},B3=(e,t,r)=>{let n=document.createRange(),o=document.createElement("textarea");if(o.value=e,document.body.appendChild(o),navigator.userAgent.match(/ipad|ipod|iphone/i)){o.readOnly=!1,o.contentEditable="true",n.selectNodeContents(o);let e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),o.setSelectionRange(0,999999)}else o.focus(),o.select();try{document.execCommand("copy")?t():r(Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(o)};var B9=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise((t,r)=>{B3(e,t,r)});let B5=mb.path`
306
+ `):Zl.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();if(t){let e;e={},"ok"===t.status&&(e={status:"exited"}),ZC(t,e)}this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:r}=this.getStackTop(),{release:n,environment:o=Zp}=r&&r.getOptions()||{},{userAgent:i}=A7.navigator||{},a=function(e){let t=Zc(),r={sid:Zh(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Zu({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:"number"==typeof r.did||"string"==typeof r.did?`${r.did}`:void 0,duration:r.duration,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})};return e&&ZC(r,e),r}({release:n,environment:o,user:t.getUser(),...i&&{userAgent:i},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&ZC(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_callExtensionMethod(e,...t){let r=Zk().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Zf&&Zl.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Zk(){return A7.__SENTRY__=A7.__SENTRY__||{extensions:{},hub:void 0},A7}function ZM(e){let t=Zk(),r=ZL(t);return ZN(t,e),r}function Zj(){let e=Zk();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Zk()){return(!(e&&e.__SENTRY__&&e.__SENTRY__.hub)||ZL(e).isOlderThan(Zx))&&ZN(e,new Zb),ZL(e)}(e)}function ZL(e){return Ze("hub",()=>new Zb,e)}function ZN(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function ZS(e,t){Zj().addBreadcrumb(e,t)}new WeakMap;let ZP={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"},Z_=Number(2),ZR=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class ZH{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){let o=`[ ${ZR.format(new Date)} ][ ${ZP[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Z_)?t(o,...n):ZS({type:"debug",level:ZP[e],category:"console",data:{head:o,arguments:n}})}debug(e,...t){this.print(5,console.debug,e,...t)}error(e,...t){this.print(1,console.error,e,...t)}info(e,...t){this.print(3,console.info,e,...t)}log(e,...t){this.print(4,console.log,e,...t)}warn(e,...t){this.print(2,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Z_=e}setLogLevel(e){this.customLogLevel=e}}let Zz=new ZH("AudioLevels.ts"),ZE=window.AudioContext||window.webkitAudioContext;class ZV{constructor(e,t){this.speakStartEventTime=0,this.speakStopEventTime=0,this.speaking=!1,this.audioMedianInterval=-1,this.audioLevelInterval=-1,this.audioLevelAverageInterval=-1,this.audioLevelAverage={count:0,average:0},this.audioLevels=[],this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new ZE,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=512,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){let{length:e}=this.audioLevels;return this.audioLevels.reduce((e,t)=>e+t,0)/e}getCurrentAudioLevel(){let{length:e}=this.audioLevels;return e?this.audioLevels[e-1]:0}audioMuteDetection(){0===this.getAudioLevelMedian()&&this.audioLevels.length>0&&this.listener?.onMuteDetection?.(this.id)}detectSpeakingChange(e){e<20&&!this.speakStopEventTime&&(this.speakStartEventTime=0,this.speakStopEventTime=Date.now()),e>=20&&!this.speakStartEventTime&&(this.speakStartEventTime=Date.now(),this.speakStopEventTime=0);let t=this.speakStartEventTime||this.speakStopEventTime,r=!!this.speakStartEventTime;(Date.now()-t>500&&r||Date.now()-t>300&&!r)&&this.speaking!==r&&(this.speaking=r,r?this.listener?.onStartSpeak():this.listener?.onStopSpeak())}computeRMS(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r]*e[r];return Math.sqrt(t/=e.length)}getInstantAudioLevel(){let e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);let t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){let e=this.getInstantAudioLevel();this.audioLevels=this.audioLevels.splice(-59),this.detectSpeakingChange(e),this.audioLevels.push(e),this.listener?.onAudioLevel?.(e,this.id)}analyse(){this.audioLevelInterval=window.setInterval(()=>this.loopCalcul(),1e3/60),this.audioMedianInterval=window.setInterval(()=>this.audioMuteDetection(),2e3)}startAverageAnalysis(){this.audioLevelAverage={count:0,average:0},clearInterval(this.audioLevelAverageInterval),this.audioLevelAverageInterval=window.setInterval(()=>{let{count:e,average:t}=this.audioLevelAverage,r=(t*e+this.getAudioLevelMedian())/(e+1);this.audioLevelAverage={count:e+1,average:r}},1e3)}stopAverageAnalysis(){return clearInterval(this.audioLevelAverageInterval),this.audioLevelAverage.average}getFrequencyData(){let e=new Uint8Array(this.analyser.frequencyBinCount);return this.analyser.getByteFrequencyData(e),e}clearListeners(){clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.audioLevels=[]}release(){this.listener=void 0,this.clearListeners(),this.stream.getTracks().forEach(e=>{this.stream.removeTrack(e)});try{this.audioStreamSource.disconnect(this.analyser)}catch(e){Zz.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch(e=>{Zz.error("release","audioContext failed to close",e)})}static isAPIAvailable(){return!!ZE}}let ZW=new ZH("AudioRenderer.ts");var ZT=class{constructor({consumerId:e}){this.consumerId=e,this.audio=new Audio,this.audio.id=e,this.audio.autoplay=!0,document.body.appendChild(this.audio)}destroy(){this.audio.pause(),this.audio.srcObject=null,document.body.removeChild(this.audio)}setSource(e){this.audio.srcObject=e}async setSink(e){await this.audio.setSinkId?.(e)}getSink(){return this.audio.sinkId}async play(){await this.audio.play().catch(e=>{ZW.warn("play","failed to play"),setTimeout(()=>{this.play()},1e3)})}};let ZD=async e=>{let{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",o="portrait"===n?t:r,i="landscape"===n?r:t,a=document.createElement("canvas"),s=a.getContext("2d"),l=window.devicePixelRatio||1;return a.width=o*l,a.height=i*l,s?.scale(l,l),s?.drawImage(e,"landscape"===n?(t-o)/2:0,"portrait"===n?(r-i)/2:0,o,i,0,0,a.width/l,a.height/l),a.toDataURL("image/jpeg")},ZO=async e=>{let t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");let n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();let o=document.createElement("canvas"),i=o.getContext("2d");return o.height=t.height,o.width=t.width,i?.drawImage(t,0,0),o.toDataURL("image/jpeg")};var ZI=hO("eEB2e"),ZA={},ZZ=ZA&&ZA.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ZB=ZA&&ZA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ZF=ZA&&ZA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ZZ(t,e,r);return ZB(t,e),t},Zq=ZA&&ZA.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ZA,"__esModule",{value:!0}),ZA.debug=ZA.parseScalabilityMode=ZA.detectDevice=ZA.Device=ZA.version=ZA.types=void 0;let ZU=Zq(hO("hZG0u"));ZA.debug=ZU.default;var Z$=hO("1ZHQC");Object.defineProperty(ZA,"Device",{enumerable:!0,get:function(){return Z$.Device}}),Object.defineProperty(ZA,"detectDevice",{enumerable:!0,get:function(){return Z$.detectDevice}});let ZY=ZF(hO("cQumC"));ZA.types=ZY,ZA.version="3.7.8";var ZX=hO("fT1lN");Object.defineProperty(ZA,"parseScalabilityMode",{enumerable:!0,get:function(){return ZX.parse}});let ZG=new ZH("StreamerMediasoup");class ZK{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){let r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter(e=>"urn:3gpp:video-orientation"!==e.uri);let n=function(){try{return new ZA.Device}catch(e){return ZG.error("failed to detects device from mediasoup, fallback on auto detection",e),function(){try{var e;let t=navigator.userAgent,r=hY.getParser(t);e="DeviceDetectionForced",Zj().setTag(e,!0),ZS({type:"debug",category:"browser",data:r.getResult()});let n=r.getOS();if("Safari"===r.getBrowserName()&&"iOS"===n.name&&Number(n.version)>=14.3)return new ZA.Device({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){ZG.error("deviceAutoDetection",e)}return new ZA.Device({handlerName:"Chrome74"})}()}}();return n.load({routerRtpCapabilities:r}),new ZK(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){let t=await e.request("createWebRtcTransport");return{id:t.id,iceParameters:t.iceParameters,iceCandidates:t.iceCandidates,dtlsParameters:{...t.dtlsParameters,role:"auto"},sctpParameters:t.sctpParameters,iceServers:this.config.iceServers,proprietaryConstraints:{optional:[{googDscp:!0}]},additionalSettings:{encodedInsertableStreams:!1}}}async createSendTransport(e){let t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",({dtlsParameters:r},n,o)=>{ZG.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(o)}),t.on("produce",async({kind:r,rtpParameters:n,appData:o},i,a)=>{try{let{id:a}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:o});i({id:a}),ZG.log("producerTransport: ",t)}catch(e){a(e)}}),t}async createRecvTransport(e){let t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",({dtlsParameters:r},n,o)=>{ZG.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(o)}),t}async createTransport(e,t){return"send"===t?await this.createSendTransport(e):await this.createRecvTransport(e)}async produceAudio(e,t,r){return await e.produce({track:t,codecOptions:{opusStereo:!0,opusDtx:!0},appData:r})}async produceVideo(e,t,r){return await e.produce({track:t,encodings:void 0,codecOptions:{videoGoogleStartBitrate:1e3},appData:r})}}var ZQ={};(function(){function e(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var t,r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e},n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof hV&&hV];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var o=n;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in o))break e;o=o[a]}(t=t(i=o[e=e[e.length-1]]))!=i&&null!=t&&r(o,e,{configurable:!0,writable:!0,value:t})}}function i(t){var r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}function a(e){if(!(e instanceof Array)){e=i(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}o("Symbol",function(e){function t(e,t){this.h=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.h};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(r){if(this instanceof e)throw TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+o++,r)}}),o("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<o.length;i++){var a=n[o[i]];"function"==typeof a&&"function"!=typeof a.prototype[t]&&r(a.prototype,t,{configurable:!0,writable:!0,value:function(){var t;return(t={next:t=e(this)})[Symbol.iterator]=function(){return this},t}})}return t});var s="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};o("Object.assign",function(e){return e||s});var l,d,c="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{e:{var u={};try{u.__proto__={a:!0},Q=u.a;break e}catch(e){}Q=!1}d=Q?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw TypeError(e+" is not extensible");return e}:null}var h=d;function p(e,t){if(e.prototype=c(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var r in t)if("prototype"!=r){if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r]}e.za=t.prototype}function f(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function m(e){if(e.m)throw TypeError("Generator is already running");e.m=!0}function C(e,t){e.l={ma:t,na:!0},e.h=e.s||e.v}function g(e,t,r){return e.h=r,{value:t}}function w(e){this.h=new f,this.i=e}function v(e,t,r,n){try{var o=t.call(e.h.j,r);if(!(o instanceof Object))throw TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.h.m=!1,o;var i=o.value}catch(t){return e.h.j=null,C(e.h,t),y(e)}return e.h.j=null,n.call(e.h,i),y(e)}function y(e){for(;e.h.h;)try{var t=e.i(e.h);if(t)return e.h.m=!1,{value:t.value,done:!1}}catch(t){e.h.i=void 0,C(e.h,t)}if(e.h.m=!1,e.h.l){if(t=e.h.l,e.h.l=null,t.na)throw t.ma;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function x(e){this.next=function(t){return m(e.h),e.h.j?t=v(e,e.h.j.next,t,e.h.u):(e.h.u(t),t=y(e)),t},this.throw=function(t){return m(e.h),e.h.j?t=v(e,e.h.j.throw,t,e.h.u):(C(e.h,t),t=y(e)),t},this.return=function(t){var r;return m(e.h),(r=e.h.j)?v(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.h.return):(e.h.return(t),y(e))},this[Symbol.iterator]=function(){return this}}function b(e){return function(e){function t(t){return e.next(t)}function r(t){return e.throw(t)}return new Promise(function(n,o){!function e(i){i.done?n(i.value):Promise.resolve(i.value).then(t,r).then(e,o)}(e.next())})}(new x(new w(e)))}function k(e){return e||Array.prototype.fill}f.prototype.u=function(e){this.i=e},f.prototype.return=function(e){this.l={return:e},this.h=this.v},o("Promise",function(e){function t(e){this.i=0,this.j=void 0,this.h=[],this.u=!1;var t=this.l();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.h=null}function o(e){return e instanceof t?e:new t(function(t){t(e)})}if(e)return e;r.prototype.i=function(e){if(null==this.h){this.h=[];var t=this;this.j(function(){t.m()})}this.h.push(e)};var a=n.setTimeout;r.prototype.j=function(e){a(e,0)},r.prototype.m=function(){for(;this.h&&this.h.length;){var e=this.h;this.h=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.l(e)}}}this.h=null},r.prototype.l=function(e){this.j(function(){throw e})},t.prototype.l=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.I),reject:e(this.m)}},t.prototype.I=function(e){if(e===this)this.m(TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.L(e);else{switch(typeof e){case"object":var r=null!=e;break;case"function":r=!0;break;default:r=!1}r?this.F(e):this.s(e)}},t.prototype.F=function(e){var t=void 0;try{t=e.then}catch(e){this.m(e);return}"function"==typeof t?this.M(t,e):this.s(e)},t.prototype.m=function(e){this.v(2,e)},t.prototype.s=function(e){this.v(1,e)},t.prototype.v=function(e,t){if(0!=this.i)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.i);this.i=e,this.j=t,2===this.i&&this.K(),this.H()},t.prototype.K=function(){var e=this;a(function(){if(e.D()){var t=n.console;void 0!==t&&t.error(e.j)}},1)},t.prototype.D=function(){if(this.u)return!1;var e=n.CustomEvent,t=n.Event,r=n.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=n.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.j,r(e))},t.prototype.H=function(){if(null!=this.h){for(var e=0;e<this.h.length;++e)s.i(this.h[e]);this.h=null}};var s=new r;return t.prototype.L=function(e){var t=this.l();e.T(t.resolve,t.reject)},t.prototype.M=function(e,t){var r=this.l();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t(function(e,t){o=e,i=t});return this.T(n(e,o),n(r,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.T=function(e,t){function r(){switch(n.i){case 1:e(n.j);break;case 2:t(n.j);break;default:throw Error("Unexpected state: "+n.i)}}var n=this;null==this.h?s.i(r):this.h.push(r),this.u=!0},t.resolve=o,t.reject=function(e){return new t(function(t,r){r(e)})},t.race=function(e){return new t(function(t,r){for(var n=i(e),a=n.next();!a.done;a=n.next())o(a.value).T(t,r)})},t.all=function(e){var r=i(e),n=r.next();return n.done?o([]):new t(function(e,t){var i=[],a=0;do i.push(void 0),a++,o(n.value).T(function(t){return function(r){i[t]=r,0==--a&&e(i)}}(i.length-1),t),n=r.next();while(!n.done)})},t}),o("Array.prototype.keys",function(e){return e||function(){var e,t,r,n,o;return e=this,t=function(e){return e},e instanceof String&&(e+=""),r=0,n=!1,(o={next:function(){if(!n&&r<e.length){var o=r++;return{value:t(o,e[o]),done:!1}}return n=!0,{done:!0,value:void 0}}})[Symbol.iterator]=function(){return o},o}}),o("Array.prototype.fill",function(e){return e||function(e,t,r){var n=this.length||0;for(0>t&&(t=Math.max(0,n+t)),(null==r||r>n)&&(r=n),0>(r=Number(r))&&(r=Math.max(0,n+r)),t=Number(t||0);t<r;t++)this[t]=e;return this}}),o("Int8Array.prototype.fill",k),o("Uint8Array.prototype.fill",k),o("Uint8ClampedArray.prototype.fill",k),o("Int16Array.prototype.fill",k),o("Uint16Array.prototype.fill",k),o("Int32Array.prototype.fill",k),o("Uint32Array.prototype.fill",k),o("Float32Array.prototype.fill",k),o("Float64Array.prototype.fill",k),o("Object.is",function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}}),o("Array.prototype.includes",function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length;for(0>(t=t||0)&&(t=Math.max(t+n,0));t<n;t++){var o=r[t];if(o===e||Object.is(o,e))return!0}return!1}}),o("String.prototype.includes",function(e){return e||function(e,t){if(null==this)throw TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw TypeError("First argument to String.prototype.includes must not be a regular expression");return -1!==this.indexOf(e,t||0)}});var M=this||self;function j(e,t){e=e.split(".");var r,n=M;for((e[0]in n)||void 0===n.execScript||n.execScript("var "+e[0]);e.length&&(r=e.shift());)e.length||void 0===t?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t}function L(e){var t;return(t=M.navigator)&&(t=t.userAgent)||(t=""),-1!=t.indexOf(e)}var N=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var r=e.length,n=Array(r),o="string"==typeof e?e.split(""):e,i=0;i<r;i++)i in o&&(n[i]=t.call(void 0,o[i],i,e));return n},S={},P=null;function _(){if(!P){P={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));S[r]=n;for(var o=0;o<n.length;o++){var i=n[o];void 0===P[i]&&(P[i]=o)}}}}var R="undefined"!=typeof Uint8Array,H=!(L("Trident")||L("MSIE"))&&"function"==typeof M.btoa;function z(e){if(!H){var t;void 0===t&&(t=0),_(),t=S[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],l=e[o+2],d=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|l>>6],l=t[63&l],r[i++]=d+a+s+l}switch(d=0,l=n,e.length-o){case 2:l=t[(15&(d=e[o+1]))<<2]||n;case 1:e=e[o],r[i]=t[e>>2]+t[(3&e)<<4|d>>4]+l+n}return r.join("")}for(t="";10240<e.length;)t+=String.fromCharCode.apply(null,e.subarray(0,10240)),e=e.subarray(10240);return btoa(t+=String.fromCharCode.apply(null,e))}var E=RegExp("[-_.]","g");function V(e){switch(e){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function W(e){if(!H){var t,r,n,o,i;return(n=3*(r=(t=e).length)/4)%3?n=Math.floor(n):-1!="=.".indexOf(t[r-1])&&(n=-1!="=.".indexOf(t[r-2])?n-2:n-1),o=new Uint8Array(n),i=0,function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),o=P[r];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}_();for(var n=0;;){var o=r(-1),i=r(0),a=r(64),s=r(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(t,function(e){o[i++]=e}),i!==n?o.subarray(0,i):o}E.test(e)&&(e=e.replace(E,V)),e=atob(e);for(var a=new Uint8Array(e.length),s=0;s<e.length;s++)a[s]=e.charCodeAt(s);return a}function T(){return J||(J=new Uint8Array(0))}var D={},O="function"==typeof Uint8Array.prototype.slice,I=0,A=0;function Z(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/4294967296),t&&(t=(r=i(F(r,e))).next().value,e=r.next().value,r=t),I=r>>>0,A=e>>>0}var B="function"==typeof BigInt;function F(e,t){return t=~t,e?e=~e+1:t+=1,[e,t]}function q(e,t){this.i=e>>>0,this.h=t>>>0}function U(e){if(!e)return ee||(ee=new q(0,0));if(!/^-?\d+$/.test(e))return null;if(16>e.length)Z(Number(e));else if(B)I=Number((e=BigInt(e))&BigInt(4294967295))>>>0,A=Number(e>>BigInt(32)&BigInt(4294967295));else{var t=+("-"===e[0]);A=I=0;for(var r=e.length,n=t,o=(r-t)%6+t;o<=r;n=o,o+=6)n=Number(e.slice(n,o)),A*=1e6,4294967296<=(I=1e6*I+n)&&(A+=I/4294967296|0,I%=4294967296);t&&(e=(t=i(F(I,A))).next().value,t=t.next().value,I=e,A=t)}return new q(I,A)}function $(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function Y(){return Error("Failed to read varint, encoding is invalid.")}function X(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function G(){throw Error("Invalid UTF8")}function K(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var Q,J,ee,et,er,en=void 0,eo="undefined"!=typeof TextDecoder,ei="undefined"!=typeof TextEncoder;function ea(e){if(e!==D)throw Error("illegal external caller")}function es(e,t){if(ea(t),this.V=e,null!=e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}function el(){return ez||(ez=new es(null,D))}function ed(e){ea(D);var t=e.V;return null==(t=null==t||R&&null!=t&&t instanceof Uint8Array?t:"string"==typeof t?W(t):null)?t:e.V=t}function ec(e,t){this.i=null,this.m=!1,this.h=this.j=this.l=0,eu(this,e,t)}function eu(e,t,r){r=void 0===r?{}:r,e.S=void 0!==r.S&&r.S,t&&(t=function(e){if("string"==typeof e)return{buffer:W(e),C:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),C:!1};if(e.constructor===Uint8Array)return{buffer:e,C:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),C:!1};if(e.constructor===es)return{buffer:ed(e)||T(),C:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),C:!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")}(t),e.i=t.buffer,e.m=t.C,e.l=0,e.j=e.i.length,e.h=e.l)}function eh(e,t){if(e.h=t,t>e.j)throw X(e.j,t)}function ep(e){var t=e.i,r=e.h,n=t[r++],o=127&n;if(128&n&&(o|=(127&(n=t[r++]))<<7,128&n&&(o|=(127&(n=t[r++]))<<14,128&n&&(o|=(127&(n=t[r++]))<<21,128&n&&(o|=(n=t[r++])<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Y();return eh(e,r),o}function ef(e,t){if(0>t)throw Error("Tried to read a negative byte length: "+t);var r=e.h,n=r+t;if(n>e.j)throw X(t,e.j-r);return e.h=n,r}ec.prototype.reset=function(){this.h=this.l};var em=[];function eC(){this.h=[]}function eg(e,t,r){for(;0<r||127<t;)e.h.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.h.push(t)}function ew(e,t){for(;127<t;)e.h.push(127&t|128),t>>>=7;e.h.push(t)}function ev(e,t){if(em.length){var r=em.pop();eu(r,e,t),e=r}else e=new ec(e,t);this.h=e,this.j=this.h.h,this.i=this.l=-1,this.setOptions(t)}function ey(e){var t=e.h;if(t.h==t.j)return!1;e.j=e.h.h;var r=ep(e.h)>>>0;if(t=r>>>3,!(0<=(r&=7)&&5>=r))throw $(r,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.l=t,e.i=r,!0}eC.prototype.length=function(){return this.h.length},eC.prototype.end=function(){var e=this.h;return this.h=[],e},ev.prototype.setOptions=function(e){e=void 0===e?{}:e,this.ca=void 0!==e.ca&&e.ca},ev.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var ex=[];function eb(){this.j=[],this.i=0,this.h=new eC}function ek(e,t){0!==t.length&&(e.j.push(t),e.i+=t.length)}var eM="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function ej(e,t){return eM?e[eM]|=t:void 0!==e.A?e.A|=t:(Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}}),t)}function eL(e,t){eM?e[eM]&&(e[eM]&=~t):void 0!==e.A&&(e.A&=~t)}function eN(e){var t;return null==(t=eM?e[eM]:e.A)?0:t}function eS(e,t){eM?e[eM]=t:void 0!==e.A?e.A=t:Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}})}function eP(e,t){eS(t,(0|e)&-51)}function e_(e,t){eS(t,(18|e)&-41)}var eR={};function eH(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var ez,eE,eV=[];function eW(e){if(2&eN(e.o))throw Error("Cannot mutate an immutable Message")}function eT(e){var t=e.length;(t=t?e[t-1]:void 0)&&eH(t)?t.g=1:(t={},e.push((t.g=1,t)))}function eD(e){var t=e.i+e.G;return e.B||(e.B=e.o[t]={})}function eO(e,t){return -1===t?null:t>=e.i?e.B?e.B[t]:void 0:e.o[t+e.G]}function eI(e,t,r,n){eW(e),eA(e,t,r,n)}function eA(e,t,r,n){e.j&&(e.j=void 0),t>=e.i||n?eD(e)[t]=r:(e.o[t+e.G]=r,(e=e.B)&&t in e&&delete e[t])}function eZ(e,t,r,n){var o=eO(e,t);Array.isArray(o)||(o=eE);var i=eN(o);if(1&i||ej(o,1),n)2&i||ej(o,2),1&r||Object.freeze(o);else{n=!(2&r);var a,s=2&i;1&r||!s?n&&16&i&&!s&&eL(o,16):(ej(a=Array.prototype.slice.call(o),1),eA(e,t,o=a))}return o}function eB(e,t){var r=eO(e,t),n=null==r?r:"number"==typeof r||"NaN"===r||"Infinity"===r||"-Infinity"===r?Number(r):void 0;return null!=n&&n!==r&&eA(e,t,n),n}function eF(e,t,r,n,o){e.h||(e.h={});var i=e.h[r],a=eZ(e,r,3,o);if(!i){var s=a;i=[];var l=!!(16&eN(e.o));a=!!(2&eN(s));var d=s;!o&&a&&(s=Array.prototype.slice.call(s));for(var c=a,u=0;u<s.length;u++){var h=s[u],p=t,f=!1;if(void 0!==(h=Array.isArray(h)?new p(h):f?new p:void 0)){var m=f=eN(p=h.o);a&&(m|=2),l&&(m|=16),m!=f&&eS(p,m),p=m,c=c||!!(2&p),i.push(h)}}return e.h[r]=i,t=33|(l=eN(s)),l!=(t=c?-9&t:8|t)&&(Object.isFrozen(c=s)&&(c=Array.prototype.slice.call(c)),eS(c,t),s=c),d!==s&&eA(e,r,s),(o||n&&a)&&ej(i,2),n&&Object.freeze(i),i}return o||(o=Object.isFrozen(i),n&&!o?Object.freeze(i):!n&&o&&(i=Array.prototype.slice.call(i),e.h[r]=i)),i}function eq(e,t,r){var n=!!(2&eN(e.o));if(t=eF(e,t,r,n,n),e=eZ(e,r,3,n),!(n||8&eN(e))){for(n=0;n<t.length;n++){if(2&eN((r=t[n]).o)){var o=e2(r,!1);o.j=r}else o=r;r!==o&&(t[n]=o,e[n]=o.o)}ej(e,8)}return t}function eU(e,t,r){if(null!=r&&"number"!=typeof r)throw Error("Value of float/double field must be a number|null|undefined, found "+typeof r+": "+r);eI(e,t,r)}function e$(e,t,r,n,o){eW(e);var i=eF(e,r,t,!1,!1);return r=null!=n?n:new r,e=eZ(e,t,2,!1),void 0!=o?(i.splice(o,0,r),e.splice(o,0,r.o)):(i.push(r),e.push(r.o)),r.C()&&eL(e,8),r}function eY(e,t){return null==e?t:e}function eX(e,t,r){return r=void 0===r?0:r,eY(eB(e,t),r)}function eG(e,t,r,n){var o=eN(e);n=n?!!(16&o):void 0,e=Array.prototype.slice.call(e);for(var i=0;i<e.length;i++)e[i]=function e(t,r,n,o){if(null!=t){if(Array.isArray(t))t=eG(t,r,n,void 0!==o);else if(eH(t)){var i,a={};for(i in t)a[i]=e(t[i],r,n,o);t=a}else t=r(t,o);return t}}(e[i],t,r,n);return r(o,e),e}function eK(e){return e.ja===eR?e.toJSON():function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e){if(Array.isArray(e)){if(0!=(128&eN(e)))return eT(e=Array.prototype.slice.call(e)),e}else{if(R&&null!=e&&e instanceof Uint8Array)return z(e);if(e instanceof es){var t=e.V;return null==t?"":"string"==typeof t?t:e.V=z(t)}}}}return e}(e)}function eQ(e,t){128&e&&eT(t)}function eJ(e,t,r,n,o,i,a){if(e=e.h&&e.h[r]){var s;if(2&(n=eN(e))?n=e:(e_(n,i=N(e,e1)),Object.freeze(i),n=i),eW(t),a=null==n?eE:(ej(s=[],1),s),null!=n){for(e=0,i=!!n.length;e<n.length;e++){var l=n[e];i=i&&!(2&eN(l.o)),a[e]=l.o}i=(i?8:0)|1,((e=eN(a))&i)!==i&&(Object.isFrozen(a)&&(a=Array.prototype.slice.call(a)),eS(a,e|i)),t.h||(t.h={}),t.h[r]=n}else t.h&&(t.h[r]=void 0);eA(t,r,a,o)}else eI(t,r,function e(t,r,n){if(n=void 0===n?e_:n,null!=t){if(R&&t instanceof Uint8Array)return t.length?new es(new Uint8Array(t),D):el();if(Array.isArray(t)){var o=eN(t);return 2&o||(r&&!(32&o)&&(16&o||0===o)?eS(t,2|o):4&(r=eN(t=eG(t,e,4&o?e_:n,!0)))&&2&r&&Object.freeze(t)),t}return t.ja===eR?e1(t):t}}(n,i,a),o)}function e1(e){return 2&eN(e.o)||ej((e=e2(e,!0)).o,2),e}function e2(e,r){var n=e.o,o=[];ej(o,16);var i=e.constructor.h;if(i&&o.push(i),i=e.B){o.length=n.length,o.fill(void 0,o.length,n.length);var a={};o[o.length-1]=a}0!=(128&eN(n))&&eT(o),r=r||e.C()?e_:eP,a=e.constructor,t=o,o=new a(o),t=void 0,e.R&&(o.R=e.R.slice()),a=!!(16&eN(n));for(var s=i?n.length-1:n.length,l=0;l<s;l++)eJ(e,o,l-e.G,n[l],!1,a,r);if(i)for(var d in i)eJ(e,o,+d,i[d],!0,a,r);return o}function e0(e,r,n){null==e&&(e=t),t=void 0;var o,i=this.constructor.i||0,a=0<i,s=this.constructor.h,l=!1;if(null==e){var d=48,c=!0;a&&(i=0,d|=128),eS(e=s?[s]:[],d)}else{if(!Array.isArray(e)||s&&s!==e[0])throw Error();var u=d=ej(e,0);if((c=0!=(16&u))&&((l=0!=(32&u))||(u|=32)),a){if(128&u)i=0;else if(0<e.length){var h=e[e.length-1];if(eH(h)&&"g"in h){i=0,u|=128,delete h.g;var p,f=!0;for(p in h){f=!1;break}f&&e.pop()}}}else if(128&u)throw Error();d!==u&&eS(e,u)}this.G=(s?0:-1)-i,this.h=void 0,this.o=e;e:{if(i=(s=this.o.length)-1,s&&eH(s=this.o[i])){this.B=s,this.i=i-this.G;break e}void 0!==r&&-1<r?(this.i=Math.max(r,i+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE}if(!a&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(n)for(r=c&&!l&&!0,a=this.i,c=0;c<n.length;c++)(l=n[c])<a?(l+=this.G,(i=e[l])?e3(i,r):e[l]=eE):(o||(o=eD(this)),(i=o[l])?e3(i,r):o[l]=eE)}function e3(e,t){if(Array.isArray(e)){var r=eN(e),n=1;!t||2&r||(n|=16),(r&n)!==n&&eS(e,r|n)}}function e9(e,t,r){if(r){var n,o={};for(n in r){var i=r[n],a=i.ra;a||(o.J=i.xa||i.oa.W,i.ia?(o.aa=tt(i.ia),a=function(e){return function(t,r,n){return e.J(t,r,n,e.aa)}}(o)):i.ka?(o.Z=tr(i.da.P,i.ka),a=function(e){return function(t,r,n){return e.J(t,r,n,e.Z)}}(o)):a=o.J,i.ra=a),a(t,e,i.da),o={J:o.J,aa:o.aa,Z:o.Z}}}!function(e,t){if(t=t.R){ek(e,e.h.end());for(var r=0;r<t.length;r++)ek(e,ed(t[r])||T())}}(t,e)}eS(eV,23),eE=Object.freeze(eV),e0.prototype.toJSON=function(){return eG(this.o,eK,eQ)},e0.prototype.C=function(){return!!(2&eN(this.o))},e0.prototype.ja=eR,e0.prototype.toString=function(){return this.o.toString()};var e5=Symbol();function e6(e,t,r){return e[e5]||(e[e5]=function(e,n){return t(e,n,r)})}function e4(e){var t=e[e5];if(!t){var r=tf(e);t=function(e,t){return tm(e,t,r)},e[e5]=t}return t}function e8(e,t){var r=e[t];return"function"==typeof r&&0===r.length&&(r=r(),e[t]=r),Array.isArray(r)&&(td in r||tn in r||0<r.length&&"function"==typeof r[0])?r:void 0}function e7(e,t,r,n,o,i){t.P=e[0];var a=1;if(e.length>a&&"number"!=typeof e[a]){var s=e[a++];r(t,s)}for(;a<e.length;){r=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;switch(s=e[a++],l-=a){case 0:n(t,r,s);break;case 1:(l=e8(e,a))?(a++,o(t,r,s,l)):n(t,r,s,e[a++]);break;case 2:o(t,r,s,l=e8(e,l=a++),e[a++]);break;case 3:i(t,r,s,e[a++],e[a++],e[a++]);break;case 4:i(t,r,s,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var te=Symbol();function tt(e){var t=e[te];if(!t){var r=tl(e);t=function(e,t){return tC(e,t,r)},e[te]=t}return t}function tr(e,t){var r=e[te];return r||(r=function(e,r){return e9(e,r,t)},e[te]=r),r}var tn=Symbol();function to(e,t){e.push(t)}function ti(e,t,r){e.push(t,r.W)}function ta(e,t,r,n){var o=tt(n),i=tl(n).P,a=r.W;e.push(t,function(e,t,r){return a(e,t,r,i,o)})}function ts(e,t,r,n,o,i){var a=tr(n,i),s=r.W;e.push(t,function(e,t,r){return s(e,t,r,n,a)})}function tl(e){var t=e[tn];return t||(t=e7(e,e[tn]=[],to,ti,ta,ts),td in e&&tn in e&&(e.length=0)),t}var td=Symbol();function tc(e,t){e[0]=t}function tu(e,t,r,n){var o=r.U;e[t]=n?function(e,t,r){return o(e,t,r,n)}:o}function th(e,t,r,n,o){var i=r.U,a=e4(n),s=tf(n).P;e[t]=function(e,t,r){return i(e,t,r,s,a,o)}}function tp(e,t,r,n,o,i,a){var s=r.U,l=e6(n,o,i);e[t]=function(e,t,r){return s(e,t,r,n,l,a)}}function tf(e){var t=e[td];return t||(t=e7(e,e[td]={},tc,tu,th,tp),td in e&&tn in e&&(e.length=0)),t}function tm(e,t,r){for(;ey(t)&&4!=t.i;){var n=t.l,o=r[n];if(!o){var i=r[0];i&&(i=i[n])&&(o=r[n]=function(e){var t,r=(t=e.ia)?e4(t):(t=e.wa)?e6(e.da.P,t,e.ka):void 0,n=e.da,o=e.oa.U;return r?function(e,t){return o(e,t,n,r)}:function(e,t){return o(e,t,n)}}(i))}if(!o||!o(t,e,n)){o=t,n=e,i=o.j,function e(t){switch(t.i){case 0:if(0!=t.i)e(t);else e:{t=t.h;for(var r=t.h,n=r+10,o=t.i;r<n;)if(0==(128&o[r++])){eh(t,r);break e}throw Y()}break;case 1:eh(t=t.h,t.h+8);break;case 2:2!=t.i?e(t):(r=ep(t.h)>>>0,eh(t=t.h,t.h+r));break;case 5:eh(t=t.h,t.h+4);break;case 3:for(r=t.l;;){if(!ey(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=r)throw Error("Unmatched end-group tag");break}e(t)}break;default:throw $(t.i,t.j)}}(o);var a=o;if(!a.ca){if(o=a.h.h-i,a.h.h=i,a=a.h,0==o)o=el();else{if(i=ef(a,o),a.S&&a.m)o=a.i.subarray(i,i+o);else{a=a.i;var s=i;o=s===(o=i+o)?T():O?a.slice(s,o):new Uint8Array(a.subarray(s,o))}o=0==o.length?el():new es(o,D)}(i=n.R)?i.push(o):n.R=[o]}}}return e}function tC(e,t,r){for(var n=r.length,o=1==n%2,i=o?1:0;i<n;i+=2)(0,r[i+1])(t,e,r[i]);e9(e,t,o?r[0]:void 0)}function tg(e,t){return{U:e,W:t}}var tw=tg(function(e,t,r){if(5!==e.i)return!1;var n=(e=e.h).i,o=e.h,i=n[o],a=n[o+1],s=n[o+2];return n=n[o+3],eh(e,e.h+4),e=2*((a=(i<<0|a<<8|s<<16|n<<24)>>>0)>>31)+1,i=a>>>23&255,a&=8388607,eI(t,r,255==i?a?NaN:1/0*e:0==i?1401298464324817e-60*e*a:e*Math.pow(2,i-150)*(a+8388608)),!0},function(e,t,r){if(null!=(t=eB(t,r))){ew(e.h,8*r+5),e=e.h;var n=+t;0===n?0<1/n?I=A=0:(A=0,I=2147483648):isNaN(n)?(A=0,I=2147483647):34028234663852886e22<(n=(r=0>n?-2147483648:0)?-n:n)?(A=0,I=(2139095040|r)>>>0):11754943508222875e-54>n?(A=0,I=(r|(n=Math.round(n/1401298464324817e-60)))>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),16777216<=(n=Math.round(8388608*n))&&++t,A=0,I=(r|t+127<<23|8388607&n)>>>0),r=I,e.h.push(r>>>0&255),e.h.push(r>>>8&255),e.h.push(r>>>16&255),e.h.push(r>>>24&255)}}),tv=tg(function(e,t,r){if(0!==e.i)return!1;var n=e.h,o=0,i=e=0,a=n.i,s=n.h;do{var l=a[s++];o|=(127&l)<<i,i+=7}while(32>i&&128&l)for(32<i&&(e|=(127&l)>>4),i=3;32>i&&128&l;i+=7)e|=(127&(l=a[s++]))<<i;if(eh(n,s),128>l)n=o>>>0,(e=2147483648&(l=e>>>0))&&(l=~l>>>0,0==(n=~n+1>>>0)&&(l=l+1>>>0)),n=4294967296*l+(n>>>0);else throw Y();return eI(t,r,e?-n:n),!0},function(e,t,r){null!=(t=eO(t,r))&&("string"==typeof t&&U(t),null!=t&&(ew(e.h,8*r),"number"==typeof t?(e=e.h,Z(t),eg(e,I,A)):(r=U(t),eg(e.h,r.i,r.h))))}),ty=tg(function(e,t,r){return 0===e.i&&(eI(t,r,ep(e.h)),!0)},function(e,t,r){if(null!=(t=eO(t,r))&&null!=t){if(ew(e.h,8*r),e=e.h,0<=(r=t))ew(e,r);else{for(t=0;9>t;t++)e.h.push(127&r|128),r>>=7;e.h.push(1)}}}),tx=tg(function(e,t,r){if(2!==e.i)return!1;var n=ep(e.h)>>>0,o=ef(e=e.h,n);if(e=e.i,eo){var i,a=e;(i=et)||(i=et=new TextDecoder("utf-8",{fatal:!0})),e=o+n,a=0===o&&e===a.length?a:a.subarray(o,e);try{var s=i.decode(a)}catch(e){if(void 0===en){try{i.decode(new Uint8Array([128]))}catch(e){}try{i.decode(new Uint8Array([97])),en=!0}catch(e){en=!1}}throw en||(et=void 0),e}}else{n=(s=o)+n,o=[];for(var l,d,c=null;s<n;)128>(l=e[s++])?o.push(l):224>l?s>=n?G():(d=e[s++],194>l||128!=(192&d)?(s--,G()):o.push((31&l)<<6|63&d)):240>l?s>=n-1?G():128!=(192&(d=e[s++]))||224===l&&160>d||237===l&&160<=d||128!=(192&(a=e[s++]))?(s--,G()):o.push((15&l)<<12|(63&d)<<6|63&a):244>=l?s>=n-2?G():128!=(192&(d=e[s++]))||0!=(l<<28)+(d-144)>>30||128!=(192&(a=e[s++]))||128!=(192&(i=e[s++]))?(s--,G()):(l=((7&l)<<18|(63&d)<<12|(63&a)<<6|63&i)-65536,o.push((l>>10&1023)+55296,(1023&l)+56320)):G(),8192<=o.length&&(c=K(c,o),o.length=0);s=K(c,o)}return eI(t,r,s),!0},function(e,t,r){if(null!=(t=eO(t,r))){if(ei)t=(er||(er=new TextEncoder)).encode(t);else{for(var n=0,o=new Uint8Array(3*t.length),i=0;i<t.length;i++){var a=t.charCodeAt(i);if(128>a)o[n++]=a;else{if(2048>a)o[n++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<t.length){var s=t.charCodeAt(++i);if(56320<=s&&57343>=s){a=1024*(a-55296)+s-56320+65536,o[n++]=a>>18|240,o[n++]=a>>12&63|128,o[n++]=a>>6&63|128,o[n++]=63&a|128;continue}i--}a=65533}o[n++]=a>>12|224,o[n++]=a>>6&63|128}o[n++]=63&a|128}}t=n===o.length?o:o.subarray(0,n)}ew(e.h,8*r+2),ew(e.h,t.length),ek(e,e.h.end()),ek(e,t)}}),tb=tg(function(e,t,r,n,o){if(2!==e.i)return!1;t=e$(t,r,n),r=e.h.j,n=ep(e.h)>>>0;var i=e.h.h+n,a=i-r;if(0>=a&&(e.h.j=i,o(t,e,void 0,void 0,void 0),a=i-e.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+n+" bytes, instead read "+(n-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.h.h=i,e.h.j=r,!0},function(e,t,r,n,o){if(null!=(t=eq(t,n,r)))for(n=0;n<t.length;n++){var i=e;ew(i.h,8*r+2);var a=i.h.end();ek(i,a),a.push(i.i),i=a,o(t[n],e),a=e;var s=i.pop();for(s=a.i+a.h.length()-s;127<s;)i.push(127&s|128),s>>>=7,a.i++;i.push(s),a.i++}});function tk(e){return function(t,r){e:{if(ex.length){var n=ex.pop();n.setOptions(r),eu(n.h,t,r),t=n}else t=new ev(t,r);try{var o=tf(e),i=tm(new o.P,t,o);break e}finally{(o=t.h).i=null,o.m=!1,o.l=0,o.j=0,o.h=0,o.S=!1,t.l=-1,t.i=-1,100>ex.length&&ex.push(t)}i=void 0}return i}}function tM(e){return function(){var t=new eb;tC(this,t,tl(e)),ek(t,t.h.end());for(var r=new Uint8Array(t.i),n=t.j,o=n.length,i=0,a=0;a<o;a++){var s=n[a];r.set(s,i),i+=s.length}return t.j=[r],r}}function tj(e){e0.call(this,e)}p(tj,e0);var tL=[tj,1,ty,2,tw,3,tx,4,tx];function tN(e){e0.call(this,e,-1,tS)}tj.prototype.l=tM(tL),p(tN,e0),tN.prototype.addClassification=function(e,t){return e$(this,1,tj,e,t),this};var tS=[1],tP=tk([tN,1,tb,tL]);function t_(e){e0.call(this,e)}p(t_,e0);var tR=[t_,1,tw,2,tw,3,tw,4,tw,5,tw];function tH(e){e0.call(this,e,-1,tz)}t_.prototype.l=tM(tR),p(tH,e0);var tz=[1],tE=tk([tH,1,tb,tR]);function tV(e){e0.call(this,e)}p(tV,e0);var tW=[tV,1,tw,2,tw,3,tw,4,tw,5,tw,6,tv],tT=tk(tW);function tD(e,t,r){if(r=e.createShader(0===r?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(r));return r}function tO(e){return{x:eX(e,1),y:eX(e,2),z:eX(e,3),visibility:null!=eB(e,4)?eX(e,4):void 0}}function tI(e,t){this.i=e,this.h=t,this.m=0}function tA(e,t,r){return(function(e,t){var r=e.h;if(void 0===e.s){var n=tD(r,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),o=tD(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,o),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(i));n=e.s=i,r.useProgram(n),o=r.getUniformLocation(n,"sampler0"),e.l={O:r.getAttribLocation(n,"aVertex"),N:r.getAttribLocation(n,"aTex"),ya:o},e.v=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.v),r.enableVertexAttribArray(e.l.O),r.vertexAttribPointer(e.l.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),e.u=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.u),r.enableVertexAttribArray(e.l.N),r.vertexAttribPointer(e.l.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(o,0)}n=e.l,r.useProgram(e.s),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.i.bindTexture2d(t.glName),r.enableVertexAttribArray(n.O),r.bindBuffer(r.ARRAY_BUFFER,e.v),r.vertexAttribPointer(n.O,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,e.u),r.vertexAttribPointer(n.N,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.O),r.disableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,null),e.i.bindTexture2d(0)}(e,t),"function"==typeof e.h.canvas.transferToImageBitmap)?Promise.resolve(e.h.canvas.transferToImageBitmap()):r?Promise.resolve(e.h.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.h.canvas):(void 0===e.j&&(e.j=document.createElement("canvas")),new Promise(function(t){e.j.height=e.h.canvas.height,e.j.width=e.h.canvas.width,e.j.getContext("2d",{}).drawImage(e.h.canvas,0,0,e.h.canvas.width,e.h.canvas.height),t(e.j)}))}function tZ(e){this.h=e}tV.prototype.l=tM(tW);var tB=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function tF(e,t){return t+e}function tq(e){if(this.h=e,this.listeners={},this.l={},this.L={},this.s={},this.v={},this.M=this.u=this.ga=!0,this.I=Promise.resolve(),this.fa="",this.D={},this.locateFile=e&&e.locateFile||tF,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!=typeof location)t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.ha=t,e.options){t=i(Object.keys(e.options));for(var r=t.next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.l[r]="function"==typeof n?n():n)}}}function tU(e,t){var r;return b(function(n){return t in e.L?n.return(e.L[t]):(r=fetch(e.locateFile(t,"")).then(function(e){return e.arrayBuffer()}),e.L[t]=r,n.return(r))})}function t$(e){return(void 0===e&&(e=0),1===e)?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function tY(e){var t=this;e=e||{},this.h=new tq({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:t$(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){var r,n,o;return b(function(i){return 1==i.h?(n="third_party/mediapipe/modules/selfie_segmentation/"+(r=t$(e)),g(i,tU(t.h,r),2)):(o=i.i,t.h.overrideFile(n,o),i.return(!0))})}}}})}(l=tq.prototype).close=function(){return this.j&&this.j.delete(),Promise.resolve()},l.reset=function(){var e=this;return b(function(t){e.j&&(e.j.reset(),e.s={},e.v={}),t.h=0})},l.setOptions=function(e,t){var r=this;if(t=t||this.h.options){for(var n=[],o=[],a={},s=i(Object.keys(e)),l=s.next();!l.done;a={X:a.X,Y:a.Y},l=s.next())if(!((l=l.value)in this.l&&this.l[l]===e[l])){this.l[l]=e[l];var d=t[l];void 0!==d&&(d.onChange&&(a.X=d.onChange,a.Y=e[l],n.push(function(e){return function(){return b(function(t){if(1==t.h)return g(t,e.X(e.Y),2);!0===t.i&&(r.u=!0),t.h=0})}}(a))),d.graphOptionXref&&(l=Object.assign({},{calculatorName:"",calculatorIndex:0},d.graphOptionXref,{valueNumber:1===d.type?e[l]:0,valueBoolean:0===d.type&&e[l],valueString:2===d.type?e[l]:""}),o.push(l)))}(0!==n.length||0!==o.length)&&(this.u=!0,this.H=(void 0===this.H?[]:this.H).concat(o),this.F=(void 0===this.F?[]:this.F).concat(n))}},l.initialize=function(){var e=this;return b(function(t){var r,n,o,s,l,d,c,u,h,p,f,m,C,w,v,y,x,k,M,j,L,N,S,P;return 1==t.h?g(t,b(function(t){switch(t.h){case 1:if(!e.ga)return t.return();return r=void 0===e.h.files?[]:"function"==typeof e.h.files?e.h.files(e.l):e.h.files,g(t,b(function(e){switch(e.h){case 1:return e.s=2,g(e,WebAssembly.instantiate(tB),4);case 4:e.h=3,e.s=0;break;case 2:return e.s=0,e.l=null,e.return(!1);case 3:return e.return(!0)}}),2);case 2:if(n=t.i,"object"==typeof window){var i,m;return i={locateFile:e.locateFile},window.createMediapipeSolutionsWasm=i,m={locateFile:e.locateFile},window.createMediapipeSolutionsPackedAssets=m,d=r.filter(function(e){return void 0!==e.data}),c=r.filter(function(e){return void 0===e.data}),u=Promise.all(d.map(function(t){var r=tU(e,t.url);if(void 0!==t.path){var n=t.path;r=r.then(function(t){return e.overrideFile(n,t),Promise.resolve(t)})}return r})),h=Promise.all(c.map(function(t){var r,o;return void 0===t.simd||t.simd&&n||!t.simd&&!n?(r=e.locateFile(t.url,e.ha),(o=document.createElement("script")).setAttribute("src",r),o.setAttribute("crossorigin","anonymous"),new Promise(function(e){o.addEventListener("load",function(){e()},!1),o.addEventListener("error",function(){e()},!1),document.body.appendChild(o)})):Promise.resolve()})).then(function(){var t,r,n;return b(function(o){if(1==o.h)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,n=e,g(o,t(r),2);n.i=o.i,o.h=0})}),p=b(function(t){return e.h.graph&&e.h.graph.url?t=g(t,tU(e,e.h.graph.url),0):(t.h=0,t=void 0),t}),g(t,Promise.all([h,u,p]),7)}if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter(function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n}).map(function(t){return e.locateFile(t.url,e.ha)}),importScripts.apply(null,a(o)),s=e,g(t,createMediapipeSolutionsWasm(Module),6);case 6:s.i=t.i,e.m=new OffscreenCanvas(1,1),e.i.canvas=e.m,l=e.i.GL.createContext(e.m,{antialias:!1,alpha:!1,va:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.i.GL.makeContextCurrent(l),t.h=4;break;case 7:if(e.m=document.createElement("canvas"),!(f=e.m.getContext("webgl2",{}))&&!(f=e.m.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();e.K=f,e.i.canvas=e.m,e.i.createContext(e.m,!0,!0,{});case 4:e.j=new e.i.SolutionWasm,e.ga=!1,t.h=0}}),2):3!=t.h?g(t,b(function(t){if(1==t.h){if(e.h.graph&&e.h.graph.url&&e.fa===e.h.graph.url)return t.return();if(e.u=!0,!e.h.graph||!e.h.graph.url){t.h=2;return}return e.fa=e.h.graph.url,g(t,tU(e,e.h.graph.url),3)}for(2!=t.h&&(m=t.i,e.j.loadGraph(m)),w=(C=i(Object.keys(e.D))).next();!w.done;w=C.next())v=w.value,e.j.overrideFile(v,e.D[v]);if(e.D={},e.h.listeners)for(x=(y=i(e.h.listeners)).next();!x.done;x=y.next())(function(e,t){for(var r=t.name||"$",n=[].concat(a(t.wants)),o=new e.i.StringList,s=i(t.wants),l=s.next();!l.done;l=s.next())o.push_back(l.value);s=e.i.PacketListener.implement({onResults:function(o){for(var a,s,l,d,c,u,h,p,f,m,C,w,v,y,x={},k=0;k<t.wants.length;++k)x[n[k]]=o.get(k);var M=e.listeners[r];M&&(e.I=(a=t.outs,b(function(t){switch(t.h){case 1:if(!a)return t.return(x);for(s={},l=0,c=(d=i(Object.keys(a))).next();!c.done;c=d.next())"string"!=typeof(u=a[c.value])&&"texture"===u.type&&void 0!==x[u.stream]&&++l;1<l&&(e.M=!1),c=(h=i(Object.keys(a))).next();case 2:if(c.done){t.h=4;break}if("string"==typeof(f=a[p=c.value]))return v=s,y=p,g(t,function(e,t,r){var n;return b(function(o){return"number"==typeof r||r instanceof Uint8Array||r instanceof e.i.Uint8BlobList?o.return(r):r instanceof e.i.Texture2dDataOut?((n=e.v[t])||(n=new tI(e.i,e.K),e.v[t]=n),o.return(tA(n,r,e.M))):o.return(void 0)})}(e,p,x[f]),14);if(m=x[f.stream],"detection_list"===f.type){if(m){for(var r=m.getRectList(),n=m.getLandmarksList(),o=m.getClassificationsList(),k=[],M=0;M<r.size();++M){var j=tT(r.get(M)),L=eX(j,1),N=eX(j,2),S=eX(j,3),P=eX(j,4),_=eX(j,5,0),R=void 0;R=void 0===R?0:R,j={la:{sa:L,ta:N,height:S,width:P,rotation:_,pa:eY(eO(j,6),R)},ea:eq(tE(n.get(M)),t_,1).map(tO),ba:eq(tP(o.get(M)),tj,1).map(function(e){var t=eO(e,1);return{index:null==t?0:t,qa:eX(e,2),label:null!=eO(e,3)?eY(eO(e,3),""):void 0,displayName:null!=eO(e,4)?eY(eO(e,4),""):void 0}})},k.push(j)}r=k}else r=[];s[p]=r,t.h=7;break}if("proto_list"===f.type){if(m){for(n=0,r=Array(m.size());n<m.size();n++)r[n]=m.get(n);m.delete()}else r=[];s[p]=r,t.h=7;break}if(void 0===m){t.h=3;break}if("float_list"===f.type||"proto"===f.type){s[p]=m,t.h=7;break}if("texture"!==f.type)throw Error("Unknown output config type: '"+f.type+"'");return(C=e.v[p])||(C=new tI(e.i,e.K),e.v[p]=C),g(t,tA(C,m,e.M),13);case 13:w=t.i,s[p]=w;case 7:f.transform&&s[p]&&(s[p]=f.transform(s[p])),t.h=3;break;case 14:v[y]=t.i;case 3:c=h.next(),t.h=2;break;case 4:return t.return(s)}})).then(function(r){r=M(r);for(var o=0;o<t.wants.length;++o){var i=x[n[o]];"object"==typeof i&&i.hasOwnProperty&&i.hasOwnProperty("delete")&&i.delete()}r&&(e.I=r)}))}}),e.j.attachMultiListener(o,s),o.delete()})(e,x.value);k=e.l,e.l={},e.setOptions(k),t.h=0}),3):g(t,b(function(t){switch(t.h){case 1:if(!e.u)return t.return();if(!e.F){t.h=2;break}j=(M=i(e.F)).next();case 3:if(j.done){t.h=5;break}return g(t,(0,j.value)(),4);case 4:j=M.next(),t.h=3;break;case 5:e.F=void 0;case 2:if(e.H){for(L=new e.i.GraphOptionChangeRequestList,S=(N=i(e.H)).next();!S.done;S=N.next())P=S.value,L.push_back(P);e.j.changeOptions(L),L.delete(),e.H=void 0}e.u=!1,t.h=0}}),0)})},l.overrideFile=function(e,t){this.j?this.j.overrideFile(e,t):this.D[e]=t},l.clearOverriddenFiles=function(){this.D={},this.j&&this.j.clearOverriddenFiles()},l.send=function(e,t){var r,n,o,a,s,l,d,c,u,h=this;return b(function(p){switch(p.h){case 1:if(!h.h.inputs)return p.return();return r=1e3*(null==t?performance.now():t),g(p,h.I,2);case 2:return g(p,h.initialize(),3);case 3:for(n=new h.i.PacketDataList,a=(o=i(Object.keys(e))).next();!a.done;a=o.next())if(s=a.value,l=h.h.inputs[s]){e:{var f=e[s];switch(l.type){case"video":var m=h.s[l.stream];if(m||(m=new tI(h.i,h.K),h.s[l.stream]=m),0===m.m&&(m.m=m.i.createTexture()),"undefined"!=typeof HTMLVideoElement&&f instanceof HTMLVideoElement)var C=f.videoWidth,w=f.videoHeight;else"undefined"!=typeof HTMLImageElement&&f instanceof HTMLImageElement?(C=f.naturalWidth,w=f.naturalHeight):(C=f.width,w=f.height);w={glName:m.m,width:C,height:w},(C=m.h).canvas.width=w.width,C.canvas.height=w.height,C.activeTexture(C.TEXTURE0),m.i.bindTexture2d(m.m),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,f),m.i.bindTexture2d(0),m=w;break e;case"detections":for((m=h.s[l.stream])||(m=new tZ(h.i),h.s[l.stream]=m),m.data||(m.data=new m.h.DetectionListData),m.data.reset(f.length),w=0;w<f.length;++w){C=f[w];var v=m.data,y=v.setBoundingBox,x=w,b=C.la,k=new tV;if(eU(k,1,b.sa),eU(k,2,b.ta),eU(k,3,b.height),eU(k,4,b.width),eU(k,5,b.rotation),eI(k,6,b.pa),b=k.l(),y.call(v,x,b),C.ea)for(v=0;v<C.ea.length;++v){k=C.ea[v],x=(y=m.data).addNormalizedLandmark,b=w,k=Object.assign({},k,{visibility:k.visibility?k.visibility:0});var M=new t_;eU(M,1,k.x),eU(M,2,k.y),eU(M,3,k.z),k.visibility&&eU(M,4,k.visibility),k=M.l(),x.call(y,b,k)}if(C.ba)for(v=0;v<C.ba.length;++v)x=(y=m.data).addClassification,b=w,k=C.ba[v],eU(M=new tj,2,k.qa),k.index&&eI(M,1,k.index),k.label&&eI(M,3,k.label),k.displayName&&eI(M,4,k.displayName),k=M.l(),x.call(y,b,k)}m=m.data;break e;default:m={}}}switch(d=m,c=l.stream,l.type){case"video":n.pushTexture2d(Object.assign({},d,{stream:c,timestamp:r}));break;case"detections":(u=d).stream=c,u.timestamp=r,n.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.j.send(n),g(p,h.I,4);case 4:n.delete(),p.h=0}})},l.onResults=function(e,t){this.listeners[t||"$"]=e},j("Solution",tq),j("OptionType",{BOOL:0,NUMBER:1,ua:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(l=tY.prototype).close=function(){return this.h.close(),Promise.resolve()},l.onResults=function(e){this.h.onResults(e)},l.initialize=function(){var e=this;return b(function(t){return g(t,e.h.initialize(),0)})},l.reset=function(){this.h.reset()},l.send=function(e){var t=this;return b(function(r){return g(r,t.h.send(e),0)})},l.setOptions=function(e){this.h.setOptions(e)},j("SelfieSegmentation",tY),j("VERSION","0.1.1675465747")}).call(ZQ);let ZJ=new ZH("MediaPipe"),Z1="https://stream-assets.snapcall.io",Z2=!1,Z0=new ZQ.SelfieSegmentation({locateFile:(e,t)=>{if(ZJ.debug("selfieSegmentation",e,t),Z1)return`${Z1}/mediapipe/${e}`;let r=window.location.href.split("/").slice(0,-1).join("/");return`${r}/mediapipe/${e}`}});var Z3={},Z9={};Z9=function(e,t,r){if(t===self.location.origin)return e;var n=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))};var Z5=hO("4qOVI");let Z6=Z5.getBundleURL("adfgW")+"timer.ed477f04.js";Z3=Z9(Z6,Z5.getOrigin(Z6),!1);class Z4{constructor(e,t){this.fillColor="#000000",this.type="blur",this.live=!1,this.fps=24,this.blurLevel=10,this.timerWorker=new Worker(Z3,{name:"VirtualBackgroundTimerWorker"}),this.stream=e,this.image=document.createElement("video"),this.image.style.display="none",this.image.setAttribute("autoplay",""),this.image.setAttribute("playsinline",""),this.image.setAttribute("muted",""),this.canvas=document.createElement("canvas"),this.canvas.style.display="none",t&&this.setOptions(t)}setOptions(e){this.setType(e.type),this.setFillColor(e.fillColor||this.fillColor),this.setVideoBackground(e.background),this.setBlurLevel(e.blurLevel||this.blurLevel)}setType(e){this.type=e}setBlurLevel(e){this.blurLevel=e}setVideoBackground(e){this.background=e}setFillColor(e){this.fillColor=e}drawWithBlur(e,t){e.save(),e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.filter=`blur(${this.blurLevel}px)`,e.globalCompositeOperation="destination-over",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}drawWithBackground(e,t){e.clearRect(0,0,this.canvas.width,this.canvas.height),e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="source-out",e.fillStyle=this.fillColor,this.background?e.drawImage(this.background,0,0,this.canvas.width,this.canvas.height):e.fillRect(0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}onFrame(e){this.canvas.width=e.image.width,this.canvas.height=e.image.height;let t=this.canvas.getContext("2d");if(t)switch(this.type){case"blur":default:this.drawWithBlur(t,e);break;case"background":this.drawWithBackground(t,e)}}runWithFrameCallback(){this.live&&this.image.requestVideoFrameCallback(()=>{Z0.send({image:this.image}),this.runWithFrameCallback()})}async createStream(){try{Z0.setOptions({selfieMode:!1,modelSelection:0}),ZJ.log("selfie segmentation initialized"),Z2||(await Z0.initialize(),Z2=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Z0.onResults(e=>{this.onFrame(e)}),this.timerWorker.onmessage=()=>{Z0.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){ZJ.error("createStream:play",e)}}}catch(e){console.error("createStream",e)}return this.canvas.captureStream()}clean(){return new Promise(e=>{this.live=!1,clearInterval(this.runInterval),this.image.srcObject=null,this.stream.getTracks().forEach(e=>{e.stop(),this.stream.removeTrack(e)}),this.timerWorker.terminate(),e()})}}let Z8=window.AudioContext||window.webkitAudioContext;class Z7{constructor(){this.audioSources={},this.tracks={},this.audioContext=new Z8,this.audioDestination=this.audioContext.createMediaStreamDestination()}getSetting(e){return this.tracks[e]?.getSettings()}removeTrack(e){let t=this.tracks[e];t&&(this.audioSources[e]?.disconnect(),delete this.tracks[e],delete this.audioSources[e],t.stop())}addTrack(e,t){if("audio"===t.kind){this.removeTrack(e);let r=new MediaStream([t]),n=this.audioContext.createMediaStreamSource(r);this.audioSources[e]=n,this.tracks[e]=t,this.audioDestination&&n.connect(this.audioDestination)}}getFinalTrack(){return this.audioDestination.stream.getTracks()[0]}removeAll(){Object.keys(this.tracks).forEach(e=>{this.removeTrack(e)})}}uj=function(e){var t,r,n=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}(e),o=n[0],i=n[1],a=new Br((o+i)*3/4-i),s=0,l=i>0?o-4:o;for(r=0;r<l;r+=4)t=Bt[e.charCodeAt(r)]<<18|Bt[e.charCodeAt(r+1)]<<12|Bt[e.charCodeAt(r+2)]<<6|Bt[e.charCodeAt(r+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===i&&(t=Bt[e.charCodeAt(r)]<<2|Bt[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===i&&(t=Bt[e.charCodeAt(r)]<<10|Bt[e.charCodeAt(r+1)]<<4|Bt[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a},uL=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,a=r-n;i<a;i+=16383)o.push(function(e,t,r){for(var n,o=[],i=t;i<r;i+=3)o.push(Be[(n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+Be[n>>12&63]+Be[n>>6&63]+Be[63&n]);return o.join("")}(e,i,i+16383>a?a:i+16383));return 1===n?o.push(Be[(t=e[r-1])>>2]+Be[t<<4&63]+"=="):2===n&&o.push(Be[(t=(e[r-2]<<8)+e[r-1])>>10]+Be[t>>4&63]+Be[t<<2&63]+"="),o.join("")};for(var Be=[],Bt=[],Br="undefined"!=typeof Uint8Array?Uint8Array:Array,Bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bo=0,Bi=Bn.length;Bo<Bi;++Bo)Be[Bo]=Bn[Bo],Bt[Bn.charCodeAt(Bo)]=Bo;Bt["-".charCodeAt(0)]=62,Bt["_".charCodeAt(0)]=63,uN=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,d=l>>1,c=-7,u=r?o-1:0,h=r?-1:1,p=e[t+u];for(u+=h,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+u],u+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+u],u+=h,c-=8);if(0===i)i=1-d;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=d}return(p?-1:1)*a*Math.pow(2,i-n)},uS=function(e,t,r,n,o,i){var a,s,l,d=8*i-o-1,c=(1<<d)-1,u=c>>1,h=23===o?5960464477539062e-23:0,p=n?0:i-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=h/l:t+=h*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,o),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=f,s/=256,o-=8);for(a=a<<o|s,d+=o;d>0;e[r+p]=255&a,p+=f,a/=256,d-=8);e[r+p-f]|=128*m};let Ba="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function Bs(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,Bl.prototype),t}function Bl(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return Bu(e)}return Bd(e,t,r)}function Bd(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!Bl.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|Bm(e,t),n=Bs(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(BD(e,Uint8Array)){let t=new Uint8Array(e);return Bp(t.buffer,t.byteOffset,t.byteLength)}return Bh(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(BD(e,ArrayBuffer)||e&&BD(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(BD(e,SharedArrayBuffer)||e&&BD(e.buffer,SharedArrayBuffer)))return Bp(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Bl.from(n,t,r);let o=function(e){var t;if(Bl.isBuffer(e)){let t=0|Bf(e.length),r=Bs(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?Bs(0):Bh(e):"Buffer"===e.type&&Array.isArray(e.data)?Bh(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Bl.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function Bc(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function Bu(e){return Bc(e),Bs(e<0?0:0|Bf(e))}function Bh(e){let t=e.length<0?0:0|Bf(e.length),r=Bs(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function Bp(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Bl.prototype),n}function Bf(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function Bm(e,t){if(Bl.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||BD(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return BV(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return BW(e).length;default:if(o)return n?-1:BV(e).length;t=(""+t).toLowerCase(),o=!0}}function BC(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=BO[e[n]];return o}(this,t,r);case"utf8":case"utf-8":return By(this,t,r);case"ascii":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}(this,t,r);case"base64":var o,i;return o=t,i=r,0===o&&i===this.length?uL(this):uL(this.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){let n=e.slice(t,r),o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Bg(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function Bw(e,t,r,n,o){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(i=r=+r)!=i&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return -1;r=e.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof t&&(t=Bl.from(t,n)),Bl.isBuffer(t))return 0===t.length?-1:Bv(e,t,r,n,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Bv(e,[t],r,n,o);throw TypeError("val must be string, number or Buffer")}function Bv(e,t,r,n,o){let i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(d(e,i)===d(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*a}else -1!==n&&(i-=i-n),n=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(d(e,i+n)!==d(t,n)){r=!1;break}if(r)return i}return -1}function By(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o<r;){let t=e[o],i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(i=t);break;case 2:(192&(r=e[o+1]))==128&&(l=(31&t)<<6|63&r)>127&&(i=l);break;case 3:r=e[o+1],n=e[o+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(i=l);break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],(192&r)==128&&(192&n)==128&&(192&s)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s)>65535&&l<1114112&&(i=l)}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function Bx(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function Bb(e,t,r,n,o,i){if(!Bl.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function Bk(e,t,r,n,o){BR(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function BM(e,t,r,n,o){BR(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function Bj(e,t,r,n,o,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function BL(e,t,r,n,o){return t=+t,r>>>=0,o||Bj(e,t,r,4,34028234663852886e22,-34028234663852886e22),uS(e,t,r,n,23,4),r+4}function BN(e,t,r,n,o){return t=+t,r>>>=0,o||Bj(e,t,r,8,17976931348623157e292,-17976931348623157e292),uS(e,t,r,n,52,8),r+8}Bl.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),Bl.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Bl.prototype,"parent",{enumerable:!0,get:function(){if(Bl.isBuffer(this))return this.buffer}}),Object.defineProperty(Bl.prototype,"offset",{enumerable:!0,get:function(){if(Bl.isBuffer(this))return this.byteOffset}}),Bl.poolSize=8192,Bl.from=function(e,t,r){return Bd(e,t,r)},Object.setPrototypeOf(Bl.prototype,Uint8Array.prototype),Object.setPrototypeOf(Bl,Uint8Array),Bl.alloc=function(e,t,r){return(Bc(e),e<=0)?Bs(e):void 0!==t?"string"==typeof r?Bs(e).fill(t,r):Bs(e).fill(t):Bs(e)},Bl.allocUnsafe=function(e){return Bu(e)},Bl.allocUnsafeSlow=function(e){return Bu(e)},Bl.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Bl.prototype},Bl.compare=function(e,t){if(BD(e,Uint8Array)&&(e=Bl.from(e,e.offset,e.byteLength)),BD(t,Uint8Array)&&(t=Bl.from(t,t.offset,t.byteLength)),!Bl.isBuffer(e)||!Bl.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},Bl.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Bl.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Bl.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=Bl.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){let t=e[r];if(BD(t,Uint8Array))o+t.length>n.length?(Bl.isBuffer(t)||(t=Bl.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else if(Bl.isBuffer(t))t.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=t.length}return n},Bl.byteLength=Bm,Bl.prototype._isBuffer=!0,Bl.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)Bg(this,t,t+1);return this},Bl.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)Bg(this,t,t+3),Bg(this,t+1,t+2);return this},Bl.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)Bg(this,t,t+7),Bg(this,t+1,t+6),Bg(this,t+2,t+5),Bg(this,t+3,t+4);return this},Bl.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?By(this,0,e):BC.apply(this,arguments)},Bl.prototype.toLocaleString=Bl.prototype.toString,Bl.prototype.equals=function(e){if(!Bl.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===Bl.compare(this,e)},Bl.prototype.inspect=function(){let e="";return e=this.toString("hex",0,50).replace(/(.{2})/g,"$1 ").trim(),this.length>50&&(e+=" ... "),"<Buffer "+e+">"},Ba&&(Bl.prototype[Ba]=Bl.prototype.inspect),Bl.prototype.compare=function(e,t,r,n,o){if(BD(e,Uint8Array)&&(e=Bl.from(e,e.offset,e.byteLength)),!Bl.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;let i=o-n,a=r-t,s=Math.min(i,a),l=this.slice(n,o),d=e.slice(t,r);for(let e=0;e<s;++e)if(l[e]!==d[e]){i=l[e],a=d[e];break}return i<a?-1:a<i?1:0},Bl.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},Bl.prototype.indexOf=function(e,t,r){return Bw(this,e,t,r,!0)},Bl.prototype.lastIndexOf=function(e,t,r){return Bw(this,e,t,r,!1)},Bl.prototype.write=function(e,t,r,n){var o,i,a,s,l,d,c,u;if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let o;r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let a=t.length;for(n>a/2&&(n=a/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(n!=n)break;e[r+o]=n}return o}(this,e,t,r);case"utf8":case"utf-8":return o=t,i=r,BT(BV(e,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return a=t,s=r,BT(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return l=t,d=r,BT(BW(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,u=r,BT(function(e,t){let r,n;let o=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(e,this.length-c),this,c,u);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},Bl.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Bl.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,Bl.prototype),n},Bl.prototype.readUintLE=Bl.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},Bl.prototype.readUintBE=Bl.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},Bl.prototype.readUint8=Bl.prototype.readUInt8=function(e,t){return e>>>=0,t||Bx(e,1,this.length),this[e]},Bl.prototype.readUint16LE=Bl.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Bx(e,2,this.length),this[e]|this[e+1]<<8},Bl.prototype.readUint16BE=Bl.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Bx(e,2,this.length),this[e]<<8|this[e+1]},Bl.prototype.readUint32LE=Bl.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Bl.prototype.readUint32BE=Bl.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Bl.prototype.readBigUInt64LE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Bz(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],o=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),Bl.prototype.readBigUInt64BE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Bz(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],o=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),Bl.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},Bl.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||Bx(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},Bl.prototype.readInt8=function(e,t){return(e>>>=0,t||Bx(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},Bl.prototype.readInt16LE=function(e,t){e>>>=0,t||Bx(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Bl.prototype.readInt16BE=function(e,t){e>>>=0,t||Bx(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Bl.prototype.readInt32LE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Bl.prototype.readInt32BE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Bl.prototype.readBigInt64LE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Bz(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+16777216*this[++e])}),Bl.prototype.readBigInt64BE=BI(function(e){BH(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Bz(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(16777216*this[++e]+65536*this[++e]+256*this[++e]+r)}),Bl.prototype.readFloatLE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),uN(this,e,!0,23,4)},Bl.prototype.readFloatBE=function(e,t){return e>>>=0,t||Bx(e,4,this.length),uN(this,e,!1,23,4)},Bl.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Bx(e,8,this.length),uN(this,e,!0,52,8)},Bl.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Bx(e,8,this.length),uN(this,e,!1,52,8)},Bl.prototype.writeUintLE=Bl.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;Bb(this,e,t,r,n,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},Bl.prototype.writeUintBE=Bl.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;Bb(this,e,t,r,n,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},Bl.prototype.writeUint8=Bl.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,1,255,0),this[t]=255&e,t+1},Bl.prototype.writeUint16LE=Bl.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Bl.prototype.writeUint16BE=Bl.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Bl.prototype.writeUint32LE=Bl.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Bl.prototype.writeUint32BE=Bl.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Bl.prototype.writeBigUInt64LE=BI(function(e,t=0){return Bk(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),Bl.prototype.writeBigUInt64BE=BI(function(e,t=0){return BM(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),Bl.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);Bb(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},Bl.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);Bb(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},Bl.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Bl.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Bl.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Bl.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Bl.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||Bb(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Bl.prototype.writeBigInt64LE=BI(function(e,t=0){return Bk(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Bl.prototype.writeBigInt64BE=BI(function(e,t=0){return BM(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Bl.prototype.writeFloatLE=function(e,t,r){return BL(this,e,t,!0,r)},Bl.prototype.writeFloatBE=function(e,t,r){return BL(this,e,t,!1,r)},Bl.prototype.writeDoubleLE=function(e,t,r){return BN(this,e,t,!0,r)},Bl.prototype.writeDoubleBE=function(e,t,r){return BN(this,e,t,!1,r)},Bl.prototype.copy=function(e,t,r,n){if(!Bl.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},Bl.prototype.fill=function(e,t,r,n){let o;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!Bl.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{let i=Bl.isBuffer(e)?e:Bl.from(e,n),a=i.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};let BS={};function BP(e,t,r){BS[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B_(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function BR(e,t,r,n,o,i){if(e>r||e<t){let n;let o="bigint"==typeof t?"n":"";throw n=i>3?0===t||t===BigInt(0)?`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:`>= ${t}${o} and <= ${r}${o}`,new BS.ERR_OUT_OF_RANGE("value",n,e)}BH(o,"offset"),(void 0===n[o]||void 0===n[o+i])&&Bz(o,n.length-(i+1))}function BH(e,t){if("number"!=typeof e)throw new BS.ERR_INVALID_ARG_TYPE(t,"number",e)}function Bz(e,t,r){if(Math.floor(e)!==e)throw BH(e,r),new BS.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new BS.ERR_BUFFER_OUT_OF_BOUNDS;throw new BS.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}BP("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),BP("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),BP("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?o=B_(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=B_(o)),o+="n"),n+=` It must be ${t}. Received ${o}`},RangeError);let BE=/[^+/0-9A-Za-z-_]/g;function BV(e,t){let r;t=t||1/0;let n=e.length,o=null,i=[];for(let a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function BW(e){return uj(function(e){if((e=(e=e.split("=")[0]).trim().replace(BE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function BT(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length)&&!(o>=e.length);++o)t[o+r]=e[o];return o}function BD(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let BO=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function BI(e){return"undefined"==typeof BigInt?BA:e}function BA(){throw Error("BigInt not supported")}let BZ=async(e,{token:t,base64Image:r,session_id:n,user_id:o,peer_id:i,stepToken:a})=>{let s=`${AF()}.jpeg`,l=Bl.from(String(r).replace(/^data:image\/\w+;base64,/,""),"base64"),{url:d,headers:c}=await fetch(`${e}/streams/${t}/snapshot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:s,contentLength:l.length})}).then(e=>e.json());await fetch(d,{method:"PUT",headers:{...c,"Content-Type":"image/*","Content-Length":l.length},body:l});let u=await fetch(`${e}/public/streams/${t}/snapshot-event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepToken:a,filename:s,peer_id:i,session_id:n,user_id:o})}).then(e=>e.json());return{url:u.url,assetId:u.id}},BB=(e,t=300)=>{let r,n,o;return function(){let i=this,a=arguments;r?(clearTimeout(n),n=setTimeout(()=>{Date.now()-o>=t&&(e.apply(i,a),o=Date.now())},Math.max(t-(Date.now()-o),0))):(e.apply(i,a),o=Date.now(),r=!0)}},BF=new ZH("StreamerClient"),Bq={WEBRTC_FAILED:"WRTC1",WEBRTC_RECOVER_ERROR:"WRTC2",CREATE_TRANSPORT_FAILED:"TRANS1",CONSUME_ERROR:"CONS1",SOCKET_LOST:"SOCK1",USER_LIMIT:"USERLIMIT"},BU={qvga:{width:{ideal:320},height:{ideal:240},qualityIndex:3},vga:{width:{ideal:640},height:{ideal:480},qualityIndex:2},hd:{width:{ideal:1280},height:{ideal:720},qualityIndex:1}};class B$ extends CustomEvent{constructor(e,t){super(e,t)}}let BY=EventTarget,BX={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10},BG=new class extends BY{constructor(){super(),this.mediasoupTransport={},this.mediaPipeOption=BX,this.useVideoBackground=!1,this.waitingRoomAccess=!1,this.pendingDeviceRequest={},this.joinOptions={},this.devicesList=[],this.plan=void 0,this.permissions=[],this.onAudioLevel=BB(e=>{let t=new B$("audioLevel",{cancelable:!0,bubbles:!0,detail:{audioLevel:e}});this.dispatchEvent(t)},1e3),navigator.mediaDevices.addEventListener("devicechange",()=>this.onDeviceChange()),this.config={streamApiURL:String("https://apistream.snapcall.io"),apiUrl:String("https://api.snapcall.io/v2"),streamerServer:String("wss://g.snapcall.io/stream"),streamerApi:String("https://g.snapcall.io/stream"),iceServers:[{urls:"turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp,turn:t.snapcall.io:80?transport=tcp,turn:t2.snapcall.io:80?transport=tcp,turn:t.snapcall.io:80?transport=udp,turn:t2.snapcall.io:80?transport=udp".split(",")||[],username:"test",credential:"test"}]},this.peers=new Map,this.consumers=new Map,this.webcams=new Map,this.webcam={device:null,resolution:"hd"},this.webcamTrack=null,this.webcamZoom={available:!1,min:0,max:0},this.muted=!1,this.roomId="",this.companyId=0,this.peerId="",this.clientId=this.setClientId(),this.webcamProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){let e=[];return this.peers.forEach((t,r)=>{let n={microphone:{enabled:!1,muted:!1},camera:{enabled:!1},screenshare:{enabled:!1}};t.producersData.forEach(e=>{"microphone"===e.deviceType?n.microphone.enabled=!0:"screen"===e.deviceType?n.screenshare.enabled=!0:"webcam"===e.deviceType&&(n.camera.enabled=!0)}),e.push({peerId:r,profile:t.profile,deviceState:n})}),{roomId:this.roomId,waitingRoomAccess:this.waitingRoomAccess,companyId:this.companyId,company:this.company,plan:this.plan,permissions:this.permissions,peerId:this.peerId,profile:this.profile,joinOptions:this.joinOptions,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){let e=new B$("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e)}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){let e=new B$("localStopSpeak",{detail:{}});this.dispatchEvent(e)}}onCriticalError(e){let t=new B$("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){let t=this.config.streamerApi,{token:r}=await fetch(`${t}/stream`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({bid:e})}).then(e=>e.json());return r}setClientId(){let e="stream-ui-client-id";try{let t=localStorage.getItem(e);if(t)return t;let r=AF();return localStorage.setItem(e,r),r}catch(e){return console.warn(e),AF()}}async init(e=this.roomId,t=this.joinOptions){let r,n;let o={flow:void 0,flowV0:void 0};if(this.roomId=e,this.peerId=AF(),this.joinOptions=t,!this.roomId)throw Error("Missing room ID");try{let n=new URLSearchParams;t.flowToken&&n.append("flowToken",t.flowToken),t.languageCode&&n.append("languageCode",t.languageCode);let{streamer_instance:i,plan:{permissions:a,name:s},flow:l,flow_v0:d,recordings:c,company_id:u,company:h,defaultPublicPage:p}=await fetch(`${this.config.apiUrl}/streams/${e}/info?${n}`,{method:"get",headers:{"Content-Type":"application/json"}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid room ID")});d&&(o.flowV0=d),l&&l.steps.length>0&&(t.recorder=!0,this.joinOptions.recorder=!0,o.flow=l),this.companyId=u,this.company=h,this.permissions=a,this.defaultPublicPage=p,(c?.headless===!0||c?.video===!0)&&a.push("record_video_on_demand"),this.plan=s;let f=new URLSearchParams({peerId:this.peerId,clientId:this.clientId,roomId:e});t.authKey&&f.append("authKey",t.authKey);let m=this.joinOptions.recorder?"/recorder":"";r=`${this.config.streamerServer}/${i}/v2/${m}?${f}`}catch(t){console.error("init",t);let e=new B$("invalidRoom",{detail:{}});this.dispatchEvent(e)}if(!r)throw Error("Invalid socket URL");this.protooTransport=new ux(r,{retry:{retries:0}}),this.protoo=new uy(this.protooTransport);let i=!1,a=e=>{};return this.protoo.on("open",async()=>{if(this.joinOptions.apiKey&&await this.setAgentIdentity({apiKey:this.joinOptions.apiKey,email:this.joinOptions.email}).catch(e=>{BF.error("onOpen","failed auth",e)}),i=!0,a(),this.joinOptions.recorder){await this.joinRecorder();return}}),this.protoo.on("failed",()=>{n=Error("failure"),a(n),BF.error("protoo.on","failed"),this.onCriticalError(Bq.SOCKET_LOST)}),this.protoo.on("disconnected",()=>{BF.error("protoo.on","disconnected"),this.onCriticalError(Bq.SOCKET_LOST)}),this.protoo.on("close",()=>BF.log("protoo.on","close :(")),this.protoo.on("notification",async e=>{if(BF.log("notification",e),"error"===e.method)e.data?.reason==="reached user limit"&&this.onCriticalError(Bq.USER_LIMIT);else if("newPeer"===e.method){let{id:t,profile:r,muted:n}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,muted:n,producersData:[]});let o=new B$("newPeer",{detail:{peerId:t,displayName:r.name,profile:r,muted:n}});this.dispatchEvent(o)}else if("newProducer"===e.method){let{peerId:t,producerId:r,deviceType:n,paused:o}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:o})}else if("peerClosed"===e.method){let{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach(e=>{this.onConsumerClose({consumerId:e.id})});let n=new B$("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){let{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("recordStopped"===e.method)this.dispatchEvent(new B$("recordStopped",{detail:e.data}));else if("displayName"===e.method){let{peerId:t,displayName:r}=e.data,n=new B$("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){let{peerId:t,profile:r}=e.data,n=new CustomEvent("profileUpdate",{detail:{peerId:t,profile:r}});this.dispatchEvent(n)}else if("requestDevice"===e.method){this.pendingDeviceRequest[e.data.requestId]=e.data;let t=new B$("requestDevice",{detail:e.data});this.dispatchEvent(t)}else if("startSpeak"===e.method);else if("stopSpeak"===e.method);else if("producerPaused"===e.method||"producerResumed"===e.method){let{peerId:t,producerId:r,deviceType:n}=e.data;if(e.data?.deviceType==="microphone"){let n=this.peers.get(t)?.producersData.find(e=>r===e.producerId);n&&(n.paused="producerPaused"===e.method)}let o=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){o=e.mediaSoupConsumer.id;break}let i=new B$("producerPaused"===e.method?"mediaPause":"mediaResume",{detail:{mediaId:o,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(i)}else if("mute"===e.method){let{peerId:t,device:r}=e.data,n=new B$("mediaPause",{detail:{peerId:t,deviceType:r,paused:!0}});this.dispatchEvent(n)}else if("unmute"===e.method){let{peerId:t,device:r}=e.data,n=new B$("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestAccessResult"===e.method){e.data.success&&this.onEnterRoom();let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("cancelAccessRequest"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("accessRequest"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("requestDeviceResult"===e.method){let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();let t=new B$(e.method,{detail:e.data});this.dispatchEvent(t)}else if("videoRecordingStarted"===e.method||"videoRecordingStopped"===e.method||"videoRecordingRequested"===e.method){let t=new B$(e.method,{detail:{}});this.dispatchEvent(t)}else if("customMessage"===e.method){let{messageId:t,chunk:r,chunkIndex:n,totalChunks:o}=e.data.event,i=this.customMessages.get(t);i?i.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:o});let a=this.customMessages.get(t);if(a&&a.totalChunks===a.chunks.length){let r=JSON.parse(a.chunks.sort((e,t)=>e.index-t.index).reduce((e,t)=>e+t.data,"")),n=new B$("customMessage",{detail:{...e.data,event:r}});this.dispatchEvent(n),this.customMessages.delete(t)}}}),await new Promise((e,t)=>{a=r=>{if(a=()=>{},r)return t(r);e()},i&&a(n)}),o}closeWebrtcTransport(e){let t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup||!this.protoo)throw Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{let n=this.streamerMediasoup.createTransport(this.protoo,t);r={disconnectTimeout:void 0,kind:e,createPromise:n},this.mediasoupTransport[`${e}-${t}`]=r,r.transport=await n,r.transport&&this.listenWebRTCTransportStates(r)}catch(e){throw this.onCriticalError(Bq.CREATE_TRANSPORT_FAILED),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",t=>{if(e.transport&&!e.transport.closed){if(BF.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout(()=>{BF.log("listenWebRTCTransportStats",`trying to restart transport for ${e.kind}`),e.transport&&this.restartIce(e.transport)},5e3);else if("connected"===t)clearTimeout(e.disconnectTimeout);else if("failed"===t){let t=Error(`webRTC transport state failed for ${e.kind}`);BF.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Bq.WEBRTC_FAILED)}}})}async setAgentIdentity({apiKey:e,email:t}){if(e){this.joinOptions.apiKey=e,this.joinOptions.email=t;try{e&&t?this.agentIdentity=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(this.agentIdentity=await this.fetchUserInfo({apiKey:e})),await this.protoo?.request("authenticate",{apiKey:e,email:t}),this.agentIdentity&&this.dispatchEvent(new B$("agentIdentity",{detail:{success:!0,email:this.agentIdentity.email,name:this.agentIdentity.name,avatarUrl:this.agentIdentity.settings?.avatar_url}}))}catch(e){BF.warn("setAgentIdentity",e),this.dispatchEvent(new B$("agentIdentity",{detail:{success:!1}}))}}}async acceptAccessRequest(e){if(!this.protoo)throw Error("not connected");await this.protoo.request("acceptAccessRequest",{id:e})}async setStep(e){if(!this.protoo)throw Error("not connected");this.stepToken=e,await this.protoo.request("step",{token:e})}async denyAccessRequest(e){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("denyAccessRequest",{id:e})}async requestRoomAccess(){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("requestAccess"),this.waitingRoomAccess=!0}async joinRoom(){if(!this.protoo)throw Error("stream client not initiated");await this.protoo.request("join"),await this.onEnterRoom(),this.agentIdentity&&this.dispatchEvent(new B$("agentIdentity",{detail:{success:!0,email:this.agentIdentity.email,name:this.agentIdentity.name,avatarUrl:this.agentIdentity.settings?.avatar_url}}))}async getRoomPeers(){if(!this.protoo)throw Error("stream client not initiated");return await this.protoo.request("getRoomPeers")}async onEnterRoom(){if(!this.protoo)throw Error("stream client not initiated");this.streamerMediasoup=await ZK.create(this.protoo,this.config);let{peers:e,videoRecordStarted:t,videoRecording:r,waitingRequests:n}=await this.protoo.request("getRoomPeers");this.peers=new Map(e.map(e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}]));let o=await this.getCallId();this.dispatchEvent(new B$("enterRoom",{detail:{waitingRequests:n,videoRecording:r,videoRecordStarted:t,peerId:this.peerId,peers:e.map(e=>({...e,peerId:e.id||e.peerId})),callId:o,plan:this.plan,permissions:this.permissions}})),BF.log("joinRoom","peers",e),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),e.forEach(e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})})}async joinRecorder(){if(!this.protoo)throw Error("stream client not initiated");this.streamerMediasoup=await ZK.create(this.protoo,this.config);let e=await this.getCallId();this.joinOptions.apiKey&&this.setAgentIdentity({apiKey:this.joinOptions.apiKey}),this.dispatchEvent(new B$("enterRoom",{detail:{videoRecording:{started:!1,requested:!1},videoRecordStarted:!1,peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions,waitingRequests:[]}}))}async switchMicrophone(e){try{BF.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.audioMedia?.removeTrack("mic"),this.micProducer?.track?.stop(),BF.log("switchMicrophone","stopping previous track"));let t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new ZV(t,this),this.audioLevel.analyse(),this.audioMedia=this.audioMedia||new Z7;let r=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",r),await this.micProducer?.replaceTrack({track:r}),BF.log("switchMicrophone","switched Microphone")}catch(e){BF.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){let e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;let t=new B$("microphoneMute",{detail:{}});this.dispatchEvent(t),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){BF.log("onDeviceChange","detecting device change");let e=new B$("devicesListChange",{detail:{}});if(this.dispatchEvent(e),this.protoo&&!this.protoo.closed&&this.micProducer){let e=await navigator.mediaDevices.enumerateDevices(),t=e.filter(e=>"audioinput"===e.kind);if(0===t.length){BF.warn("onDeviceChange","no audio input device"),await this.closeMicrophoneProducer();return}let r=t.find(e=>"default"===e.deviceId);if(r){let t=e.filter(e=>!this.devicesList.find(t=>t.deviceId===e.deviceId&&t.label===e.label));BF.log("onDeviceChange",t),this.devicesList=e;let n=!!t.find(e=>"audioinput"===e.kind);if(0!==t.length&&!1===n){BF.warn("onDeviceChange","no audio input change");return}if(BF.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){let e=new B$("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),BF.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone({deviceId:e}={}){if(!this.micProducer||this.micProducer?.closed){let t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();let r=await this.getTransport("audio","send");this.audioLevel=new ZV(t,this),this.audioLevel.analyse(),this.audioMedia=this.audioMedia||new Z7;let n=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",n);let o=await r.produce({track:this.audioMedia.getFinalTrack(),codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:"microphone"}});o.on("transportclose",()=>{BF.log("enableMicrophone","micproducer transportclose")}),n.addEventListener("ended",()=>{BF.log("enableMicrophone","track ended!")}),o.on("trackended",async()=>{BF.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()}),this.micProducer=o,this.muted=!1;let i=new B$("microphoneEnabled",{detail:{}});this.dispatchEvent(i)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0,this.protoo?.notify("mute",{device:"microphone"});let e=new B$("microphoneMute",{detail:{}});this.dispatchEvent(e)}}unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),this.muted=!1,this.protoo?.notify("unmute",{device:"microphone"});let e=new B$("microphoneUnmute",{detail:{}});this.dispatchEvent(e)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){for(let e in BF.log("release"),this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=void 0),this.audioMedia?.removeAll(),this.audioMedia=void 0,this.webcamTrack?.stop(),this.webcamTrack=null,this.protooTransport?.close(),this.protoo?.close(),this.micProducer?.close(),this.screenshareVideoProducer?.close(),this.webcamProducer?.close(),this.consumers.forEach(e=>{e.mediaSoupConsumer.close()}),this.consumers.clear(),this.audioLevel?.release()}endCall(){this.release();let e=new B$("leaveRoom",{detail:{}});this.dispatchEvent(e);let t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){if(!this.protoo)throw Error("stream client not initiated");this.protoo.request("terminateRoom")}async updateWebcams(){for(let e of(this.webcams=new Map,await navigator.mediaDevices.enumerateDevices()))"videoinput"===e.kind&&this.webcams.set(e.deviceId,e);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);let e=new B$("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(e)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach(n=>{let o=this.pendingDeviceRequest[n];e===o.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo?.notify("requestDeviceResult",{result:!!t,failure:r,...o}))})}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,!!r,n?.name),n)throw n;return r}}async restartIce(e){if(BF.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed&&this.protoo)try{let t=await this.protoo.request("restartIce",{transportId:e.id});BF.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(e){this.onCriticalError(Bq.WEBRTC_RECOVER_ERROR),BF.log("restartIce","restartIceFailed",e)}}scaleVideoMediasConstraintsParameter(e){let t=BU.hd;2===e?t=BU.vga:e>2&&(t=BU.qvga),(!this.webcam.resolution||BU[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(BF.log("scaleVideoMediasConstraintsParameter",`scaling video by ${e}`,t),this.webcamProducer?.track?.applyConstraints(t))}scaleVideoEncodingsParameter(){if(!this.useVideoBackground)try{let e=0;this.consumers.forEach(t=>{"video"===t.mediaSoupConsumer.kind&&e++}),this.screenshareVideoProducer&&!this.screenshareVideoProducer.closed&&e++;let t={scaleResolutionDownBy:1};if(e>=3&&(t={scaleResolutionDownBy:2}),e>=9&&(t={scaleResolutionDownBy:4}),!ZI.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(BF.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch(e=>{BF.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)}))}catch(e){BF.error("scaleVideoEncodingsParameter","scaleVideo error",e)}}setVideoBackground(e){this.mediaPipe?.setOptions(e),this.mediaPipeOption=e}async initVideoBackground(){if(!this.permissions.find(e=>"virtual_background"===e))throw Error("feature not allowed");!0!==this.useVideoBackground&&(this.useVideoBackground=!0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async stopVideoBackground(){!1!==this.useVideoBackground&&(this.useVideoBackground=!1,await this.mediaPipe?.clean(),this.mediaPipe=void 0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async switchWebcam({device:e,resolution:t,rotate:r,frameRate:n,facingMode:o}){if(!this.webcam.device)throw Error("no webcam devices");let i={};if(r){if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",i.facingMode=this.webcam.facingMode;else{let e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknown",r=e.indexOf(t);r<e.length-1?r++:r=0;let n=this.webcams.get(e[r]);if(!n)throw Error("no webcam device");this.webcam.device=n,i.deviceId={ideal:this.webcam.device?.deviceId}}}else o?(this.webcam.facingMode=o,i.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,i.deviceId={ideal:this.webcam.device.deviceId});this.webcam.resolution=t||this.webcam.resolution||"hd",this.webcam.framerate=n||this.webcam.framerate;let a=BU[t||this.webcam.resolution];this.useVideoBackground&&(a={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await this.webcamProducer?.replaceTrack?.({track:null}).catch(e=>{BF.error("switchCamera","clean track failed",e)});let s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{...i,...a}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Z4(s,this.mediaPipeOption));let l=await this.mediaPipe?.createStream()||s;if(!await this.getTransport("video","send"))throw Error("video transport not found, can not switch");let d=l.getVideoTracks()[0];this.webcamTrack=d,await this.webcamProducer?.replaceTrack?.({track:d});let c=await d.getCapabilities?.()||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:!!c?.zoom,min:c?.zoom?.min||0,max:c?.zoom?.max||0};let u=new B$("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(u)}async enableVideo(e){await this.updateWebcams();let t={};if(e?.facingMode?(t.facingMode=e.facingMode,this.webcam.facingMode=e.facingMode):(e?.device&&(this.webcam.device=e.device),t.deviceId={ideal:this.webcam.device?.deviceId}),!this.webcam.device)throw Error("no webcam devices");this.webcam.resolution=e?.resolution||this.webcam.resolution||"hd",this.webcam.framerate=e?.frameRate||this.webcam.framerate;let r=BU[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(r={width:{ideal:560},height:{ideal:400},qualityIndex:2});let n=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:e?.frameRate,...t,...r}}));if(e?.facingMode)try{let e=n.getVideoTracks()[0].getCapabilities();if(!e?.facingMode||0===e.facingMode.length)throw Error("no facing mod")}catch{this.webcam.device=this.webcams.values().next().value,this.webcam.facingMode=void 0}this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Z4(n,this.mediaPipeOption));let o=await this.mediaPipe?.createStream()||n;await this.updateWebcams();let i=await this.getTransport("video","send"),a=o.getVideoTracks()[0];this.webcamTrack=a;let s=await a.getCapabilities?.()||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:!!s?.zoom,min:s?.zoom?.min||0,max:s?.zoom?.max||0},s.focusMode&&a.applyConstraints({advanced:[{focusMode:"continuous"}]}),this.webcamProducer=await i.produce({track:a,encodings:void 0,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",()=>{this.webcamProducer=null}),this.webcamProducer.on("trackended",()=>{this.disableVideo().catch(()=>{})});let l=new B$("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(l)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw Error("Webcam zoom is not available");if(!this.webcamTrack)throw Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw Error("Webcam zoom is not available");if(!this.webcamTrack)throw Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:this.webcamZoom.min}]})}async disableVideo(){if(!this.webcamProducer)return;this.webcamProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;let e=new B$("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(e={audioTransportOption:"classic"}){if(!this.permissions.find(e=>"screen_sharing"===e))throw Error("feature not allowed");if("mix"===e.audioTransportOption&&!this.micProducer)throw Error("microphone not activated and audio mix transport requested");let t=e.mediaStream;if(t||(t=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:"none"!==e.audioTransportOption,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}))),!t)return;let r="screen",n=await this.getTransport("audio","send"),o=t.getAudioTracks()[0];if(o){if("classic"===e.audioTransportOption)this.screenshareAudioProducer=await this.streamerMediasoup?.produceAudio(n,o,{deviceType:r,share:!0}),this.screenshareVideoProducer?.on("transportclose",()=>{this.screenshareVideoProducer=void 0});else if("mix"===e.audioTransportOption){this.audioMedia=this.audioMedia||new Z7,this.audioMedia.addTrack("screen",o);let e=this.audioMedia.getFinalTrack();e&&this.micProducer&&this.micProducer.replaceTrack({track:e})}}let i=t.getVideoTracks()[0],a=await this.getTransport("video","send");this.screenshareVideoProducer=await this.streamerMediasoup?.produceVideo(a,i,{deviceType:r,share:!0}),this.screenshareVideoProducer?.on("transportclose",()=>{this.screenshareVideoProducer=void 0}),this.screenshareVideoProducer?.on("trackended",()=>{this.disableScreenshare().catch(()=>{})});let s=new B$("screenshareEnabled",{detail:{}});this.dispatchEvent(s)}async disableScreenshare(){this.screenshareVideoProducer&&(this.screenshareVideoProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareVideoProducer.id}),this.screenshareVideoProducer=void 0),this.audioMedia?.removeTrack("screen"),this.screenshareAudioProducer&&(this.screenshareAudioProducer.close(),this.protoo?.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareAudioProducer.id}),this.screenshareAudioProducer=void 0);let e=new B$("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){let t=this.consumers.get(e);if(t){let r=t.mediaSoupConsumer.producerId;this.peers.forEach(e=>{let t=e.producersData.findIndex(e=>e.producerId===r);-1!==t&&e.producersData.splice(t,1)}),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();let n=new B$("mediaStop",{detail:{mediaId:e,peerId:String(t.mediaSoupConsumer.appData.peerId),deviceType:t.deviceType,paused:!1}});"microphone"===t.deviceType&&this.deleteAudioRenderer(e),this.dispatchEvent(n)}}requestVideo({mediaId:e,element:t}){BF.info("requestVideo");let r=this.consumers.get(e);if(r){let e=new MediaStream;e.onremovetrack=()=>BF.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>BF.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else BF.error("requestVideo",`Video consumer ${r} not found`)}async saveCapture(e){return BZ(this.config.apiUrl,{token:this.roomId,base64Image:e,peer_id:this.peerId,user_id:this.agentIdentity?.id,stepToken:this.stepToken})}async deleteCapture(e){return await this.protoo?.request("deleteCapture",{assetId:e})}async captureVideo(e){if(this.permissions.find(e=>"instant_picture"===e)){let t;if(e)t=await ZD(e);else if(this.webcamProducer&&this.webcamProducer.track)t=await ZO(this.webcamProducer.track);else throw Error("no video to capture");return t}throw Error("feature not allowed")}requestLocalVideo(e){if(BF.info("requestLocalVideo"),this.webcamProducer){let t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;let r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareVideoProducer){let t=new MediaStream;t.addTrack(this.screenshareVideoProducer.track),e.srcObject=t}else BF.log("requestLocalScreenshare","screenshare producer not available yet")}consumePeer({peerId:e,producersData:t}){t.forEach(t=>{this.consumeProducer({peerId:e,producerId:t.producerId,deviceType:t.deviceType,paused:t.paused})})}async consumeProducer({peerId:e,producerId:t,deviceType:r,paused:n}){try{let o="microphone"===r?"audio":"video",i=await this.getTransport(o,"recv"),a=await this.protoo?.request("consume",{peerId:e,producerId:t,transportId:i.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});let{producerId:l,id:d,kind:c,rtpParameters:u,appData:h}=a;BF.log("consumeProducer","Data: ",a);let p=await i.consume({id:d,producerId:l,kind:c,rtpParameters:u,appData:{...h,peerId:e}});BF.log("transport",i),BF.log("consumer",p),this.consumers.set(p.id,{mediaSoupConsumer:p,deviceType:r}),this.scaleVideoEncodingsParameter();let f=new B$("mediaStart",{detail:{peerId:e,mediaId:p.id,deviceType:r,paused:!!s&&s.muted}});if(this.dispatchEvent(f),"audio"===p.kind){let e=this.createAudioRenderer(p.id),t=new MediaStream;t.addTrack(p.track),e.setSource(t),e.play()}"video"===p.kind&&await this.protoo?.request("resumeConsumer",{consumerId:p.id})}catch(e){this.onCriticalError(Bq.CONSUME_ERROR),BF.error("consumeProducer","newConsumer request failed",e)}}async setDisplayName(e){await this.setProfile({name:e});let t=new B$("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){let t=await this.protoo?.request("setProfile",e);this.joinOptions.profile=e,this.profile={...t};let r=new B$("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){if(!this.permissions.find(e=>"request_input"===e))throw Error("feature not allowed");return this.protoo?.request("requestPeerDevice",{remotePeerId:e,deviceType:t})}denyDeviceRequest(e){this.resolvePendingDeviceRequest(e,!1,"user denied permission")}async getCallId(){try{let{callId:e}=await this.protoo?.request("getCallId");return e}catch(e){throw BF.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){let e=!!this.micProducer&&!this.micProducer.closed,t=!!this.webcamProducer&&!this.webcamProducer.closed,r=!!this.screenshareVideoProducer&&!this.screenshareVideoProducer.closed;return{microphone:{enabled:e,muted:this.muted},camera:{enabled:t},screenshare:{enabled:r}}}getCustomMessageEventChunks(e){let t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e+=9e4)r.push(t.substring(e,e+9e4));return r}async sendCustomMessageToAll(e){let t=AF(),r=this.getCustomMessageEventChunks(e),n=r.map((e,n)=>this.protoo?.notify("customMessageToAllPeers",{messageId:t,chunkIndex:n,chunk:e,totalChunks:r.length}));await Promise.all(n)}async sendCustomMessage(e,t){let r=AF(),n=this.getCustomMessageEventChunks(t),o=n.map((t,o)=>this.protoo?.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:o,chunk:t,totalChunks:n.length}}));await Promise.all(o)}async listAudioDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind||"audiooutput"===e.kind)}async listVideoDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter(e=>"videoinput"===e.kind)}isListDevicesSupported(){return!!navigator.mediaDevices?.enumerateDevices}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.audioMedia?.getSetting("mic")||this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){let e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){let e=t.getSink();if(e)return e}return"default"}async setWebcamResolution(e){if(this.webcam.device)await this.switchWebcam({resolution:e});else{this.webcam.resolution=e;let t=new B$("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){let t=new ZT({consumerId:e});return this.audioRenderers[e]=t,t}deleteAudioRenderer(e){this.audioRenderers[e]?.destroy(),delete this.audioRenderers[e]}async playAudioRenderer(e){await this.audioRenderers[e]?.play()}async setAudioSink(e){let t=Object.keys(this.audioRenderers).map(t=>this.audioRenderers[t].setSink(e).catch(e=>BF.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)));await Promise.allSettled(t)}dispatchEvent(e){let t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){let r=this.config.apiUrl;return await fetch(`${r}/agents/${t}`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid agent info")})}async fetchUserInfo({apiKey:e}){let t=this.config.apiUrl;return await fetch(`${t}/users/me`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then(e=>{if(e.ok)return e.json();throw Error("Invalid user info")})}setConfig(e){this.config={...this.config,...e}}getPermissions(){return this.permissions}async startRecord(){await this.protoo?.request("startRecord")}async stopRecord(){await this.protoo?.request("stopRecord")}async getPublicPage(e){return(await fetch(`${this.config.apiUrl}/public/public-pages/${e}`,{method:"get",headers:{"Content-Type":"application/json"}})).json()}};var p4=hO("85Hg2");let BK=(0,p4.createContext)({});var p4=hO("85Hg2");(w=uP||(uP={}))[w.SET_STREAMS=0]="SET_STREAMS",w[w.ADD_STREAM=1]="ADD_STREAM",w[w.REMOVE_STREAM=2]="REMOVE_STREAM",w[w.DEVICE_UPDATE=3]="DEVICE_UPDATE",w[w.MUTE=4]="MUTE",w[w.UNMUTE=5]="UNMUTE",w[w.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",w[w.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",w[w.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",w[w.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";let BQ={streams:[],highlightedTile:null},BJ=(e,t)=>{switch(t.type){case 0:return{...e,streams:t.payload};case 1:if(e.streams.find(e=>e.id===t.payload.id))return e;return{...e,streams:[...e.streams,t.payload]};case 2:return{...e,streams:[...e.streams.filter(e=>e.id!==t.payload.id)]};case 3:{let{streamId:r,mediaId:n,device:o,available:i,paused:a}=t.payload;return{...e,streams:e.streams.map(e=>{if(e.id===r){let t=e.muted;return"microphone"===o&&(t=a),{...e,[o]:i?n:null,muted:t}}return e})}}case 4:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,muted:!0}:e)};case 5:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,muted:!1}:e)};case 6:return{...e,highlightedTile:t.payload};case 7:return{...e,highlightedTile:null};case 8:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e)};case 9:return{...e,streams:e.streams.map(e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e)};default:return e}},B1=(0,p4.createContext)(void 0),B2=({children:e})=>{let[t,r]=(0,p4.useReducer)(BJ,BQ);return(0,hA.jsx)(B1.Provider,{value:{state:t,dispatch:r},children:e})},B0=()=>{let e=(0,p4.useContext)(B1);if(void 0===e)throw Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}},B3=(e,t,r)=>{let n=document.createRange(),o=document.createElement("textarea");if(o.value=e,document.body.appendChild(o),navigator.userAgent.match(/ipad|ipod|iphone/i)){o.readOnly=!1,o.contentEditable="true",n.selectNodeContents(o);let e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),o.setSelectionRange(0,999999)}else o.focus(),o.select();try{document.execCommand("copy")?t():r(Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(o)};var B9=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise((t,r)=>{B3(e,t,r)});let B5=mb.path`
307
307
  fill: ${e=>e.theme.logoColor};
308
308
  stroke: ${e=>e.stroke?e.theme.logoColor:"unset"};
309
309
  `,B6=()=>(0,hA.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)(B5,{d:"M7.82 15.328c.806 0 1.48-.668 1.243-1.438a4.788 4.788 0 0 0-1.143-1.93 4.579 4.579 0 0 0-3.28-1.396c-1.231 0-2.411.502-3.281 1.395a4.788 4.788 0 0 0-1.143 1.93c-.237.771.438 1.44 1.244 1.44h6.36ZM7.513 0C6.706 0 6.03.668 6.269 1.438a4.788 4.788 0 0 0 1.142 1.93 4.58 4.58 0 0 0 3.281 1.396c1.23 0 2.411-.502 3.281-1.395.531-.545.92-1.209 1.143-1.93C15.353.667 14.678 0 13.872 0h-6.36ZM10.692 13.868c0 .807.67 1.482 1.435 1.227a4.622 4.622 0 0 0 1.846-1.162 4.83 4.83 0 0 0 1.36-3.369 4.83 4.83 0 0 0-1.36-3.369 4.62 4.62 0 0 0-1.846-1.162c-.764-.255-1.435.42-1.435 1.227v6.608ZM4.64 1.46c0-.806-.67-1.482-1.435-1.226a4.62 4.62 0 0 0-1.846 1.161A4.83 4.83 0 0 0 0 4.765a4.83 4.83 0 0 0 1.359 3.368 4.62 4.62 0 0 0 1.846 1.162c.765.255 1.435-.42 1.435-1.226v-6.61Z"})}),B4=()=>(0,hA.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)(B5,{d:"M27.445 13.543c-1.288 0-2.324-.206-3.107-.618-.773-.422-1.355-.948-1.747-1.576a.327.327 0 0 1 .108-.448l.882-.665a.253.253 0 0 1 .185-.077c.093 0 .18.056.263.17.69 1.112 1.85 1.669 3.477 1.669.712 0 1.314-.129 1.809-.387.505-.257.757-.67.757-1.236 0-.422-.144-.752-.432-.989-.279-.237-.712-.448-1.299-.634-.536-.164-.87-.262-1.005-.293a32.224 32.224 0 0 1-1.916-.603c-.99-.37-1.644-.798-1.963-1.282-.32-.485-.48-.99-.48-1.515 0-.433.135-.896.402-1.39.279-.506.712-.933 1.299-1.283.598-.361 1.345-.541 2.241-.541.938 0 1.726.118 2.365.355.639.227 1.247.608 1.824 1.144.072.072.108.144.108.216 0 .103-.051.186-.155.247l-.989.665a.414.414 0 0 1-.2.077c-.093 0-.181-.046-.263-.139-.619-.66-1.469-.989-2.55-.989-.619 0-1.098.093-1.438.278-.33.186-.551.392-.665.618a1.486 1.486 0 0 0-.154.603c0 .37.144.67.432.896.289.227.716.433 1.283.618.052.021.448.14 1.19.356.464.123.943.263 1.438.417 1.082.36 1.803.82 2.164 1.375.37.557.556 1.093.556 1.608 0 .556-.134 1.087-.402 1.591-.257.505-.716.928-1.375 1.268-.65.33-1.53.494-2.643.494ZM37.403 5.06c.773 0 1.489.226 2.148.679.66.443.99 1.262.99 2.457v4.837c0 .103-.031.186-.093.247-.052.052-.13.078-.232.078H39.21a.374.374 0 0 1-.247-.078.374.374 0 0 1-.077-.247V8.46c-.031-.587-.196-1.051-.495-1.39-.289-.34-.665-.51-1.128-.51-.33 0-.66.092-.99.277-.32.175-.592.448-.819.82-.227.36-.36.813-.402 1.36v4.017c0 .103-.03.186-.092.247-.052.052-.13.078-.232.078h-1.005a.373.373 0 0 1-.247-.078.374.374 0 0 1-.078-.247V5.585c0-.104.026-.18.078-.232a.334.334 0 0 1 .247-.093h1.005c.103 0 .18.03.232.093.061.051.092.128.092.232v.185c0 .072.01.129.031.17.031.03.067.046.108.046.083 0 .191-.056.325-.17a3.58 3.58 0 0 1 .927-.556c.34-.134.66-.2.959-.2ZM49.302 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.432.865c-.083.186-.217.252-.402.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.185-.371-.278-.726-.278-1.066 0-.557.17-1.056.51-1.5.35-.442.87-.752 1.561-.927.474-.113 1.134-.2 1.978-.262.577-.042.995-.083 1.252-.124.206-.03.3-.155.279-.37-.052-.464-.206-.835-.464-1.114-.247-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.164-.051-.247-.139-.247-.262 0-.031.01-.078.031-.14a2.977 2.977 0 0 1 1.221-1.421c.567-.36 1.304-.541 2.21-.541.886 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.061-.061-.144-.082-.247-.061l-.603.061a17.05 17.05 0 0 0-1.638.217 2.807 2.807 0 0 0-1.067.402.898.898 0 0 0-.433.803c0 .423.186.711.557.866.371.154.778.231 1.221.231ZM55.598 5.06c.99 0 1.757.236 2.303.71.547.464.918 1.015 1.113 1.653.196.629.294 1.257.294 1.886 0 .628-.098 1.262-.294 1.9-.195.63-.566 1.18-1.113 1.654-.546.464-1.313.696-2.303.696-.803 0-1.473-.217-2.009-.65-.072-.072-.144-.108-.216-.108-.103 0-.155.088-.155.263v3.245c0 .103-.03.18-.093.232-.051.062-.128.093-.231.093h-.928a.335.335 0 0 1-.247-.093c-.052-.051-.077-.129-.077-.232V5.584c0-.103.025-.18.077-.231a.334.334 0 0 1 .247-.093h.928c.103 0 .18.03.231.093.062.051.093.128.093.232 0 .082.01.149.031.2.031.042.067.062.108.062.052 0 .098-.02.14-.062.545-.484 1.246-.726 2.101-.726Zm-.154 7.077c.793 0 1.375-.273 1.746-.82.382-.545.572-1.215.572-2.008 0-.793-.19-1.463-.572-2.01-.37-.545-.953-.818-1.746-.818-.783 0-1.355.273-1.716.819-.35.536-.525 1.205-.525 2.009 0 .803.175 1.478.525 2.024.36.536.933.804 1.716.804ZM66.122 13.543c-1.174 0-2.19-.253-3.045-.757a4.991 4.991 0 0 1-1.932-2.071c-.433-.886-.649-1.89-.649-3.014 0-1.123.216-2.122.65-2.998a4.97 4.97 0 0 1 1.931-2.086c.856-.505 1.87-.757 3.045-.757 1.113 0 2.077.227 2.89.68a4.896 4.896 0 0 1 1.933 1.9c.03.062.046.12.046.17 0 .114-.077.196-.232.248L69.6 5.15a.342.342 0 0 1-.108.016c-.134 0-.237-.067-.31-.201-.638-1.05-1.658-1.576-3.06-1.576-.865 0-1.582.2-2.148.602a3.541 3.541 0 0 0-1.252 1.592 5.497 5.497 0 0 0-.402 2.117c0 .763.134 1.468.402 2.117a3.555 3.555 0 0 0 1.252 1.577c.566.402 1.283.602 2.148.602.814 0 1.52-.19 2.118-.571.608-.382 1.04-.964 1.298-1.747.072-.195.201-.278.387-.247l1.174.155c.175.03.263.113.263.247a.93.93 0 0 1-.03.154c-.454 1.185-1.114 2.076-1.98 2.674-.855.587-1.931.88-3.23.88ZM79.474 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.433.865c-.082.186-.216.252-.401.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.186-.371-.278-.726-.278-1.066a2.4 2.4 0 0 1 .51-1.5c.35-.442.87-.752 1.56-.927.475-.113 1.134-.2 1.98-.262.576-.042.994-.083 1.251-.124.206-.03.3-.155.278-.37-.051-.464-.206-.835-.463-1.114-.248-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.165-.051-.247-.139-.247-.262 0-.031.01-.078.03-.14a2.979 2.979 0 0 1 1.222-1.421c.567-.36 1.303-.541 2.21-.541.887 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.062-.061-.144-.082-.247-.061l-.603.061c-.67.062-1.216.134-1.638.217a2.808 2.808 0 0 0-1.067.402.898.898 0 0 0-.432.803c0 .423.185.711.556.866.37.154.778.231 1.221.231ZM83.467 13.033c0 .103-.03.185-.092.247-.052.052-.13.077-.232.077h-1.005a.374.374 0 0 1-.247-.077.374.374 0 0 1-.078-.247V2.354c0-.103.026-.18.078-.232a.335.335 0 0 1 .247-.092h1.005c.103 0 .18.03.232.093.061.051.092.128.092.231v10.679ZM87.35 13.033c0 .103-.03.185-.093.247-.051.052-.129.077-.232.077h-1.004a.374.374 0 0 1-.248-.077.374.374 0 0 1-.077-.247V2.354c0-.103.026-.18.078-.232a.334.334 0 0 1 .247-.092h1.004c.103 0 .18.03.232.093.062.051.093.128.093.231v10.679Z",stroke:"#fff",strokeWidth:".5"})});var B8=({size:e="large"})=>"small"===e?(0,hA.jsx)(B6,{}):"medium"===e?(0,hA.jsx)(B4,{}):(0,hA.jsxs)(hA.Fragment,{children:[(0,hA.jsx)(B6,{}),(0,hA.jsx)(B4,{})]});let B7=()=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M19 2H9a3 3 0 0 0-3 3v1H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Zm-3 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-7h12v7Zm0-9H4V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Zm4 5a1 1 0 0 1-1 1h-1V9a3 3 0 0 0-.18-1H20v7Zm0-9H8V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Z",fill:"#fff"})}),Fe=({color:e})=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M21 8.94a1.307 1.307 0 0 0-.06-.27v-.09a1.07 1.07 0 0 0-.19-.28l-6-6a1.071 1.071 0 0 0-.28-.19.32.32 0 0 0-.09 0 .88.88 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V8.94Zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1V5.41ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5v1Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3v5Z",fill:e||"#fff"})}),Ft=({color:e})=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M8 21H4a1 1 0 0 1-1-1v-4a1 1 0 1 0-2 0v4a3 3 0 0 0 3 3h4a1 1 0 0 0 0-2Zm14-6a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 0 0 2h4a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1ZM20 1h-4a1 1 0 1 0 0 2h4a1 1 0 0 1 1 1v4a1 1 0 0 0 2 0V4a3 3 0 0 0-3-3ZM2 9a1 1 0 0 0 1-1V4a1 1 0 0 1 1-1h4a1 1 0 0 0 0-2H4a3 3 0 0 0-3 3v4a1 1 0 0 0 1 1Zm8-4H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1ZM9 9H7V7h2v2Zm5 2h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1Zm1-4h2v2h-2V7Zm-5 6H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-1 4H7v-2h2v2Zm5-1a1 1 0 0 0 1-1 1 1 0 0 0 0-2h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1Zm4-3a1 1 0 0 0-1 1v3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-4 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:e||"#fff"})}),Fr=()=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"m21.32 9.55-1.89-.63.89-1.78A1 1 0 0 0 20.13 6L18 3.87a1 1 0 0 0-1.15-.19l-1.78.89-.63-1.89A1 1 0 0 0 13.5 2h-3a1 1 0 0 0-.95.68l-.63 1.89-1.78-.89A1 1 0 0 0 6 3.87L3.87 6a1 1 0 0 0-.19 1.15l.89 1.78-1.89.63a1 1 0 0 0-.68.94v3a1 1 0 0 0 .68.95l1.89.63-.89 1.78A1 1 0 0 0 3.87 18L6 20.13a1 1 0 0 0 1.15.19l1.78-.89.63 1.89a1 1 0 0 0 .95.68h3a1 1 0 0 0 .95-.68l.63-1.89 1.78.89a1 1 0 0 0 1.13-.19L20.13 18a1 1 0 0 0 .19-1.15l-.89-1.78 1.89-.63a1 1 0 0 0 .68-.94v-3a1 1 0 0 0-.68-.95ZM20 12.78l-1.2.4A2 2 0 0 0 17.64 16l.57 1.14-1.1 1.1-1.11-.6a2 2 0 0 0-2.79 1.16l-.4 1.2h-1.59l-.4-1.2A2 2 0 0 0 8 17.64l-1.14.57-1.1-1.1.6-1.11a2 2 0 0 0-1.16-2.82l-1.2-.4v-1.56l1.2-.4A2 2 0 0 0 6.36 8l-.57-1.11 1.1-1.1L8 6.36a2 2 0 0 0 2.82-1.16l.4-1.2h1.56l.4 1.2A2 2 0 0 0 16 6.36l1.14-.57 1.1 1.1-.6 1.11a2 2 0 0 0 1.16 2.79l1.2.4v1.59ZM12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#fff"})}),Fn=()=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M4 12a1 1 0 0 0 1 1h7.59l-2.3 2.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l4-4a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76 1 1 0 0 0-.21-.33l-4-4a1.003 1.003 0 1 0-1.42 1.42l2.3 2.29H5a1 1 0 0 0-1 1ZM17 2H7a3 3 0 0 0-3 3v3a1 1 0 0 0 2 0V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-3a1 1 0 1 0-2 0v3a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Z",fill:"#fff"})}),Fo=()=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M4.91 13.1a1 1 0 0 0 .85.47A1 1 0 0 0 6.61 12a17 17 0 0 1-2.47-6.85 1 1 0 0 1 .578-1.06A1 1 0 0 1 5.13 4h3a1 1 0 0 1 1 .8c0 .23.08.44.13.67v.13c.116.525.273 1.04.47 1.54l-1.39.66a1 1 0 0 0-.52.57 1 1 0 0 0 0 .77c.1.21.2.42.32.64a1 1 0 0 0 1.755-.028 1 1 0 0 0 .115-.542l.57-.21a2 2 0 0 0 1.05-2.48 9.317 9.317 0 0 1-.39-1.3v-.1c0-.2-.08-.4-.11-.58A3 3 0 0 0 8.16 2h-3a3 3 0 0 0-2.28 1 3 3 0 0 0-.72 2.39 19.05 19.05 0 0 0 2.75 7.71Zm14.61-.21-.6-.11h-.08a9.325 9.325 0 0 1-1.33-.39 2 2 0 0 0-2.47 1l-.21.46a12.392 12.392 0 0 1-1.92-1.37l8.8-8.79a1.004 1.004 0 1 0-1.42-1.42l-18 18a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.59-4.6a19.09 19.09 0 0 0 10.29 4.73c.133.01.267.01.4 0a3 3 0 0 0 2-.75 3 3 0 0 0 1-2.25v-3a3 3 0 0 0-2.47-2.93Zm.48 6a.999.999 0 0 1-.718.96 1 1 0 0 1-.432.03 17.07 17.07 0 0 1-9.14-4.18l1.77-1.77a14.695 14.695 0 0 0 3.38 2.21 1.002 1.002 0 0 0 .77 0 1 1 0 0 0 .57-.52l.62-1.41c.522.194 1.056.35 1.6.47h.11l.69.13a1 1 0 0 1 .78 1v3.08Z",fill:"#D84949"})}),Fi=()=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsxs)("g",{clipPath:"url(#pip)",fill:"#fff",children:[(0,hA.jsx)("path",{d:"M0 5v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H3a3 3 0 0 0-3 3Zm17-1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h14Z"}),(0,hA.jsx)("path",{d:"M10 14v4.879a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V14a3 3 0 0 0-3-3h-8a3 3 0 0 0-3 3ZM10 11.149c0 .113-.02.226-.06.332a.85.85 0 0 1-.8.519H5.736a.851.851 0 0 1 0-1.702h1.353l-2.792-2.8a.851.851 0 1 1 1.2-1.2l2.8 2.8V7.744a.851.851 0 0 1 1.703 0v3.405Z"})]})}),Fa=({color:e})=>(0,hA.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hA.jsx)("path",{d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3ZM5 18a1 1 0 0 1-1-1v-2.42l3.3-3.29a1 1 0 0 1 1.4 0L15.41 18H5Zm15-1a1 1 0 0 1-1 1h-.77l-3.81-3.83.88-.88a1 1 0 0 1 1.4 0l3.3 3.29V17Zm0-3.24-1.88-1.87a3.06 3.06 0 0 0-4.24 0l-.88.88-2.88-2.88a3.06 3.06 0 0 0-4.24 0L4 11.76V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6.76Z",fill:e||"#fff"})});var p4=(hO("85Hg2"),hO("85Hg2"));let Fs=(e,t)=>((0,p4.useEffect)(()=>{let r=performance.now(),n=n=>{!e?.current?.contains(n.target)&&n.timeStamp>r&&t()};if(e?.current)return window.addEventListener("click",n),()=>window.removeEventListener("click",n)},[e,t]),null),Fl=mb.div`