@snapcall/stream-ui 1.15.0 → 1.15.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.
- package/dist/stream-ui.esm.js +0 -3
- package/dist/stream-ui.js +0 -3
- package/dist/stream-ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/stream-ui.esm.js
CHANGED
|
@@ -2206,9 +2206,6 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
|
|
|
2206
2206
|
async joinRecorder() {
|
|
2207
2207
|
this.streamerMediasoup = await (0, $a2f0e3c29b11c88e$export$2e2bcd8739ae039).create(this.protoo, this.config);
|
|
2208
2208
|
const callId = await this.getCallId();
|
|
2209
|
-
if (this.joinOptions.apiKey) await this.protoo.request("setUser", {
|
|
2210
|
-
apiKey: this.joinOptions.apiKey
|
|
2211
|
-
}).catch((error)=>console.warn("setUser not implemented", error));
|
|
2212
2209
|
this.dispatchEvent(new $c31e3fb4360572af$var$SnapcallEvent("enterRoom", {
|
|
2213
2210
|
detail: {
|
|
2214
2211
|
videoRecording: {
|
package/dist/stream-ui.js
CHANGED
|
@@ -2211,9 +2211,6 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
2211
2211
|
async joinRecorder() {
|
|
2212
2212
|
this.streamerMediasoup = await (0, $a62e7f17be5cf3a0$export$2e2bcd8739ae039).create(this.protoo, this.config);
|
|
2213
2213
|
const callId = await this.getCallId();
|
|
2214
|
-
if (this.joinOptions.apiKey) await this.protoo.request("setUser", {
|
|
2215
|
-
apiKey: this.joinOptions.apiKey
|
|
2216
|
-
}).catch((error)=>console.warn("setUser not implemented", error));
|
|
2217
2214
|
this.dispatchEvent(new $1dedebd5ff3002eb$var$SnapcallEvent("enterRoom", {
|
|
2218
2215
|
detail: {
|
|
2219
2216
|
videoRecording: {
|
package/dist/stream-ui.umd.js
CHANGED
|
@@ -354,7 +354,7 @@ to {
|
|
|
354
354
|
/*! iNoBounce - v0.2.0
|
|
355
355
|
* https://github.com/lazd/iNoBounce/
|
|
356
356
|
* Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */
|
|
357
|
-
!function(e){var t=0,r=!1,n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,i)}catch(e){}var o=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 i=window.getComputedStyle(r);if(!i)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var o=i.getPropertyValue("-webkit-overflow-scrolling"),a=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===o&&("auto"===a||"scroll"===a),l=r.scrollHeight>r.offsetHeight;if(c&&l){var d=e.touches?e.touches[0].screenY:e.screenY,u=t<=d&&0===r.scrollTop,p=t>=d&&r.scrollHeight-r.scrollTop===s;return void((u||p)&&e.preventDefault())}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",o,!!n&&{passive:!1}),r=!0},c=document.createElement("div");document.documentElement.appendChild(c),c.style.WebkitOverflowScrolling="touch";var l="getComputedStyle"in window&&"touch"===window.getComputedStyle(c)["-webkit-overflow-scrolling"];document.documentElement.removeChild(c),l&&s();var d={enable:s,disable:function(){window.removeEventListener("touchstart",a,!1),window.removeEventListener("touchmove",o,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Nr&&(Nr=d),"function"==typeof e.define?function(e){e("iNoBounce",[],(function(){return d}))}(e.define):e.iNoBounce=d}(Nr);var rn={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},nn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.init(t,r)}return Ur(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||rn,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,tn(tn({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),on=function(){function e(){Br(this,e),this.observers={}}return Ur(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function an(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function sn(e){return null==e?"":""+e}function cn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function ln(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function dn(e,t,r){var n=ln(e,t,Object);n.obj[n.k]=r}function un(e,t){var r=ln(e,t),n=r.obj,i=r.k;if(n)return n[i]}function pn(e,t,r){var n=un(e,r);return void 0!==n?n:un(t,r)}function hn(e,t,r){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):hn(e[n],t[n],r):e[n]=t[n]);return e}function fn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var mn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function gn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return mn[e]})):e}var vn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,yn=[" ",",","?","!",";"];function bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Sn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;o<n.length;++o){if(!i)return;if("string"==typeof i[n[o]]&&o+1<n.length)return;if(void 0===i[n[o]]){for(var a=2,s=n.slice(o,o+a).join(r),c=i[s];void 0===c&&n.length>o+a;)a++,c=i[s=n.slice(o,o+a).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var l=n.slice(o+a).join(r);return l?Sn(c,l,r):void 0}i=i[n[o]]}return i}}var _n=function(e){qr(r,e);var t=xn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Br(this,r),n=t.call(this),vn&&on.call(Vr(n)),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return Ur(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];r&&"string"!=typeof r&&(a=a.concat(r)),r&&"string"==typeof r&&(a=a.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(a=e.split("."));var s=un(this.data,a);return s||!o||"string"!=typeof r?s:Sn(this.data&&this.data[e]&&this.data[e][t],r,i)}},{key:"addResource",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(n=t,t=(a=e.split("."))[1]),this.addNamespaces(t),dn(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in r)"string"!=typeof r[i]&&"[object Array]"!==Object.prototype.toString.apply(r[i])||this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=un(this.data,a)||{};n?hn(s,r,i):s=wn(wn({},s),r),dn(this.data,a,s),o.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?wn(wn({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(on),kn={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,r,n,i))})),t}};function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?En(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}var Rn={},Tn=function(e){qr(r,e);var t=Pn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Br(this,r),n=t.call(this),vn&&on.call(Vr(n)),cn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Vr(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=nn.create("translator"),n}return Ur(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=yn.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===n.length)return!0;var i=new RegExp("(".concat(n.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}(e,r,n));if(o&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,n){var i=this;if("object"!==Fr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,l=s.namespaces,d=l[l.length-1],u=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(d).concat(h).concat(c),f):"".concat(d).concat(h).concat(c)}return o?(f.res=c,f):c}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||c,v=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&S&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Cn(Cn({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=_,f):_}if(a){var k="[object Array]"===y,E=k?[]:{},C=k?v:g;for(var P in m)if(Object.prototype.hasOwnProperty.call(m,P)){var R="".concat(C).concat(a).concat(P);E[P]=this.translate(R,Cn(Cn({},t),{joinArrays:!1,ns:l})),E[P]===R&&(E[P]=m[P])}m=E}}else if(x&&"string"==typeof w&&"[object Array]"===y)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,n));else{var T=!1,j=!1,O=void 0!==t.count&&"string"!=typeof t.count,M=r.hasDefaultValue(t),L=O?this.pluralResolver.getSuffix(u,t.count,t):"",I=t["defaultValue".concat(L)]||t.defaultValue;!this.isValidLookup(m)&&M&&(T=!0,m=I),this.isValidLookup(m)||(j=!0,m=c);var D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,A=D&&j?void 0:m,N=M&&I!==m&&this.options.updateMissing;if(j||T||N){if(this.logger.log(N?"updateKey":"missingKey",u,d,c,N?I:m),a){var F=this.resolve(c,Cn(Cn({},t),{},{keySeparator:!1}));F&&F.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.")}var B=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)B.push(z[U]);else"all"===this.options.saveMissingTo?B=this.languageUtils.toResolveHierarchy(t.lng||this.language):B.push(t.lng||this.language);var V=function(e,r,n){var o=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,o,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,o,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?B.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||I)}))})):V(B,c,I))}m=this.extendTranslation(m,e,t,f,n),j&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),(j||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(c):c,T?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Cn(Cn({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(Cn(Cn({},r),{interpolation:Cn(Cn({},this.options.interpolation),r.interpolation)}));var a,s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=Cn(Cn({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);a<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return i&&i[0]===n[0]&&!r.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):o.translate.apply(o,n.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var u=r.postProcess||this.options.postProcess,p="string"==typeof u?[u]:u;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=kn.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Cn({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;a.options.fallbackNS&&(d=d.concat(a.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);d.forEach((function(e){a.isValidLookup(t)||(o=e,!Rn["".concat(f[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(Rn["".concat(f[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" 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!!!")),f.forEach((function(r){if(!a.isValidLookup(t)){i=r;var o,c=[l];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=a.pluralResolver.getSuffix(r,s.count,s));var f="".concat(a.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+f)),h){var m="".concat(l).concat(a.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+f))}}for(;o=c.pop();)a.isValidLookup(t)||(n=o,t=a.getResource(r,e,o,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var 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)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}(on);function jn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var On=function(){function e(t){Br(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nn.create("languageUtils")}return Ur(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=jn(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]=jn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=jn(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var n=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(r.isSupportedCode(e)?i.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&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)),n.forEach((function(e){i.indexOf(e)<0&&o(r.formatLanguageCode(e))})),i}}]),e}(),Mn=[{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}],Ln={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)}},In=["v1","v2","v3"],Dn={zero:0,one:1,two:2,few:3,many:4,other:5};function An(){var e={};return Mn.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Ln[t.fc]}}))})),e}var Nn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.languageUtils=t,this.options=r,this.logger=nn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==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=An()}return Ur(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var 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}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((function(e,t){return Dn[e]-Dn[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):n.numbers.map((function(n){return t.getSuffix(e,n,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!In.includes(this.options.compatibilityJSON)}}]),e}();function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=nn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Ur(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:gn,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?fn(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?fn(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?fn(t.nestingPrefix):t.nestingPrefixEscaped||fn("$t("),this.nestingSuffix=t.nestingSuffix?fn(t.nestingSuffix):t.nestingSuffixEscaped||fn(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var i,o,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(e.indexOf(s.formatSeparator)<0){var i=pn(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:e})):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),l=o.join(s.formatSeparator).trim();return s.format(pn(t,c,a),l,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:a}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(o=d(r)))if("function"==typeof u){var c=u(e,i,n);o="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))o="";else{if(p){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=sn(o));var l=t.safeValue(o);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Bn({},o);function s(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),i="{".concat(n[1]);e=n[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=Bn(Bn({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;r=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var d=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=d.shift(),c=d,l=!0}if((n=t(s.call(this,r[1].trim(),a),a))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=sn(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce((function(e,t){return i.format(e,t,o.lng,Bn(Bn({},o),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function Un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=nn.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,Vn(Vn({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Vn({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Vn({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Vn({},r)).format(e)}},this.init(t)}return Ur(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,n){var i=this;return t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=Xr(e.split(":")),n=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[n.trim()]||(r[n.trim()]=i),"false"===i&&(r[n.trim()]=!1),"true"===i&&(r[n.trim()]=!0),isNaN(i)||(r[n.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:r}}(t),a=o.formatName,s=o.formatOptions;if(i.formats[a]){var c=e;try{var l=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},d=l.locale||l.lng||n.locale||n.lng||r;c=i.formats[a](e,d,Vn(Vn(Vn({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}var Kn=function(e){qr(r,e);var t=$n(r);function r(e,n,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Br(this,r),o=t.call(this),vn&&on.call(Vr(o)),o.backend=e,o.store=n,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=nn.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return Ur(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,o={},a={},s={},c={};return e.forEach((function(e){var n=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!r.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===a[s]&&(a[s]=!0):(i.state[s]=1,n=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),r&&this.store.addResourceBundle(i,o,r),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=o,l=ln(n,[i],Object),d=l.obj,u=l.k,d[u]=d[u]||[],c&&(d[u]=d[u].concat(s)),c||d[u].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){a[e]||(a[e]={});var t=r.loaded[e];t.length&&t.forEach((function(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((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:i,wait:o,callback:a}):(this.readingCalls++,this.backend[r](e,t,(function(s,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}s&&c&&i<n.maxRetries?setTimeout((function(){n.read.call(n,e,t,r,i+1,2*o,a)}),o):a(s,c)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=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."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(function(n,a){n&&t.logger.warn("".concat(r,"loading namespace ").concat(o," for language ").concat(i," failed"),n),!n&&a&&t.logger.log("".concat(r,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,n,a)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(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!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,Wn(Wn({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(on);function Gn(){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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Fr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Fr(e[2])||"object"===Fr(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Zn(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&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Xn(){}function ei(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ti=function(e){qr(r,e);var t=Jn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Br(this,r),e=t.call(this),vn&&on.call(Vr(e)),e.options=Zn(n),e.services={},e.logger=nn,e.modules={external:[]},ei(Vr(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),Wr(e,Vr(e));setTimeout((function(){e.init(n,i)}),0)}return e}return Ur(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var n=Gn();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yn(Yn(Yn({},n),this.options),Zn(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yn(Yn({},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){var o;this.modules.logger?nn.init(i(this.modules.logger),this.options):nn.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Hn);var a=new On(this.options);this.store=new _n(this.options.resources,this.options);var s=this.services;s.logger=nn,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new Nn(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new zn(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Kn(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Tn(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=Xn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var d=["addResource","addResources","addResourceBundle","removeResourceBundle"];d.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var u=an(),p=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),u}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn,n=r,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var o=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=an();return e||(e=this.languages),t||(t=this.options.ns),r||(r=Xn),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new 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&&kn.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=an();this.emit("languageChanging",e);var i=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},o=function(o){e||o||!r.services.languageDetector||(o=[]);var a="string"==typeof o?o:r.services.languageUtils.getBestMatchFromCodes(o);a&&(r.language||i(a),r.translator.language||r.translator.changeLanguage(a),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(a)),r.loadResources(a,(function(e){!function(e,o){o?(i(o),r.translator.changeLanguage(o),r.isLanguageChangingTo=void 0,r.emit("languageChanged",o),r.logger.log("languageChanged",o)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var o;if("object"!==Fr(i)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];o=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else o=Yn({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=o.keyPrefix?"".concat(o.keyPrefix).concat(l).concat(t):t;return n.t(d,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=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;var n=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};if(r.precheck){var s=r.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||i&&!a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=an();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=an();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter((function(e){return n.indexOf(e)<0}));return i.length?(this.options.preload=n.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),o=new r(i),a=["store","services","language"];return a.forEach((function(t){o[t]=e[t]})),o.services=Yn({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Tn(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o.emit.apply(o,[e].concat(r))})),o.init(i,n),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(on);Kr(ti,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ti(e,t)}));var ri=ti.createInstance();ri.createInstance=ti.createInstance;ri.createInstance,ri.init,ri.loadResources,ri.reloadResources,ri.use,ri.changeLanguage,ri.getFixedT,ri.t,ri.exists,ri.setDefaultNamespace,ri.hasLoadedNamespace,ri.loadNamespaces,ri.loadLanguages;var ni=ri,ii={};(ii=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ii.default=ii;var oi={};function ai(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(oi=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,oi.default=oi;var si={};(si=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}).__esModule=!0,si.default=si;je=o("85Hg2");var ci=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,li={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},di=function(e){return li[e]};function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ui(Object(n),!0).forEach((function(t){r(si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ui(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hi,fi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(ci,di)}},mi=(0,je.createContext)();function gi(){return fi}var vi=function(){function e(){r(ii)(this,e),this.usedNamespaces={}}return r(oi)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function yi(){return hi}var bi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fi=pi(pi({},fi),e)}(e.options.react),function(e){hi=e}(e)}};const wi=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},xi={en:{name:"English",translation:{header:{free:"Free version"},loader:{connection:"Connecting..."},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"},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"},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"},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"},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",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You",cancel:"Cancel",confirm:"Confirm",remove:"Remove"},greeting:{mainTitle:"Welcome to SnapCall",sideTitle:"Are you ready to join?",sideDescription:"Before joining the room, enter your name. It will displayed to participants.",namePlaceholder:"Your name",nameSubmit:"Join Conversation",footerTitle:"Powered by SnapCall",footerDescription:"Meet SnapCall, the easiest way to add real-time video to platform, product or service."},recorder:{limit:"Video recording limited to 5 min.",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 }}",sendElement:"Send {{ type }}",sendElements:"Send {{ count }} elements",allowAccess:"Allow access",okay:"Okay",allowCamMicAccess:"Allow access to camera and microphone",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?",instructions:{allowAccessOnPrompt:"When prompted, <1>allow access</1> to the camera and microphone.",tapPhotoButton:"Tap the <1 /><2>Camera button</2> to take a photo.",multiplePhotos:"Feel free to take multiple photos for more details.",reviewAndSendPhotos:"Review your photo and <1>send it when you're satisfied.</1>",reviewAndSendScreenShare:"Review your video and <1>send it when you're satisfied.</1>",tapVideoButton:"Tap the <1 /><2>Record button</2> to start recording.",videoSpeech:"You can <1>talk during</1> the recording to provide additional information.",tapStopVideoButton:"When you're done, tap the <1 /><2>Stop button</2>.",reviewAndSendVideos:"Review your video and <1>send it when you're satisfied</1>.",tapScreenShareButton:"Tap <1>Record my screen</1> to begin recording.",tapStopScreenShareButton:"When you're done, tap <1>Stop recording</1>.",screenShareInstruction:"Select the screen or window you wish to record.",privacyPolicy:"By proceeding, you agree to our <1>Privacy Policy</1>."},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?"}}},fr:{name:"Français",translation:{header:{free:"Version gratuite"},loader:{connection:"Connexion..."},notifications:{screensharingError:"Une erreur est survenue pendant l'activation du partage d'écran",microphoneError:"Une erreur est survenue pendant l'activation du micro",cameraError:"Une erreur est survenue pendant l'activation de la caméra",cameraRotateError:"Une erreur est survenue pendant la rotation de la caméra",noCamera:"Aucune caméra disponible",blockedMicrophonePopupTitle:"Votre caméra et micro sont bloqués",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.",reload:"Recharger",criticalError:"Une erreur critique est survenue (erreur {{code}}).",agentJoinError:"Une erreur est survenue en essayant de rejoindre la salle en tant qu'agent",close:"Fermer",connectedTo:"Connecté à {{name}}",recording:"Enregistrement en cours"},recordingPopup:{recordingStartTitle:"L'enregistrement va commencer.",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.",dismiss:"Fermer"},endView:{goBack:"Retourner dans l'appel",tooLate:"Vous êtes arrivez trop tard",callIsOver:"Cet appel est terminé ou supprimé",callEnded:"Cet appel est terminé",callLeft:"Vous avez quitté l'appel",full:"Impossible de rejoindre l'appel",fullDescription:"Limite d'utilisateurs atteinte. Merci de rejoindre l'appel ultérieurement."},menu:{title:"Menu",new:"NOUVEAU",openNewTab:"Ouvrir un nouvel onglet",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Partage d'écran",stopRecord:"Arrêter l'enregistrement",startRecord:"Enregistrer l'appel"},blockedFeature:{titleConnected:"Souscrire au plan Pro",titleGuest:"Fonctionnalité non disponible",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.",dismissGuest:"D'accord",dismissConnected:"Souscrire à Pro"},copyLink:{title:"Copier le lien",description:"Copier le lien dans le presse-papiers",error:"Une erreur est survenue pendant la copie du lien dans le presse-papier",copied:"Lien copié dans le presse-papier"},quickConnect:{title:"Quick Connect",scanTitle:"Scannez le QR Code",scan:"Scannez ce QR code avec votre téléphone pour ouvrir l'appel."},settings:{title:"Paramètres",preferences:"Préférences",language:"Langage",devices:"Appareils",help:"Aide",helpCenter:"Accéder au centre d'aide"},audioMenu:{title:"Audio",blockedMicrophone:"Votre micro est bloqué.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Basse définition (240p)",standardDef:"Définition standard (480p)",highDef:"Haute définition (720p)",blockedCamera:"Votre caméra est bloqué.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Résolution envoyée (max)"},shareLink:{title:"Partager un lien",title2:"Partager un lien",invalid:"Lien invalide",sentToUsers:"Lien envoyé aux participants",sentToUser:"Lien envoyé à {{user}}",failed:"Une erreur est survenue pendant l'envoi du lien",poweredBy:"Proposé par",invoice:"{{user}} vous a envoyé une facture.",pay:"Payer"},youtube:{title:"Regardons Ensemble",url:"URL YOUTUBE",invalid:"URL YouTube invalide",share:"Regarder maintenant"},sharedHistory:{shared:"Partagé avec vous"},snapshot:{title:"Snapshot",shared:"Snapshot envoyé.",sentToUsers:"Snapshot envoyé aux participants.",sentToUser:"Snapshot envoyé à {{user}}",save:"Sauvegarder l'image",error:"Une erreur est survenue pendant l'envoi du snapshot"},gdpr:{recordedWarning:"Pour améliorer la qualité de notre service, cet appel va être enregistré."},requestDevice:{requestInput:"Demander l'activation",request:"{{user}} voudrait que vous partagiez votre {{device}}",timedOut:"Votre requête n'a pas eu de réponse",declined:"Votre requête a été refusé.",userDeclined:"{{user}} a décliné votre requête."},leave:{title:"Quitter",leaveCall:"Quitter l'appel",endCall:"Terminer l'appel"},virtualBackground:{title:"Arrière plan virtuel",setBackground:"Mettre l'arrière plan"},misc:{someone:"Quelqu'un",camera:"Caméra",microphone:"Micro",photo:"Photo",video:"Vidéo",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous",cancel:"Annuler",confirm:"Confirmer",remove:"Enlever"},greeting:{mainTitle:"Bienvenue sur SnapCall",sideTitle:"Prêt à rejoindre ?",sideDescription:"Avant de rejoindre la salle, veuillez entrer votre nom.",namePlaceholder:"Nom",nameSubmit:"Rejoindre la conversation",footerTitle:"Propulsé par SnapCall",footerDescription:"Découvrez SnapCall, ajoutez de la vidéo en temps réel à n'importe quelle plateforme, produit ou service."},recorder:{limit:"Enregistrement vidéo limité à 5 min.",submissionTitle:"Merci pour votre soumission !",submissionDescription:"Votre photo/vidéo a été envoyée avec succès. Nous l'examinerons et reviendrons vers vous bientôt.",confirmRemovalTitle:"Confirmer la suppression",confirmRemovalDescription:"Voulez-vous vraiment supprimer cette photo/vidéo ? Cette action ne peut pas être annulée.",elementBeingProcessed:"Veuillez patienter un moment pendant que votre {{ type }} est en cours de traitement...",waitVideo:"Cela peut prendre jusqu'à 15 secondes pour qu'une vidéo soit prête.",elementCaptureSuccess:"{{ type }} capturé(e) avec succès",takeNewElement:"Prendre une nouvelle {{ type }}",sendElement:"Envoyer la {{ type }}",sendElements:"Envoyer {{ count }} éléments",allowAccess:"Autoriser l'accès",okay:"D'accord",allowCamMicAccess:"Autoriser l'accès à la caméra et au micro",allowScreenShareAccess:"Autoriser l'accès au partage d'écran",permissionDeniedTitle:"Quelque chose s'est mal passé !",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.",photoInstructionsTitle:"Prêt(e) à prendre une photo ?",videoInstructionsTitle:"Prêt(e) à enregistrer une vidéo ?",screenShareInstructionsTitle:"Prêt(e) à partager votre écran ?",instructions:{allowAccessOnPrompt:"Lorsque vous y êtes invité(e), <1>autorisez l'accès</1> à la caméra et au microphone.",tapPhotoButton:"Appuyez sur le <1 /><2>bouton Appareil photo</2> pour prendre une photo.",multiplePhotos:"N'hésitez pas à prendre plusieurs photos pour plus de détails.",reviewAndSendPhotos:"Vous pouvez revoir votre photo, puis <1>l'envoyer lorsque vous avez terminé.</1>",tapVideoButton:"Appuyez sur le <1 /><2>bouton d'enregistrement</2> pour démarrer un enregistrement.",videoSpeech:"Vous pouvez <1>parler pendant</1> l'enregistrement pour ajouter des détails.",tapStopVideoButton:"Lorsque vous avez terminé, appuyez sur le <1 /><2>bouton Arrêter</2>.",reviewAndSendVideos:"Vous pouvez revoir votre vidéo, puis <1>l'envoyer lorsque vous avez terminé</2>.",tapScreenShareButton:"Appuyez sur <1>Enregistrer écran</1> pour démarrer un enregistrement.",tapStopScreenShareButton:"Lorsque vous avez terminé, appuyez sur <1>Stop enregistrement</1>.",reviewAndSendScreenShare:"Vous pouvez revoir votre vidéo, puis <1>l'envoyer lorsque vous avez terminé.</1>",screenShareInstruction:"Sélectionnez l'écran ou la fenêtre que vous souhaitez enregistrer.",privacyPolicy:"En poursuivant, vous acceptez notre <1>Politique de confidentialité</1>."},switchToMobileTitle:"Passez sur votre mobile",switchToMobileDescription:"Profitez d'une expérience encore plus pratique en utilisant votre téléphone pour prendre des photos et enregistrer des vidéos.",useDesktopVersion:"Continuer",scanQRCode:"Scannez ce code QR avec un appareil compatible.",startScreenShareButton:"Enregistrer écran",stopScreenShareButton:"Stop enregistrement",screenTitle:"Prêt à capturer votre écran ?"}}},it:{name:"Italiano",translation:{header:{free:"Versione gratuita"},loader:{connection:"Connessione..."},notifications:{screensharingError:"Si è verificato un errore durante l'attivazione della condivisione dello schermo",microphoneError:"Si è verificato un errore durante l'attivazione del microfono",cameraError:"Si è verificato un errore durante l'attivazione della fotocamera",cameraRotateError:"Si è verificato un errore durante la rotazione della fotocamera",noCamera:"Nessuna fotocamera disponibile",blockedMicrophonePopupTitle:"La tua fotocamera e il tuo microfono sono bloccati",blockedMicrophonePopup:"SnapCall ha bisogno di accedere alla fotocamera e al microfono. Fare clic sull'icona della fotocamera bloccata nella barra degli indirizzi del browser.",reload:"Ricaricare",criticalError:"Si è verificato un errore critico (errore {{code}}).",agentJoinError:"Si è verificato un errore cercando di entrare nella conversazione come agente",close:"Chiudere",connectedTo:"Connesso a {{name}}",recording:"Registrazione in corso"},recordingPopup:{recordingStartTitle:"Registrazione in procinto di iniziare.",recordingStartText:"Questa chiamata verrà registrata a breve. Se preferisci non essere registrato, sei libero di lasciare la chiamata in questo momento.",dismiss:"Chiudi"},endView:{goBack:"Torna alla chiamata",tooLate:"Sei arrivato troppo tardi",callIsOver:"Questa chiamata è finita o è stata eliminata",callEnded:"Questa chiamata è finita",callLeft:"Hai lasciato la chiamata",full:"Impossibile partecipare alla chiamata",fullDescription:"Limite d'uso attenente."},menu:{title:"Menù",new:"NUOVO",openNewTab:"Apri una nuova scheda",quickConnect:"Connessione Rapida",pictureInPicture:"Immagine nell'immagine",screenSharing:"Condivisione dello schermo",stopRecord:"Interrompere la registrazione",startRecord:"Registra chiamata"},blockedFeature:{titleConnected:"L'aggiornamento a Pro",titleGuest:"Funzione non disponibile",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.",dismissGuest:"Okay",dismissConnected:"L'aggiornamento a Pro"},copyLink:{title:"Copia il link",description:"Copia il link negli appunti",error:"Si è verificato un errore durante la copia negli Appunti",copied:"Link copiato negli Appunti"},quickConnect:{title:"Connessione Rapida",scanTitle:"Scansiona il codice QR",scan:"Scansiona questo codice QR con il telefono per aprire la chiamata."},settings:{title:"Impostazioni",preferences:"Preferenze",language:"Linguaggio",devices:"Dispositivi",help:"Aiuto",helpCenter:"Accedi all'Assistenza"},audioMenu:{title:"Audio",blockedMicrophone:"Il tuo microfono è bloccato.",microphonePermissions:"Si prega di accettare la condivisione del microfono prima di accedere a queste opzioni."},videoMenu:{title:"Video",lowDef:"Definizione bassa (240p)",standardDef:"Definizione standard (480p)",highDef:"Alta definizione (720p)",blockedCamera:"La fotocamera è bloccata.",cameraPermissions:"Si prega di accettare la condivisione della fotocamera prima di accedere a queste opzioni.",sendResolution:"Risoluzione inviata (max)"},shareLink:{title:"Condividi un link",title2:"Condividi un link",invalid:"Collegamento non valido",sentToUsers:"Link inviato ai partecipanti",sentToUser:"Link inviato a {{user}}",failed:"Si è verificato un errore durante l'invio del link",poweredBy:"Proposto da",invoice:"{{User}} ti ha inviato una fattura.",pay:"Paga"},youtube:{title:"Vedere Assieme",url:"URL YOUTUBE",invalid:"URL YouTube non valido",share:"Guarda ora"},sharedHistory:{shared:"Condiviso con te"},snapshot:{title:"Schermata",shared:"Schermata inviata",sentToUsers:"Schermanta inviata ai partecipanti",sentToUser:"Schermata inviata a {{user}}",save:"Salva l'immagine",error:"Si è verificato un errore durante l'invio della schermata"},gdpr:{recordedWarning:"Per migliorare la qualità del nostro servizio, questa chiamata verrà registrata."},requestDevice:{requestInput:"Richiesta di attivazione",request:"{{user}} vorrebbe condividere il tuo {{device}}",timedOut:"La tua richiesta non ha ricevuto risposta",declined:"La tua richiesta è stata rifiutata.",userDeclined:"{{user}} ha rifiutato la tua richiesta"},leave:{title:"Lasciare",leaveCall:"Lascia la chiamata",endCall:"Termina la chiamata per tutti"},virtualBackground:{title:"Sfondo virtuale",setBackground:"Imposta sfondo"},virtualbackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Qualcuno",camera:"Telecamera",microphone:"Microfono",photo:"Foto",video:"Video",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi",cancel:"Annulla",confirm:"Confermare",remove:"Rimuovere"},greeting:{mainTitle:"Benvenuto a SnapCall",sideTitle:"Sei pronto per unirti?",sideDescription:"Prima di entrare nella stanza, inserisci il tuo nome. Verrà visualizzato ai partecipanti.",namePlaceholder:"Il tuo nome",nameSubmit:"Partecipa alla conversazione",footerTitle:"Offerto da SnapCall",footerDescription:"Incontrare SnapCall, il modo più semplice per aggiungere video in tempo reale a piattaforma, prodotto o servizio."},recorder:{limit:"Registrazione video limitata a 5 min.",submissionTitle:"Grazie per il tuo invio!",submissionDescription:"La tua foto/video è stata inviata con successo. La esamineremo e ti risponderemo al più presto.",confirmRemovalTitle:"Conferma rimozione",confirmRemovalDescription:"Sei sicuro di voler rimuovere questa foto/video? Questa azione non può essere annullata.",elementBeingProcessed:"Attendi un momento mentre il tuo {{ type }} viene elaborato...",waitVideo:"Potrebbero essere necessari fino a 15 secondi affinché un video sia pronto.",elementCaptureSuccess:"{{ type }} catturato con successo",takeNewElement:"Cattura un nuovo {{ type }}",sendElement:"Invia {{ type }}",sendElements:"Invia {{ count }} elementi",allowAccess:"Consenti accesso",okay:"Okay",allowCamMicAccess:"Consenti accesso a fotocamera e microfono",allowScreenShareAccess:"Consenti accesso alla condivisione dello schermo",permissionDeniedTitle:"Qualcosa è andato storto!",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.",photoInstructionsTitle:"Pronto a scattare una foto?",videoInstructionsTitle:"Pronto a registrare un video?",screenShareInstructionsTitle:"Pronto a condividere il tuo schermo?",instructions:{allowAccessOnPrompt:"Quando richiesto, <1>consenti l'accesso</1> a fotocamera e microfono.",tapPhotoButton:"Tocca il pulsante <1 /><2>Fotocamera</2> per scattare una foto.",multiplePhotos:"Non esitare a scattare più foto per maggiori dettagli.",reviewAndSendPhotos:"Puoi rivedere la tua foto e poi <1>inviarla quando hai finito.</1>",tapVideoButton:"Tocca il pulsante <1 /><2>Registra</2> per avviare una registrazione.",videoSpeech:"Puoi <1>parlare durante</1> la registrazione per aggiungere dettagli.",tapStopVideoButton:"Quando hai finito, tocca il pulsante <1 /><2>Ferma</2>.",reviewAndSendVideos:"Puoi rivedere il tuo video e poi <1>inviarlo quando hai finito</1>.",tapScreenShareButton:"Tocca <1>Registra il mio schermo</1> per avviare una registrazione.",tapStopScreenShareButton:"Quando hai finito, tocca <1>Ferma registrazione</1>.",reviewAndSendScreenShare:"Puoi rivedere il tuo video e poi <1>inviarlo quando hai finito.</1>",screenShareInstruction:"Seleziona lo schermo o la finestra che desideri registrare.",privacyPolicy:"Procedendo, l'utente accetta la nostra <1>Privacy Policy</1>."},switchToMobileTitle:"Passa al tuo dispositivo mobile",switchToMobileDescription:"Goditi un'esperienza ancora più pratica utilizzando il tuo telefono per scattare foto e registrare video.",useDesktopVersion:"Usa la versione desktop",scanQRCode:"Scansiona questo codice QR con un dispositivo compatibile.",startScreenShareButton:"Registra il mio schermo",stopScreenShareButton:"Ferma registrazione",screenTitle:"Pronto a catturare il tuo schermo?"}}}};ni.use(bi).init({lng:wi(),fallbackLng:"en",resources:xi,interpolation:{escapeValue:!1}});var Si=ni,_i=(je=o("85Hg2"),{}),ki={};(ki=function(e){if(Array.isArray(e))return e}).__esModule=!0,ki.default=ki;var Ei={};(Ei=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}).__esModule=!0,Ei.default=Ei;var Ci={},Pi={};(Pi=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}).__esModule=!0,Pi.default=Pi,(Ci=function(e,t){if(e){if("string"==typeof e)return Pi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pi(e,t):void 0}}).__esModule=!0,Ci.default=Ci;var Ri={};(Ri=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Ri.default=Ri,(_i=function(e,t){return ki(e)||Ei(e,t)||Ci(e,t)||Ri()}).__esModule=!0,_i.default=_i;je=o("85Hg2");function Ti(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var ji={};function Oi(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&ji[t[0]]||("string"==typeof t[0]&&(ji[t[0]]=new Date),Ti.apply(void 0,t))}function Mi(e,t,r){e.loadNamespaces(t,(function(){if(e.isInitialized)r();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),r()}))}}))}function Li(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,o=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(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)||i&&!a(o,e))))}function Ii(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return Oi("i18n.languages were undefined or empty",t.languages),!0;var n=void 0!==t.options.ignoreJSONStructure;return n?t.hasLoadedNamespace(e,{precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):Li(e,t,r)}function Di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(n),!0).forEach((function(t){r(si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ni=function(e,t){var r=(0,je.useRef)();return(0,je.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Fi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,je.useContext)(mi)||{},o=i.i18n,a=i.defaultNS,s=n||o||yi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new vi),!s){Oi("You will need to pass in an i18next instance by using initReactI18next");var c=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[c,{},!1];return l.t=c,l.i18n={},l.ready=!1,l}s.options.react&&void 0!==s.options.react.wait&&Oi("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Ai(Ai(Ai({},gi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,h=e||a||s.options&&s.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var f=(s.isInitialized||s.initializedStoreOnce)&&h.every((function(e){return Ii(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?h:h[0],p)}var g=(0,je.useState)(m),v=r(_i)(g,2),y=v[0],b=v[1],w=h.join(),x=Ni(w),S=(0,je.useRef)(!0);(0,je.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function r(){S.current&&b(m)}return S.current=!0,f||u||Mi(s,h,(function(){S.current&&b(m)})),f&&x&&x!==w&&S.current&&b(m),e&&s&&s.on(e,r),t&&s&&s.store.on(t,r),function(){S.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,r)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,r)}))}}),[s,w]);var _=(0,je.useRef)(!0);(0,je.useEffect)((function(){S.current&&!_.current&&b(m),_.current=!1}),[s,p]);var k=[y,s,f];if(k.t=y,k.i18n=s,k.ready=f,f)return k;if(!f&&!u)return k;throw new Promise((function(e){Mi(s,h,(function(){e()}))}))}var Bi=o("4Fy4N");var zi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ui;const Vi=new Uint8Array(16);function Hi(){if(!Ui&&(Ui="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ui))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ui(Vi)}const qi=[];for(let e=0;e<256;++e)qi.push((e+256).toString(16).slice(1));function Wi(e,t=0){return(qi[e[t+0]]+qi[e[t+1]]+qi[e[t+2]]+qi[e[t+3]]+"-"+qi[e[t+4]]+qi[e[t+5]]+"-"+qi[e[t+6]]+qi[e[t+7]]+"-"+qi[e[t+8]]+qi[e[t+9]]+"-"+qi[e[t+10]]+qi[e[t+11]]+qi[e[t+12]]+qi[e[t+13]]+qi[e[t+14]]+qi[e[t+15]]).toLowerCase()}var $i,Ki,Gi,Zi=function(e,t,r){if(zi.randomUUID&&!t&&!e)return zi.randomUUID();const n=(e=e||{}).random||(e.rng||Hi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Wi(n)},Qi=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,Yi={},Ji=o("hZG0u");const Xi="protoo-client";Yi=class{constructor(e){e?(this._debug=Ji(`${Xi}:${e}`),this._warn=Ji(`${Xi}:WARN:${e}`),this._error=Ji(`${Xi}:ERROR:${e}`)):(this._debug=Ji(Xi),this._warn=Ji(`${Xi}:WARN`),this._error=Ji(`${Xi}: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 eo,to=o("3oV8N").EventEmitter;eo=class extends to{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new Yi("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 ro={},no=function(){return Math.round(1e7*Math.random())};const io=new Yi("Message");ro=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void io.error("parse() | invalid JSON: %s",e)}if("object"==typeof t&&!Array.isArray(t)){if(t.request){if(r.request=!0,"string"!=typeof t.method)return void io.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void io.error("parse() | missing/invalid id field");r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id)return void io.error("parse() | missing/invalid id field");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)return void io.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void io.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}io.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:no(),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||{}}}};const oo=new Yi("Peer");Gi=class extends eo{constructor(e){super(oo),oo.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 new Error("cannot override data object")}close(){if(!this._closed){oo.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close();for(const e of this._sents.values())e.close();this.safeEmit("close")}}async request(e,t){const r=ro.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise(((e,t)=>{const n=1500*(15+.1*this._sents.size),i={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),t(e))},timer:setTimeout((()=>{this._sents.delete(r.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(i.timer),t(new Error("peer closed"))}};this._sents.set(r.id,i)}))}async notify(e,t){const r=ro.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed)return this._closed=!0,void setTimeout((()=>{this._closed||(this._connected=!1,this.safeEmit("close"))}));this._transport.on("open",(()=>{this._closed||(oo.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(oo.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(oo.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,oo.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=>{const r=ro.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);const n=ro.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=ro.createErrorResponse(e,500,String(t));this._transport.send(r).catch((()=>{}))}}_handleResponse(e){const t=this._sents.get(e.id);if(t)if(e.ok)t.resolve(e.data);else{const r=new Error(e.errorReason);r.code=e.errorCode,t.reject(r)}else oo.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var ao;if("object"==typeof globalThis)ao=globalThis;else try{ao=o("jCEG4")}catch(e){}finally{if(ao||"undefined"==typeof window||(ao=window),!ao)throw new Error("Could not determine global this")}var so,co=ao.WebSocket||ao.MozWebSocket;function lo(e,t){return t?new co(e,t):new co(e)}so=o("kUMHr").version,co&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(lo,e,{get:function(){return co[e]}})}));var uo={w3cwebsocket:co?lo:null,version:so}.w3cwebsocket,po={};po=o("jxXWz");const ho={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},fo=new Yi("WebSocketTransport");$i=Gi,Ki=class extends eo{constructor(e,t){super(fo),fo.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){fo.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){fo.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw new Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw fo.warn("send() failed:%o",e),e}}_runWebSocket(){const e=po.operation(this._options.retry||ho);let t=!1;e.attempt((r=>{this._closed?e.stop():(fo.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new uo(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(fo.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;return void this._runWebSocket()}if(this.safeEmit("failed",r),this._closed)return;if(e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||fo.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=ro.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):fo.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var mo=(0,(xo=o("bWPEY")).getGlobalObject)(),go=["debug","info","warn","error","log","assert","trace"];function vo(e){var t=(0,xo.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};go.forEach((e=>{var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((e=>{r[e]=n[e]}))}}function yo(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?go.forEach((r=>{t[r]=(...t)=>{e&&vo((()=>{mo.console[r](`Sentry Logger [${r}]:`,...t)}))}})):go.forEach((e=>{t[e]=()=>{}})),t}let bo;bo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,xo.getGlobalSingleton)("logger",yo):yo();var wo=o("gTODe"),xo=o("bWPEY"),So=o("hLvaX"),_o=(xo=o("bWPEY"),xo=o("bWPEY"),Object.prototype.toString);function ko(e,t){return _o.call(e)===`[object ${t}]`}function Eo(e){return ko(e,"Object")}function Co(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Po(e){return Ro(e,new Map)}function Ro(e,t){if(Eo(e)){if(void 0!==(i=t.get(e)))return i;var r={};for(var n of(t.set(e,r),Object.keys(e)))void 0!==e[n]&&(r[n]=Ro(e[n],t));return r}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;r=[];return t.set(e,r),e.forEach((e=>{r.push(Ro(e,t))})),r}return e}function To(){var e=(0,xo.getGlobalObject)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var jo;o("gTODe"),xo=o("bWPEY");!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(jo||(jo={}));class Oo{__init(){this._state=jo.PENDING}__init2(){this._handlers=[]}constructor(e){Oo.prototype.__init.call(this),Oo.prototype.__init2.call(this),Oo.prototype.__init3.call(this),Oo.prototype.__init4.call(this),Oo.prototype.__init5.call(this),Oo.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Oo(((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 Oo(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(jo.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(jo.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===jo.PENDING&&(Co(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==jo.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===jo.RESOLVED&&e[1](this._value),this._state===jo.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}wo=o("gTODe");function Mo(e){var t=(0,wo.timestampInSeconds)(),r={sid:To(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Po({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&Lo(r,e),r}function Lo(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||(0,wo.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:To()),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{var r=e.timestamp-e.started;e.duration=r>=0?r: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 Io(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Lo(e,r)}class Do{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Do;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Lo(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={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();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){var t=e(this);return t instanceof Do?t:this}return e instanceof Do?(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)):Eo(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)),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}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,wo.dateTimestampInSeconds)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...Ao(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new Oo(((i,o)=>{var a=e[n];if(null===t||"function"!=typeof a)i(t);else{var s=a({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&bo.log(`Event processor "${a.id}" dropped event`),Co(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,o):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,o)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Ao(){return(0,xo.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var No=100;class Fo{__init(){this._stack=[{}]}constructor(e,t=new Do,r=4){this._version=r,Fo.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Do.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:To(),n=new Error("Sentry syntheticException");return this._withClient(((i,o)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},o)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:To(),i=new Error(e);return this._withClient(((o,a)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},a)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:To();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=No}=n.getOptions&&n.getOptions()||{};if(!(o<=0)){var a={timestamp:(0,wo.dateTimestampInSeconds)(),...e},s=i?vo((()=>i(a,t))):a;null!==s&&r.addBreadcrumb(s,o)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=zo(this);try{e(this)}finally{zo(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&bo.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&Io(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var o=(0,xo.getGlobalObject)();const{userAgent:a}=o.navigator||{};var s=Mo({release:n,environment:i,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Lo(c,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=Bo().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&bo.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Bo(){var e=(0,xo.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function zo(e){var t=Bo(),r=Ho(t);return qo(t,e),r}function Uo(){var e=Bo();return Vo(e)&&!Ho(e).isOlderThan(4)||qo(e,new Fo),(0,So.isNodeEnv)()?function(e){try{var t=Bo().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Ho(e);if(!Vo(r)||Ho(r).isOlderThan(4)){var n=Ho(e).getStackTop();qo(r,new Fo(n.client,Do.clone(n.scope)))}return Ho(r)}catch(t){return Ho(e)}}(e):Ho(e)}function Vo(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ho(e){return(0,xo.getGlobalSingleton)("hub",(()=>new Fo),e)}function qo(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Wo(e){Uo().addBreadcrumb(e)}const $o=1,Ko=2,Go=3,Zo=4,Qo=5,Yo={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let Jo=Number(2);const Xo=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class ea{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${Xo.format(new Date)} ][ ${Yo[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Jo)?t(i,...n):Wo({type:"debug",level:Yo[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(Qo,console.debug,e,...t)}error(e,...t){this.print($o,console.error,e,...t)}info(e,...t){this.print(Go,console.info,e,...t)}log(e,...t){this.print(Zo,console.log,e,...t)}warn(e,...t){this.print(Ko,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Jo=e}setLogLevel(e){this.customLogLevel=e}}const ta=new ea("AudioLevels.ts"),ra=window.AudioContext||window.webkitAudioContext;class na{speakStartEventTime=0;speakStopEventTime=0;speaking=!1;audioMedianInterval=-1;audioLevelInterval=-1;audioLevels=[];constructor(e,t){this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new ra,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=32,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){const{length:e}=this.audioLevels;return this.audioLevels.reduce(((e,t)=>e+t),0)/e}getCurrentAudioLevel(){const{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);const t=this.speakStartEventTime||this.speakStopEventTime,r=Boolean(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 t/=e.length,Math.sqrt(t)}getInstantAudioLevel(){const e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);const t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){const 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)}release(){this.listener=void 0,clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.stream.getTracks().forEach((e=>{this.stream.removeTrack(e)}));try{this.audioStreamSource.disconnect(this.analyser)}catch(e){ta.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{ta.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!ra}}const ia=new ea("AudioRenderer.ts");var oa=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=>{ia.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const aa=(e,t=1)=>new Promise((r=>{const n=e.getContext("2d"),i=new Blob(['<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>'],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i),a=new Image;a.onload=()=>{const i=e.width/t-a.width-16,o=e.height/t-a.height-16;n?.drawImage(a,i,o),r(e)},a.src=o})),sa=(e,t=1)=>new Promise((r=>{const n=e.getContext("2d"),i=new Blob(['<svg xmlns="http://www.w3.org/2000/svg" width="100" height="103"><path d="M92.527 39.465 22.312 1.87A15.549 15.549 0 0 0 14.777 0c-2.64.02-5.226.703-7.5 1.98a14.086 14.086 0 0 0-5.332 5.032A13.185 13.185 0 0 0 0 13.906v75.188c-.004 2.422.668 4.8 1.945 6.894 1.278 2.094 3.117 3.832 5.332 5.035a15.598 15.598 0 0 0 7.5 1.977 15.6 15.6 0 0 0 7.536-1.867l70.214-37.598c2.262-1.187 4.153-2.933 5.465-5.05A13.198 13.198 0 0 0 100 51.5c0-2.457-.691-4.867-2.008-6.984-1.312-2.118-3.203-3.86-5.465-5.051Zm0 0" style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1"/></svg>'],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i),a=new Image;a.onload=()=>{const i=e.width/t/2-a.width/2,o=e.height/t/2-a.height/2;n?.drawImage(a,i,o),r(e)},a.src=o,n&&(n.fillStyle="#00000064",n.fillRect(0,0,e.width,e.height),n.restore())})),ca=async(e,t={addPlayWatermark:!1})=>{const{videoWidth:r,videoHeight:n}=e,i=r>n?"landscape":"portrait",o="portrait"===i?r:n,a="landscape"===i?n:r,s="landscape"===i?(r-o)/2:0,c="portrait"===i?(n-a)/2:0;let l=document.createElement("canvas");const d=l.getContext("2d"),u=window.devicePixelRatio||1;l.width=o*u,l.height=a*u,d?.scale(u,u),d?.drawImage(e,s,c,o,a,0,0,l.width/u,l.height/u),t.addPlayWatermark&&(l=await sa(l,window.devicePixelRatio));return(await aa(l,window.devicePixelRatio)).toDataURL("image/jpeg")},la=async(e,t={addPlayWatermark:!1})=>{const r=document.createElement("video"),n=new MediaStream;n.addTrack(e),r.srcObject=n,r.setAttribute("muted","true");const i=e.getSettings();r.width=i.width||0,r.height=i.height||0,await r.play();let o=document.createElement("canvas");const a=o.getContext("2d");o.height=r.height,o.width=r.width,a?.drawImage(r,0,0),t.addPlayWatermark&&(o=await sa(o));return(await aa(o)).toDataURL("image/jpeg")};var da=o("eEB2e"),ua=(Bi=o("4Fy4N"),{}),pa=ua&&ua.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ha=ua&&ua.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fa=ua&&ua.__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)&&pa(t,e,r);return ha(t,e),t},ma=ua&&ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ua,"__esModule",{value:!0}),ua.debug=ua.parseScalabilityMode=ua.detectDevice=ua.Device=ua.version=ua.types=void 0;const ga=ma(o("hZG0u"));ua.debug=ga.default;var va=o("1ZHQC");Object.defineProperty(ua,"Device",{enumerable:!0,get:function(){return va.Device}}),Object.defineProperty(ua,"detectDevice",{enumerable:!0,get:function(){return va.detectDevice}});const ya=fa(o("cQumC"));ua.types=ya,ua.version="3.6.53";var ba=o("fT1lN");Object.defineProperty(ua,"parseScalabilityMode",{enumerable:!0,get:function(){return ba.parse}});const wa=new ea("StreamerMediasoup");function xa(){try{const r=navigator.userAgent,n=Bi.getParser(r);e="DeviceDetectionForced",t=!0,Uo().setTag(e,t),Wo({type:"debug",category:"browser",data:n.getResult()});const i=n.getOS();if("Safari"===n.getBrowserName()&&"iOS"===i.name&&Number(i.version)>=14.3)return new(0,ua.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){wa.error("deviceAutoDetection",e)}var e,t;return new(0,ua.Device)({handlerName:"Chrome74"})}class Sa{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){const r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter((e=>"urn:3gpp:video-orientation"!==e.uri));const n=function(){try{return new(0,ua.Device)}catch(e){return wa.error("failed to detects device from mediasoup, fallback on auto detection",e),xa()}}();return n.load({routerRtpCapabilities:r}),new Sa(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){const 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){const t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{wa.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t.on("produce",(async({kind:r,rtpParameters:n,appData:i},o,a)=>{try{const{id:a}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});o({id:a}),wa.log("producerTransport: ",t)}catch(e){a(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{wa.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),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:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:r})}}var _a={};(function(){"use strict";var e;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t];for(var r=0;r<e.length;++r){var n=e[r];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var r=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in r))break e;r=r[a]}(t=t(o=r[e=e[e.length-1]]))!=o&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=s(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.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+i++,n)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var s=i[t[o]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(r(this))}})}return e}));var l,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var u;e:{var p={};try{p.__proto__={a:!0},u=p.a;break e}catch(e){}u=!1}l=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=l;function f(e,t){if(e.prototype=d(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.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function v(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,r){return e.g=r,{value:t}}function b(e){this.g=new m,this.h=e}function w(e,t,r,n){try{var i=t.call(e.g.i,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,o),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,v(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function S(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=x(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(v(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){g(e.g);var r=e.g.i;return r?w(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function _(e,t){return t=new S(new b(t)),h&&e.prototype&&h(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var k="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 i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};o("Object.assign",(function(e){return e||k})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.g=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;r.prototype.i=function(e){o(e,0)},r.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.j(e)}}}this.g=null},r.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,r=i.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,r(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new r;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var r=this.j();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{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(n(e,i),n(r,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function r(){switch(n.h){case 1:e(n.i);break;case 2:t(n.i);break;default:throw Error("Unexpected state: "+n.h)}}var n=this;null==this.g?a.h(r):this.g.push(r),this.o=!0},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=s(e),o=i.next();!o.done;o=i.next())n(o.value).J(t,r)}))},t.all=function(e){var r=s(e),i=r.next();return i.done?n([]):new t((function(e,t){function o(t){return function(r){a[t]=r,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,n(i.value).J(o(a.length-1),t),i=r.next()}while(!i.done)}))},t})),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 i=r[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var r=0,n=!1,i={next:function(){if(!n&&r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var E=this||self;function C(e,t){e=e.split(".");var r,n=E;e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(;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 P(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var R,T,j="undefined"!=typeof TextDecoder,O="undefined"!=typeof TextEncoder;function M(e){if(O)e=(T||(T=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var r=0,n=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)n[r++]=o;else{if(2048>o)n[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}n[r++]=o>>12|224,n[r++]=o>>6&63|128}n[r++]=63&o|128}}e=n.subarray(0,r)}return e}var L={},I=null;function D(e,t){void 0===t&&(t=0),N(),t=L[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],s=e[i+1],c=e[i+2],l=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[o++]=l+a+s+c}switch(l=0,c=n,e.length-i){case 2:c=t[(15&(l=e[i+1]))<<2]||n;case 1:e=e[i],r[o]=t[e>>2]+t[(3&e)<<4|l>>4]+c+n}return r.join("")}function A(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),i=I[r];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}N();for(var n=0;;){var i=r(-1),o=r(0),a=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){n[i++]=e})),n.subarray(0,i)}function N(){if(!I){I={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));L[r]=n;for(var i=0;i<n.length;i++){var o=n[i];void 0===I[o]&&(I[o]=i)}}}}var F,B="function"==typeof Uint8Array.prototype.slice;function z(e,t,r){return t===r?F||(F=new Uint8Array(0)):B?e.slice(t,r):new Uint8Array(e.subarray(t,r))}var U=0;function V(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&H(this,e)}function H(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?A(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function q(e){var t=e.h,r=t[e.g],n=127&r;return 128>r?(e.g+=1,n):(n|=(127&(r=t[e.g+1]))<<7,128>r?(e.g+=2,n):(n|=(127&(r=t[e.g+2]))<<14,128>r?(e.g+=3,n):(n|=(127&(r=t[e.g+3]))<<21,128>r?(e.g+=4,n):(n|=(15&(r=t[e.g+4]))<<28,128>r?(e.g+=5,n>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,n)))))}function W(e){var t=e.h[e.g],r=e.h[e.g+1],n=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((r=(t<<0|r<<8|n<<16|i<<24)>>>0)>>31)+1,t=r>>>23&255,r&=8388607,255==t?r?NaN:1/0*e:0==t?e*Math.pow(2,-149)*r:e*Math.pow(2,t-150)*(r+Math.pow(2,23))}V.prototype.reset=function(){this.g=this.j};var $=[];function K(){this.g=new Uint8Array(64),this.h=0}function G(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function Z(e){var t={},r=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=r,t=this.o,$.length?(r=$.pop(),t&&(r.v=t.v),e&&H(r,e),e=r):e=new V(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function Q(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var r=7&(t=q(e.g));return 0!=r&&5!=r&&1!=r&&2!=r&&3!=r&&4!=r?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=r,!0)}function Y(e){switch(e.h){case 0:if(0!=e.h)Y(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Y(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Y(e);else{var t=q(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Y(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Q(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Y(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=q(e.g);return i=e.g.g+i,e.g.i=i,r(t,e),e.g.g=i,e.g.i=n,t}function X(e){var t,r=q(e.g),n=(e=e.g).g;if(e.g+=r,e=e.h,j)(t=R)||(t=R=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(n,n+r));else{r=n+r;for(var i,o,a,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(o=e[n++],194>i||128!=(192&o)?(n--,s.push(65533)):s.push((31&i)<<6|63&o)):240>i?n>=r-1?s.push(65533):128!=(192&(o=e[n++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&o)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(o=e[n++]))||0!=o-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(a=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,s.push(55296+(i>>10&1023),56320+(1023&i))):s.push(65533),8192<=s.length&&(c=P(c,s),s.length=0);t=P(c,s)}return t}function ee(){this.h=[],this.i=0,this.g=new K}function te(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var r=e.h,n=r.length,i=0,o=0;o<n;o++){var a=r[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(n=(r=e.g).h)&&(t.set(r.g.subarray(0,n),i),r.h=0),e.h=[t],t}function ne(e,t,r){if(null!=r){G(e.g,8*t+5),e=e.g;var n=r;0===(n=(r=0>n?1:0)?-n:n)?0<1/n?U=0:(0,U=2147483648):isNaN(n)?(0,U=2147483647):34028234663852886e22<n?(0,U=(r<<31|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),0,U=(r<<31|n)>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),n=8388607&Math.round(8388608*n),0,U=(r<<31|t+127<<23|n)>>>0),r=U,e.push(r>>>0&255),e.push(r>>>8&255),e.push(r>>>16&255),e.push(r>>>24&255)}}K.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},K.prototype.length=function(){return this.h},K.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,z(e,0,t)},Z.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function oe(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):ae(e,t,r):t(e)}function ae(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=oe(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=oe(e[i],t,r);return n}function se(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ce,le={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,le),e}function ue(e,t,r){var n=ce;if(ce=null,e||(e=n),n=this.constructor.ca,e||(e=n?[n]:[]),this.j=n?0:-1,this.i=null,this.g=e,e=(n=this.g.length)-1,n&&null!==(n=this.g[e])&&"object"==typeof n&&n.constructor===Object?(this.l=e-this.j,this.h=n):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,r)for(t=0;t<r.length;t++)(e=r[t])<this.l?(e+=this.j,(n=this.g[e])?de(n):this.g[e]=pe):(he(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function he(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function fe(e,t,r){return-1===t?null:void 0!==r&&r||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function me(e){var t=void 0!==t&&t,r=fe(e,1,t);return null==r&&(r=pe),r===pe&&ve(e,1,r=de([]),t),r}function ge(e,t,r){return null==(e=null==(e=fe(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(he(e),e.h[t]=r):e.g[t+e.j]=r}function ye(e,t){e.i||(e.i={});var r=e.i[1];if(!r){var n=me(e);r=[];for(var i=0;i<n.length;i++)r[i]=new t(n[i]);e.i[1]=r}return r}function be(e,t,r,n){var i=ye(e,r);t=t||new r,e=me(e),null!=n?(i.splice(n,0,t),e.splice(n,0,we(t,!1))):(i.push(t),e.push(we(t,!1)))}function we(e,t){if(e.i)for(var r in e.i){var n=e.i[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)n[i]&&we(n[i],t);else n&&we(n,t)}return e.g}function xe(e,t){return null==(e=fe(e,t))?0:e}function Se(e,t){return null==(e=fe(e,t))?"":e}function _e(e,t){if(e=e.m){te(t,t.g.end());for(var r=0;r<e.length;r++)te(t,e[r])}}function ke(e,t){if(4==t.h)return!1;var r=t.m;return Y(t),t.N||(t=z(t.g.h,r,t.g.g),(r=e.m)?r.push(t):e.m=[t]),!0}function Ee(e,t){var r=void 0;return new(r||(r=Promise))((function(n,i){function o(e){try{s(t.next(e))}catch(e){i(e)}}function a(e){try{s(t.throw(e))}catch(e){i(e)}}function s(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(o,a)}s((t=t.apply(e,void 0)).next())}))}function Ce(e){ue.call(this,e)}function Pe(e,t){for(;Q(t);)switch(t.i){case 8:var r=q(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 26:ve(e,3,r=X(t));break;case 34:ve(e,4,r=X(t));break;default:if(!ke(e,t))return e}return e}function Re(e){ue.call(this,e,-1,Te)}ue.prototype.toJSON=function(){return ae(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},f(Ce,ue),f(Re,ue),Re.prototype.addClassification=function(e,t){be(this,e,Ce,t)};var Te=[1];function je(e){ue.call(this,e)}function Oe(e,t){for(;Q(t);)switch(t.i){case 13:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 29:ve(e,3,r=W(t.g));break;case 37:ve(e,4,r=W(t.g));break;case 45:ve(e,5,r=W(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Le)}f(je,ue),f(Me,ue);var Le=[1];function Ie(e){ue.call(this,e)}function De(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 Ae(e){return ye(e,Ce).map((function(e){return{index:xe(e,1),Y:ge(e,2),label:null!=fe(e,3)?Se(e,3):void 0,displayName:null!=fe(e,4)?Se(e,4):void 0}}))}function Ne(e){return{x:ge(e,1),y:ge(e,2),z:ge(e,3),visibility:null!=fe(e,4)?ge(e,4):void 0}}function Fe(e,t){this.h=e,this.g=t,this.l=0}function Be(e,t,r){return function(e,t){var r=e.g;if(void 0===e.m){var n=De(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),i=De(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getProgramParameter(o,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(o));n=e.m=o,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),e.j={I:r.getAttribLocation(n,"aVertex"),H:r.getAttribLocation(n,"aTex"),da:i},e.s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.enableVertexAttribArray(e.j.I),r.vertexAttribPointer(e.j.I,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.o=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.enableVertexAttribArray(e.j.H),r.vertexAttribPointer(e.j.H,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(i,0)}n=e.j,r.useProgram(e.m),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.h.bindTexture2d(t.glName),r.enableVertexAttribArray(n.I),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.vertexAttribPointer(n.I,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.vertexAttribPointer(n.H,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.I),r.disableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):r?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function ze(e){this.g=e}f(Ie,ue);var Ue=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 Ve(e,t){return t+e}function He(e,t){window[e]=t}function qe(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||Ve,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=t,e.options)for(var r=(t=s(Object.keys(e.options))).next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.j[r]="function"==typeof n?n():n)}}function We(e){return Ee(e,(function e(){var t,r,n,i,o,a,s,l,d,u,p,h=this;return _(e,(function(e){switch(e.g){case 1:return t=h,h.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(h,h.j),y(e,function(){return Ee(this,(function e(){return _(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Ue),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:if(n=e.h,"object"==typeof window)return He("createMediapipeSolutionsWasm",{locateFile:h.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:h.locateFile}),a=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(a.map((function(e){var r=$e(t,e.url);if(void 0!==e.path){var n=e.path;r=r.then((function(e){return t.overrideFile(n,e),Promise.resolve(e)}))}return r}))),d=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(t.locateFile(e.url,t.S)):Promise.resolve()}))).then((function(){return Ee(t,(function e(){var t,r,n=this;return _(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,y(e,t(r),2);n.h=e.h,e.g=0}))}))})),u=Ee(t,(function e(){var t=this;return _(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,$e(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(e,Promise.all([d,l,u]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=r.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),y(e,createMediapipeSolutionsWasm(Module),6);case 6:h.h=e.h,h.l=new OffscreenCanvas(1,1),h.h.canvas=h.l,o=h.h.GL.createContext(h.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),h.h.GL.makeContextCurrent(o),e.g=4;break;case 7:if(h.l=document.createElement("canvas"),!(p=h.l.getContext("webgl2",{}))&&!(p=h.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();h.D=p,h.h.canvas=h.l,h.h.createContext(h.l,!0,!0,{});case 4:h.i=new h.h.SolutionWasm,h.R=!1,e.g=0}}))}))}function $e(e,t){return Ee(e,(function e(){var r,n,i=this;return _(e,(function(e){return t in i.F?e.return(i.F[t]):(r=i.locateFile(t,""),n=fetch(r).then((function(e){return e.arrayBuffer()})),i.F[t]=n,e.return(n))}))}))}function Ke(e,t,r){return Ee(e,(function e(){var n,i,o,a,c,l,d,u,p,h,f,m,g,v,b=this;return _(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,o=s(Object.keys(r)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(l=r[c])&&"texture"===l.type&&void 0!==t[l.stream]&&++i;1<i&&(b.G=!1),d=s(Object.keys(r)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(p=r[u]))return g=n,v=u,y(e,function(e,t,r){return Ee(e,(function e(){var n,i=this;return _(e,(function(e){return"number"==typeof r||r instanceof Uint8Array||r instanceof i.h.Uint8BlobList?e.return(r):r instanceof i.h.Texture2dDataOut?((n=i.s[t])||(n=new Fe(i.h,i.D),i.s[t]=n),e.return(Be(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(h=t[p.stream],"detection_list"===p.type){if(h){for(var w=h.getRectList(),x=h.getLandmarksList(),S=h.getClassificationsList(),k=[],E=0;E<w.size();++E){var C=w.get(E);e:{var P=new Ie;for(C=new Z(C);Q(C);)switch(C.i){case 13:var R=W(C.g);ve(P,1,R);break;case 21:ve(P,2,R=W(C.g));break;case 29:ve(P,3,R=W(C.g));break;case 37:ve(P,4,R=W(C.g));break;case 45:ve(P,5,R=W(C.g));break;case 48:for(var T=C.g,j=128,O=0,M=R=0;4>M&&128<=j;M++)O|=(127&(j=T.h[T.g++]))<<7*M;if(128<=j&&(O|=(127&(j=T.h[T.g++]))<<28,R|=(127&j)>>4),128<=j)for(M=0;5>M&&128<=j;M++)R|=(127&(j=T.h[T.g++]))<<7*M+3;128>j?(T=O>>>0,(R=2147483648&(j=R>>>0))&&(j=~j>>>0,0==(T=1+~T>>>0)&&(j=j+1>>>0)),T=4294967296*j+(T>>>0),R=R?-T:T):(T.l=!0,R=void 0),ve(P,6,R);break;default:if(!ke(P,C))break e}}P={Z:ge(P,1),$:ge(P,2),height:ge(P,3),width:ge(P,4),rotation:ge(P,5,0),X:xe(P,6)},R=x.get(E);e:for(C=new Me,R=new Z(R);Q(R);)if(10===R.i)be(C,T=J(R,new je,Oe),je,void 0);else if(!ke(C,R))break e;C=ye(C,je).map(Ne),T=S.get(E);e:for(R=new Re,T=new Z(T);Q(T);)if(10===T.i)R.addClassification(J(T,new Ce,Pe));else if(!ke(R,T))break e;P={T:P,O:C,M:Ae(R)},k.push(P)}w=k}else w=[];n[u]=w,e.g=7;break}if("proto_list"===p.type){if(h){for(w=Array(h.size()),x=0;x<h.size();x++)w[x]=h.get(x);h.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===p.type){n[u]=h,e.g=7;break}if("proto"===p.type){n[u]=h,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(f=b.s[u])||(f=new Fe(b.h,b.D),b.s[u]=f),y(e,Be(f,h,b.G),13);case 13:m=e.h,n[u]=m;case 7:p.transform&&n[u]&&(n[u]=p.transform(n[u])),e.g=3;break;case 14:g[v]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ge(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,o=s(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[n[a]]=i.get(a);var s=e.listeners[r];s&&(e.C=Ke(e,o,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var a=o[n[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Ze(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Qe(e){var t=this;e=e||{},this.g=new qe({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:Ze(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:"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){return Ee(t,(function t(){var r,n,i,o=this;return _(t,(function(t){return 1==t.g?(r=Ze(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,$e(o.g,r),2)):(i=t.h,o.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=qe.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},e.setOptions=function(e,t){var r=this;if(t=t||this.g.options){for(var n=[],i=[],o={},a=s(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var l=c.value;l in this.j&&this.j[l]===e[l]||(this.j[l]=e[l],void 0!==(c=t[l])&&(c.onChange&&(o.K=c.onChange,o.L=e[l],n.push(function(e){return function(){return Ee(r,(function t(){var r=this;return _(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(r.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(l={valueNumber:1===c.type?e[l]:0,valueBoolean:0===c.type&&e[l],valueString:2===c.type?e[l]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),l),i.push(c))))}0===n.length&&0===i.length||(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(n))}},e.initialize=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){return 1==e.g?y(e,We(t),2):3!=e.g?y(e,Ee(t,(function e(){var t,r,n,i,o,a,c,l,d=this;return _(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,y(e,$e(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),r=s(Object.keys(d.B)),n=r.next();!n.done;n=r.next())i=n.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=s(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Ge(d,c);l=d.j,d.j={},d.setOptions(l),e.g=0}))})),3):y(e,function(e){return Ee(e,(function e(){var t,r,n,i,o,a,c=this;return _(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=s(c.u),r=t.next();case 3:if(r.done){e.g=5;break}return y(e,(0,r.value)(),4);case 4:r=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(n=new c.h.GraphOptionChangeRequestList,i=s(c.A),o=i.next();!o.done;o=i.next())a=o.value,n.push_back(a);c.i.changeOptions(n),n.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},e.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){return Ee(this,(function r(){var n,i,o,a,c,l,d,u,p,h=this;return _(r,(function(r){switch(r.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,h.C,2)):r.return();case 2:return y(r,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=s(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,l=h.g.inputs[c]){e:{var f=h,m=e[c];switch(l.type){case"video":var g=f.m[l.stream];if(g||(g=new Fe(f.h,f.D),f.m[l.stream]=g),0===(f=g).l&&(f.l=f.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&m instanceof HTMLVideoElement){var v=m.videoWidth;g=m.videoHeight}else"undefined"!=typeof HTMLImageElement&&m instanceof HTMLImageElement?(v=m.naturalWidth,g=m.naturalHeight):(v=m.width,g=m.height);g={glName:f.l,width:v,height:g},(v=f.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),f.h.bindTexture2d(f.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[l.stream])||(g=new ze(f.h),f.m[l.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=f.data,w=b.setBoundingBox,x=g,S=v.T,_=new Ie;ve(_,1,S.Z),ve(_,2,S.$),ve(_,3,S.height),ve(_,4,S.width),ve(_,5,S.rotation),ve(_,6,S.X);var k=S=new ee;ne(k,1,fe(_,1)),ne(k,2,fe(_,2)),ne(k,3,fe(_,3)),ne(k,4,fe(_,4)),ne(k,5,fe(_,5));var E=fe(_,6);if(null!=E&&null!=E){G(k.g,48);var C=k.g,P=E;E=0>P;var R=(P=Math.abs(P))>>>0;for(P=Math.floor((P-R)/4294967296),P>>>=0,E&&(P=~P>>>0,4294967295<(R=1+(~R>>>0))&&(R=0,4294967295<++P&&(P=0))),E=U=R,R=P;0<R||127<E;)C.push(127&E|128),E=(E>>>7|R<<25)>>>0,R>>>=7;C.push(E)}if(_e(_,k),S=re(S),w.call(b,x,S),v.O)for(b=0;b<v.O.length;++b)k=!!(_=v.O[b]).visibility,x=(w=f.data).addNormalizedLandmark,S=g,_=Object.assign(Object.assign({},_),{visibility:k?_.visibility:0}),ve(k=new je,1,_.x),ve(k,2,_.y),ve(k,3,_.z),_.visibility&&ve(k,4,_.visibility),ne(C=_=new ee,1,fe(k,1)),ne(C,2,fe(k,2)),ne(C,3,fe(k,3)),ne(C,4,fe(k,4)),ne(C,5,fe(k,5)),_e(k,C),_=re(_),x.call(w,S,_);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=f.data).addClassification,S=g,_=v.M[b],ve(k=new Ce,2,_.Y),_.index&&ve(k,1,_.index),_.label&&ve(k,3,_.label),_.displayName&&ve(k,4,_.displayName),C=_=new ee,null!=(R=fe(k,1))&&null!=R)if(G(C.g,8),E=C.g,0<=R)G(E,R);else{for(P=0;9>P;P++)E.push(127&R|128),R>>=7;E.push(1)}ne(C,2,fe(k,2)),null!=(E=fe(k,3))&&(E=M(E),G(C.g,26),G(C.g,E.length),te(C,C.g.end()),te(C,E)),null!=(E=fe(k,4))&&(E=M(E),G(C.g,34),G(C.g,E.length),te(C,C.g.end()),te(C,E)),_e(k,C),_=re(_),x.call(w,S,_)}}f=f.data;break e;default:f={}}}switch(d=f,u=l.stream,l.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:n}));break;case"detections":(p=d).stream=u,p.timestamp=n,i.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.i.send(i),y(r,h.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",qe),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Qe.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){return y(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Ee(this,(function t(){var r=this;return _(t,(function(t){return y(t,r.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},C("SelfieSegmentation",Qe),C("VERSION","0.1.1632777926")}).call(_a);const ka=new ea("MediaPipe"),Ea="https://stream-assets.snapcall.io";let Ca=!1;const Pa=new _a.SelfieSegmentation({locateFile:(e,t)=>{if(ka.debug("selfieSegmentation",e,t),Ea)return`${Ea}/mediapipe/${e}`;return`${window.location.href.split("/").slice(0,-1).join("/")}/mediapipe/${e}`}});var Ra,Ta,ja,Oa;Ta=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 Ma={};function La(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}ja=function(e){var t=Ma[e];return t||(t=function(){try{throw new Error}catch(t){var e=(""+t.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g);if(e)return La(e[2])}return"/"}(),Ma[e]=t),t},Oa=function(e){var t=(""+e).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^/]+/);if(!t)throw new Error("Origin not found");return t[0]};let Ia=ja("adfgW")+o("juxiN").resolve("5WDBY");Ra=Ta(Ia,Oa(Ia),!1);class Da{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Ra,{name:"VirtualBackgroundTimerWorker"});constructor(e,t){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;const 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((()=>{Pa.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};Pa.setOptions(e),ka.log("selfie segmentation initialized"),Ca||(await Pa.initialize(),Ca=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Pa.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{Pa.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){ka.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()}))}}const Aa=window.AudioContext||window.webkitAudioContext;class Na{audioSources={};tracks={};constructor(){this.audioContext=new Aa,this.audioDestination=this.audioContext.createMediaStreamDestination()}getSetting(e){return this.tracks[e]?.getSettings()}removeTrack(e){const 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);const 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)}))}}const Fa=new ea("StreamerClient"),Ba="WRTC1",za="WRTC2",Ua="TRANS1",Va="CONS1",Ha="SOCK1",qa="USERLIMIT",Wa={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 $a extends CustomEvent{constructor(e,t){super(e,t)}}const Ka=EventTarget,Ga={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const Za=new class extends Ka{mediasoupTransport={};mediaPipeOption=Ga;useVideoBackground=!1;pendingDeviceRequest={};joinOptions={};devicesList=[];plan=void 0;permissions=[];constructor(){super(),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.peerId="",this.webcamProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){const e=[];return this.peers.forEach(((t,r)=>{const 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,peerId:this.peerId,profile:this.profile,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new $a("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new $a("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new $a("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){const 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}async init(e=this.roomId,t=this.joinOptions){if(this.roomId=e,this.joinOptions=t,!this.roomId)throw new Error("Missing room ID");let r;this.peerId||(this.peerId=Zi());try{const{streamer_instance:n,plan:{permissions:i,name:o},recordings:a}=await fetch(`${this.config.apiUrl}/streams/${e}/info`,{method:"get",headers:{"Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid room ID")}));this.permissions=i,!0===a?.headless&&i.push("record_video_on_demand"),this.plan=o;const s=new URLSearchParams({peerId:this.peerId,roomId:e});t.authKey&&s.append("authKey",t.authKey);const c=this.joinOptions.recorder?"/recorder":"";r=`${this.config.streamerServer}/${n}${c}?${s}`}catch(e){console.error("init",e);const t=new $a("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new Ki(r,{retry:{retries:0}}),this.protoo=new $i(this.protooTransport),this.protoo.on("open",(()=>{this.joinOptions.recorder?this.joinRecorder():this.joinRoom()})),this.protoo.on("failed",(()=>{Fa.error("protoo.on","failed"),this.onCriticalError(Ha)})),this.protoo.on("disconnected",(()=>{Fa.error("protoo.on","disconnected"),this.onCriticalError(Ha)})),this.protoo.on("close",(()=>Fa.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(Fa.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(qa);else if("newPeer"===e.method){const{id:t,profile:r,muted:n}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,muted:n,producersData:[]});const i=new $a("newPeer",{detail:{peerId:t,displayName:r.name,profile:r,muted:n}});this.dispatchEvent(i)}else if("newProducer"===e.method){const{peerId:t,producerId:r,deviceType:n,paused:i}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:i})}else if("peerClosed"===e.method){const{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach((e=>{this.onConsumerClose({consumerId:e.id})}));const n=new $a("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){const{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("recordStopped"===e.method)this.dispatchEvent(new $a("recordStopped",{detail:e.data}));else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new $a("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){const{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;const t=new $a("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){const{peerId:t,producerId:r,deviceType:n}=e.data;if("microphone"===e.data?.deviceType){const n=this.peers.get(t)?.producersData.find((e=>r===e.producerId));n&&(n.paused="producerPaused"===e.method)}let i=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){i=e.mediaSoupConsumer.id;break}const o="producerPaused"===e.method?"mediaPause":"mediaResume",a=new $a(o,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(a)}else if("mute"===e.method){const{peerId:t,device:r}=e.data,n=new $a("mediaPause",{detail:{peerId:t,deviceType:r,paused:!0}});this.dispatchEvent(n)}else if("unmute"===e.method){const{peerId:t,device:r}=e.data,n=new $a("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestDeviceResult"===e.method){const t=new $a(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new $a(e.method,{detail:e.data});this.dispatchEvent(t)}else if("videoRecordingStarted"===e.method||"videoRecordingStopped"===e.method||"videoRecordingRequested"===e.method){const t=new $a(e.method,{detail:{}});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,o=this.customMessages.get(t);o?o.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const a=this.customMessages.get(t);if(a&&a.totalChunks===a.chunks.length){const r=a.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new $a("customMessage",{detail:{...e.data,event:n}});this.dispatchEvent(i),this.customMessages.delete(t)}}}))}closeWebrtcTransport(e){const t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup)throw new Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{const 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(Ua),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw new Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",(t=>{if(e.transport&&!e.transport.closed)if(Fa.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{Fa.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){const t=new Error(`webRTC transport state failed for ${e.kind}`);Fa.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Ba)}}))}async joinRoom(){this.streamerMediasoup=await Sa.create(this.protoo,this.config);const{apiKey:e,email:t}=this.joinOptions;if(e)try{let r=null;e&&t?r=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(r=await this.fetchUserInfo({apiKey:e})),r&&this.dispatchEvent(new $a("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){Fa.warn("joinRoom",e),this.dispatchEvent(new $a("agentIdentity",{detail:{success:!1}}))}const{peers:r,videoRecordStarted:n,videoRecording:i}=await this.protoo.request("getRoomPeers",{apiKey:e,email:t});this.peers=new Map(r.map((e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}])));const o=await this.getCallId();this.dispatchEvent(new $a("enterRoom",{detail:{videoRecording:i,videoRecordStarted:n,peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:o,plan:this.plan,permissions:this.permissions}})),Fa.log("joinRoom","peers",r),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),r.forEach((e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})}))}async joinRecorder(){this.streamerMediasoup=await Sa.create(this.protoo,this.config);const e=await this.getCallId();this.joinOptions.apiKey&&await this.protoo.request("setUser",{apiKey:this.joinOptions.apiKey}).catch((e=>console.warn("setUser not implemented",e))),this.dispatchEvent(new $a("enterRoom",{detail:{videoRecording:{started:!1,requested:!1},videoRecordStarted:!1,peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions}}))}async switchMicrophone(e){try{Fa.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.audioMedia?.removeTrack("mic"),this.micProducer?.track?.stop(),Fa.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new na(t,this),this.audioMedia=this.audioMedia||new Na;const r=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",r),await(this.micProducer?.replaceTrack({track:r})),Fa.log("switchMicrophone","switched Microphone")}catch(e){Fa.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new $a("microphoneMute",{detail:{}});this.dispatchEvent(t),this.protoo.connected&&await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){Fa.log("onDeviceChange","detecting device change");const e=new $a("devicesListChange",{detail:{}});if(this.dispatchEvent(e),this.protoo&&!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return Fa.warn("onDeviceChange","no audio input device"),void await this.closeMicrophoneProducer();const r=t.find((e=>"default"===e.deviceId));if(r){const t=e.filter((e=>!Boolean(this.devicesList.find((t=>t.deviceId===e.deviceId&&t.label===e.label)))));Fa.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void Fa.warn("onDeviceChange","no audio input change");if(Fa.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new $a("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),Fa.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone(){if(!this.micProducer||this.micProducer?.closed){const e=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();const t=await this.getTransport("audio","send");this.audioLevel=new na(e,this),this.audioMedia=this.audioMedia||new Na;const r=e.getAudioTracks()[0];this.audioMedia.addTrack("mic",r);const n="microphone",i=await t.produce({track:this.audioMedia.getFinalTrack(),codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{Fa.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{Fa.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{Fa.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const o=new $a("microphoneEnabled",{detail:{}});this.dispatchEvent(o)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0;const e="microphone";this.protoo.notify("mute",{device:e});const t=new $a("microphoneMute",{detail:{}});this.dispatchEvent(t)}}unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),this.muted=!1;const e="microphone";this.protoo.notify("unmute",{device:e});const t=new $a("microphoneUnmute",{detail:{}});this.dispatchEvent(t)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){Fa.log("release");for(let e in 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();const e=new $a("leaveRoom",{detail:{}});this.dispatchEvent(e);const t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){this.protoo.request("terminateRoom")}async updateWebcams(){this.webcams=new Map;const e=await navigator.mediaDevices.enumerateDevices();for(const t of e)"videoinput"===t.kind&&this.webcams.set(t.deviceId,t);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);const t=new $a("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(t)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach((n=>{const i=this.pendingDeviceRequest[n];e===i.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo.notify("requestDeviceResult",{result:Boolean(t),failure:r,...i}))}))}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,Boolean(r),n?.name),n)throw n;return r}}async restartIce(e){if(Fa.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});Fa.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(e){this.onCriticalError(za),Fa.log("restartIce","restartIceFailed",e)}}scaleVideoMediasConstraintsParameter(e){let t=Wa.hd;2===e?t=Wa.vga:e>2&&(t=Wa.qvga),(!this.webcam.resolution||Wa[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(Fa.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}),!da.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(Fa.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{Fa.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){Fa.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 new 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:i}){if(!this.webcam.device)throw new Error("no webcam devices");const o={};if(r)if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",o.facingMode=this.webcam.facingMode;else{const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknown";let r=e.indexOf(t);r<e.length-1?r++:r=0;const n=this.webcams.get(e[r]);if(!n)throw new Error("no webcam device");this.webcam.device=n,o.deviceId={ideal:this.webcam.device?.deviceId}}else i?(this.webcam.facingMode=i,o.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,o.deviceId={ideal:this.webcam.device.deviceId});this.webcam.resolution=t||this.webcam.resolution||"hd",this.webcam.framerate=n||this.webcam.framerate;let a=Wa[t||this.webcam.resolution];this.useVideoBackground&&(a={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await(this.webcamProducer?.replaceTrack?.({track:null}).catch((e=>{Fa.error("switchCamera","clean track failed",e)})));const s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{...o,...a}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Da(s,this.mediaPipeOption));const c=await(this.mediaPipe?.createStream())||s;if(!await this.getTransport("video","send"))throw new Error("video transport not found, can not switch");const l=c.getVideoTracks()[0];await(this.webcamProducer?.replaceTrack?.({track:l}));const d=await(l.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(d?.zoom),min:d?.zoom?.min||0,max:d?.zoom?.max||0};const u=new $a("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(u)}async enableVideo(e){await this.updateWebcams();const 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 new Error("no webcam devices");this.webcam.resolution=e?.resolution||this.webcam.resolution||"hd",this.webcam.framerate=e?.frameRate||this.webcam.framerate;let r=Wa[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(r={width:{ideal:560},height:{ideal:400},qualityIndex:2});const n=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:e?.frameRate,...t,...r}}));if(e?.facingMode)try{const e=n.getVideoTracks()[0].getCapabilities();if(!e?.facingMode||0===e.facingMode.length)throw new 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 Da(n,this.mediaPipeOption));const i=await(this.mediaPipe?.createStream())||n;await this.updateWebcams();const o=await this.getTransport("video","send"),a=i.getVideoTracks()[0];this.webcamTrack=a;const s=await(a.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};this.webcamProducer=await o.produce({track:a,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",(()=>{this.webcamProducer=null})),this.webcamProducer.on("trackended",(()=>{this.disableVideo().catch((()=>{}))}));const c=new $a("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(c)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new 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;const e=new $a("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(e={audioTransportOption:"classic"}){if(!this.permissions.find((e=>"screen_sharing"===e)))throw new Error("feature not allowed");if("mix"===e.audioTransportOption&&!this.micProducer)throw new Error("microphone not activated and audio mix transport requested");const 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}}}));if(!t)return;const r="screen",n=await this.getTransport("audio","send"),i=t.getAudioTracks()[0];if(i)if("classic"===e.audioTransportOption)this.screenshareAudioProducer=await(this.streamerMediasoup?.produceAudio(n,i,{deviceType:r,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0}));else if("mix"===e.audioTransportOption){this.audioMedia=this.audioMedia||new Na,this.audioMedia.addTrack("screen",i);const e=this.audioMedia.getFinalTrack();e&&this.micProducer&&this.micProducer.replaceTrack({track:e})}const o=t.getVideoTracks()[0],a=await this.getTransport("video","send");this.screenshareVideoProducer=await(this.streamerMediasoup?.produceVideo(a,o,{deviceType:r,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0})),this.screenshareVideoProducer?.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const s=new $a("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);const e=new $a("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){const t=this.consumers.get(e);if(t){const r=t.mediaSoupConsumer.producerId;this.peers.forEach((e=>{const t=e.producersData.findIndex((e=>e.producerId===r));-1!==t&&e.producersData.splice(t,1)})),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();const n=new $a("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}){Fa.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>Fa.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>Fa.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else Fa.error("requestVideo",`Video consumer ${r} not found`)}async saveCapture(e){const{objectUrl:t}=await fetch(`${this.config.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));return{url:t,assetId:(await this.protoo.request("addCapture",{url:t})).assetId}}async saveThumbnail(e){const{objectUrl:t}=await fetch(`${this.config.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));return{url:t,assetId:(await this.protoo.request("addThumbnail",{url:t})).assetId}}async deleteCapture(e){return await this.protoo.request("deleteCapture",{assetId:e})}async captureVideo(e,t){if(this.permissions.find((e=>"instant_picture"===e))){let r;if(e)r=await ca(e,t);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");r=await la(this.webcamProducer.track,t)}return r}throw new Error("feature not allowed")}requestLocalVideo(e){if(Fa.info("requestLocalVideo"),this.webcamProducer){const t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;const r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw new Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareVideoProducer){const t=new MediaStream;t.addTrack(this.screenshareVideoProducer.track),e.srcObject=t}else Fa.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{const i="microphone"===r?"audio":"video",o=await this.getTransport(i,"recv"),a=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:o.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});const{producerId:c,id:l,kind:d,rtpParameters:u,appData:p}=a;Fa.log("consumeProducer","Data: ",a);const h=await o.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});Fa.log("transport",o),Fa.log("consumer",h),this.consumers.set(h.id,{mediaSoupConsumer:h,deviceType:r}),this.scaleVideoEncodingsParameter();const f=new $a("mediaStart",{detail:{peerId:e,mediaId:h.id,deviceType:r,paused:!!s&&s.muted}});if(this.dispatchEvent(f),"audio"===h.kind){const e=this.createAudioRenderer(h.id),t=new MediaStream;t.addTrack(h.track),e.setSource(t),e.play()}"video"===h.kind&&await this.protoo.request("resumeConsumer",{consumerId:h.id})}catch(e){this.onCriticalError(Va),Fa.error("consumeProducer","newConsumer request failed",e)}}async setDisplayName(e){await this.setProfile({name:e});const t=new $a("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){const t=await this.protoo.request("setProfile",e);this.profile={...t};const r=new $a("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){if(!this.permissions.find((e=>"request_input"===e)))throw new 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{const{callId:e}=await this.protoo.request("getCallId");return e}catch(e){throw Fa.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){const 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){const 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){const t=Zi(),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){const r=Zi(),n=this.getCustomMessageEventChunks(t),i=n.map(((t,i)=>this.protoo.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:i,chunk:t,totalChunks:n.length}})));await Promise.all(i)}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 Boolean(navigator.mediaDevices?.enumerateDevices)}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.audioMedia?.getSetting("mic")||this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){const e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){const 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;const t=new $a("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new oa({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){const t=Object.keys(this.audioRenderers).map((t=>this.audioRenderers[t].setSink(e).catch((e=>Fa.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)))));await Promise.allSettled(t)}dispatchEvent(e){const t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){const 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 new Error("Invalid agent info")}))}async fetchUserInfo({apiKey:e}){const 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 new 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")}};var Qa=(0,(je=o("85Hg2")).createContext)({});je=o("85Hg2");let Ya;var Ja;(Ja=Ya||(Ya={}))[Ja.SET_STREAMS=0]="SET_STREAMS",Ja[Ja.ADD_STREAM=1]="ADD_STREAM",Ja[Ja.REMOVE_STREAM=2]="REMOVE_STREAM",Ja[Ja.DEVICE_UPDATE=3]="DEVICE_UPDATE",Ja[Ja.MUTE=4]="MUTE",Ja[Ja.UNMUTE=5]="UNMUTE",Ja[Ja.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",Ja[Ja.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",Ja[Ja.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",Ja[Ja.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const Xa={streams:[],highlightedTile:null},es=(e,t)=>{switch(t.type){case Ya.SET_STREAMS:return{...e,streams:t.payload};case Ya.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case Ya.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case Ya.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:o,paused:a}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=a),{...e,[i]:o?n:null,muted:t}}return e}))}}case Ya.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case Ya.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case Ya.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case Ya.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case Ya.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case Ya.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},ts=(0,je.createContext)(void 0),rs=({children:e})=>{const[t,r]=(0,je.useReducer)(es,Xa),n={state:t,dispatch:r};return(0,a.jsx)(ts.Provider,{value:n,children:e})},ns=()=>{const e=(0,je.useContext)(ts);if(void 0===e)throw new Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}};var is=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise(((t,r)=>{((e,t,r)=>{const n=document.createRange(),i=document.createElement("textarea");if(i.value=e,document.body.appendChild(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.readOnly=!1,i.contentEditable="true",n.selectNodeContents(i);const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),i.setSelectionRange(0,999999)}else i.focus(),i.select();try{document.execCommand("copy")?t():r(new Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(i)})(e,t,r)}));const os=yr.path`
|
|
357
|
+
!function(e){var t=0,r=!1,n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,i)}catch(e){}var o=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 i=window.getComputedStyle(r);if(!i)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var o=i.getPropertyValue("-webkit-overflow-scrolling"),a=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===o&&("auto"===a||"scroll"===a),l=r.scrollHeight>r.offsetHeight;if(c&&l){var d=e.touches?e.touches[0].screenY:e.screenY,u=t<=d&&0===r.scrollTop,p=t>=d&&r.scrollHeight-r.scrollTop===s;return void((u||p)&&e.preventDefault())}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",o,!!n&&{passive:!1}),r=!0},c=document.createElement("div");document.documentElement.appendChild(c),c.style.WebkitOverflowScrolling="touch";var l="getComputedStyle"in window&&"touch"===window.getComputedStyle(c)["-webkit-overflow-scrolling"];document.documentElement.removeChild(c),l&&s();var d={enable:s,disable:function(){window.removeEventListener("touchstart",a,!1),window.removeEventListener("touchmove",o,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Nr&&(Nr=d),"function"==typeof e.define?function(e){e("iNoBounce",[],(function(){return d}))}(e.define):e.iNoBounce=d}(Nr);var rn={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},nn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.init(t,r)}return Ur(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||rn,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,tn(tn({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),on=function(){function e(){Br(this,e),this.observers={}}return Ur(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function an(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function sn(e){return null==e?"":""+e}function cn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function ln(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:n(o.shift())}}function dn(e,t,r){var n=ln(e,t,Object);n.obj[n.k]=r}function un(e,t){var r=ln(e,t),n=r.obj,i=r.k;if(n)return n[i]}function pn(e,t,r){var n=un(e,r);return void 0!==n?n:un(t,r)}function hn(e,t,r){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):hn(e[n],t[n],r):e[n]=t[n]);return e}function fn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var mn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function gn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return mn[e]})):e}var vn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,yn=[" ",",","?","!",";"];function bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Sn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;o<n.length;++o){if(!i)return;if("string"==typeof i[n[o]]&&o+1<n.length)return;if(void 0===i[n[o]]){for(var a=2,s=n.slice(o,o+a).join(r),c=i[s];void 0===c&&n.length>o+a;)a++,c=i[s=n.slice(o,o+a).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var l=n.slice(o+a).join(r);return l?Sn(c,l,r):void 0}i=i[n[o]]}return i}}var _n=function(e){qr(r,e);var t=xn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Br(this,r),n=t.call(this),vn&&on.call(Vr(n)),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return Ur(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];r&&"string"!=typeof r&&(a=a.concat(r)),r&&"string"==typeof r&&(a=a.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(a=e.split("."));var s=un(this.data,a);return s||!o||"string"!=typeof r?s:Sn(this.data&&this.data[e]&&this.data[e][t],r,i)}},{key:"addResource",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(n=t,t=(a=e.split("."))[1]),this.addNamespaces(t),dn(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in r)"string"!=typeof r[i]&&"[object Array]"!==Object.prototype.toString.apply(r[i])||this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=un(this.data,a)||{};n?hn(s,r,i):s=wn(wn({},s),r),dn(this.data,a,s),o.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?wn(wn({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(on),kn={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,r,n,i))})),t}};function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?En(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}var Rn={},Tn=function(e){qr(r,e);var t=Pn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Br(this,r),n=t.call(this),vn&&on.call(Vr(n)),cn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Vr(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=nn.create("translator"),n}return Ur(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=yn.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===n.length)return!0;var i=new RegExp("(".concat(n.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}(e,r,n));if(o&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,n){var i=this;if("object"!==Fr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,l=s.namespaces,d=l[l.length-1],u=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(d).concat(h).concat(c),f):"".concat(d).concat(h).concat(c)}return o?(f.res=c,f):c}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||c,v=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&S&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Cn(Cn({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=_,f):_}if(a){var k="[object Array]"===y,E=k?[]:{},C=k?v:g;for(var P in m)if(Object.prototype.hasOwnProperty.call(m,P)){var R="".concat(C).concat(a).concat(P);E[P]=this.translate(R,Cn(Cn({},t),{joinArrays:!1,ns:l})),E[P]===R&&(E[P]=m[P])}m=E}}else if(x&&"string"==typeof w&&"[object Array]"===y)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,n));else{var T=!1,j=!1,O=void 0!==t.count&&"string"!=typeof t.count,M=r.hasDefaultValue(t),L=O?this.pluralResolver.getSuffix(u,t.count,t):"",I=t["defaultValue".concat(L)]||t.defaultValue;!this.isValidLookup(m)&&M&&(T=!0,m=I),this.isValidLookup(m)||(j=!0,m=c);var D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,A=D&&j?void 0:m,N=M&&I!==m&&this.options.updateMissing;if(j||T||N){if(this.logger.log(N?"updateKey":"missingKey",u,d,c,N?I:m),a){var F=this.resolve(c,Cn(Cn({},t),{},{keySeparator:!1}));F&&F.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.")}var B=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)B.push(z[U]);else"all"===this.options.saveMissingTo?B=this.languageUtils.toResolveHierarchy(t.lng||this.language):B.push(t.lng||this.language);var V=function(e,r,n){var o=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,o,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,o,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?B.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||I)}))})):V(B,c,I))}m=this.extendTranslation(m,e,t,f,n),j&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),(j||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(c):c,T?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Cn(Cn({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(Cn(Cn({},r),{interpolation:Cn(Cn({},this.options.interpolation),r.interpolation)}));var a,s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=Cn(Cn({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);a<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return i&&i[0]===n[0]&&!r.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):o.translate.apply(o,n.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var u=r.postProcess||this.options.postProcess,p="string"==typeof u?[u]:u;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=kn.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Cn({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;a.options.fallbackNS&&(d=d.concat(a.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);d.forEach((function(e){a.isValidLookup(t)||(o=e,!Rn["".concat(f[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(Rn["".concat(f[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" 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!!!")),f.forEach((function(r){if(!a.isValidLookup(t)){i=r;var o,c=[l];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=a.pluralResolver.getSuffix(r,s.count,s));var f="".concat(a.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+f)),h){var m="".concat(l).concat(a.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+f))}}for(;o=c.pop();)a.isValidLookup(t)||(n=o,t=a.getResource(r,e,o,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var 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)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}(on);function jn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var On=function(){function e(t){Br(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nn.create("languageUtils")}return Ur(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=jn(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]=jn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=jn(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var n=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(r.isSupportedCode(e)?i.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&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)),n.forEach((function(e){i.indexOf(e)<0&&o(r.formatLanguageCode(e))})),i}}]),e}(),Mn=[{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}],Ln={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)}},In=["v1","v2","v3"],Dn={zero:0,one:1,two:2,few:3,many:4,other:5};function An(){var e={};return Mn.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Ln[t.fc]}}))})),e}var Nn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.languageUtils=t,this.options=r,this.logger=nn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==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=An()}return Ur(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var 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}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((function(e,t){return Dn[e]-Dn[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):n.numbers.map((function(n){return t.getSuffix(e,n,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!In.includes(this.options.compatibilityJSON)}}]),e}();function Fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=nn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Ur(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:gn,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?fn(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?fn(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?fn(t.nestingPrefix):t.nestingPrefixEscaped||fn("$t("),this.nestingSuffix=t.nestingSuffix?fn(t.nestingSuffix):t.nestingSuffixEscaped||fn(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var i,o,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(e.indexOf(s.formatSeparator)<0){var i=pn(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:e})):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),l=o.join(s.formatSeparator).trim();return s.format(pn(t,c,a),l,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:a}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(o=d(r)))if("function"==typeof u){var c=u(e,i,n);o="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))o="";else{if(p){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=sn(o));var l=t.safeValue(o);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Bn({},o);function s(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),i="{".concat(n[1]);e=n[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=Bn(Bn({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;r=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var d=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=d.shift(),c=d,l=!0}if((n=t(s.call(this,r[1].trim(),a),a))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=sn(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce((function(e,t){return i.format(e,t,o.lng,Bn(Bn({},o),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function Un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=nn.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,Vn(Vn({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Vn({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Vn({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Vn({},r)).format(e)}},this.init(t)}return Ur(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,n){var i=this;return t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=Xr(e.split(":")),n=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[n.trim()]||(r[n.trim()]=i),"false"===i&&(r[n.trim()]=!1),"true"===i&&(r[n.trim()]=!0),isNaN(i)||(r[n.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:r}}(t),a=o.formatName,s=o.formatOptions;if(i.formats[a]){var c=e;try{var l=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},d=l.locale||l.lng||n.locale||n.lng||r;c=i.formats[a](e,d,Vn(Vn(Vn({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}();function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}var Kn=function(e){qr(r,e);var t=$n(r);function r(e,n,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Br(this,r),o=t.call(this),vn&&on.call(Vr(o)),o.backend=e,o.store=n,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=nn.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return Ur(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,o={},a={},s={},c={};return e.forEach((function(e){var n=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!r.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===a[s]&&(a[s]=!0):(i.state[s]=1,n=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),r&&this.store.addResourceBundle(i,o,r),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=o,l=ln(n,[i],Object),d=l.obj,u=l.k,d[u]=d[u]||[],c&&(d[u]=d[u].concat(s)),c||d[u].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){a[e]||(a[e]={});var t=r.loaded[e];t.length&&t.forEach((function(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((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:i,wait:o,callback:a}):(this.readingCalls++,this.backend[r](e,t,(function(s,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}s&&c&&i<n.maxRetries?setTimeout((function(){n.read.call(n,e,t,r,i+1,2*o,a)}),o):a(s,c)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=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."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(function(n,a){n&&t.logger.warn("".concat(r,"loading namespace ").concat(o," for language ").concat(i," failed"),n),!n&&a&&t.logger.log("".concat(r,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,n,a)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(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!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,Wn(Wn({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(on);function Gn(){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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Fr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Fr(e[2])||"object"===Fr(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Zn(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&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qn(Object(r),!0).forEach((function(t){Kr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$r(e);if(t){var i=$r(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Xn(){}function ei(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ti=function(e){qr(r,e);var t=Jn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Br(this,r),e=t.call(this),vn&&on.call(Vr(e)),e.options=Zn(n),e.services={},e.logger=nn,e.modules={external:[]},ei(Vr(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),Wr(e,Vr(e));setTimeout((function(){e.init(n,i)}),0)}return e}return Ur(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var n=Gn();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yn(Yn(Yn({},n),this.options),Zn(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yn(Yn({},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){var o;this.modules.logger?nn.init(i(this.modules.logger),this.options):nn.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Hn);var a=new On(this.options);this.store=new _n(this.options.resources,this.options);var s=this.services;s.logger=nn,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new Nn(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new zn(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Kn(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Tn(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=Xn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var d=["addResource","addResources","addResourceBundle","removeResourceBundle"];d.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var u=an(),p=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),u}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn,n=r,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var o=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=an();return e||(e=this.languages),t||(t=this.options.ns),r||(r=Xn),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new 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&&kn.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=an();this.emit("languageChanging",e);var i=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},o=function(o){e||o||!r.services.languageDetector||(o=[]);var a="string"==typeof o?o:r.services.languageUtils.getBestMatchFromCodes(o);a&&(r.language||i(a),r.translator.language||r.translator.changeLanguage(a),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(a)),r.loadResources(a,(function(e){!function(e,o){o?(i(o),r.translator.changeLanguage(o),r.isLanguageChangingTo=void 0,r.emit("languageChanged",o),r.logger.log("languageChanged",o)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var o;if("object"!==Fr(i)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];o=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else o=Yn({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=o.keyPrefix?"".concat(o.keyPrefix).concat(l).concat(t):t;return n.t(d,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=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;var n=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};if(r.precheck){var s=r.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||i&&!a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=an();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=an();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter((function(e){return n.indexOf(e)<0}));return i.length?(this.options.preload=n.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),o=new r(i),a=["store","services","language"];return a.forEach((function(t){o[t]=e[t]})),o.services=Yn({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Tn(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];o.emit.apply(o,[e].concat(r))})),o.init(i,n),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(on);Kr(ti,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ti(e,t)}));var ri=ti.createInstance();ri.createInstance=ti.createInstance;ri.createInstance,ri.init,ri.loadResources,ri.reloadResources,ri.use,ri.changeLanguage,ri.getFixedT,ri.t,ri.exists,ri.setDefaultNamespace,ri.hasLoadedNamespace,ri.loadNamespaces,ri.loadLanguages;var ni=ri,ii={};(ii=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ii.default=ii;var oi={};function ai(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(oi=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,oi.default=oi;var si={};(si=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}).__esModule=!0,si.default=si;je=o("85Hg2");var ci=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,li={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},di=function(e){return li[e]};function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ui(Object(n),!0).forEach((function(t){r(si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ui(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hi,fi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(ci,di)}},mi=(0,je.createContext)();function gi(){return fi}var vi=function(){function e(){r(ii)(this,e),this.usedNamespaces={}}return r(oi)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function yi(){return hi}var bi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fi=pi(pi({},fi),e)}(e.options.react),function(e){hi=e}(e)}};const wi=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},xi={en:{name:"English",translation:{header:{free:"Free version"},loader:{connection:"Connecting..."},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"},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"},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"},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"},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",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You",cancel:"Cancel",confirm:"Confirm",remove:"Remove"},greeting:{mainTitle:"Welcome to SnapCall",sideTitle:"Are you ready to join?",sideDescription:"Before joining the room, enter your name. It will displayed to participants.",namePlaceholder:"Your name",nameSubmit:"Join Conversation",footerTitle:"Powered by SnapCall",footerDescription:"Meet SnapCall, the easiest way to add real-time video to platform, product or service."},recorder:{limit:"Video recording limited to 5 min.",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 }}",sendElement:"Send {{ type }}",sendElements:"Send {{ count }} elements",allowAccess:"Allow access",okay:"Okay",allowCamMicAccess:"Allow access to camera and microphone",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?",instructions:{allowAccessOnPrompt:"When prompted, <1>allow access</1> to the camera and microphone.",tapPhotoButton:"Tap the <1 /><2>Camera button</2> to take a photo.",multiplePhotos:"Feel free to take multiple photos for more details.",reviewAndSendPhotos:"Review your photo and <1>send it when you're satisfied.</1>",reviewAndSendScreenShare:"Review your video and <1>send it when you're satisfied.</1>",tapVideoButton:"Tap the <1 /><2>Record button</2> to start recording.",videoSpeech:"You can <1>talk during</1> the recording to provide additional information.",tapStopVideoButton:"When you're done, tap the <1 /><2>Stop button</2>.",reviewAndSendVideos:"Review your video and <1>send it when you're satisfied</1>.",tapScreenShareButton:"Tap <1>Record my screen</1> to begin recording.",tapStopScreenShareButton:"When you're done, tap <1>Stop recording</1>.",screenShareInstruction:"Select the screen or window you wish to record.",privacyPolicy:"By proceeding, you agree to our <1>Privacy Policy</1>."},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?"}}},fr:{name:"Français",translation:{header:{free:"Version gratuite"},loader:{connection:"Connexion..."},notifications:{screensharingError:"Une erreur est survenue pendant l'activation du partage d'écran",microphoneError:"Une erreur est survenue pendant l'activation du micro",cameraError:"Une erreur est survenue pendant l'activation de la caméra",cameraRotateError:"Une erreur est survenue pendant la rotation de la caméra",noCamera:"Aucune caméra disponible",blockedMicrophonePopupTitle:"Votre caméra et micro sont bloqués",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.",reload:"Recharger",criticalError:"Une erreur critique est survenue (erreur {{code}}).",agentJoinError:"Une erreur est survenue en essayant de rejoindre la salle en tant qu'agent",close:"Fermer",connectedTo:"Connecté à {{name}}",recording:"Enregistrement en cours"},recordingPopup:{recordingStartTitle:"L'enregistrement va commencer.",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.",dismiss:"Fermer"},endView:{goBack:"Retourner dans l'appel",tooLate:"Vous êtes arrivez trop tard",callIsOver:"Cet appel est terminé ou supprimé",callEnded:"Cet appel est terminé",callLeft:"Vous avez quitté l'appel",full:"Impossible de rejoindre l'appel",fullDescription:"Limite d'utilisateurs atteinte. Merci de rejoindre l'appel ultérieurement."},menu:{title:"Menu",new:"NOUVEAU",openNewTab:"Ouvrir un nouvel onglet",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Partage d'écran",stopRecord:"Arrêter l'enregistrement",startRecord:"Enregistrer l'appel"},blockedFeature:{titleConnected:"Souscrire au plan Pro",titleGuest:"Fonctionnalité non disponible",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.",dismissGuest:"D'accord",dismissConnected:"Souscrire à Pro"},copyLink:{title:"Copier le lien",description:"Copier le lien dans le presse-papiers",error:"Une erreur est survenue pendant la copie du lien dans le presse-papier",copied:"Lien copié dans le presse-papier"},quickConnect:{title:"Quick Connect",scanTitle:"Scannez le QR Code",scan:"Scannez ce QR code avec votre téléphone pour ouvrir l'appel."},settings:{title:"Paramètres",preferences:"Préférences",language:"Langage",devices:"Appareils",help:"Aide",helpCenter:"Accéder au centre d'aide"},audioMenu:{title:"Audio",blockedMicrophone:"Votre micro est bloqué.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Basse définition (240p)",standardDef:"Définition standard (480p)",highDef:"Haute définition (720p)",blockedCamera:"Votre caméra est bloqué.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Résolution envoyée (max)"},shareLink:{title:"Partager un lien",title2:"Partager un lien",invalid:"Lien invalide",sentToUsers:"Lien envoyé aux participants",sentToUser:"Lien envoyé à {{user}}",failed:"Une erreur est survenue pendant l'envoi du lien",poweredBy:"Proposé par",invoice:"{{user}} vous a envoyé une facture.",pay:"Payer"},youtube:{title:"Regardons Ensemble",url:"URL YOUTUBE",invalid:"URL YouTube invalide",share:"Regarder maintenant"},sharedHistory:{shared:"Partagé avec vous"},snapshot:{title:"Snapshot",shared:"Snapshot envoyé.",sentToUsers:"Snapshot envoyé aux participants.",sentToUser:"Snapshot envoyé à {{user}}",save:"Sauvegarder l'image",error:"Une erreur est survenue pendant l'envoi du snapshot"},gdpr:{recordedWarning:"Pour améliorer la qualité de notre service, cet appel va être enregistré."},requestDevice:{requestInput:"Demander l'activation",request:"{{user}} voudrait que vous partagiez votre {{device}}",timedOut:"Votre requête n'a pas eu de réponse",declined:"Votre requête a été refusé.",userDeclined:"{{user}} a décliné votre requête."},leave:{title:"Quitter",leaveCall:"Quitter l'appel",endCall:"Terminer l'appel"},virtualBackground:{title:"Arrière plan virtuel",setBackground:"Mettre l'arrière plan"},misc:{someone:"Quelqu'un",camera:"Caméra",microphone:"Micro",photo:"Photo",video:"Vidéo",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous",cancel:"Annuler",confirm:"Confirmer",remove:"Enlever"},greeting:{mainTitle:"Bienvenue sur SnapCall",sideTitle:"Prêt à rejoindre ?",sideDescription:"Avant de rejoindre la salle, veuillez entrer votre nom.",namePlaceholder:"Nom",nameSubmit:"Rejoindre la conversation",footerTitle:"Propulsé par SnapCall",footerDescription:"Découvrez SnapCall, ajoutez de la vidéo en temps réel à n'importe quelle plateforme, produit ou service."},recorder:{limit:"Enregistrement vidéo limité à 5 min.",submissionTitle:"Merci pour votre soumission !",submissionDescription:"Votre photo/vidéo a été envoyée avec succès. Nous l'examinerons et reviendrons vers vous bientôt.",confirmRemovalTitle:"Confirmer la suppression",confirmRemovalDescription:"Voulez-vous vraiment supprimer cette photo/vidéo ? Cette action ne peut pas être annulée.",elementBeingProcessed:"Veuillez patienter un moment pendant que votre {{ type }} est en cours de traitement...",waitVideo:"Cela peut prendre jusqu'à 15 secondes pour qu'une vidéo soit prête.",elementCaptureSuccess:"{{ type }} capturé(e) avec succès",takeNewElement:"Prendre une nouvelle {{ type }}",sendElement:"Envoyer la {{ type }}",sendElements:"Envoyer {{ count }} éléments",allowAccess:"Autoriser l'accès",okay:"D'accord",allowCamMicAccess:"Autoriser l'accès à la caméra et au micro",allowScreenShareAccess:"Autoriser l'accès au partage d'écran",permissionDeniedTitle:"Quelque chose s'est mal passé !",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.",photoInstructionsTitle:"Prêt(e) à prendre une photo ?",videoInstructionsTitle:"Prêt(e) à enregistrer une vidéo ?",screenShareInstructionsTitle:"Prêt(e) à partager votre écran ?",instructions:{allowAccessOnPrompt:"Lorsque vous y êtes invité(e), <1>autorisez l'accès</1> à la caméra et au microphone.",tapPhotoButton:"Appuyez sur le <1 /><2>bouton Appareil photo</2> pour prendre une photo.",multiplePhotos:"N'hésitez pas à prendre plusieurs photos pour plus de détails.",reviewAndSendPhotos:"Vous pouvez revoir votre photo, puis <1>l'envoyer lorsque vous avez terminé.</1>",tapVideoButton:"Appuyez sur le <1 /><2>bouton d'enregistrement</2> pour démarrer un enregistrement.",videoSpeech:"Vous pouvez <1>parler pendant</1> l'enregistrement pour ajouter des détails.",tapStopVideoButton:"Lorsque vous avez terminé, appuyez sur le <1 /><2>bouton Arrêter</2>.",reviewAndSendVideos:"Vous pouvez revoir votre vidéo, puis <1>l'envoyer lorsque vous avez terminé</2>.",tapScreenShareButton:"Appuyez sur <1>Enregistrer écran</1> pour démarrer un enregistrement.",tapStopScreenShareButton:"Lorsque vous avez terminé, appuyez sur <1>Stop enregistrement</1>.",reviewAndSendScreenShare:"Vous pouvez revoir votre vidéo, puis <1>l'envoyer lorsque vous avez terminé.</1>",screenShareInstruction:"Sélectionnez l'écran ou la fenêtre que vous souhaitez enregistrer.",privacyPolicy:"En poursuivant, vous acceptez notre <1>Politique de confidentialité</1>."},switchToMobileTitle:"Passez sur votre mobile",switchToMobileDescription:"Profitez d'une expérience encore plus pratique en utilisant votre téléphone pour prendre des photos et enregistrer des vidéos.",useDesktopVersion:"Continuer",scanQRCode:"Scannez ce code QR avec un appareil compatible.",startScreenShareButton:"Enregistrer écran",stopScreenShareButton:"Stop enregistrement",screenTitle:"Prêt à capturer votre écran ?"}}},it:{name:"Italiano",translation:{header:{free:"Versione gratuita"},loader:{connection:"Connessione..."},notifications:{screensharingError:"Si è verificato un errore durante l'attivazione della condivisione dello schermo",microphoneError:"Si è verificato un errore durante l'attivazione del microfono",cameraError:"Si è verificato un errore durante l'attivazione della fotocamera",cameraRotateError:"Si è verificato un errore durante la rotazione della fotocamera",noCamera:"Nessuna fotocamera disponibile",blockedMicrophonePopupTitle:"La tua fotocamera e il tuo microfono sono bloccati",blockedMicrophonePopup:"SnapCall ha bisogno di accedere alla fotocamera e al microfono. Fare clic sull'icona della fotocamera bloccata nella barra degli indirizzi del browser.",reload:"Ricaricare",criticalError:"Si è verificato un errore critico (errore {{code}}).",agentJoinError:"Si è verificato un errore cercando di entrare nella conversazione come agente",close:"Chiudere",connectedTo:"Connesso a {{name}}",recording:"Registrazione in corso"},recordingPopup:{recordingStartTitle:"Registrazione in procinto di iniziare.",recordingStartText:"Questa chiamata verrà registrata a breve. Se preferisci non essere registrato, sei libero di lasciare la chiamata in questo momento.",dismiss:"Chiudi"},endView:{goBack:"Torna alla chiamata",tooLate:"Sei arrivato troppo tardi",callIsOver:"Questa chiamata è finita o è stata eliminata",callEnded:"Questa chiamata è finita",callLeft:"Hai lasciato la chiamata",full:"Impossibile partecipare alla chiamata",fullDescription:"Limite d'uso attenente."},menu:{title:"Menù",new:"NUOVO",openNewTab:"Apri una nuova scheda",quickConnect:"Connessione Rapida",pictureInPicture:"Immagine nell'immagine",screenSharing:"Condivisione dello schermo",stopRecord:"Interrompere la registrazione",startRecord:"Registra chiamata"},blockedFeature:{titleConnected:"L'aggiornamento a Pro",titleGuest:"Funzione non disponibile",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.",dismissGuest:"Okay",dismissConnected:"L'aggiornamento a Pro"},copyLink:{title:"Copia il link",description:"Copia il link negli appunti",error:"Si è verificato un errore durante la copia negli Appunti",copied:"Link copiato negli Appunti"},quickConnect:{title:"Connessione Rapida",scanTitle:"Scansiona il codice QR",scan:"Scansiona questo codice QR con il telefono per aprire la chiamata."},settings:{title:"Impostazioni",preferences:"Preferenze",language:"Linguaggio",devices:"Dispositivi",help:"Aiuto",helpCenter:"Accedi all'Assistenza"},audioMenu:{title:"Audio",blockedMicrophone:"Il tuo microfono è bloccato.",microphonePermissions:"Si prega di accettare la condivisione del microfono prima di accedere a queste opzioni."},videoMenu:{title:"Video",lowDef:"Definizione bassa (240p)",standardDef:"Definizione standard (480p)",highDef:"Alta definizione (720p)",blockedCamera:"La fotocamera è bloccata.",cameraPermissions:"Si prega di accettare la condivisione della fotocamera prima di accedere a queste opzioni.",sendResolution:"Risoluzione inviata (max)"},shareLink:{title:"Condividi un link",title2:"Condividi un link",invalid:"Collegamento non valido",sentToUsers:"Link inviato ai partecipanti",sentToUser:"Link inviato a {{user}}",failed:"Si è verificato un errore durante l'invio del link",poweredBy:"Proposto da",invoice:"{{User}} ti ha inviato una fattura.",pay:"Paga"},youtube:{title:"Vedere Assieme",url:"URL YOUTUBE",invalid:"URL YouTube non valido",share:"Guarda ora"},sharedHistory:{shared:"Condiviso con te"},snapshot:{title:"Schermata",shared:"Schermata inviata",sentToUsers:"Schermanta inviata ai partecipanti",sentToUser:"Schermata inviata a {{user}}",save:"Salva l'immagine",error:"Si è verificato un errore durante l'invio della schermata"},gdpr:{recordedWarning:"Per migliorare la qualità del nostro servizio, questa chiamata verrà registrata."},requestDevice:{requestInput:"Richiesta di attivazione",request:"{{user}} vorrebbe condividere il tuo {{device}}",timedOut:"La tua richiesta non ha ricevuto risposta",declined:"La tua richiesta è stata rifiutata.",userDeclined:"{{user}} ha rifiutato la tua richiesta"},leave:{title:"Lasciare",leaveCall:"Lascia la chiamata",endCall:"Termina la chiamata per tutti"},virtualBackground:{title:"Sfondo virtuale",setBackground:"Imposta sfondo"},virtualbackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Qualcuno",camera:"Telecamera",microphone:"Microfono",photo:"Foto",video:"Video",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi",cancel:"Annulla",confirm:"Confermare",remove:"Rimuovere"},greeting:{mainTitle:"Benvenuto a SnapCall",sideTitle:"Sei pronto per unirti?",sideDescription:"Prima di entrare nella stanza, inserisci il tuo nome. Verrà visualizzato ai partecipanti.",namePlaceholder:"Il tuo nome",nameSubmit:"Partecipa alla conversazione",footerTitle:"Offerto da SnapCall",footerDescription:"Incontrare SnapCall, il modo più semplice per aggiungere video in tempo reale a piattaforma, prodotto o servizio."},recorder:{limit:"Registrazione video limitata a 5 min.",submissionTitle:"Grazie per il tuo invio!",submissionDescription:"La tua foto/video è stata inviata con successo. La esamineremo e ti risponderemo al più presto.",confirmRemovalTitle:"Conferma rimozione",confirmRemovalDescription:"Sei sicuro di voler rimuovere questa foto/video? Questa azione non può essere annullata.",elementBeingProcessed:"Attendi un momento mentre il tuo {{ type }} viene elaborato...",waitVideo:"Potrebbero essere necessari fino a 15 secondi affinché un video sia pronto.",elementCaptureSuccess:"{{ type }} catturato con successo",takeNewElement:"Cattura un nuovo {{ type }}",sendElement:"Invia {{ type }}",sendElements:"Invia {{ count }} elementi",allowAccess:"Consenti accesso",okay:"Okay",allowCamMicAccess:"Consenti accesso a fotocamera e microfono",allowScreenShareAccess:"Consenti accesso alla condivisione dello schermo",permissionDeniedTitle:"Qualcosa è andato storto!",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.",photoInstructionsTitle:"Pronto a scattare una foto?",videoInstructionsTitle:"Pronto a registrare un video?",screenShareInstructionsTitle:"Pronto a condividere il tuo schermo?",instructions:{allowAccessOnPrompt:"Quando richiesto, <1>consenti l'accesso</1> a fotocamera e microfono.",tapPhotoButton:"Tocca il pulsante <1 /><2>Fotocamera</2> per scattare una foto.",multiplePhotos:"Non esitare a scattare più foto per maggiori dettagli.",reviewAndSendPhotos:"Puoi rivedere la tua foto e poi <1>inviarla quando hai finito.</1>",tapVideoButton:"Tocca il pulsante <1 /><2>Registra</2> per avviare una registrazione.",videoSpeech:"Puoi <1>parlare durante</1> la registrazione per aggiungere dettagli.",tapStopVideoButton:"Quando hai finito, tocca il pulsante <1 /><2>Ferma</2>.",reviewAndSendVideos:"Puoi rivedere il tuo video e poi <1>inviarlo quando hai finito</1>.",tapScreenShareButton:"Tocca <1>Registra il mio schermo</1> per avviare una registrazione.",tapStopScreenShareButton:"Quando hai finito, tocca <1>Ferma registrazione</1>.",reviewAndSendScreenShare:"Puoi rivedere il tuo video e poi <1>inviarlo quando hai finito.</1>",screenShareInstruction:"Seleziona lo schermo o la finestra che desideri registrare.",privacyPolicy:"Procedendo, l'utente accetta la nostra <1>Privacy Policy</1>."},switchToMobileTitle:"Passa al tuo dispositivo mobile",switchToMobileDescription:"Goditi un'esperienza ancora più pratica utilizzando il tuo telefono per scattare foto e registrare video.",useDesktopVersion:"Usa la versione desktop",scanQRCode:"Scansiona questo codice QR con un dispositivo compatibile.",startScreenShareButton:"Registra il mio schermo",stopScreenShareButton:"Ferma registrazione",screenTitle:"Pronto a catturare il tuo schermo?"}}}};ni.use(bi).init({lng:wi(),fallbackLng:"en",resources:xi,interpolation:{escapeValue:!1}});var Si=ni,_i=(je=o("85Hg2"),{}),ki={};(ki=function(e){if(Array.isArray(e))return e}).__esModule=!0,ki.default=ki;var Ei={};(Ei=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}).__esModule=!0,Ei.default=Ei;var Ci={},Pi={};(Pi=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}).__esModule=!0,Pi.default=Pi,(Ci=function(e,t){if(e){if("string"==typeof e)return Pi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pi(e,t):void 0}}).__esModule=!0,Ci.default=Ci;var Ri={};(Ri=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Ri.default=Ri,(_i=function(e,t){return ki(e)||Ei(e,t)||Ci(e,t)||Ri()}).__esModule=!0,_i.default=_i;je=o("85Hg2");function Ti(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var ji={};function Oi(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&ji[t[0]]||("string"==typeof t[0]&&(ji[t[0]]=new Date),Ti.apply(void 0,t))}function Mi(e,t,r){e.loadNamespaces(t,(function(){if(e.isInitialized)r();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),r()}))}}))}function Li(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,o=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(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)||i&&!a(o,e))))}function Ii(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return Oi("i18n.languages were undefined or empty",t.languages),!0;var n=void 0!==t.options.ignoreJSONStructure;return n?t.hasLoadedNamespace(e,{precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):Li(e,t,r)}function Di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(n),!0).forEach((function(t){r(si)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ni=function(e,t){var r=(0,je.useRef)();return(0,je.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Fi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,je.useContext)(mi)||{},o=i.i18n,a=i.defaultNS,s=n||o||yi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new vi),!s){Oi("You will need to pass in an i18next instance by using initReactI18next");var c=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[c,{},!1];return l.t=c,l.i18n={},l.ready=!1,l}s.options.react&&void 0!==s.options.react.wait&&Oi("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Ai(Ai(Ai({},gi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,h=e||a||s.options&&s.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var f=(s.isInitialized||s.initializedStoreOnce)&&h.every((function(e){return Ii(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?h:h[0],p)}var g=(0,je.useState)(m),v=r(_i)(g,2),y=v[0],b=v[1],w=h.join(),x=Ni(w),S=(0,je.useRef)(!0);(0,je.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function r(){S.current&&b(m)}return S.current=!0,f||u||Mi(s,h,(function(){S.current&&b(m)})),f&&x&&x!==w&&S.current&&b(m),e&&s&&s.on(e,r),t&&s&&s.store.on(t,r),function(){S.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,r)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,r)}))}}),[s,w]);var _=(0,je.useRef)(!0);(0,je.useEffect)((function(){S.current&&!_.current&&b(m),_.current=!1}),[s,p]);var k=[y,s,f];if(k.t=y,k.i18n=s,k.ready=f,f)return k;if(!f&&!u)return k;throw new Promise((function(e){Mi(s,h,(function(){e()}))}))}var Bi=o("4Fy4N");var zi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ui;const Vi=new Uint8Array(16);function Hi(){if(!Ui&&(Ui="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ui))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ui(Vi)}const qi=[];for(let e=0;e<256;++e)qi.push((e+256).toString(16).slice(1));function Wi(e,t=0){return(qi[e[t+0]]+qi[e[t+1]]+qi[e[t+2]]+qi[e[t+3]]+"-"+qi[e[t+4]]+qi[e[t+5]]+"-"+qi[e[t+6]]+qi[e[t+7]]+"-"+qi[e[t+8]]+qi[e[t+9]]+"-"+qi[e[t+10]]+qi[e[t+11]]+qi[e[t+12]]+qi[e[t+13]]+qi[e[t+14]]+qi[e[t+15]]).toLowerCase()}var $i,Ki,Gi,Zi=function(e,t,r){if(zi.randomUUID&&!t&&!e)return zi.randomUUID();const n=(e=e||{}).random||(e.rng||Hi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return Wi(n)},Qi=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,Yi={},Ji=o("hZG0u");const Xi="protoo-client";Yi=class{constructor(e){e?(this._debug=Ji(`${Xi}:${e}`),this._warn=Ji(`${Xi}:WARN:${e}`),this._error=Ji(`${Xi}:ERROR:${e}`)):(this._debug=Ji(Xi),this._warn=Ji(`${Xi}:WARN`),this._error=Ji(`${Xi}: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 eo,to=o("3oV8N").EventEmitter;eo=class extends to{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new Yi("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 ro={},no=function(){return Math.round(1e7*Math.random())};const io=new Yi("Message");ro=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void io.error("parse() | invalid JSON: %s",e)}if("object"==typeof t&&!Array.isArray(t)){if(t.request){if(r.request=!0,"string"!=typeof t.method)return void io.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void io.error("parse() | missing/invalid id field");r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id)return void io.error("parse() | missing/invalid id field");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)return void io.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void io.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}io.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:no(),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||{}}}};const oo=new Yi("Peer");Gi=class extends eo{constructor(e){super(oo),oo.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 new Error("cannot override data object")}close(){if(!this._closed){oo.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close();for(const e of this._sents.values())e.close();this.safeEmit("close")}}async request(e,t){const r=ro.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise(((e,t)=>{const n=1500*(15+.1*this._sents.size),i={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),t(e))},timer:setTimeout((()=>{this._sents.delete(r.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(i.timer),t(new Error("peer closed"))}};this._sents.set(r.id,i)}))}async notify(e,t){const r=ro.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed)return this._closed=!0,void setTimeout((()=>{this._closed||(this._connected=!1,this.safeEmit("close"))}));this._transport.on("open",(()=>{this._closed||(oo.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(oo.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(oo.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,oo.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=>{const r=ro.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);const n=ro.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=ro.createErrorResponse(e,500,String(t));this._transport.send(r).catch((()=>{}))}}_handleResponse(e){const t=this._sents.get(e.id);if(t)if(e.ok)t.resolve(e.data);else{const r=new Error(e.errorReason);r.code=e.errorCode,t.reject(r)}else oo.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var ao;if("object"==typeof globalThis)ao=globalThis;else try{ao=o("jCEG4")}catch(e){}finally{if(ao||"undefined"==typeof window||(ao=window),!ao)throw new Error("Could not determine global this")}var so,co=ao.WebSocket||ao.MozWebSocket;function lo(e,t){return t?new co(e,t):new co(e)}so=o("kUMHr").version,co&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(lo,e,{get:function(){return co[e]}})}));var uo={w3cwebsocket:co?lo:null,version:so}.w3cwebsocket,po={};po=o("jxXWz");const ho={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},fo=new Yi("WebSocketTransport");$i=Gi,Ki=class extends eo{constructor(e,t){super(fo),fo.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){fo.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){fo.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw new Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw fo.warn("send() failed:%o",e),e}}_runWebSocket(){const e=po.operation(this._options.retry||ho);let t=!1;e.attempt((r=>{this._closed?e.stop():(fo.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new uo(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(fo.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;return void this._runWebSocket()}if(this.safeEmit("failed",r),this._closed)return;if(e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||fo.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=ro.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):fo.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var mo=(0,(xo=o("bWPEY")).getGlobalObject)(),go=["debug","info","warn","error","log","assert","trace"];function vo(e){var t=(0,xo.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};go.forEach((e=>{var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((e=>{r[e]=n[e]}))}}function yo(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?go.forEach((r=>{t[r]=(...t)=>{e&&vo((()=>{mo.console[r](`Sentry Logger [${r}]:`,...t)}))}})):go.forEach((e=>{t[e]=()=>{}})),t}let bo;bo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,xo.getGlobalSingleton)("logger",yo):yo();var wo=o("gTODe"),xo=o("bWPEY"),So=o("hLvaX"),_o=(xo=o("bWPEY"),xo=o("bWPEY"),Object.prototype.toString);function ko(e,t){return _o.call(e)===`[object ${t}]`}function Eo(e){return ko(e,"Object")}function Co(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Po(e){return Ro(e,new Map)}function Ro(e,t){if(Eo(e)){if(void 0!==(i=t.get(e)))return i;var r={};for(var n of(t.set(e,r),Object.keys(e)))void 0!==e[n]&&(r[n]=Ro(e[n],t));return r}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;r=[];return t.set(e,r),e.forEach((e=>{r.push(Ro(e,t))})),r}return e}function To(){var e=(0,xo.getGlobalObject)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var jo;o("gTODe"),xo=o("bWPEY");!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(jo||(jo={}));class Oo{__init(){this._state=jo.PENDING}__init2(){this._handlers=[]}constructor(e){Oo.prototype.__init.call(this),Oo.prototype.__init2.call(this),Oo.prototype.__init3.call(this),Oo.prototype.__init4.call(this),Oo.prototype.__init5.call(this),Oo.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Oo(((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 Oo(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(jo.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(jo.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===jo.PENDING&&(Co(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==jo.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===jo.RESOLVED&&e[1](this._value),this._state===jo.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}wo=o("gTODe");function Mo(e){var t=(0,wo.timestampInSeconds)(),r={sid:To(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Po({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&Lo(r,e),r}function Lo(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||(0,wo.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:To()),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{var r=e.timestamp-e.started;e.duration=r>=0?r: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 Io(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Lo(e,r)}class Do{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Do;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Lo(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={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();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){var t=e(this);return t instanceof Do?t:this}return e instanceof Do?(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)):Eo(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)),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}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,wo.dateTimestampInSeconds)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...Ao(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new Oo(((i,o)=>{var a=e[n];if(null===t||"function"!=typeof a)i(t);else{var s=a({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&bo.log(`Event processor "${a.id}" dropped event`),Co(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,o):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,o)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Ao(){return(0,xo.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var No=100;class Fo{__init(){this._stack=[{}]}constructor(e,t=new Do,r=4){this._version=r,Fo.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Do.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:To(),n=new Error("Sentry syntheticException");return this._withClient(((i,o)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},o)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:To(),i=new Error(e);return this._withClient(((o,a)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},a)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:To();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=No}=n.getOptions&&n.getOptions()||{};if(!(o<=0)){var a={timestamp:(0,wo.dateTimestampInSeconds)(),...e},s=i?vo((()=>i(a,t))):a;null!==s&&r.addBreadcrumb(s,o)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=zo(this);try{e(this)}finally{zo(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&bo.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&Io(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var o=(0,xo.getGlobalObject)();const{userAgent:a}=o.navigator||{};var s=Mo({release:n,environment:i,...t&&{user:t.getUser()},...a&&{userAgent:a},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Lo(c,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=Bo().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&bo.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Bo(){var e=(0,xo.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function zo(e){var t=Bo(),r=Ho(t);return qo(t,e),r}function Uo(){var e=Bo();return Vo(e)&&!Ho(e).isOlderThan(4)||qo(e,new Fo),(0,So.isNodeEnv)()?function(e){try{var t=Bo().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Ho(e);if(!Vo(r)||Ho(r).isOlderThan(4)){var n=Ho(e).getStackTop();qo(r,new Fo(n.client,Do.clone(n.scope)))}return Ho(r)}catch(t){return Ho(e)}}(e):Ho(e)}function Vo(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ho(e){return(0,xo.getGlobalSingleton)("hub",(()=>new Fo),e)}function qo(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Wo(e){Uo().addBreadcrumb(e)}const $o=1,Ko=2,Go=3,Zo=4,Qo=5,Yo={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let Jo=Number(2);const Xo=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class ea{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${Xo.format(new Date)} ][ ${Yo[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Jo)?t(i,...n):Wo({type:"debug",level:Yo[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(Qo,console.debug,e,...t)}error(e,...t){this.print($o,console.error,e,...t)}info(e,...t){this.print(Go,console.info,e,...t)}log(e,...t){this.print(Zo,console.log,e,...t)}warn(e,...t){this.print(Ko,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Jo=e}setLogLevel(e){this.customLogLevel=e}}const ta=new ea("AudioLevels.ts"),ra=window.AudioContext||window.webkitAudioContext;class na{speakStartEventTime=0;speakStopEventTime=0;speaking=!1;audioMedianInterval=-1;audioLevelInterval=-1;audioLevels=[];constructor(e,t){this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new ra,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=32,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){const{length:e}=this.audioLevels;return this.audioLevels.reduce(((e,t)=>e+t),0)/e}getCurrentAudioLevel(){const{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);const t=this.speakStartEventTime||this.speakStopEventTime,r=Boolean(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 t/=e.length,Math.sqrt(t)}getInstantAudioLevel(){const e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);const t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){const 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)}release(){this.listener=void 0,clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.stream.getTracks().forEach((e=>{this.stream.removeTrack(e)}));try{this.audioStreamSource.disconnect(this.analyser)}catch(e){ta.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{ta.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!ra}}const ia=new ea("AudioRenderer.ts");var oa=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=>{ia.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const aa=(e,t=1)=>new Promise((r=>{const n=e.getContext("2d"),i=new Blob(['<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>'],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i),a=new Image;a.onload=()=>{const i=e.width/t-a.width-16,o=e.height/t-a.height-16;n?.drawImage(a,i,o),r(e)},a.src=o})),sa=(e,t=1)=>new Promise((r=>{const n=e.getContext("2d"),i=new Blob(['<svg xmlns="http://www.w3.org/2000/svg" width="100" height="103"><path d="M92.527 39.465 22.312 1.87A15.549 15.549 0 0 0 14.777 0c-2.64.02-5.226.703-7.5 1.98a14.086 14.086 0 0 0-5.332 5.032A13.185 13.185 0 0 0 0 13.906v75.188c-.004 2.422.668 4.8 1.945 6.894 1.278 2.094 3.117 3.832 5.332 5.035a15.598 15.598 0 0 0 7.5 1.977 15.6 15.6 0 0 0 7.536-1.867l70.214-37.598c2.262-1.187 4.153-2.933 5.465-5.05A13.198 13.198 0 0 0 100 51.5c0-2.457-.691-4.867-2.008-6.984-1.312-2.118-3.203-3.86-5.465-5.051Zm0 0" style="stroke:none;fill-rule:nonzero;fill:#fff;fill-opacity:1"/></svg>'],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i),a=new Image;a.onload=()=>{const i=e.width/t/2-a.width/2,o=e.height/t/2-a.height/2;n?.drawImage(a,i,o),r(e)},a.src=o,n&&(n.fillStyle="#00000064",n.fillRect(0,0,e.width,e.height),n.restore())})),ca=async(e,t={addPlayWatermark:!1})=>{const{videoWidth:r,videoHeight:n}=e,i=r>n?"landscape":"portrait",o="portrait"===i?r:n,a="landscape"===i?n:r,s="landscape"===i?(r-o)/2:0,c="portrait"===i?(n-a)/2:0;let l=document.createElement("canvas");const d=l.getContext("2d"),u=window.devicePixelRatio||1;l.width=o*u,l.height=a*u,d?.scale(u,u),d?.drawImage(e,s,c,o,a,0,0,l.width/u,l.height/u),t.addPlayWatermark&&(l=await sa(l,window.devicePixelRatio));return(await aa(l,window.devicePixelRatio)).toDataURL("image/jpeg")},la=async(e,t={addPlayWatermark:!1})=>{const r=document.createElement("video"),n=new MediaStream;n.addTrack(e),r.srcObject=n,r.setAttribute("muted","true");const i=e.getSettings();r.width=i.width||0,r.height=i.height||0,await r.play();let o=document.createElement("canvas");const a=o.getContext("2d");o.height=r.height,o.width=r.width,a?.drawImage(r,0,0),t.addPlayWatermark&&(o=await sa(o));return(await aa(o)).toDataURL("image/jpeg")};var da=o("eEB2e"),ua=(Bi=o("4Fy4N"),{}),pa=ua&&ua.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ha=ua&&ua.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fa=ua&&ua.__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)&&pa(t,e,r);return ha(t,e),t},ma=ua&&ua.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ua,"__esModule",{value:!0}),ua.debug=ua.parseScalabilityMode=ua.detectDevice=ua.Device=ua.version=ua.types=void 0;const ga=ma(o("hZG0u"));ua.debug=ga.default;var va=o("1ZHQC");Object.defineProperty(ua,"Device",{enumerable:!0,get:function(){return va.Device}}),Object.defineProperty(ua,"detectDevice",{enumerable:!0,get:function(){return va.detectDevice}});const ya=fa(o("cQumC"));ua.types=ya,ua.version="3.6.53";var ba=o("fT1lN");Object.defineProperty(ua,"parseScalabilityMode",{enumerable:!0,get:function(){return ba.parse}});const wa=new ea("StreamerMediasoup");function xa(){try{const r=navigator.userAgent,n=Bi.getParser(r);e="DeviceDetectionForced",t=!0,Uo().setTag(e,t),Wo({type:"debug",category:"browser",data:n.getResult()});const i=n.getOS();if("Safari"===n.getBrowserName()&&"iOS"===i.name&&Number(i.version)>=14.3)return new(0,ua.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){wa.error("deviceAutoDetection",e)}var e,t;return new(0,ua.Device)({handlerName:"Chrome74"})}class Sa{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){const r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter((e=>"urn:3gpp:video-orientation"!==e.uri));const n=function(){try{return new(0,ua.Device)}catch(e){return wa.error("failed to detects device from mediasoup, fallback on auto detection",e),xa()}}();return n.load({routerRtpCapabilities:r}),new Sa(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){const 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){const t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{wa.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t.on("produce",(async({kind:r,rtpParameters:n,appData:i},o,a)=>{try{const{id:a}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});o({id:a}),wa.log("producerTransport: ",t)}catch(e){a(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{wa.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),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:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:r})}}var _a={};(function(){"use strict";var e;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t];for(var r=0;r<e.length;++r){var n=e[r];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var r=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in r))break e;r=r[a]}(t=t(o=r[e=e[e.length-1]]))!=o&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=s(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.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+i++,n)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var s=i[t[o]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(r(this))}})}return e}));var l,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var u;e:{var p={};try{p.__proto__={a:!0},u=p.a;break e}catch(e){}u=!1}l=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=l;function f(e,t){if(e.prototype=d(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.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function v(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,r){return e.g=r,{value:t}}function b(e){this.g=new m,this.h=e}function w(e,t,r,n){try{var i=t.call(e.g.i,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,o),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,v(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function S(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=x(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(v(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){g(e.g);var r=e.g.i;return r?w(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function _(e,t){return t=new S(new b(t)),h&&e.prototype&&h(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var k="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 i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};o("Object.assign",(function(e){return e||k})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.g=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;r.prototype.i=function(e){o(e,0)},r.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.j(e)}}}this.g=null},r.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,r=i.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,r(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new r;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var r=this.j();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{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(n(e,i),n(r,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function r(){switch(n.h){case 1:e(n.i);break;case 2:t(n.i);break;default:throw Error("Unexpected state: "+n.h)}}var n=this;null==this.g?a.h(r):this.g.push(r),this.o=!0},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=s(e),o=i.next();!o.done;o=i.next())n(o.value).J(t,r)}))},t.all=function(e){var r=s(e),i=r.next();return i.done?n([]):new t((function(e,t){function o(t){return function(r){a[t]=r,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,n(i.value).J(o(a.length-1),t),i=r.next()}while(!i.done)}))},t})),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 i=r[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var r=0,n=!1,i={next:function(){if(!n&&r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var E=this||self;function C(e,t){e=e.split(".");var r,n=E;e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(;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 P(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var R,T,j="undefined"!=typeof TextDecoder,O="undefined"!=typeof TextEncoder;function M(e){if(O)e=(T||(T=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var r=0,n=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)n[r++]=o;else{if(2048>o)n[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}n[r++]=o>>12|224,n[r++]=o>>6&63|128}n[r++]=63&o|128}}e=n.subarray(0,r)}return e}var L={},I=null;function D(e,t){void 0===t&&(t=0),N(),t=L[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],s=e[i+1],c=e[i+2],l=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[o++]=l+a+s+c}switch(l=0,c=n,e.length-i){case 2:c=t[(15&(l=e[i+1]))<<2]||n;case 1:e=e[i],r[o]=t[e>>2]+t[(3&e)<<4|l>>4]+c+n}return r.join("")}function A(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),i=I[r];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}N();for(var n=0;;){var i=r(-1),o=r(0),a=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){n[i++]=e})),n.subarray(0,i)}function N(){if(!I){I={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));L[r]=n;for(var i=0;i<n.length;i++){var o=n[i];void 0===I[o]&&(I[o]=i)}}}}var F,B="function"==typeof Uint8Array.prototype.slice;function z(e,t,r){return t===r?F||(F=new Uint8Array(0)):B?e.slice(t,r):new Uint8Array(e.subarray(t,r))}var U=0;function V(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&H(this,e)}function H(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?A(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function q(e){var t=e.h,r=t[e.g],n=127&r;return 128>r?(e.g+=1,n):(n|=(127&(r=t[e.g+1]))<<7,128>r?(e.g+=2,n):(n|=(127&(r=t[e.g+2]))<<14,128>r?(e.g+=3,n):(n|=(127&(r=t[e.g+3]))<<21,128>r?(e.g+=4,n):(n|=(15&(r=t[e.g+4]))<<28,128>r?(e.g+=5,n>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,n)))))}function W(e){var t=e.h[e.g],r=e.h[e.g+1],n=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((r=(t<<0|r<<8|n<<16|i<<24)>>>0)>>31)+1,t=r>>>23&255,r&=8388607,255==t?r?NaN:1/0*e:0==t?e*Math.pow(2,-149)*r:e*Math.pow(2,t-150)*(r+Math.pow(2,23))}V.prototype.reset=function(){this.g=this.j};var $=[];function K(){this.g=new Uint8Array(64),this.h=0}function G(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function Z(e){var t={},r=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=r,t=this.o,$.length?(r=$.pop(),t&&(r.v=t.v),e&&H(r,e),e=r):e=new V(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function Q(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var r=7&(t=q(e.g));return 0!=r&&5!=r&&1!=r&&2!=r&&3!=r&&4!=r?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=r,!0)}function Y(e){switch(e.h){case 0:if(0!=e.h)Y(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Y(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Y(e);else{var t=q(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Y(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Q(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Y(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=q(e.g);return i=e.g.g+i,e.g.i=i,r(t,e),e.g.g=i,e.g.i=n,t}function X(e){var t,r=q(e.g),n=(e=e.g).g;if(e.g+=r,e=e.h,j)(t=R)||(t=R=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(n,n+r));else{r=n+r;for(var i,o,a,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(o=e[n++],194>i||128!=(192&o)?(n--,s.push(65533)):s.push((31&i)<<6|63&o)):240>i?n>=r-1?s.push(65533):128!=(192&(o=e[n++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&o)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(o=e[n++]))||0!=o-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(a=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,s.push(55296+(i>>10&1023),56320+(1023&i))):s.push(65533),8192<=s.length&&(c=P(c,s),s.length=0);t=P(c,s)}return t}function ee(){this.h=[],this.i=0,this.g=new K}function te(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var r=e.h,n=r.length,i=0,o=0;o<n;o++){var a=r[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(n=(r=e.g).h)&&(t.set(r.g.subarray(0,n),i),r.h=0),e.h=[t],t}function ne(e,t,r){if(null!=r){G(e.g,8*t+5),e=e.g;var n=r;0===(n=(r=0>n?1:0)?-n:n)?0<1/n?U=0:(0,U=2147483648):isNaN(n)?(0,U=2147483647):34028234663852886e22<n?(0,U=(r<<31|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),0,U=(r<<31|n)>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),n=8388607&Math.round(8388608*n),0,U=(r<<31|t+127<<23|n)>>>0),r=U,e.push(r>>>0&255),e.push(r>>>8&255),e.push(r>>>16&255),e.push(r>>>24&255)}}K.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},K.prototype.length=function(){return this.h},K.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,z(e,0,t)},Z.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function oe(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):ae(e,t,r):t(e)}function ae(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=oe(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=oe(e[i],t,r);return n}function se(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ce,le={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,le),e}function ue(e,t,r){var n=ce;if(ce=null,e||(e=n),n=this.constructor.ca,e||(e=n?[n]:[]),this.j=n?0:-1,this.i=null,this.g=e,e=(n=this.g.length)-1,n&&null!==(n=this.g[e])&&"object"==typeof n&&n.constructor===Object?(this.l=e-this.j,this.h=n):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,r)for(t=0;t<r.length;t++)(e=r[t])<this.l?(e+=this.j,(n=this.g[e])?de(n):this.g[e]=pe):(he(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function he(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function fe(e,t,r){return-1===t?null:void 0!==r&&r||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function me(e){var t=void 0!==t&&t,r=fe(e,1,t);return null==r&&(r=pe),r===pe&&ve(e,1,r=de([]),t),r}function ge(e,t,r){return null==(e=null==(e=fe(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(he(e),e.h[t]=r):e.g[t+e.j]=r}function ye(e,t){e.i||(e.i={});var r=e.i[1];if(!r){var n=me(e);r=[];for(var i=0;i<n.length;i++)r[i]=new t(n[i]);e.i[1]=r}return r}function be(e,t,r,n){var i=ye(e,r);t=t||new r,e=me(e),null!=n?(i.splice(n,0,t),e.splice(n,0,we(t,!1))):(i.push(t),e.push(we(t,!1)))}function we(e,t){if(e.i)for(var r in e.i){var n=e.i[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)n[i]&&we(n[i],t);else n&&we(n,t)}return e.g}function xe(e,t){return null==(e=fe(e,t))?0:e}function Se(e,t){return null==(e=fe(e,t))?"":e}function _e(e,t){if(e=e.m){te(t,t.g.end());for(var r=0;r<e.length;r++)te(t,e[r])}}function ke(e,t){if(4==t.h)return!1;var r=t.m;return Y(t),t.N||(t=z(t.g.h,r,t.g.g),(r=e.m)?r.push(t):e.m=[t]),!0}function Ee(e,t){var r=void 0;return new(r||(r=Promise))((function(n,i){function o(e){try{s(t.next(e))}catch(e){i(e)}}function a(e){try{s(t.throw(e))}catch(e){i(e)}}function s(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(o,a)}s((t=t.apply(e,void 0)).next())}))}function Ce(e){ue.call(this,e)}function Pe(e,t){for(;Q(t);)switch(t.i){case 8:var r=q(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 26:ve(e,3,r=X(t));break;case 34:ve(e,4,r=X(t));break;default:if(!ke(e,t))return e}return e}function Re(e){ue.call(this,e,-1,Te)}ue.prototype.toJSON=function(){return ae(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},f(Ce,ue),f(Re,ue),Re.prototype.addClassification=function(e,t){be(this,e,Ce,t)};var Te=[1];function je(e){ue.call(this,e)}function Oe(e,t){for(;Q(t);)switch(t.i){case 13:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 29:ve(e,3,r=W(t.g));break;case 37:ve(e,4,r=W(t.g));break;case 45:ve(e,5,r=W(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Le)}f(je,ue),f(Me,ue);var Le=[1];function Ie(e){ue.call(this,e)}function De(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 Ae(e){return ye(e,Ce).map((function(e){return{index:xe(e,1),Y:ge(e,2),label:null!=fe(e,3)?Se(e,3):void 0,displayName:null!=fe(e,4)?Se(e,4):void 0}}))}function Ne(e){return{x:ge(e,1),y:ge(e,2),z:ge(e,3),visibility:null!=fe(e,4)?ge(e,4):void 0}}function Fe(e,t){this.h=e,this.g=t,this.l=0}function Be(e,t,r){return function(e,t){var r=e.g;if(void 0===e.m){var n=De(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),i=De(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getProgramParameter(o,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(o));n=e.m=o,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),e.j={I:r.getAttribLocation(n,"aVertex"),H:r.getAttribLocation(n,"aTex"),da:i},e.s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.enableVertexAttribArray(e.j.I),r.vertexAttribPointer(e.j.I,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.o=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.enableVertexAttribArray(e.j.H),r.vertexAttribPointer(e.j.H,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(i,0)}n=e.j,r.useProgram(e.m),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.h.bindTexture2d(t.glName),r.enableVertexAttribArray(n.I),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.vertexAttribPointer(n.I,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.vertexAttribPointer(n.H,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.I),r.disableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):r?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function ze(e){this.g=e}f(Ie,ue);var Ue=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 Ve(e,t){return t+e}function He(e,t){window[e]=t}function qe(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||Ve,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=t,e.options)for(var r=(t=s(Object.keys(e.options))).next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.j[r]="function"==typeof n?n():n)}}function We(e){return Ee(e,(function e(){var t,r,n,i,o,a,s,l,d,u,p,h=this;return _(e,(function(e){switch(e.g){case 1:return t=h,h.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(h,h.j),y(e,function(){return Ee(this,(function e(){return _(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Ue),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:if(n=e.h,"object"==typeof window)return He("createMediapipeSolutionsWasm",{locateFile:h.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:h.locateFile}),a=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(a.map((function(e){var r=$e(t,e.url);if(void 0!==e.path){var n=e.path;r=r.then((function(e){return t.overrideFile(n,e),Promise.resolve(e)}))}return r}))),d=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(t.locateFile(e.url,t.S)):Promise.resolve()}))).then((function(){return Ee(t,(function e(){var t,r,n=this;return _(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,y(e,t(r),2);n.h=e.h,e.g=0}))}))})),u=Ee(t,(function e(){var t=this;return _(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,$e(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(e,Promise.all([d,l,u]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=r.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),y(e,createMediapipeSolutionsWasm(Module),6);case 6:h.h=e.h,h.l=new OffscreenCanvas(1,1),h.h.canvas=h.l,o=h.h.GL.createContext(h.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),h.h.GL.makeContextCurrent(o),e.g=4;break;case 7:if(h.l=document.createElement("canvas"),!(p=h.l.getContext("webgl2",{}))&&!(p=h.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();h.D=p,h.h.canvas=h.l,h.h.createContext(h.l,!0,!0,{});case 4:h.i=new h.h.SolutionWasm,h.R=!1,e.g=0}}))}))}function $e(e,t){return Ee(e,(function e(){var r,n,i=this;return _(e,(function(e){return t in i.F?e.return(i.F[t]):(r=i.locateFile(t,""),n=fetch(r).then((function(e){return e.arrayBuffer()})),i.F[t]=n,e.return(n))}))}))}function Ke(e,t,r){return Ee(e,(function e(){var n,i,o,a,c,l,d,u,p,h,f,m,g,v,b=this;return _(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,o=s(Object.keys(r)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(l=r[c])&&"texture"===l.type&&void 0!==t[l.stream]&&++i;1<i&&(b.G=!1),d=s(Object.keys(r)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(p=r[u]))return g=n,v=u,y(e,function(e,t,r){return Ee(e,(function e(){var n,i=this;return _(e,(function(e){return"number"==typeof r||r instanceof Uint8Array||r instanceof i.h.Uint8BlobList?e.return(r):r instanceof i.h.Texture2dDataOut?((n=i.s[t])||(n=new Fe(i.h,i.D),i.s[t]=n),e.return(Be(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(h=t[p.stream],"detection_list"===p.type){if(h){for(var w=h.getRectList(),x=h.getLandmarksList(),S=h.getClassificationsList(),k=[],E=0;E<w.size();++E){var C=w.get(E);e:{var P=new Ie;for(C=new Z(C);Q(C);)switch(C.i){case 13:var R=W(C.g);ve(P,1,R);break;case 21:ve(P,2,R=W(C.g));break;case 29:ve(P,3,R=W(C.g));break;case 37:ve(P,4,R=W(C.g));break;case 45:ve(P,5,R=W(C.g));break;case 48:for(var T=C.g,j=128,O=0,M=R=0;4>M&&128<=j;M++)O|=(127&(j=T.h[T.g++]))<<7*M;if(128<=j&&(O|=(127&(j=T.h[T.g++]))<<28,R|=(127&j)>>4),128<=j)for(M=0;5>M&&128<=j;M++)R|=(127&(j=T.h[T.g++]))<<7*M+3;128>j?(T=O>>>0,(R=2147483648&(j=R>>>0))&&(j=~j>>>0,0==(T=1+~T>>>0)&&(j=j+1>>>0)),T=4294967296*j+(T>>>0),R=R?-T:T):(T.l=!0,R=void 0),ve(P,6,R);break;default:if(!ke(P,C))break e}}P={Z:ge(P,1),$:ge(P,2),height:ge(P,3),width:ge(P,4),rotation:ge(P,5,0),X:xe(P,6)},R=x.get(E);e:for(C=new Me,R=new Z(R);Q(R);)if(10===R.i)be(C,T=J(R,new je,Oe),je,void 0);else if(!ke(C,R))break e;C=ye(C,je).map(Ne),T=S.get(E);e:for(R=new Re,T=new Z(T);Q(T);)if(10===T.i)R.addClassification(J(T,new Ce,Pe));else if(!ke(R,T))break e;P={T:P,O:C,M:Ae(R)},k.push(P)}w=k}else w=[];n[u]=w,e.g=7;break}if("proto_list"===p.type){if(h){for(w=Array(h.size()),x=0;x<h.size();x++)w[x]=h.get(x);h.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===p.type){n[u]=h,e.g=7;break}if("proto"===p.type){n[u]=h,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(f=b.s[u])||(f=new Fe(b.h,b.D),b.s[u]=f),y(e,Be(f,h,b.G),13);case 13:m=e.h,n[u]=m;case 7:p.transform&&n[u]&&(n[u]=p.transform(n[u])),e.g=3;break;case 14:g[v]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ge(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,o=s(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[n[a]]=i.get(a);var s=e.listeners[r];s&&(e.C=Ke(e,o,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var a=o[n[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Ze(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Qe(e){var t=this;e=e||{},this.g=new qe({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:Ze(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:"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){return Ee(t,(function t(){var r,n,i,o=this;return _(t,(function(t){return 1==t.g?(r=Ze(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,$e(o.g,r),2)):(i=t.h,o.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=qe.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},e.setOptions=function(e,t){var r=this;if(t=t||this.g.options){for(var n=[],i=[],o={},a=s(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var l=c.value;l in this.j&&this.j[l]===e[l]||(this.j[l]=e[l],void 0!==(c=t[l])&&(c.onChange&&(o.K=c.onChange,o.L=e[l],n.push(function(e){return function(){return Ee(r,(function t(){var r=this;return _(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(r.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(l={valueNumber:1===c.type?e[l]:0,valueBoolean:0===c.type&&e[l],valueString:2===c.type?e[l]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),l),i.push(c))))}0===n.length&&0===i.length||(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(n))}},e.initialize=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){return 1==e.g?y(e,We(t),2):3!=e.g?y(e,Ee(t,(function e(){var t,r,n,i,o,a,c,l,d=this;return _(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,y(e,$e(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),r=s(Object.keys(d.B)),n=r.next();!n.done;n=r.next())i=n.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=s(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Ge(d,c);l=d.j,d.j={},d.setOptions(l),e.g=0}))})),3):y(e,function(e){return Ee(e,(function e(){var t,r,n,i,o,a,c=this;return _(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=s(c.u),r=t.next();case 3:if(r.done){e.g=5;break}return y(e,(0,r.value)(),4);case 4:r=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(n=new c.h.GraphOptionChangeRequestList,i=s(c.A),o=i.next();!o.done;o=i.next())a=o.value,n.push_back(a);c.i.changeOptions(n),n.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},e.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){return Ee(this,(function r(){var n,i,o,a,c,l,d,u,p,h=this;return _(r,(function(r){switch(r.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,h.C,2)):r.return();case 2:return y(r,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=s(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,l=h.g.inputs[c]){e:{var f=h,m=e[c];switch(l.type){case"video":var g=f.m[l.stream];if(g||(g=new Fe(f.h,f.D),f.m[l.stream]=g),0===(f=g).l&&(f.l=f.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&m instanceof HTMLVideoElement){var v=m.videoWidth;g=m.videoHeight}else"undefined"!=typeof HTMLImageElement&&m instanceof HTMLImageElement?(v=m.naturalWidth,g=m.naturalHeight):(v=m.width,g=m.height);g={glName:f.l,width:v,height:g},(v=f.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),f.h.bindTexture2d(f.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[l.stream])||(g=new ze(f.h),f.m[l.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=f.data,w=b.setBoundingBox,x=g,S=v.T,_=new Ie;ve(_,1,S.Z),ve(_,2,S.$),ve(_,3,S.height),ve(_,4,S.width),ve(_,5,S.rotation),ve(_,6,S.X);var k=S=new ee;ne(k,1,fe(_,1)),ne(k,2,fe(_,2)),ne(k,3,fe(_,3)),ne(k,4,fe(_,4)),ne(k,5,fe(_,5));var E=fe(_,6);if(null!=E&&null!=E){G(k.g,48);var C=k.g,P=E;E=0>P;var R=(P=Math.abs(P))>>>0;for(P=Math.floor((P-R)/4294967296),P>>>=0,E&&(P=~P>>>0,4294967295<(R=1+(~R>>>0))&&(R=0,4294967295<++P&&(P=0))),E=U=R,R=P;0<R||127<E;)C.push(127&E|128),E=(E>>>7|R<<25)>>>0,R>>>=7;C.push(E)}if(_e(_,k),S=re(S),w.call(b,x,S),v.O)for(b=0;b<v.O.length;++b)k=!!(_=v.O[b]).visibility,x=(w=f.data).addNormalizedLandmark,S=g,_=Object.assign(Object.assign({},_),{visibility:k?_.visibility:0}),ve(k=new je,1,_.x),ve(k,2,_.y),ve(k,3,_.z),_.visibility&&ve(k,4,_.visibility),ne(C=_=new ee,1,fe(k,1)),ne(C,2,fe(k,2)),ne(C,3,fe(k,3)),ne(C,4,fe(k,4)),ne(C,5,fe(k,5)),_e(k,C),_=re(_),x.call(w,S,_);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=f.data).addClassification,S=g,_=v.M[b],ve(k=new Ce,2,_.Y),_.index&&ve(k,1,_.index),_.label&&ve(k,3,_.label),_.displayName&&ve(k,4,_.displayName),C=_=new ee,null!=(R=fe(k,1))&&null!=R)if(G(C.g,8),E=C.g,0<=R)G(E,R);else{for(P=0;9>P;P++)E.push(127&R|128),R>>=7;E.push(1)}ne(C,2,fe(k,2)),null!=(E=fe(k,3))&&(E=M(E),G(C.g,26),G(C.g,E.length),te(C,C.g.end()),te(C,E)),null!=(E=fe(k,4))&&(E=M(E),G(C.g,34),G(C.g,E.length),te(C,C.g.end()),te(C,E)),_e(k,C),_=re(_),x.call(w,S,_)}}f=f.data;break e;default:f={}}}switch(d=f,u=l.stream,l.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:n}));break;case"detections":(p=d).stream=u,p.timestamp=n,i.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.i.send(i),y(r,h.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",qe),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Qe.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Ee(this,(function e(){var t=this;return _(e,(function(e){return y(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Ee(this,(function t(){var r=this;return _(t,(function(t){return y(t,r.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},C("SelfieSegmentation",Qe),C("VERSION","0.1.1632777926")}).call(_a);const ka=new ea("MediaPipe"),Ea="https://stream-assets.snapcall.io";let Ca=!1;const Pa=new _a.SelfieSegmentation({locateFile:(e,t)=>{if(ka.debug("selfieSegmentation",e,t),Ea)return`${Ea}/mediapipe/${e}`;return`${window.location.href.split("/").slice(0,-1).join("/")}/mediapipe/${e}`}});var Ra,Ta,ja,Oa;Ta=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 Ma={};function La(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}ja=function(e){var t=Ma[e];return t||(t=function(){try{throw new Error}catch(t){var e=(""+t.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g);if(e)return La(e[2])}return"/"}(),Ma[e]=t),t},Oa=function(e){var t=(""+e).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^/]+/);if(!t)throw new Error("Origin not found");return t[0]};let Ia=ja("adfgW")+o("juxiN").resolve("5WDBY");Ra=Ta(Ia,Oa(Ia),!1);class Da{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Ra,{name:"VirtualBackgroundTimerWorker"});constructor(e,t){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;const 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((()=>{Pa.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};Pa.setOptions(e),ka.log("selfie segmentation initialized"),Ca||(await Pa.initialize(),Ca=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Pa.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{Pa.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){ka.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()}))}}const Aa=window.AudioContext||window.webkitAudioContext;class Na{audioSources={};tracks={};constructor(){this.audioContext=new Aa,this.audioDestination=this.audioContext.createMediaStreamDestination()}getSetting(e){return this.tracks[e]?.getSettings()}removeTrack(e){const 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);const 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)}))}}const Fa=new ea("StreamerClient"),Ba="WRTC1",za="WRTC2",Ua="TRANS1",Va="CONS1",Ha="SOCK1",qa="USERLIMIT",Wa={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 $a extends CustomEvent{constructor(e,t){super(e,t)}}const Ka=EventTarget,Ga={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const Za=new class extends Ka{mediasoupTransport={};mediaPipeOption=Ga;useVideoBackground=!1;pendingDeviceRequest={};joinOptions={};devicesList=[];plan=void 0;permissions=[];constructor(){super(),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.peerId="",this.webcamProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){const e=[];return this.peers.forEach(((t,r)=>{const 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,peerId:this.peerId,profile:this.profile,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new $a("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new $a("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new $a("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){const 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}async init(e=this.roomId,t=this.joinOptions){if(this.roomId=e,this.joinOptions=t,!this.roomId)throw new Error("Missing room ID");let r;this.peerId||(this.peerId=Zi());try{const{streamer_instance:n,plan:{permissions:i,name:o},recordings:a}=await fetch(`${this.config.apiUrl}/streams/${e}/info`,{method:"get",headers:{"Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid room ID")}));this.permissions=i,!0===a?.headless&&i.push("record_video_on_demand"),this.plan=o;const s=new URLSearchParams({peerId:this.peerId,roomId:e});t.authKey&&s.append("authKey",t.authKey);const c=this.joinOptions.recorder?"/recorder":"";r=`${this.config.streamerServer}/${n}${c}?${s}`}catch(e){console.error("init",e);const t=new $a("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new Ki(r,{retry:{retries:0}}),this.protoo=new $i(this.protooTransport),this.protoo.on("open",(()=>{this.joinOptions.recorder?this.joinRecorder():this.joinRoom()})),this.protoo.on("failed",(()=>{Fa.error("protoo.on","failed"),this.onCriticalError(Ha)})),this.protoo.on("disconnected",(()=>{Fa.error("protoo.on","disconnected"),this.onCriticalError(Ha)})),this.protoo.on("close",(()=>Fa.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(Fa.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(qa);else if("newPeer"===e.method){const{id:t,profile:r,muted:n}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,muted:n,producersData:[]});const i=new $a("newPeer",{detail:{peerId:t,displayName:r.name,profile:r,muted:n}});this.dispatchEvent(i)}else if("newProducer"===e.method){const{peerId:t,producerId:r,deviceType:n,paused:i}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:i})}else if("peerClosed"===e.method){const{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach((e=>{this.onConsumerClose({consumerId:e.id})}));const n=new $a("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){const{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("recordStopped"===e.method)this.dispatchEvent(new $a("recordStopped",{detail:e.data}));else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new $a("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){const{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;const t=new $a("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){const{peerId:t,producerId:r,deviceType:n}=e.data;if("microphone"===e.data?.deviceType){const n=this.peers.get(t)?.producersData.find((e=>r===e.producerId));n&&(n.paused="producerPaused"===e.method)}let i=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){i=e.mediaSoupConsumer.id;break}const o="producerPaused"===e.method?"mediaPause":"mediaResume",a=new $a(o,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(a)}else if("mute"===e.method){const{peerId:t,device:r}=e.data,n=new $a("mediaPause",{detail:{peerId:t,deviceType:r,paused:!0}});this.dispatchEvent(n)}else if("unmute"===e.method){const{peerId:t,device:r}=e.data,n=new $a("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestDeviceResult"===e.method){const t=new $a(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new $a(e.method,{detail:e.data});this.dispatchEvent(t)}else if("videoRecordingStarted"===e.method||"videoRecordingStopped"===e.method||"videoRecordingRequested"===e.method){const t=new $a(e.method,{detail:{}});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,o=this.customMessages.get(t);o?o.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const a=this.customMessages.get(t);if(a&&a.totalChunks===a.chunks.length){const r=a.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new $a("customMessage",{detail:{...e.data,event:n}});this.dispatchEvent(i),this.customMessages.delete(t)}}}))}closeWebrtcTransport(e){const t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup)throw new Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{const 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(Ua),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw new Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",(t=>{if(e.transport&&!e.transport.closed)if(Fa.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{Fa.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){const t=new Error(`webRTC transport state failed for ${e.kind}`);Fa.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Ba)}}))}async joinRoom(){this.streamerMediasoup=await Sa.create(this.protoo,this.config);const{apiKey:e,email:t}=this.joinOptions;if(e)try{let r=null;e&&t?r=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(r=await this.fetchUserInfo({apiKey:e})),r&&this.dispatchEvent(new $a("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){Fa.warn("joinRoom",e),this.dispatchEvent(new $a("agentIdentity",{detail:{success:!1}}))}const{peers:r,videoRecordStarted:n,videoRecording:i}=await this.protoo.request("getRoomPeers",{apiKey:e,email:t});this.peers=new Map(r.map((e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}])));const o=await this.getCallId();this.dispatchEvent(new $a("enterRoom",{detail:{videoRecording:i,videoRecordStarted:n,peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:o,plan:this.plan,permissions:this.permissions}})),Fa.log("joinRoom","peers",r),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),r.forEach((e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})}))}async joinRecorder(){this.streamerMediasoup=await Sa.create(this.protoo,this.config);const e=await this.getCallId();this.dispatchEvent(new $a("enterRoom",{detail:{videoRecording:{started:!1,requested:!1},videoRecordStarted:!1,peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions}}))}async switchMicrophone(e){try{Fa.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.audioMedia?.removeTrack("mic"),this.micProducer?.track?.stop(),Fa.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new na(t,this),this.audioMedia=this.audioMedia||new Na;const r=t.getAudioTracks()[0];this.audioMedia.addTrack("mic",r),await(this.micProducer?.replaceTrack({track:r})),Fa.log("switchMicrophone","switched Microphone")}catch(e){Fa.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new $a("microphoneMute",{detail:{}});this.dispatchEvent(t),this.protoo.connected&&await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){Fa.log("onDeviceChange","detecting device change");const e=new $a("devicesListChange",{detail:{}});if(this.dispatchEvent(e),this.protoo&&!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return Fa.warn("onDeviceChange","no audio input device"),void await this.closeMicrophoneProducer();const r=t.find((e=>"default"===e.deviceId));if(r){const t=e.filter((e=>!Boolean(this.devicesList.find((t=>t.deviceId===e.deviceId&&t.label===e.label)))));Fa.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void Fa.warn("onDeviceChange","no audio input change");if(Fa.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new $a("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),Fa.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone(){if(!this.micProducer||this.micProducer?.closed){const e=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();const t=await this.getTransport("audio","send");this.audioLevel=new na(e,this),this.audioMedia=this.audioMedia||new Na;const r=e.getAudioTracks()[0];this.audioMedia.addTrack("mic",r);const n="microphone",i=await t.produce({track:this.audioMedia.getFinalTrack(),codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{Fa.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{Fa.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{Fa.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const o=new $a("microphoneEnabled",{detail:{}});this.dispatchEvent(o)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0;const e="microphone";this.protoo.notify("mute",{device:e});const t=new $a("microphoneMute",{detail:{}});this.dispatchEvent(t)}}unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),this.muted=!1;const e="microphone";this.protoo.notify("unmute",{device:e});const t=new $a("microphoneUnmute",{detail:{}});this.dispatchEvent(t)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){Fa.log("release");for(let e in 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();const e=new $a("leaveRoom",{detail:{}});this.dispatchEvent(e);const t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){this.protoo.request("terminateRoom")}async updateWebcams(){this.webcams=new Map;const e=await navigator.mediaDevices.enumerateDevices();for(const t of e)"videoinput"===t.kind&&this.webcams.set(t.deviceId,t);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);const t=new $a("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(t)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach((n=>{const i=this.pendingDeviceRequest[n];e===i.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo.notify("requestDeviceResult",{result:Boolean(t),failure:r,...i}))}))}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,Boolean(r),n?.name),n)throw n;return r}}async restartIce(e){if(Fa.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});Fa.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(e){this.onCriticalError(za),Fa.log("restartIce","restartIceFailed",e)}}scaleVideoMediasConstraintsParameter(e){let t=Wa.hd;2===e?t=Wa.vga:e>2&&(t=Wa.qvga),(!this.webcam.resolution||Wa[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(Fa.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}),!da.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(Fa.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{Fa.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){Fa.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 new 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:i}){if(!this.webcam.device)throw new Error("no webcam devices");const o={};if(r)if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",o.facingMode=this.webcam.facingMode;else{const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknown";let r=e.indexOf(t);r<e.length-1?r++:r=0;const n=this.webcams.get(e[r]);if(!n)throw new Error("no webcam device");this.webcam.device=n,o.deviceId={ideal:this.webcam.device?.deviceId}}else i?(this.webcam.facingMode=i,o.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,o.deviceId={ideal:this.webcam.device.deviceId});this.webcam.resolution=t||this.webcam.resolution||"hd",this.webcam.framerate=n||this.webcam.framerate;let a=Wa[t||this.webcam.resolution];this.useVideoBackground&&(a={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await(this.webcamProducer?.replaceTrack?.({track:null}).catch((e=>{Fa.error("switchCamera","clean track failed",e)})));const s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{...o,...a}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Da(s,this.mediaPipeOption));const c=await(this.mediaPipe?.createStream())||s;if(!await this.getTransport("video","send"))throw new Error("video transport not found, can not switch");const l=c.getVideoTracks()[0];await(this.webcamProducer?.replaceTrack?.({track:l}));const d=await(l.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(d?.zoom),min:d?.zoom?.min||0,max:d?.zoom?.max||0};const u=new $a("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(u)}async enableVideo(e){await this.updateWebcams();const 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 new Error("no webcam devices");this.webcam.resolution=e?.resolution||this.webcam.resolution||"hd",this.webcam.framerate=e?.frameRate||this.webcam.framerate;let r=Wa[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(r={width:{ideal:560},height:{ideal:400},qualityIndex:2});const n=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:e?.frameRate,...t,...r}}));if(e?.facingMode)try{const e=n.getVideoTracks()[0].getCapabilities();if(!e?.facingMode||0===e.facingMode.length)throw new 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 Da(n,this.mediaPipeOption));const i=await(this.mediaPipe?.createStream())||n;await this.updateWebcams();const o=await this.getTransport("video","send"),a=i.getVideoTracks()[0];this.webcamTrack=a;const s=await(a.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};this.webcamProducer=await o.produce({track:a,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",(()=>{this.webcamProducer=null})),this.webcamProducer.on("trackended",(()=>{this.disableVideo().catch((()=>{}))}));const c=new $a("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(c)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new 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;const e=new $a("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(e={audioTransportOption:"classic"}){if(!this.permissions.find((e=>"screen_sharing"===e)))throw new Error("feature not allowed");if("mix"===e.audioTransportOption&&!this.micProducer)throw new Error("microphone not activated and audio mix transport requested");const 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}}}));if(!t)return;const r="screen",n=await this.getTransport("audio","send"),i=t.getAudioTracks()[0];if(i)if("classic"===e.audioTransportOption)this.screenshareAudioProducer=await(this.streamerMediasoup?.produceAudio(n,i,{deviceType:r,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0}));else if("mix"===e.audioTransportOption){this.audioMedia=this.audioMedia||new Na,this.audioMedia.addTrack("screen",i);const e=this.audioMedia.getFinalTrack();e&&this.micProducer&&this.micProducer.replaceTrack({track:e})}const o=t.getVideoTracks()[0],a=await this.getTransport("video","send");this.screenshareVideoProducer=await(this.streamerMediasoup?.produceVideo(a,o,{deviceType:r,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0})),this.screenshareVideoProducer?.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const s=new $a("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);const e=new $a("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){const t=this.consumers.get(e);if(t){const r=t.mediaSoupConsumer.producerId;this.peers.forEach((e=>{const t=e.producersData.findIndex((e=>e.producerId===r));-1!==t&&e.producersData.splice(t,1)})),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();const n=new $a("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}){Fa.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>Fa.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>Fa.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else Fa.error("requestVideo",`Video consumer ${r} not found`)}async saveCapture(e){const{objectUrl:t}=await fetch(`${this.config.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));return{url:t,assetId:(await this.protoo.request("addCapture",{url:t})).assetId}}async saveThumbnail(e){const{objectUrl:t}=await fetch(`${this.config.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));return{url:t,assetId:(await this.protoo.request("addThumbnail",{url:t})).assetId}}async deleteCapture(e){return await this.protoo.request("deleteCapture",{assetId:e})}async captureVideo(e,t){if(this.permissions.find((e=>"instant_picture"===e))){let r;if(e)r=await ca(e,t);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");r=await la(this.webcamProducer.track,t)}return r}throw new Error("feature not allowed")}requestLocalVideo(e){if(Fa.info("requestLocalVideo"),this.webcamProducer){const t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;const r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw new Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareVideoProducer){const t=new MediaStream;t.addTrack(this.screenshareVideoProducer.track),e.srcObject=t}else Fa.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{const i="microphone"===r?"audio":"video",o=await this.getTransport(i,"recv"),a=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:o.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});const{producerId:c,id:l,kind:d,rtpParameters:u,appData:p}=a;Fa.log("consumeProducer","Data: ",a);const h=await o.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});Fa.log("transport",o),Fa.log("consumer",h),this.consumers.set(h.id,{mediaSoupConsumer:h,deviceType:r}),this.scaleVideoEncodingsParameter();const f=new $a("mediaStart",{detail:{peerId:e,mediaId:h.id,deviceType:r,paused:!!s&&s.muted}});if(this.dispatchEvent(f),"audio"===h.kind){const e=this.createAudioRenderer(h.id),t=new MediaStream;t.addTrack(h.track),e.setSource(t),e.play()}"video"===h.kind&&await this.protoo.request("resumeConsumer",{consumerId:h.id})}catch(e){this.onCriticalError(Va),Fa.error("consumeProducer","newConsumer request failed",e)}}async setDisplayName(e){await this.setProfile({name:e});const t=new $a("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){const t=await this.protoo.request("setProfile",e);this.profile={...t};const r=new $a("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){if(!this.permissions.find((e=>"request_input"===e)))throw new 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{const{callId:e}=await this.protoo.request("getCallId");return e}catch(e){throw Fa.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){const 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){const 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){const t=Zi(),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){const r=Zi(),n=this.getCustomMessageEventChunks(t),i=n.map(((t,i)=>this.protoo.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:i,chunk:t,totalChunks:n.length}})));await Promise.all(i)}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 Boolean(navigator.mediaDevices?.enumerateDevices)}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.audioMedia?.getSetting("mic")||this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){const e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){const 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;const t=new $a("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new oa({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){const t=Object.keys(this.audioRenderers).map((t=>this.audioRenderers[t].setSink(e).catch((e=>Fa.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)))));await Promise.allSettled(t)}dispatchEvent(e){const t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){const 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 new Error("Invalid agent info")}))}async fetchUserInfo({apiKey:e}){const 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 new 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")}};var Qa=(0,(je=o("85Hg2")).createContext)({});je=o("85Hg2");let Ya;var Ja;(Ja=Ya||(Ya={}))[Ja.SET_STREAMS=0]="SET_STREAMS",Ja[Ja.ADD_STREAM=1]="ADD_STREAM",Ja[Ja.REMOVE_STREAM=2]="REMOVE_STREAM",Ja[Ja.DEVICE_UPDATE=3]="DEVICE_UPDATE",Ja[Ja.MUTE=4]="MUTE",Ja[Ja.UNMUTE=5]="UNMUTE",Ja[Ja.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",Ja[Ja.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",Ja[Ja.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",Ja[Ja.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const Xa={streams:[],highlightedTile:null},es=(e,t)=>{switch(t.type){case Ya.SET_STREAMS:return{...e,streams:t.payload};case Ya.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case Ya.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case Ya.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:o,paused:a}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=a),{...e,[i]:o?n:null,muted:t}}return e}))}}case Ya.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case Ya.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case Ya.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case Ya.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case Ya.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case Ya.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},ts=(0,je.createContext)(void 0),rs=({children:e})=>{const[t,r]=(0,je.useReducer)(es,Xa),n={state:t,dispatch:r};return(0,a.jsx)(ts.Provider,{value:n,children:e})},ns=()=>{const e=(0,je.useContext)(ts);if(void 0===e)throw new Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}};var is=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise(((t,r)=>{((e,t,r)=>{const n=document.createRange(),i=document.createElement("textarea");if(i.value=e,document.body.appendChild(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.readOnly=!1,i.contentEditable="true",n.selectNodeContents(i);const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),i.setSelectionRange(0,999999)}else i.focus(),i.select();try{document.execCommand("copy")?t():r(new Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(i)})(e,t,r)}));const os=yr.path`
|
|
358
358
|
fill: ${e=>e.theme.logoColor};
|
|
359
359
|
stroke: ${e=>e.stroke?e.theme.logoColor:"unset"};
|
|
360
360
|
`,as=()=>(0,a.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(os,{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"})}),ss=()=>(0,a.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(os,{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"})}),cs=()=>(0,a.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_243_300)",children:[(0,a.jsx)("path",{d:"M0 24C0 4.236 4.236 0 24 0C43.764 0 48 4.236 48 24C48 43.764 43.764 48 24 48C4.236 48 0 43.764 0 24Z",fill:"black"}),(0,a.jsx)("path",{d:"M24.15 38.2856C25.7279 38.2856 27.0502 36.9758 26.5626 35.4753C26.1419 34.1801 25.4321 32.9898 24.4746 32.0064C22.853 30.341 20.6537 29.4053 18.3605 29.4053C16.0673 29.4053 13.8679 30.341 12.2464 32.0064C11.2888 32.9898 10.5791 34.1801 10.1583 35.4753C9.67078 36.9758 10.9931 38.2856 12.571 38.2856H24.15Z",fill:"white"}),(0,a.jsx)("path",{d:"M23.8494 9.71436C22.2714 9.71436 20.9491 11.0242 21.4367 12.5249C21.8574 13.8199 22.5672 15.0102 23.5248 15.9937C25.1463 17.6591 27.3456 18.5947 29.6389 18.5947C31.932 18.5947 34.1314 17.6591 35.7529 15.9937C36.7106 15.0102 37.4203 13.8199 37.8409 12.5249C38.3286 11.0242 37.0063 9.71436 35.4283 9.71436H23.8494Z",fill:"white"}),(0,a.jsx)("path",{d:"M29.6387 35.4287C29.6387 37.0067 30.953 38.3301 32.4415 37.8064C33.6767 37.3715 34.8118 36.6509 35.7527 35.6847C37.3744 34.0195 38.2852 31.7606 38.2852 29.4055C38.2852 27.0502 37.3744 24.7915 35.7527 23.1261C34.8118 22.1599 33.6767 21.4393 32.4415 21.0046C30.953 20.4807 29.6387 21.8043 29.6387 23.3823V35.4287Z",fill:"white"}),(0,a.jsx)("path",{d:"M18.3605 12.5712C18.3605 10.9933 17.0461 9.66972 15.5576 10.1936C14.3224 10.6283 13.1872 11.3489 12.2464 12.3151C10.6248 13.9804 9.71387 16.2392 9.71387 18.5944C9.71387 20.9496 10.6248 23.2083 12.2464 24.8737C13.1872 25.8399 14.3224 26.5605 15.5576 26.9952C17.0461 27.5191 18.3605 26.1955 18.3605 24.6176V12.5712Z",fill:"white"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_243_300",children:(0,a.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]});var ls=({size:e="large"})=>"small"===e?(0,a.jsx)(as,{}):"medium"===e?(0,a.jsx)(ss,{}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(as,{}),(0,a.jsx)(ss,{})]});const ds=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),us=({color:e})=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),ps=({color:e})=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),hs=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),fs=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),ms=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})}),gs=()=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsxs)("g",{clipPath:"url(#pip)",fill:"#fff",children:[(0,a.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,a.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"})]})}),vs=({color:e})=>(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.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"})});je=o("85Hg2"),je=o("85Hg2");const ys=(e,t)=>((0,je.useEffect)((()=>{const 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),bs=yr.div`
|