@snapcall/stream-ui 1.11.2 → 1.11.4
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 +96 -53
- package/dist/stream-ui.js +96 -53
- package/dist/stream-ui.umd.js +5 -5
- package/dist/types.d.ts +6 -2
- package/package.json +1 -1
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 a=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 a=i.getPropertyValue("-webkit-overflow-scrolling"),o=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===a&&("auto"===o||"scroll"===o),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()}},o=function(e){t=e.touches?e.touches[0].screenY:e.screenY},s=function(){window.addEventListener("touchstart",o,!!n&&{passive:!1}),window.addEventListener("touchmove",a,!!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",o,!1),window.removeEventListener("touchmove",a,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Ar&&(Ar=d),"function"==typeof e.define?function(e){e("iNoBounce",[],(function(){return d}))}(e.define):e.iNoBounce=d}(Ar);var tn={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)}},rn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fr(this,e),this.init(t,r)}return Br(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||tn,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,en(en({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),nn=function(){function e(){Fr(this,e),this.observers={}}return Br(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 a=[].concat(this.observers["*"]);a.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 on(e){return null==e?"":""+e}function sn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function cn(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return i()?{}:{obj:e,k:n(a.shift())}}function ln(e,t,r){var n=cn(e,t,Object);n.obj[n.k]=r}function dn(e,t){var r=cn(e,t),n=r.obj,i=r.k;if(n)return n[i]}function un(e,t,r){var n=dn(e,r);return void 0!==n?n:dn(t,r)}function pn(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]):pn(e[n],t[n],r):e[n]=t[n]);return e}function fn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function mn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return hn[e]})):e}var gn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,vn=[" ",",","?","!",";"];function yn(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?yn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wn(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(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,a=0;a<n.length;++a){if(!i)return;if("string"==typeof i[n[a]]&&a+1<n.length)return;if(void 0===i[n[a]]){for(var o=2,s=n.slice(a,a+o).join(r),c=i[s];void 0===c&&n.length>a+o;)o++,c=i[s=n.slice(a,a+o).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(a+o).join(r);return l?xn(c,l,r):void 0}i=i[n[a]]}return i}}var Sn=function(e){Hr(r,e);var t=wn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Fr(this,r),n=t.call(this),gn&&nn.call(Ur(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 Br(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,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];r&&"string"!=typeof r&&(o=o.concat(r)),r&&"string"==typeof r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."));var s=dn(this.data,o);return s||!a||"string"!=typeof r?s:xn(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},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(n=t,t=(o=e.split("."))[1]),this.addNamespaces(t),ln(this.data,o,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 a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var s=dn(this.data,o)||{};n?pn(s,r,i):s=bn(bn({},s),r),ln(this.data,o,s),a.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?bn(bn({},{}),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}(nn),_n={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,r,n,i))})),t}};function kn(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 En(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cn(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 Pn={},Rn=function(e){Hr(r,e);var t=Cn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fr(this,r),n=t.call(this),gn&&nn.call(Ur(n)),sn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Ur(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=rn.create("translator"),n}return Br(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||[],a=r&&e.indexOf(r)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=vn.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("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}(e,r,n));if(a&&!o){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"!==Nr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=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 f=t.nsSeparator||this.options.nsSeparator;return a?(h.res="".concat(d).concat(f).concat(c),h):"".concat(d).concat(f).concat(c)}return a?(h.res=c,h):c}var h=this.resolve(e,t),m=h&&h.res,g=h&&h.usedKey||c,v=h&&h.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,En(En({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(h.res=_,h):_}if(o){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(o).concat(P);E[P]=this.translate(R,En(En({},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),o){var F=this.resolve(c,En(En({},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 z=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var U=0;U<B.length;U++)z.push(B[U]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(t.lng||this.language):z.push(t.lng||this.language);var V=function(e,r,n){var a=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,a,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,a,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?z.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||I)}))})):V(z,c,I))}m=this.extendTranslation(m,e,t,h,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 a?(h.res=m,h):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,En(En({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(En(En({},r),{interpolation:En(En({},this.options.interpolation),r.interpolation)}));var o,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);o=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=En(En({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);o<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return i&&i[0]===n[0]&&!r.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):a.translate.apply(a,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=_n.handle(p,e,t,this.options&&this.options.postProcessPassResolved?En({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var c=o.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;o.options.fallbackNS&&(d=d.concat(o.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&o.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);d.forEach((function(e){o.isValidLookup(t)||(a=e,!Pn["".concat(h[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&(Pn["".concat(h[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(a,'" 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!!!")),h.forEach((function(r){if(!o.isValidLookup(t)){i=r;var a,c=[l];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=o.pluralResolver.getSuffix(r,s.count,s));var h="".concat(o.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+h)),f){var m="".concat(l).concat(o.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+h))}}for(;a=c.pop();)o.isValidLookup(t)||(n=a,t=o.getResource(r,e,a,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:a}}},{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}(nn);function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var jn=function(){function e(t){Fr(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rn.create("languageUtils")}return Br(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]=Tn(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]=Tn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tn(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=[],a=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&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),n.forEach((function(e){i.indexOf(e)<0&&a(r.formatLanguageCode(e))})),i}}]),e}(),On=[{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}],Mn={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)}},Ln=["v1","v2","v3"],In={zero:0,one:1,two:2,few:3,many:4,other:5};function Dn(){var e={};return On.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Mn[t.fc]}}))})),e}var An=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fr(this,e),this.languageUtils=t,this.options=r,this.logger=rn.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=Dn()}return Br(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 In[e]-In[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 a=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()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!Ln.includes(this.options.compatibilityJSON)}}]),e}();function Nn(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 Fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(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]:{};Fr(this,e),this.logger=rn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Br(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:mn,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,a,o,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=un(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Fn(Fn(Fn({},n),t),{},{interpolationkey:e})):i}var a=e.split(s.formatSeparator),o=a.shift().trim(),l=a.join(s.formatSeparator).trim();return s.format(un(t,c,o),l,r,Fn(Fn(Fn({},n),t),{},{interpolationkey:o}))};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(o=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(a=d(r)))if("function"==typeof u){var c=u(e,i,n);a="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))a="";else{if(p){a=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),a=""}else"string"==typeof a||s.useRawValueToEscape||(a=on(a));var l=t.safeValue(a);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++o>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Fn({},a);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,o)).replace(/'/g,'"');try{o=JSON.parse(i),t&&(o=Fn(Fn({},t),o))}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 o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.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(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=on(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,a.lng,Fn(Fn({},a),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();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 Un(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){qr(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}var Vn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Fr(this,e),this.logger=rn.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,Un(Un({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Un({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Un({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Un({},r)).format(e)}},this.init(t)}return Br(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 a=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=Jr(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),o=a.formatName,s=a.formatOptions;if(i.formats[o]){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[o](e,d,Un(Un(Un({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(o)),e}),e)}}]),e}();function Hn(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?Hn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(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 qn=function(e){Hr(r,e);var t=$n(r);function r(e,n,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Fr(this,r),a=t.call(this),gn&&nn.call(Ur(a)),a.backend=e,a.store=n,a.services=i,a.languageUtils=i.languageUtils,a.options=o,a.logger=rn.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=o.maxParallelReads||10,a.readingCalls=0,a.maxRetries=o.maxRetries>=0?o.maxRetries:5,a.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,o.backend,o),a}return Br(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,a={},o={},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===o[s]&&(o[s]=!0):(i.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===a[s]&&(a[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),r&&this.store.addResourceBundle(i,a,r),this.state[e]=t?-1:2;var o={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=a,l=cn(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){o[e]||(o[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===o[e][t]&&(o[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",o),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,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=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:a,callback:o}):(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*a,o)}),a):o(s,c)}))):o(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 a=this.queueLoad(e,t,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.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],a=n[1];this.read(i,a,"read",void 0,void 0,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(a," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(a," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var a=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({},a),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(nn);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"===Nr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Nr(e[2])||"object"===Nr(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 Kn(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?Kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qn(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 Jn(){}function Xn(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ei=function(e){Hr(r,e);var t=Qn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Fr(this,r),e=t.call(this),gn&&nn.call(Ur(e)),e.options=Zn(n),e.services={},e.logger=rn,e.modules={external:[]},Xn(Ur(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),Wr(e,Ur(e));setTimeout((function(){e.init(n,i)}),0)}return e}return Br(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 a;this.modules.logger?rn.init(i(this.modules.logger),this.options):rn.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Vn);var o=new jn(this.options);this.store=new Sn(this.options.resources,this.options);var s=this.services;s.logger=rn,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new An(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(a),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 qn(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 Rn(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=Jn),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]:Jn,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 a=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};if(i)o(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return o(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(a,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=Jn),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&&_n.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)},a=function(a){e||a||!r.services.languageDetector||(a=[]);var o="string"==typeof a?a:r.services.languageUtils.getBestMatchFromCodes(a);o&&(r.language||i(o),r.translator.language||r.translator.changeLanguage(o),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(o)),r.loadResources(o,(function(e){!function(e,a){a?(i(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var a;if("object"!==Nr(i)){for(var o=arguments.length,s=new Array(o>2?o-2:0),c=2;c<o;c++)s[c-2]=arguments[c];a=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else a=Yn({},i);a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,a.keyPrefix=a.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=a.keyPrefix?"".concat(a.keyPrefix).concat(l).concat(t):t;return n.t(d,a)};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,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=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,o);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,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]:Jn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),a=new r(i),o=["store","services","language"];return o.forEach((function(t){a[t]=e[t]})),a.services=Yn({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new Rn(a.services,a.options),a.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];a.emit.apply(a,[e].concat(r))})),a.init(i,n),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nn);qr(ei,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ei(e,t)}));var ti=ei.createInstance();ti.createInstance=ei.createInstance;ti.createInstance,ti.init,ti.loadResources,ti.reloadResources,ti.use,ti.changeLanguage,ti.getFixedT,ti.t,ti.exists,ti.setDefaultNamespace,ti.hasLoadedNamespace,ti.loadNamespaces,ti.loadLanguages;var ri=ti,ni={};(ni=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ni.default=ni;var ii={};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)}}(ii=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,ii.default=ii;var oi={};(oi=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,oi.default=oi;je=a("85Hg2");var si=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ci={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},li=function(e){return ci[e]};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 ui(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(oi)(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 pi,fi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(si,li)}},hi=(0,je.createContext)();function mi(){return fi}var gi=function(){function e(){r(ni)(this,e),this.usedNamespaces={}}return r(ii)(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 vi(){return pi}var yi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fi=ui(ui({},fi),e)}(e.options.react),function(e){pi=e}(e)}};const bi=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},wi={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}}"},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"},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",screen:"Screen",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You"},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."}}},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}}"},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"},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",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous"},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."}}},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}}"},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"},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",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi"},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."}}}};ri.use(yi).init({lng:bi(),fallbackLng:"en",resources:wi,interpolation:{escapeValue:!1}});var xi=ri,Si=(je=a("85Hg2"),{}),_i={};(_i=function(e){if(Array.isArray(e))return e}).__esModule=!0,_i.default=_i;var ki={};(ki=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}).__esModule=!0,ki.default=ki;var Ei={},Ci={};(Ci=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,Ci.default=Ci,(Ei=function(e,t){if(e){if("string"==typeof e)return Ci(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)?Ci(e,t):void 0}}).__esModule=!0,Ei.default=Ei;var Pi={};(Pi=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,Pi.default=Pi,(Si=function(e,t){return _i(e)||ki(e,t)||Ei(e,t)||Pi()}).__esModule=!0,Si.default=Si;je=a("85Hg2");function Ri(){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 Ti={};function ji(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&Ti[t[0]]||("string"==typeof t[0]&&(Ti[t[0]]=new Date),Ri.apply(void 0,t))}function Oi(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 Mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=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&&!o(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(n,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e))))}function Li(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return ji("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}}):Mi(e,t,r)}function Ii(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 Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach((function(t){r(oi)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ai=function(e,t){var r=(0,je.useRef)();return(0,je.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Ni(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,je.useContext)(hi)||{},a=i.i18n,o=i.defaultNS,s=n||a||vi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new gi),!s){ji("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&&ji("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Di(Di(Di({},mi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,f=e||o||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var h=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return Li(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?f:f[0],p)}var g=(0,je.useState)(m),v=r(Si)(g,2),y=v[0],b=v[1],w=f.join(),x=Ai(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,h||u||Oi(s,f,(function(){S.current&&b(m)})),h&&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,h];if(k.t=y,k.i18n=s,k.ready=h,h)return k;if(!h&&!u)return k;throw new Promise((function(e){Oi(s,f,(function(){e()}))}))}var Fi=a("4Fy4N");var zi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Bi;const Ui=new Uint8Array(16);function Vi(){if(!Bi&&(Bi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bi(Ui)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Wi(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}var $i,qi,Gi,Zi=function(e,t,r){if(zi.randomUUID&&!t&&!e)return zi.randomUUID();const n=(e=e||{}).random||(e.rng||Vi)();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)},Ki=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={},Qi=a("hZG0u");const Ji="protoo-client";Yi=class{constructor(e){e?(this._debug=Qi(`${Ji}:${e}`),this._warn=Qi(`${Ji}:WARN:${e}`),this._error=Qi(`${Ji}:ERROR:${e}`)):(this._debug=Qi(Ji),this._warn=Qi(`${Ji}:WARN`),this._error=Qi(`${Ji}: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 Xi,ea=a("3oV8N").EventEmitter;Xi=class extends ea{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 ta={},ra=function(){return Math.round(1e7*Math.random())};const na=new Yi("Message");ta=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void na.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 na.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void na.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 na.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 na.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void na.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}na.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:ra(),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 ia=new Yi("Peer");Gi=class extends Xi{constructor(e){super(ia),ia.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){ia.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=ta.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=ta.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||(ia.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(ia.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(ia.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,ia.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=ta.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=ta.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=ta.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 ia.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var aa;if("object"==typeof globalThis)aa=globalThis;else try{aa=a("jCEG4")}catch(e){}finally{if(aa||"undefined"==typeof window||(aa=window),!aa)throw new Error("Could not determine global this")}var oa,sa=aa.WebSocket||aa.MozWebSocket;function ca(e,t){return t?new sa(e,t):new sa(e)}oa=a("kUMHr").version,sa&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(ca,e,{get:function(){return sa[e]}})}));var la={w3cwebsocket:sa?ca:null,version:oa}.w3cwebsocket,da={};da=a("jxXWz");const ua={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},pa=new Yi("WebSocketTransport");$i=Gi,qi=class extends Xi{constructor(e,t){super(pa),pa.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){pa.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){pa.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 pa.warn("send() failed:%o",e),e}}_runWebSocket(){const e=da.operation(this._options.retry||ua);let t=!1;e.attempt((r=>{this._closed?e.stop():(pa.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new la(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(pa.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||pa.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=ta.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):pa.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var fa=(0,(ba=a("bWPEY")).getGlobalObject)(),ha=["debug","info","warn","error","log","assert","trace"];function ma(e){var t=(0,ba.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};ha.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 ga(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ha.forEach((r=>{t[r]=(...t)=>{e&&ma((()=>{fa.console[r](`Sentry Logger [${r}]:`,...t)}))}})):ha.forEach((e=>{t[e]=()=>{}})),t}let va;va="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,ba.getGlobalSingleton)("logger",ga):ga();var ya=a("gTODe"),ba=a("bWPEY"),wa=a("hLvaX"),xa=(ba=a("bWPEY"),ba=a("bWPEY"),Object.prototype.toString);function Sa(e,t){return xa.call(e)===`[object ${t}]`}function _a(e){return Sa(e,"Object")}function ka(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Ea(e){return Ca(e,new Map)}function Ca(e,t){if(_a(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]=Ca(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(Ca(e,t))})),r}return e}function Pa(){var e=(0,ba.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 Ra;a("gTODe"),ba=a("bWPEY");!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ra||(Ra={}));class Ta{__init(){this._state=Ra.PENDING}__init2(){this._handlers=[]}constructor(e){Ta.prototype.__init.call(this),Ta.prototype.__init2.call(this),Ta.prototype.__init3.call(this),Ta.prototype.__init4.call(this),Ta.prototype.__init5.call(this),Ta.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Ta(((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 Ta(((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(Ra.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Ra.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Ra.PENDING&&(ka(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==Ra.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ra.RESOLVED&&e[1](this._value),this._state===Ra.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}ya=a("gTODe");function ja(e){var t=(0,ya.timestampInSeconds)(),r={sid:Pa(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Ea({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&&Oa(r,e),r}function Oa(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,ya.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Pa()),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 Ma(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Oa(e,r)}class La{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 La;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&&Oa(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 La?t:this}return e instanceof La?(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)):_a(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,ya.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([...Ia(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new Ta(((i,a)=>{var o=e[n];if(null===t||"function"!=typeof o)i(t);else{var s=o({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.id&&null===s&&va.log(`Event processor "${o.id}" dropped event`),ka(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,a):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,a)}}))}_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 Ia(){return(0,ba.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var Da=100;class Aa{__init(){this._stack=[{}]}constructor(e,t=new La,r=4){this._version=r,Aa.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=La.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:Pa(),n=new Error("Sentry syntheticException");return this._withClient(((i,a)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},a)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:Pa(),i=new Error(e);return this._withClient(((a,o)=>{a.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},o)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:Pa();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:a=Da}=n.getOptions&&n.getOptions()||{};if(!(a<=0)){var o={timestamp:(0,ya.dateTimestampInSeconds)(),...e},s=i?ma((()=>i(o,t))):o;null!==s&&r.addBreadcrumb(s,a)}}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=Fa(this);try{e(this)}finally{Fa(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__)&&va.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&&Ma(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var a=(0,ba.getGlobalObject)();const{userAgent:o}=a.navigator||{};var s=ja({release:n,environment:i,...t&&{user:t.getUser()},...o&&{userAgent:o},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Oa(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=Na().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&va.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Na(){var e=(0,ba.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Fa(e){var t=Na(),r=Ua(t);return Va(t,e),r}function za(){var e=Na();return Ba(e)&&!Ua(e).isOlderThan(4)||Va(e,new Aa),(0,wa.isNodeEnv)()?function(e){try{var t=Na().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Ua(e);if(!Ba(r)||Ua(r).isOlderThan(4)){var n=Ua(e).getStackTop();Va(r,new Aa(n.client,La.clone(n.scope)))}return Ua(r)}catch(t){return Ua(e)}}(e):Ua(e)}function Ba(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ua(e){return(0,ba.getGlobalSingleton)("hub",(()=>new Aa),e)}function Va(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Ha(e,t){return za().captureException(e,{captureContext:t})}function Wa(e){za().addBreadcrumb(e)}const $a=1,qa=2,Ga=3,Za=4,Ka=5,Ya={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let Qa=Number(2);const Ja=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class Xa{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${Ja.format(new Date)} ][ ${Ya[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Qa)?t(i,...n):Wa({type:"debug",level:Ya[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(Ka,console.debug,e,...t)}error(e,...t){this.print($a,console.error,e,...t)}info(e,...t){this.print(Ga,console.info,e,...t)}log(e,...t){this.print(Za,console.log,e,...t)}warn(e,...t){this.print(qa,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Qa=e}setLogLevel(e){this.customLogLevel=e}}const eo=new Xa("AudioLevels.ts"),to=window.AudioContext||window.webkitAudioContext;class ro{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 to,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){eo.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{eo.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!to}}const no=new Xa("AudioRenderer.ts");var io=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=>{no.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const ao=e=>new Promise((t=>{const r=window.devicePixelRatio||1,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"}),a=URL.createObjectURL(i),o=new Image;o.onload=()=>{const i=e.width/r-o.width-16,a=e.height/r-o.height-16;n?.drawImage(o,i,a),t(e)},o.src=a})),oo=async e=>{const{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",i="portrait"===n?t:r,a="landscape"===n?r:t,o="landscape"===n?(t-i)/2:0,s="portrait"===n?(r-a)/2:0,c=document.createElement("canvas"),l=c.getContext("2d"),d=window.devicePixelRatio||1;c.width=i*d,c.height=a*d,l?.scale(d,d),l?.drawImage(e,o,s,i,a,0,0,c.width/d,c.height/d);return(await ao(c)).toDataURL("image/jpeg")},so=async e=>{const t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");const n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();const i=document.createElement("canvas"),a=i.getContext("2d");i.height=t.height,i.width=t.width,a?.drawImage(t,0,0);return(await ao(i)).toDataURL("image/jpeg")};var co=a("eEB2e"),lo=(Fi=a("4Fy4N"),{}),uo=lo&&lo.__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]}),po=lo&&lo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fo=lo&&lo.__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)&&uo(t,e,r);return po(t,e),t},ho=lo&&lo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lo,"__esModule",{value:!0}),lo.debug=lo.parseScalabilityMode=lo.detectDevice=lo.Device=lo.version=lo.types=void 0;const mo=ho(a("hZG0u"));lo.debug=mo.default;var go=a("1ZHQC");Object.defineProperty(lo,"Device",{enumerable:!0,get:function(){return go.Device}}),Object.defineProperty(lo,"detectDevice",{enumerable:!0,get:function(){return go.detectDevice}});const vo=fo(a("cQumC"));lo.types=vo,lo.version="3.6.53";var yo=a("fT1lN");Object.defineProperty(lo,"parseScalabilityMode",{enumerable:!0,get:function(){return yo.parse}});const bo=new Xa("StreamerMediasoup");function wo(){try{const r=navigator.userAgent,n=Fi.getParser(r);e="DeviceDetectionForced",t=!0,za().setTag(e,t),Wa({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,lo.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){bo.error("deviceAutoDetection",e),Ha(e)}var e,t;return new(0,lo.Device)({handlerName:"Chrome74"})}class xo{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,lo.Device)}catch(e){return bo.error("failed to detects device from mediasoup, fallback on auto detection",e),wo()}}();return n.load({routerRtpCapabilities:r}),new xo(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)=>{bo.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},a,o)=>{try{const{id:o}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});a({id:o}),bo.log("producerTransport: ",t)}catch(e){o(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{bo.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)}}var So={};(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 a(e,t){if(t)e:{var r=i;e=e.split(".");for(var a=0;a<e.length-1;a++){var o=e[a];if(!(o in r))break e;r=r[o]}(t=t(a=r[e=e[e.length-1]]))!=a&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function o(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}a("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)}})),a("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(" "),a=0;a<t.length;a++){var s=i[t[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(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 f=l;function h(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,f)f(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 a=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,a),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)),f&&e.prototype&&f(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};a("Object.assign",(function(e){return e||k})),a("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 a=i.setTimeout;r.prototype.i=function(e){a(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;a((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)o.h(this.g[e]);this.g=null}};var o=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){a(e)}}:t}var i,a,o=new t((function(e,t){i=e,a=t}));return this.J(n(e,i),n(r,a)),o},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?o.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),a=i.next();!a.done;a=i.next())n(a.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 a(t){return function(r){o[t]=r,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,n(i.value).J(a(o.length-1),t),i=r.next()}while(!i.done)}))},t})),a("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),a("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}})),a("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)}})),a("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 a=e.charCodeAt(i);if(128>a)n[r++]=a;else{if(2048>a)n[r++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<e.length){var o=e.charCodeAt(++i);if(56320<=o&&57343>=o){a=1024*(a-55296)+o-56320+65536,n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");a=65533}n[r++]=a>>12|224,n[r++]=a>>6&63|128}n[r++]=63&a|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,a=0;i<e.length-2;i+=3){var o=e[i],s=e[i+1],c=e[i+2],l=t[o>>2];o=t[(3&o)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[a++]=l+o+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[a]=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),a=r(0),o=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|a>>4),64!=o&&(t(a<<4&240|o>>2),64!=s&&t(o<<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 a=n[i];void 0===I[a]&&(I[a]=i)}}}}var F,z="function"==typeof Uint8Array.prototype.slice;function B(e,t,r){return t===r?F||(F=new Uint8Array(0)):z?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 W(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 $(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 q=[];function G(){this.g=new Uint8Array(64),this.h=0}function Z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function K(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,q.length?(r=q.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 Y(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=W(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 Q(e){switch(e.h){case 0:if(0!=e.h)Q(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Q(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Q(e);else{var t=W(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Q(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Y(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Q(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=W(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=W(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,a,o,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(a=e[n++],194>i||128!=(192&a)?(n--,s.push(65533)):s.push((31&i)<<6|63&a)):240>i?n>=r-1?s.push(65533):128!=(192&(a=e[n++]))||224===i&&160>a||237===i&&160<=a||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&a)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(a=e[n++]))||0!=a-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(o=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&a)<<12|(63&t)<<6|63&o,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 G}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,a=0;a<n;a++){var o=r[a];0!==o.length&&(t.set(o,i),i+=o.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){Z(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)}}G.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},G.prototype.length=function(){return this.h},G.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,B(e,0,t)},K.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function ae(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):oe(e,t,r):t(e)}function oe(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=ae(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=ae(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):(fe(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function fe(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function he(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=he(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=he(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(fe(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=he(e,t))?0:e}function Se(e,t){return null==(e=he(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 Q(t),t.N||(t=B(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 a(e){try{s(t.next(e))}catch(e){i(e)}}function o(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(a,o)}s((t=t.apply(e,void 0)).next())}))}function Ce(e){ue.call(this,e)}function Pe(e,t){for(;Y(t);)switch(t.i){case 8:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=$(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 oe(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},h(Ce,ue),h(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(;Y(t);)switch(t.i){case 13:var r=$(t.g);ve(e,1,r);break;case 21:ve(e,2,r=$(t.g));break;case 29:ve(e,3,r=$(t.g));break;case 37:ve(e,4,r=$(t.g));break;case 45:ve(e,5,r=$(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Le)}h(je,ue),h(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!=he(e,3)?Se(e,3):void 0,displayName:null!=he(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!=he(e,4)?ge(e,4):void 0}}function Fe(e,t){this.h=e,this.g=t,this.l=0}function ze(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),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(a));n=e.m=a,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 Be(e){this.g=e}h(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 We(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 $e(e){return Ee(e,(function e(){var t,r,n,i,a,o,s,l,d,u,p,f=this;return _(e,(function(e){switch(e.g){case 1:return t=f,f.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(f,f.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:f.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:f.locateFile}),o=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(o.map((function(e){var r=qe(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,qe(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:f.h=e.h,f.l=new OffscreenCanvas(1,1),f.h.canvas=f.l,a=f.h.GL.createContext(f.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),f.h.GL.makeContextCurrent(a),e.g=4;break;case 7:if(f.l=document.createElement("canvas"),!(p=f.l.getContext("webgl2",{}))&&!(p=f.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();f.D=p,f.h.canvas=f.l,f.h.createContext(f.l,!0,!0,{});case 4:f.i=new f.h.SolutionWasm,f.R=!1,e.g=0}}))}))}function qe(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 Ge(e,t,r){return Ee(e,(function e(){var n,i,a,o,c,l,d,u,p,f,h,m,g,v,b=this;return _(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,a=s(Object.keys(r)),o=a.next();!o.done;o=a.next())c=o.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)),o=d.next();case 2:if(o.done){e.g=4;break}if(u=o.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(ze(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(f=t[p.stream],"detection_list"===p.type){if(f){for(var w=f.getRectList(),x=f.getLandmarksList(),S=f.getClassificationsList(),k=[],E=0;E<w.size();++E){var C=w.get(E);e:{var P=new Ie;for(C=new K(C);Y(C);)switch(C.i){case 13:var R=$(C.g);ve(P,1,R);break;case 21:ve(P,2,R=$(C.g));break;case 29:ve(P,3,R=$(C.g));break;case 37:ve(P,4,R=$(C.g));break;case 45:ve(P,5,R=$(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 K(R);Y(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 K(T);Y(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(f){for(w=Array(f.size()),x=0;x<f.size();x++)w[x]=f.get(x);f.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===f){e.g=3;break}if("float_list"===p.type){n[u]=f,e.g=7;break}if("proto"===p.type){n[u]=f,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(h=b.s[u])||(h=new Fe(b.h,b.D),b.s[u]=h),y(e,ze(h,f,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:o=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ze(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,a=s(t.wants),o=a.next();!o.done;o=a.next())i.push_back(o.value);a=e.h.PacketListener.implement({onResults:function(i){for(var a={},o=0;o<t.wants.length;++o)a[n[o]]=i.get(o);var s=e.listeners[r];s&&(e.C=Ge(e,a,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var o=a[n[i]];"object"==typeof o&&o.hasOwnProperty&&o.hasOwnProperty("delete")&&o.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,a),i.delete()}function Ke(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Ye(e){var t=this;e=e||{},this.g=new We({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:Ke(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,a=this;return _(t,(function(t){return 1==t.g?(r=Ke(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,qe(a.g,r),2)):(i=t.h,a.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=We.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=[],a={},o=s(Object.keys(e)),c=o.next();!c.done;a={K:a.K,L:a.L},c=o.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&&(a.K=c.onChange,a.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}))}))}}(a))),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,$e(t),2):3!=e.g?y(e,Ee(t,(function e(){var t,r,n,i,a,o,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,qe(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(a=s(d.g.listeners),o=a.next();!o.done;o=a.next())c=o.value,Ze(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,a,o,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),a=i.next();!a.done;a=i.next())o=a.value,n.push_back(o);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,a,o,c,l,d,u,p,f=this;return _(r,(function(r){switch(r.g){case 1:return f.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,f.C,2)):r.return();case 2:return y(r,f.initialize(),3);case 3:for(i=new f.h.PacketDataList,a=s(Object.keys(e)),o=a.next();!o.done;o=a.next())if(c=o.value,l=f.g.inputs[c]){e:{var h=f,m=e[c];switch(l.type){case"video":var g=h.m[l.stream];if(g||(g=new Fe(h.h,h.D),h.m[l.stream]=g),0===(h=g).l&&(h.l=h.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:h.l,width:v,height:g},(v=h.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),h.h.bindTexture2d(h.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),h.h.bindTexture2d(0),h=g;break e;case"detections":for((g=h.m[l.stream])||(g=new Be(h.h),h.m[l.stream]=g),(h=g).data||(h.data=new h.g.DetectionListData),h.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=h.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,he(_,1)),ne(k,2,he(_,2)),ne(k,3,he(_,3)),ne(k,4,he(_,4)),ne(k,5,he(_,5));var E=he(_,6);if(null!=E&&null!=E){Z(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=h.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,he(k,1)),ne(C,2,he(k,2)),ne(C,3,he(k,3)),ne(C,4,he(k,4)),ne(C,5,he(k,5)),_e(k,C),_=re(_),x.call(w,S,_);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=h.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=he(k,1))&&null!=R)if(Z(C.g,8),E=C.g,0<=R)Z(E,R);else{for(P=0;9>P;P++)E.push(127&R|128),R>>=7;E.push(1)}ne(C,2,he(k,2)),null!=(E=he(k,3))&&(E=M(E),Z(C.g,26),Z(C.g,E.length),te(C,C.g.end()),te(C,E)),null!=(E=he(k,4))&&(E=M(E),Z(C.g,34),Z(C.g,E.length),te(C,C.g.end()),te(C,E)),_e(k,C),_=re(_),x.call(w,S,_)}}h=h.data;break e;default:h={}}}switch(d=h,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 f.i.send(i),y(r,f.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",We),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Ye.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",Ye),C("VERSION","0.1.1632777926")}).call(So);const _o=new Xa("MediaPipe"),ko="https://stream-assets.snapcall.io";let Eo=!1;const Co=new So.SelfieSegmentation({locateFile:(e,t)=>{if(_o.debug("selfieSegmentation",e,t),ko)return`${ko}/mediapipe/${e}`;return`${window.location.href.split("/").slice(0,-1).join("/")}/mediapipe/${e}`}});var Po,Ro,To,jo;Ro=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 Oo={};function Mo(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}To=function(e){var t=Oo[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 Mo(e[2])}return"/"}(),Oo[e]=t),t},jo=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 Lo=To("adfgW")+a("juxiN").resolve("5WDBY");Po=Ro(Lo,jo(Lo),!1);class Io{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Po,{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((()=>{Co.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};Co.setOptions(e),_o.log("selfie segmentation initialized"),Eo||(await Co.initialize(),Eo=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Co.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{Co.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){_o.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 Do=new Xa("StreamerClient"),Ao="WRTC1",No="WRTC2",Fo="TRANS1",zo="CONS1",Bo="SOCK1",Uo="USERLIMIT",Vo={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 Ho extends CustomEvent{constructor(e,t){super(e,t)}}const Wo=EventTarget,$o={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const qo=new class extends Wo{mediasoupTransport={};mediaPipeOption=$o;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",credentialType:"password"}]},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.screenshareProducer=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 Ho("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new Ho("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new Ho("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:t,plan:{permissions:n,name:i}}=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=n,this.plan=i,r=`${this.config.streamerServer}/${t}${this.joinOptions.recorder?"/recorder":""}?roomId=${e}&peerId=${this.peerId}`}catch(e){const t=new Ho("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new qi(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",(()=>{Do.error("protoo.on","failed"),this.onCriticalError(Bo)})),this.protoo.on("disconnected",(()=>{Do.error("protoo.on","disconnected"),this.onCriticalError(Bo)})),this.protoo.on("close",(()=>Do.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(Do.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(Uo);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 Ho("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 Ho("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 Ho("recordStopped",{detail:e.data}));else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new Ho("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 Ho("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 a="producerPaused"===e.method?"mediaPause":"mediaResume",o=new Ho(a,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(o)}else if("mute"===e.method){const{peerId:t,device:r}=e.data,n=new Ho("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 Ho("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestDeviceResult"===e.method){const t=new Ho(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new Ho(e.method,{detail:e.data});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,a=this.customMessages.get(t);a?a.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const o=this.customMessages.get(t);if(o&&o.totalChunks===o.chunks.length){const r=o.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new Ho("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(Fo),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(Do.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{Do.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}`);Ha(t,{extra:{direction:e.transport?.direction,id:e.transport?.id,kind:e.kind}}),Do.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Ao)}}))}async joinRoom(){this.streamerMediasoup=await xo.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 Ho("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){Do.warn("joinRoom",e),this.dispatchEvent(new Ho("agentIdentity",{detail:{success:!1}}))}const{peers:r}=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 n=await this.getCallId();this.dispatchEvent(new Ho("enterRoom",{detail:{peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:n,plan:this.plan,permissions:this.permissions}})),Do.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 xo.create(this.protoo,this.config);const e=await this.getCallId();this.dispatchEvent(new Ho("enterRoom",{detail:{peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions}}))}async switchMicrophone(e){try{Do.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.micProducer?.track?.stop(),Do.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new ro(t,this);const r=t.getAudioTracks()[0];await(this.micProducer?.replaceTrack({track:r})),Do.log("switchMicrophone","switched Microphone")}catch(e){Do.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new Ho("microphoneMute",{detail:{}});this.dispatchEvent(t),await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){Do.log("onDeviceChange","detecting device change");const e=new Ho("devicesListChange",{detail:{}});if(this.dispatchEvent(e),!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return Do.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)))));Do.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void Do.warn("onDeviceChange","no audio input change");if(Do.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new Ho("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),Do.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 ro(e,this);const r=e.getAudioTracks()[0],n="microphone",i=await t.produce({track:r,codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{Do.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{Do.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{Do.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const a=new Ho("microphoneEnabled",{detail:{}});this.dispatchEvent(a)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0;const e="microphone";this.protoo.notify("mute",{device:e});const t=new Ho("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 Ho("microphoneUnmute",{detail:{}});this.dispatchEvent(t)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){Do.log("release");for(let e in this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=void 0),this.webcamTrack?.stop(),this.webcamTrack=null,this.protooTransport.close(),this.protoo.close(),this.micProducer?.close(),this.screenshareProducer?.close(),this.webcamProducer?.close(),this.consumers.forEach((e=>{e.mediaSoupConsumer.close()})),this.consumers.clear(),this.audioLevel?.release()}endCall(){this.release();const e=new Ho("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 Ho("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(Do.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});Do.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(t){this.onCriticalError(No),Do.log("restartIce","restartIceFailed",t),Ha(t,{extra:{direction:e.direction,id:e.id}})}}scaleVideoMediasConstraintsParameter(e){let t=Vo.hd;2===e?t=Vo.vga:e>2&&(t=Vo.qvga),(!this.webcam.resolution||Vo[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(Do.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.screenshareProducer&&!this.screenshareProducer.closed&&e++;let t={scaleResolutionDownBy:1};if(e>=3&&(t={scaleResolutionDownBy:2}),e>=9&&(t={scaleResolutionDownBy:4}),!co.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(Do.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{Do.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){Do.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 a={};if(r)if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",a.facingMode=this.webcam.facingMode;else{const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknow";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,this.webcam.resolution="hd",a.deviceId={ideal:this.webcam.device?.deviceId}}else i?(this.webcam.facingMode=i,a.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,a.deviceId={ideal:this.webcam.device.deviceId}),t&&(this.webcam.resolution=t);let o=Vo[t||this.webcam.resolution];this.useVideoBackground&&(o={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await(this.webcamProducer?.replaceTrack?.({track:null}).catch((e=>{Do.error("switchCamera","clean track failed",e)})));const s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:n,...a,...o}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Io(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 Ho("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");let r=Vo[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 Io(n,this.mediaPipeOption));const i=await(this.mediaPipe?.createStream())||n;await this.updateWebcams();const a=await this.getTransport("video","send"),o=i.getVideoTracks()[0];this.webcamTrack=o;const s=await(o.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};this.webcamProducer=await a.produce({track:o,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 Ho("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(),await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;const e=new Ho("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(){if(!this.permissions.find((e=>"screen_sharing"===e)))throw new Error("feature not allowed");const e=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:!1,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}));if(!e)return;const t=await this.getTransport("video","send"),r=e.getVideoTracks()[0];this.screenshareProducer=await t.produce({track:r,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"screen",share:!0}}),this.screenshareProducer.on("transportclose",(()=>{this.screenshareProducer=null})),this.screenshareProducer.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const n=new Ho("screenshareEnabled",{detail:{}});this.dispatchEvent(n)}async disableScreenshare(){this.screenshareProducer&&(this.screenshareProducer.close(),await this.protoo.request("closeProducer",{producerId:this.screenshareProducer.id}),this.screenshareProducer=null);const e=new Ho("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 Ho("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}){Do.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>Do.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>Do.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else Do.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 deleteCapture(e){return await this.protoo.request("deleteCapture",{assetId:e})}async captureVideo(e){if(this.permissions.find((e=>"instant_picture"===e))){let t;if(e)t=await oo(e);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");t=await so(this.webcamProducer.track)}return t}throw new Error("feature not allowed")}requestLocalVideo(e){if(Do.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.screenshareProducer){const t=new MediaStream;t.addTrack(this.screenshareProducer.track),e.srcObject=t}else Do.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}){const i="microphone"===r?"audio":"video",a=await this.getTransport(i,"recv"),o=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:a.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}=o;Do.log("consumeProducer","Data: ",o);try{const t=await a.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});Do.log("transport",a),Do.log("consumer",t),this.consumers.set(t.id,{mediaSoupConsumer:t,deviceType:r}),this.scaleVideoEncodingsParameter();const n=!!s&&s.muted,i=new Ho("mediaStart",{detail:{peerId:e,mediaId:t.id,deviceType:r,paused:n}});if(this.dispatchEvent(i),"audio"===t.kind){const e=this.createAudioRenderer(t.id),r=new MediaStream;r.addTrack(t.track),e.setSource(r),e.play()}"video"===t.kind&&await this.protoo.request("resumeConsumer",{consumerId:t.id})}catch(e){throw this.onCriticalError(zo),Do.error("consumeProducer","newConsumer request failed",e),e}}async setDisplayName(e){await this.setProfile({name:e});const t=new Ho("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 Ho("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 Do.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.screenshareProducer&&!this.screenshareProducer.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.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 Ho("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new io({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=>Do.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 Go=(0,(je=a("85Hg2")).createContext)({});je=a("85Hg2");let Zo;var Ko;(Ko=Zo||(Zo={}))[Ko.SET_STREAMS=0]="SET_STREAMS",Ko[Ko.ADD_STREAM=1]="ADD_STREAM",Ko[Ko.REMOVE_STREAM=2]="REMOVE_STREAM",Ko[Ko.DEVICE_UPDATE=3]="DEVICE_UPDATE",Ko[Ko.MUTE=4]="MUTE",Ko[Ko.UNMUTE=5]="UNMUTE",Ko[Ko.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",Ko[Ko.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",Ko[Ko.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",Ko[Ko.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const Yo={streams:[],highlightedTile:null},Qo=(e,t)=>{switch(t.type){case Zo.SET_STREAMS:return{...e,streams:t.payload};case Zo.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case Zo.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case Zo.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:a,paused:o}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=o),{...e,[i]:a?n:null,muted:t}}return e}))}}case Zo.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case Zo.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case Zo.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case Zo.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case Zo.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case Zo.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},Jo=(0,je.createContext)(void 0),Xo=({children:e})=>{const[t,r]=(0,je.useReducer)(Qo,Yo),n={state:t,dispatch:r};return(0,o.jsx)(Jo.Provider,{value:n,children:e})},es=()=>{const e=(0,je.useContext)(Jo);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 ts=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 rs=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 a=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 a=i.getPropertyValue("-webkit-overflow-scrolling"),o=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===a&&("auto"===o||"scroll"===o),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()}},o=function(e){t=e.touches?e.touches[0].screenY:e.screenY},s=function(){window.addEventListener("touchstart",o,!!n&&{passive:!1}),window.addEventListener("touchmove",a,!!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",o,!1),window.removeEventListener("touchmove",a,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Ar&&(Ar=d),"function"==typeof e.define?function(e){e("iNoBounce",[],(function(){return d}))}(e.define):e.iNoBounce=d}(Ar);var tn={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)}},rn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fr(this,e),this.init(t,r)}return Br(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||tn,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,en(en({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),nn=function(){function e(){Fr(this,e),this.observers={}}return Br(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 a=[].concat(this.observers["*"]);a.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 on(e){return null==e?"":""+e}function sn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function cn(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return i()?{}:{obj:e,k:n(a.shift())}}function ln(e,t,r){var n=cn(e,t,Object);n.obj[n.k]=r}function dn(e,t){var r=cn(e,t),n=r.obj,i=r.k;if(n)return n[i]}function un(e,t,r){var n=dn(e,r);return void 0!==n?n:dn(t,r)}function pn(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]):pn(e[n],t[n],r):e[n]=t[n]);return e}function fn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function mn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return hn[e]})):e}var gn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,vn=[" ",",","?","!",";"];function yn(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?yn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wn(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(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,a=0;a<n.length;++a){if(!i)return;if("string"==typeof i[n[a]]&&a+1<n.length)return;if(void 0===i[n[a]]){for(var o=2,s=n.slice(a,a+o).join(r),c=i[s];void 0===c&&n.length>a+o;)o++,c=i[s=n.slice(a,a+o).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(a+o).join(r);return l?xn(c,l,r):void 0}i=i[n[a]]}return i}}var Sn=function(e){Hr(r,e);var t=wn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Fr(this,r),n=t.call(this),gn&&nn.call(Ur(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 Br(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,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];r&&"string"!=typeof r&&(o=o.concat(r)),r&&"string"==typeof r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."));var s=dn(this.data,o);return s||!a||"string"!=typeof r?s:xn(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},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(n=t,t=(o=e.split("."))[1]),this.addNamespaces(t),ln(this.data,o,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 a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var s=dn(this.data,o)||{};n?pn(s,r,i):s=bn(bn({},s),r),ln(this.data,o,s),a.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?bn(bn({},{}),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}(nn),_n={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,r,n,i))})),t}};function kn(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 En(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cn(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 Pn={},Rn=function(e){Hr(r,e);var t=Cn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fr(this,r),n=t.call(this),gn&&nn.call(Ur(n)),sn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Ur(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=rn.create("translator"),n}return Br(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||[],a=r&&e.indexOf(r)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=vn.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("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}(e,r,n));if(a&&!o){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"!==Nr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=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 f=t.nsSeparator||this.options.nsSeparator;return a?(h.res="".concat(d).concat(f).concat(c),h):"".concat(d).concat(f).concat(c)}return a?(h.res=c,h):c}var h=this.resolve(e,t),m=h&&h.res,g=h&&h.usedKey||c,v=h&&h.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,En(En({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(h.res=_,h):_}if(o){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(o).concat(P);E[P]=this.translate(R,En(En({},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),o){var F=this.resolve(c,En(En({},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 z=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var U=0;U<B.length;U++)z.push(B[U]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(t.lng||this.language):z.push(t.lng||this.language);var V=function(e,r,n){var a=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,a,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,a,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?z.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||I)}))})):V(z,c,I))}m=this.extendTranslation(m,e,t,h,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 a?(h.res=m,h):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,En(En({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(En(En({},r),{interpolation:En(En({},this.options.interpolation),r.interpolation)}));var o,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);o=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=En(En({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);o<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return i&&i[0]===n[0]&&!r.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):a.translate.apply(a,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=_n.handle(p,e,t,this.options&&this.options.postProcessPassResolved?En({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var c=o.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;o.options.fallbackNS&&(d=d.concat(o.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&o.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);d.forEach((function(e){o.isValidLookup(t)||(a=e,!Pn["".concat(h[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&(Pn["".concat(h[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(a,'" 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!!!")),h.forEach((function(r){if(!o.isValidLookup(t)){i=r;var a,c=[l];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=o.pluralResolver.getSuffix(r,s.count,s));var h="".concat(o.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+h)),f){var m="".concat(l).concat(o.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+h))}}for(;a=c.pop();)o.isValidLookup(t)||(n=a,t=o.getResource(r,e,a,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:a}}},{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}(nn);function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var jn=function(){function e(t){Fr(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rn.create("languageUtils")}return Br(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]=Tn(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]=Tn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tn(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=[],a=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&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),n.forEach((function(e){i.indexOf(e)<0&&a(r.formatLanguageCode(e))})),i}}]),e}(),On=[{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}],Mn={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)}},Ln=["v1","v2","v3"],In={zero:0,one:1,two:2,few:3,many:4,other:5};function Dn(){var e={};return On.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Mn[t.fc]}}))})),e}var An=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fr(this,e),this.languageUtils=t,this.options=r,this.logger=rn.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=Dn()}return Br(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 In[e]-In[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 a=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()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!Ln.includes(this.options.compatibilityJSON)}}]),e}();function Nn(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 Fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(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]:{};Fr(this,e),this.logger=rn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Br(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:mn,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,a,o,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=un(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Fn(Fn(Fn({},n),t),{},{interpolationkey:e})):i}var a=e.split(s.formatSeparator),o=a.shift().trim(),l=a.join(s.formatSeparator).trim();return s.format(un(t,c,o),l,r,Fn(Fn(Fn({},n),t),{},{interpolationkey:o}))};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(o=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(a=d(r)))if("function"==typeof u){var c=u(e,i,n);a="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))a="";else{if(p){a=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),a=""}else"string"==typeof a||s.useRawValueToEscape||(a=on(a));var l=t.safeValue(a);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++o>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Fn({},a);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,o)).replace(/'/g,'"');try{o=JSON.parse(i),t&&(o=Fn(Fn({},t),o))}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 o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.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(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=on(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,a.lng,Fn(Fn({},a),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();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 Un(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){qr(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}var Vn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Fr(this,e),this.logger=rn.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,Un(Un({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Un({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Un({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Un({},r)).format(e)}},this.init(t)}return Br(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 a=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=Jr(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),o=a.formatName,s=a.formatOptions;if(i.formats[o]){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[o](e,d,Un(Un(Un({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(o)),e}),e)}}]),e}();function Hn(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?Hn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(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 qn=function(e){Hr(r,e);var t=$n(r);function r(e,n,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Fr(this,r),a=t.call(this),gn&&nn.call(Ur(a)),a.backend=e,a.store=n,a.services=i,a.languageUtils=i.languageUtils,a.options=o,a.logger=rn.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=o.maxParallelReads||10,a.readingCalls=0,a.maxRetries=o.maxRetries>=0?o.maxRetries:5,a.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,o.backend,o),a}return Br(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,a={},o={},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===o[s]&&(o[s]=!0):(i.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===a[s]&&(a[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),r&&this.store.addResourceBundle(i,a,r),this.state[e]=t?-1:2;var o={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=a,l=cn(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){o[e]||(o[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===o[e][t]&&(o[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",o),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,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=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:a,callback:o}):(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*a,o)}),a):o(s,c)}))):o(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 a=this.queueLoad(e,t,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.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],a=n[1];this.read(i,a,"read",void 0,void 0,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(a," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(a," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var a=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({},a),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(nn);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"===Nr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Nr(e[2])||"object"===Nr(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 Kn(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?Kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qn(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 Jn(){}function Xn(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ei=function(e){Hr(r,e);var t=Qn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Fr(this,r),e=t.call(this),gn&&nn.call(Ur(e)),e.options=Zn(n),e.services={},e.logger=rn,e.modules={external:[]},Xn(Ur(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),Wr(e,Ur(e));setTimeout((function(){e.init(n,i)}),0)}return e}return Br(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 a;this.modules.logger?rn.init(i(this.modules.logger),this.options):rn.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Vn);var o=new jn(this.options);this.store=new Sn(this.options.resources,this.options);var s=this.services;s.logger=rn,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new An(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(a),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 qn(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 Rn(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=Jn),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]:Jn,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 a=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};if(i)o(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return o(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(a,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=Jn),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&&_n.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)},a=function(a){e||a||!r.services.languageDetector||(a=[]);var o="string"==typeof a?a:r.services.languageUtils.getBestMatchFromCodes(a);o&&(r.language||i(o),r.translator.language||r.translator.changeLanguage(o),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(o)),r.loadResources(o,(function(e){!function(e,a){a?(i(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var a;if("object"!==Nr(i)){for(var o=arguments.length,s=new Array(o>2?o-2:0),c=2;c<o;c++)s[c-2]=arguments[c];a=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else a=Yn({},i);a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,a.keyPrefix=a.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=a.keyPrefix?"".concat(a.keyPrefix).concat(l).concat(t):t;return n.t(d,a)};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,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=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,o);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,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]:Jn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),a=new r(i),o=["store","services","language"];return o.forEach((function(t){a[t]=e[t]})),a.services=Yn({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new Rn(a.services,a.options),a.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];a.emit.apply(a,[e].concat(r))})),a.init(i,n),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nn);qr(ei,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ei(e,t)}));var ti=ei.createInstance();ti.createInstance=ei.createInstance;ti.createInstance,ti.init,ti.loadResources,ti.reloadResources,ti.use,ti.changeLanguage,ti.getFixedT,ti.t,ti.exists,ti.setDefaultNamespace,ti.hasLoadedNamespace,ti.loadNamespaces,ti.loadLanguages;var ri=ti,ni={};(ni=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,ni.default=ni;var ii={};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)}}(ii=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,ii.default=ii;var oi={};(oi=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,oi.default=oi;je=a("85Hg2");var si=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ci={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},li=function(e){return ci[e]};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 ui(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(oi)(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 pi,fi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(si,li)}},hi=(0,je.createContext)();function mi(){return fi}var gi=function(){function e(){r(ni)(this,e),this.usedNamespaces={}}return r(ii)(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 vi(){return pi}var yi={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fi=ui(ui({},fi),e)}(e.options.react),function(e){pi=e}(e)}};const bi=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},wi={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}}"},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"},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",screen:"Screen",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You"},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."}}},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}}"},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"},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",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous"},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."}}},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}}"},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"},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",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi"},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."}}}};ri.use(yi).init({lng:bi(),fallbackLng:"en",resources:wi,interpolation:{escapeValue:!1}});var xi=ri,Si=(je=a("85Hg2"),{}),_i={};(_i=function(e){if(Array.isArray(e))return e}).__esModule=!0,_i.default=_i;var ki={};(ki=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}).__esModule=!0,ki.default=ki;var Ei={},Ci={};(Ci=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,Ci.default=Ci,(Ei=function(e,t){if(e){if("string"==typeof e)return Ci(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)?Ci(e,t):void 0}}).__esModule=!0,Ei.default=Ei;var Pi={};(Pi=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,Pi.default=Pi,(Si=function(e,t){return _i(e)||ki(e,t)||Ei(e,t)||Pi()}).__esModule=!0,Si.default=Si;je=a("85Hg2");function Ri(){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 Ti={};function ji(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&Ti[t[0]]||("string"==typeof t[0]&&(Ti[t[0]]=new Date),Ri.apply(void 0,t))}function Oi(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 Mi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=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&&!o(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(n,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e))))}function Li(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return ji("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}}):Mi(e,t,r)}function Ii(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 Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach((function(t){r(oi)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ai=function(e,t){var r=(0,je.useRef)();return(0,je.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Ni(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,je.useContext)(hi)||{},a=i.i18n,o=i.defaultNS,s=n||a||vi();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new gi),!s){ji("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&&ji("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Di(Di(Di({},mi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,f=e||o||s.options&&s.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var h=(s.isInitialized||s.initializedStoreOnce)&&f.every((function(e){return Li(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?f:f[0],p)}var g=(0,je.useState)(m),v=r(Si)(g,2),y=v[0],b=v[1],w=f.join(),x=Ai(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,h||u||Oi(s,f,(function(){S.current&&b(m)})),h&&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,h];if(k.t=y,k.i18n=s,k.ready=h,h)return k;if(!h&&!u)return k;throw new Promise((function(e){Oi(s,f,(function(){e()}))}))}var Fi=a("4Fy4N");var zi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Bi;const Ui=new Uint8Array(16);function Vi(){if(!Bi&&(Bi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bi(Ui)}const Hi=[];for(let e=0;e<256;++e)Hi.push((e+256).toString(16).slice(1));function Wi(e,t=0){return(Hi[e[t+0]]+Hi[e[t+1]]+Hi[e[t+2]]+Hi[e[t+3]]+"-"+Hi[e[t+4]]+Hi[e[t+5]]+"-"+Hi[e[t+6]]+Hi[e[t+7]]+"-"+Hi[e[t+8]]+Hi[e[t+9]]+"-"+Hi[e[t+10]]+Hi[e[t+11]]+Hi[e[t+12]]+Hi[e[t+13]]+Hi[e[t+14]]+Hi[e[t+15]]).toLowerCase()}var $i,qi,Gi,Zi=function(e,t,r){if(zi.randomUUID&&!t&&!e)return zi.randomUUID();const n=(e=e||{}).random||(e.rng||Vi)();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)},Ki=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={},Qi=a("hZG0u");const Ji="protoo-client";Yi=class{constructor(e){e?(this._debug=Qi(`${Ji}:${e}`),this._warn=Qi(`${Ji}:WARN:${e}`),this._error=Qi(`${Ji}:ERROR:${e}`)):(this._debug=Qi(Ji),this._warn=Qi(`${Ji}:WARN`),this._error=Qi(`${Ji}: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 Xi,ea=a("3oV8N").EventEmitter;Xi=class extends ea{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 ta={},ra=function(){return Math.round(1e7*Math.random())};const na=new Yi("Message");ta=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void na.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 na.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void na.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 na.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 na.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void na.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}na.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:ra(),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 ia=new Yi("Peer");Gi=class extends Xi{constructor(e){super(ia),ia.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){ia.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=ta.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=ta.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||(ia.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(ia.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(ia.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,ia.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=ta.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=ta.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=ta.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 ia.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var aa;if("object"==typeof globalThis)aa=globalThis;else try{aa=a("jCEG4")}catch(e){}finally{if(aa||"undefined"==typeof window||(aa=window),!aa)throw new Error("Could not determine global this")}var oa,sa=aa.WebSocket||aa.MozWebSocket;function ca(e,t){return t?new sa(e,t):new sa(e)}oa=a("kUMHr").version,sa&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(ca,e,{get:function(){return sa[e]}})}));var la={w3cwebsocket:sa?ca:null,version:oa}.w3cwebsocket,da={};da=a("jxXWz");const ua={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},pa=new Yi("WebSocketTransport");$i=Gi,qi=class extends Xi{constructor(e,t){super(pa),pa.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){pa.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){pa.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 pa.warn("send() failed:%o",e),e}}_runWebSocket(){const e=da.operation(this._options.retry||ua);let t=!1;e.attempt((r=>{this._closed?e.stop():(pa.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new la(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(pa.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||pa.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=ta.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):pa.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var fa=(0,(ba=a("bWPEY")).getGlobalObject)(),ha=["debug","info","warn","error","log","assert","trace"];function ma(e){var t=(0,ba.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};ha.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 ga(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ha.forEach((r=>{t[r]=(...t)=>{e&&ma((()=>{fa.console[r](`Sentry Logger [${r}]:`,...t)}))}})):ha.forEach((e=>{t[e]=()=>{}})),t}let va;va="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,ba.getGlobalSingleton)("logger",ga):ga();var ya=a("gTODe"),ba=a("bWPEY"),wa=a("hLvaX"),xa=(ba=a("bWPEY"),ba=a("bWPEY"),Object.prototype.toString);function Sa(e,t){return xa.call(e)===`[object ${t}]`}function _a(e){return Sa(e,"Object")}function ka(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Ea(e){return Ca(e,new Map)}function Ca(e,t){if(_a(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]=Ca(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(Ca(e,t))})),r}return e}function Pa(){var e=(0,ba.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 Ra;a("gTODe"),ba=a("bWPEY");!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ra||(Ra={}));class Ta{__init(){this._state=Ra.PENDING}__init2(){this._handlers=[]}constructor(e){Ta.prototype.__init.call(this),Ta.prototype.__init2.call(this),Ta.prototype.__init3.call(this),Ta.prototype.__init4.call(this),Ta.prototype.__init5.call(this),Ta.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Ta(((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 Ta(((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(Ra.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Ra.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Ra.PENDING&&(ka(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==Ra.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ra.RESOLVED&&e[1](this._value),this._state===Ra.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}ya=a("gTODe");function ja(e){var t=(0,ya.timestampInSeconds)(),r={sid:Pa(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Ea({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&&Oa(r,e),r}function Oa(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,ya.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Pa()),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 Ma(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Oa(e,r)}class La{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 La;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&&Oa(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 La?t:this}return e instanceof La?(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)):_a(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,ya.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([...Ia(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new Ta(((i,a)=>{var o=e[n];if(null===t||"function"!=typeof o)i(t);else{var s=o({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.id&&null===s&&va.log(`Event processor "${o.id}" dropped event`),ka(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,a):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,a)}}))}_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 Ia(){return(0,ba.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var Da=100;class Aa{__init(){this._stack=[{}]}constructor(e,t=new La,r=4){this._version=r,Aa.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=La.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:Pa(),n=new Error("Sentry syntheticException");return this._withClient(((i,a)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},a)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:Pa(),i=new Error(e);return this._withClient(((a,o)=>{a.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},o)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:Pa();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:a=Da}=n.getOptions&&n.getOptions()||{};if(!(a<=0)){var o={timestamp:(0,ya.dateTimestampInSeconds)(),...e},s=i?ma((()=>i(o,t))):o;null!==s&&r.addBreadcrumb(s,a)}}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=Fa(this);try{e(this)}finally{Fa(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__)&&va.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&&Ma(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var a=(0,ba.getGlobalObject)();const{userAgent:o}=a.navigator||{};var s=ja({release:n,environment:i,...t&&{user:t.getUser()},...o&&{userAgent:o},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Oa(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=Na().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&va.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Na(){var e=(0,ba.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Fa(e){var t=Na(),r=Ua(t);return Va(t,e),r}function za(){var e=Na();return Ba(e)&&!Ua(e).isOlderThan(4)||Va(e,new Aa),(0,wa.isNodeEnv)()?function(e){try{var t=Na().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Ua(e);if(!Ba(r)||Ua(r).isOlderThan(4)){var n=Ua(e).getStackTop();Va(r,new Aa(n.client,La.clone(n.scope)))}return Ua(r)}catch(t){return Ua(e)}}(e):Ua(e)}function Ba(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ua(e){return(0,ba.getGlobalSingleton)("hub",(()=>new Aa),e)}function Va(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function Ha(e,t){return za().captureException(e,{captureContext:t})}function Wa(e){za().addBreadcrumb(e)}const $a=1,qa=2,Ga=3,Za=4,Ka=5,Ya={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let Qa=Number(2);const Ja=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class Xa{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${Ja.format(new Date)} ][ ${Ya[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||Qa)?t(i,...n):Wa({type:"debug",level:Ya[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(Ka,console.debug,e,...t)}error(e,...t){this.print($a,console.error,e,...t)}info(e,...t){this.print(Ga,console.info,e,...t)}log(e,...t){this.print(Za,console.log,e,...t)}warn(e,...t){this.print(qa,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){Qa=e}setLogLevel(e){this.customLogLevel=e}}const eo=new Xa("AudioLevels.ts"),to=window.AudioContext||window.webkitAudioContext;class ro{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 to,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){eo.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{eo.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!to}}const no=new Xa("AudioRenderer.ts");var io=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=>{no.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const ao=e=>new Promise((t=>{const r=window.devicePixelRatio||1,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"}),a=URL.createObjectURL(i),o=new Image;o.onload=()=>{const i=e.width/r-o.width-16,a=e.height/r-o.height-16;n?.drawImage(o,i,a),t(e)},o.src=a})),oo=async e=>{const{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",i="portrait"===n?t:r,a="landscape"===n?r:t,o="landscape"===n?(t-i)/2:0,s="portrait"===n?(r-a)/2:0,c=document.createElement("canvas"),l=c.getContext("2d"),d=window.devicePixelRatio||1;c.width=i*d,c.height=a*d,l?.scale(d,d),l?.drawImage(e,o,s,i,a,0,0,c.width/d,c.height/d);return(await ao(c)).toDataURL("image/jpeg")},so=async e=>{const t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");const n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();const i=document.createElement("canvas"),a=i.getContext("2d");i.height=t.height,i.width=t.width,a?.drawImage(t,0,0);return(await ao(i)).toDataURL("image/jpeg")};var co=a("eEB2e"),lo=(Fi=a("4Fy4N"),{}),uo=lo&&lo.__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]}),po=lo&&lo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fo=lo&&lo.__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)&&uo(t,e,r);return po(t,e),t},ho=lo&&lo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lo,"__esModule",{value:!0}),lo.debug=lo.parseScalabilityMode=lo.detectDevice=lo.Device=lo.version=lo.types=void 0;const mo=ho(a("hZG0u"));lo.debug=mo.default;var go=a("1ZHQC");Object.defineProperty(lo,"Device",{enumerable:!0,get:function(){return go.Device}}),Object.defineProperty(lo,"detectDevice",{enumerable:!0,get:function(){return go.detectDevice}});const vo=fo(a("cQumC"));lo.types=vo,lo.version="3.6.53";var yo=a("fT1lN");Object.defineProperty(lo,"parseScalabilityMode",{enumerable:!0,get:function(){return yo.parse}});const bo=new Xa("StreamerMediasoup");function wo(){try{const r=navigator.userAgent,n=Fi.getParser(r);e="DeviceDetectionForced",t=!0,za().setTag(e,t),Wa({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,lo.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){bo.error("deviceAutoDetection",e),Ha(e)}var e,t;return new(0,lo.Device)({handlerName:"Chrome74"})}class xo{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,lo.Device)}catch(e){return bo.error("failed to detects device from mediasoup, fallback on auto detection",e),wo()}}();return n.load({routerRtpCapabilities:r}),new xo(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)=>{bo.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},a,o)=>{try{const{id:o}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});a({id:o}),bo.log("producerTransport: ",t)}catch(e){o(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{bo.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 So={};(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 a(e,t){if(t)e:{var r=i;e=e.split(".");for(var a=0;a<e.length-1;a++){var o=e[a];if(!(o in r))break e;r=r[o]}(t=t(a=r[e=e[e.length-1]]))!=a&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function o(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}a("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)}})),a("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(" "),a=0;a<t.length;a++){var s=i[t[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(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 f=l;function h(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,f)f(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 a=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,a),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)),f&&e.prototype&&f(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};a("Object.assign",(function(e){return e||k})),a("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 a=i.setTimeout;r.prototype.i=function(e){a(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;a((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)o.h(this.g[e]);this.g=null}};var o=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){a(e)}}:t}var i,a,o=new t((function(e,t){i=e,a=t}));return this.J(n(e,i),n(r,a)),o},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?o.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),a=i.next();!a.done;a=i.next())n(a.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 a(t){return function(r){o[t]=r,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,n(i.value).J(a(o.length-1),t),i=r.next()}while(!i.done)}))},t})),a("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),a("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}})),a("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)}})),a("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 a=e.charCodeAt(i);if(128>a)n[r++]=a;else{if(2048>a)n[r++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<e.length){var o=e.charCodeAt(++i);if(56320<=o&&57343>=o){a=1024*(a-55296)+o-56320+65536,n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");a=65533}n[r++]=a>>12|224,n[r++]=a>>6&63|128}n[r++]=63&a|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,a=0;i<e.length-2;i+=3){var o=e[i],s=e[i+1],c=e[i+2],l=t[o>>2];o=t[(3&o)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[a++]=l+o+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[a]=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),a=r(0),o=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|a>>4),64!=o&&(t(a<<4&240|o>>2),64!=s&&t(o<<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 a=n[i];void 0===I[a]&&(I[a]=i)}}}}var F,z="function"==typeof Uint8Array.prototype.slice;function B(e,t,r){return t===r?F||(F=new Uint8Array(0)):z?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 W(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 $(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 q=[];function G(){this.g=new Uint8Array(64),this.h=0}function Z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function K(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,q.length?(r=q.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 Y(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=W(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 Q(e){switch(e.h){case 0:if(0!=e.h)Q(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Q(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Q(e);else{var t=W(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Q(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Y(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Q(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=W(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=W(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,a,o,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(a=e[n++],194>i||128!=(192&a)?(n--,s.push(65533)):s.push((31&i)<<6|63&a)):240>i?n>=r-1?s.push(65533):128!=(192&(a=e[n++]))||224===i&&160>a||237===i&&160<=a||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&a)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(a=e[n++]))||0!=a-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(o=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&a)<<12|(63&t)<<6|63&o,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 G}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,a=0;a<n;a++){var o=r[a];0!==o.length&&(t.set(o,i),i+=o.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){Z(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)}}G.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},G.prototype.length=function(){return this.h},G.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,B(e,0,t)},K.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function ae(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):oe(e,t,r):t(e)}function oe(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=ae(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=ae(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):(fe(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function fe(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function he(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=he(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=he(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(fe(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=he(e,t))?0:e}function Se(e,t){return null==(e=he(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 Q(t),t.N||(t=B(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 a(e){try{s(t.next(e))}catch(e){i(e)}}function o(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(a,o)}s((t=t.apply(e,void 0)).next())}))}function Ce(e){ue.call(this,e)}function Pe(e,t){for(;Y(t);)switch(t.i){case 8:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=$(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 oe(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},h(Ce,ue),h(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(;Y(t);)switch(t.i){case 13:var r=$(t.g);ve(e,1,r);break;case 21:ve(e,2,r=$(t.g));break;case 29:ve(e,3,r=$(t.g));break;case 37:ve(e,4,r=$(t.g));break;case 45:ve(e,5,r=$(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Le)}h(je,ue),h(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!=he(e,3)?Se(e,3):void 0,displayName:null!=he(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!=he(e,4)?ge(e,4):void 0}}function Fe(e,t){this.h=e,this.g=t,this.l=0}function ze(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),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(a));n=e.m=a,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 Be(e){this.g=e}h(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 We(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 $e(e){return Ee(e,(function e(){var t,r,n,i,a,o,s,l,d,u,p,f=this;return _(e,(function(e){switch(e.g){case 1:return t=f,f.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(f,f.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:f.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:f.locateFile}),o=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(o.map((function(e){var r=qe(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,qe(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:f.h=e.h,f.l=new OffscreenCanvas(1,1),f.h.canvas=f.l,a=f.h.GL.createContext(f.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),f.h.GL.makeContextCurrent(a),e.g=4;break;case 7:if(f.l=document.createElement("canvas"),!(p=f.l.getContext("webgl2",{}))&&!(p=f.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();f.D=p,f.h.canvas=f.l,f.h.createContext(f.l,!0,!0,{});case 4:f.i=new f.h.SolutionWasm,f.R=!1,e.g=0}}))}))}function qe(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 Ge(e,t,r){return Ee(e,(function e(){var n,i,a,o,c,l,d,u,p,f,h,m,g,v,b=this;return _(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,a=s(Object.keys(r)),o=a.next();!o.done;o=a.next())c=o.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)),o=d.next();case 2:if(o.done){e.g=4;break}if(u=o.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(ze(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(f=t[p.stream],"detection_list"===p.type){if(f){for(var w=f.getRectList(),x=f.getLandmarksList(),S=f.getClassificationsList(),k=[],E=0;E<w.size();++E){var C=w.get(E);e:{var P=new Ie;for(C=new K(C);Y(C);)switch(C.i){case 13:var R=$(C.g);ve(P,1,R);break;case 21:ve(P,2,R=$(C.g));break;case 29:ve(P,3,R=$(C.g));break;case 37:ve(P,4,R=$(C.g));break;case 45:ve(P,5,R=$(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 K(R);Y(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 K(T);Y(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(f){for(w=Array(f.size()),x=0;x<f.size();x++)w[x]=f.get(x);f.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===f){e.g=3;break}if("float_list"===p.type){n[u]=f,e.g=7;break}if("proto"===p.type){n[u]=f,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(h=b.s[u])||(h=new Fe(b.h,b.D),b.s[u]=h),y(e,ze(h,f,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:o=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ze(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,a=s(t.wants),o=a.next();!o.done;o=a.next())i.push_back(o.value);a=e.h.PacketListener.implement({onResults:function(i){for(var a={},o=0;o<t.wants.length;++o)a[n[o]]=i.get(o);var s=e.listeners[r];s&&(e.C=Ge(e,a,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var o=a[n[i]];"object"==typeof o&&o.hasOwnProperty&&o.hasOwnProperty("delete")&&o.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,a),i.delete()}function Ke(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Ye(e){var t=this;e=e||{},this.g=new We({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:Ke(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,a=this;return _(t,(function(t){return 1==t.g?(r=Ke(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,qe(a.g,r),2)):(i=t.h,a.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=We.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=[],a={},o=s(Object.keys(e)),c=o.next();!c.done;a={K:a.K,L:a.L},c=o.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&&(a.K=c.onChange,a.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}))}))}}(a))),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,$e(t),2):3!=e.g?y(e,Ee(t,(function e(){var t,r,n,i,a,o,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,qe(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(a=s(d.g.listeners),o=a.next();!o.done;o=a.next())c=o.value,Ze(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,a,o,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),a=i.next();!a.done;a=i.next())o=a.value,n.push_back(o);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,a,o,c,l,d,u,p,f=this;return _(r,(function(r){switch(r.g){case 1:return f.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,f.C,2)):r.return();case 2:return y(r,f.initialize(),3);case 3:for(i=new f.h.PacketDataList,a=s(Object.keys(e)),o=a.next();!o.done;o=a.next())if(c=o.value,l=f.g.inputs[c]){e:{var h=f,m=e[c];switch(l.type){case"video":var g=h.m[l.stream];if(g||(g=new Fe(h.h,h.D),h.m[l.stream]=g),0===(h=g).l&&(h.l=h.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:h.l,width:v,height:g},(v=h.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),h.h.bindTexture2d(h.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),h.h.bindTexture2d(0),h=g;break e;case"detections":for((g=h.m[l.stream])||(g=new Be(h.h),h.m[l.stream]=g),(h=g).data||(h.data=new h.g.DetectionListData),h.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=h.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,he(_,1)),ne(k,2,he(_,2)),ne(k,3,he(_,3)),ne(k,4,he(_,4)),ne(k,5,he(_,5));var E=he(_,6);if(null!=E&&null!=E){Z(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=h.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,he(k,1)),ne(C,2,he(k,2)),ne(C,3,he(k,3)),ne(C,4,he(k,4)),ne(C,5,he(k,5)),_e(k,C),_=re(_),x.call(w,S,_);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=h.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=he(k,1))&&null!=R)if(Z(C.g,8),E=C.g,0<=R)Z(E,R);else{for(P=0;9>P;P++)E.push(127&R|128),R>>=7;E.push(1)}ne(C,2,he(k,2)),null!=(E=he(k,3))&&(E=M(E),Z(C.g,26),Z(C.g,E.length),te(C,C.g.end()),te(C,E)),null!=(E=he(k,4))&&(E=M(E),Z(C.g,34),Z(C.g,E.length),te(C,C.g.end()),te(C,E)),_e(k,C),_=re(_),x.call(w,S,_)}}h=h.data;break e;default:h={}}}switch(d=h,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 f.i.send(i),y(r,f.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},C("Solution",We),C("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Ye.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",Ye),C("VERSION","0.1.1632777926")}).call(So);const _o=new Xa("MediaPipe"),ko="https://stream-assets.snapcall.io";let Eo=!1;const Co=new So.SelfieSegmentation({locateFile:(e,t)=>{if(_o.debug("selfieSegmentation",e,t),ko)return`${ko}/mediapipe/${e}`;return`${window.location.href.split("/").slice(0,-1).join("/")}/mediapipe/${e}`}});var Po,Ro,To,jo;Ro=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 Oo={};function Mo(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}To=function(e){var t=Oo[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 Mo(e[2])}return"/"}(),Oo[e]=t),t},jo=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 Lo=To("adfgW")+a("juxiN").resolve("5WDBY");Po=Ro(Lo,jo(Lo),!1);class Io{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Po,{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((()=>{Co.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};Co.setOptions(e),_o.log("selfie segmentation initialized"),Eo||(await Co.initialize(),Eo=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Co.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{Co.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){_o.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 Do=new Xa("StreamerClient"),Ao="WRTC1",No="WRTC2",Fo="TRANS1",zo="CONS1",Bo="SOCK1",Uo="USERLIMIT",Vo={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 Ho extends CustomEvent{constructor(e,t){super(e,t)}}const Wo=EventTarget,$o={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const qo=new class extends Wo{mediasoupTransport={};mediaPipeOption=$o;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",credentialType:"password"}]},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 Ho("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new Ho("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new Ho("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:t,plan:{permissions:n,name:i}}=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=n,this.plan=i,r=`${this.config.streamerServer}/${t}${this.joinOptions.recorder?"/recorder":""}?roomId=${e}&peerId=${this.peerId}`}catch(e){const t=new Ho("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new qi(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",(()=>{Do.error("protoo.on","failed"),this.onCriticalError(Bo)})),this.protoo.on("disconnected",(()=>{Do.error("protoo.on","disconnected"),this.onCriticalError(Bo)})),this.protoo.on("close",(()=>Do.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(Do.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(Uo);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 Ho("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 Ho("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 Ho("recordStopped",{detail:e.data}));else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new Ho("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 Ho("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 a="producerPaused"===e.method?"mediaPause":"mediaResume",o=new Ho(a,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(o)}else if("mute"===e.method){const{peerId:t,device:r}=e.data,n=new Ho("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 Ho("mediaResume",{detail:{peerId:t,deviceType:r,paused:!1}});this.dispatchEvent(n)}else if("requestDeviceResult"===e.method){const t=new Ho(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new Ho(e.method,{detail:e.data});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,a=this.customMessages.get(t);a?a.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const o=this.customMessages.get(t);if(o&&o.totalChunks===o.chunks.length){const r=o.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new Ho("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(Fo),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(Do.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{Do.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}`);Ha(t,{extra:{direction:e.transport?.direction,id:e.transport?.id,kind:e.kind}}),Do.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Ao)}}))}async joinRoom(){this.streamerMediasoup=await xo.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 Ho("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){Do.warn("joinRoom",e),this.dispatchEvent(new Ho("agentIdentity",{detail:{success:!1}}))}const{peers:r}=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 n=await this.getCallId();this.dispatchEvent(new Ho("enterRoom",{detail:{peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:n,plan:this.plan,permissions:this.permissions}})),Do.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 xo.create(this.protoo,this.config);const e=await this.getCallId();this.dispatchEvent(new Ho("enterRoom",{detail:{peerId:this.peerId,peers:[],callId:e,plan:this.plan,permissions:this.permissions}}))}async switchMicrophone(e){try{Do.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.micProducer?.track?.stop(),Do.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new ro(t,this);const r=t.getAudioTracks()[0];await(this.micProducer?.replaceTrack({track:r})),Do.log("switchMicrophone","switched Microphone")}catch(e){Do.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new Ho("microphoneMute",{detail:{}});this.dispatchEvent(t),this.protoo.connected&&await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){Do.log("onDeviceChange","detecting device change");const e=new Ho("devicesListChange",{detail:{}});if(this.dispatchEvent(e),!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return Do.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)))));Do.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void Do.warn("onDeviceChange","no audio input change");if(Do.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new Ho("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),Do.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 ro(e,this);const r=e.getAudioTracks()[0],n="microphone",i=await t.produce({track:r,codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{Do.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{Do.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{Do.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const a=new Ho("microphoneEnabled",{detail:{}});this.dispatchEvent(a)}}muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer.pause(),this.muted=!0;const e="microphone";this.protoo.notify("mute",{device:e});const t=new Ho("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 Ho("microphoneUnmute",{detail:{}});this.dispatchEvent(t)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){Do.log("release");for(let e in this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=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 Ho("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 Ho("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(Do.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});Do.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(t){this.onCriticalError(No),Do.log("restartIce","restartIceFailed",t),Ha(t,{extra:{direction:e.direction,id:e.id}})}}scaleVideoMediasConstraintsParameter(e){let t=Vo.hd;2===e?t=Vo.vga:e>2&&(t=Vo.qvga),(!this.webcam.resolution||Vo[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(Do.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}),!co.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(Do.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{Do.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){Do.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 a={};if(r)if(this.webcam.facingMode)console.log("switch by facing mod"),this.webcam.facingMode="user"===this.webcam.facingMode?"environment":"user",a.facingMode=this.webcam.facingMode;else{const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknow";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,this.webcam.resolution="hd",a.deviceId={ideal:this.webcam.device?.deviceId}}else i?(this.webcam.facingMode=i,a.facingMode=this.webcam.facingMode):e&&(this.webcam.device=e,this.webcam.facingMode=void 0,a.deviceId={ideal:this.webcam.device.deviceId}),t&&(this.webcam.resolution=t);let o=Vo[t||this.webcam.resolution];this.useVideoBackground&&(o={width:{ideal:560},height:{ideal:400},qualityIndex:2}),await(this.webcamProducer?.replaceTrack?.({track:null}).catch((e=>{Do.error("switchCamera","clean track failed",e)})));const s=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{frameRate:n,...a,...o}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Io(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 Ho("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");let r=Vo[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 Io(n,this.mediaPipeOption));const i=await(this.mediaPipe?.createStream())||n;await this.updateWebcams();const a=await this.getTransport("video","send"),o=i.getVideoTracks()[0];this.webcamTrack=o;const s=await(o.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};this.webcamProducer=await a.produce({track:o,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 Ho("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 Ho("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(){if(!this.permissions.find((e=>"screen_sharing"===e)))throw new Error("feature not allowed");const e=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:!0,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}));if(!e)return;const t="screen",r=await this.getTransport("audio","send"),n=e.getAudioTracks()[0];n&&(this.screenshareAudioProducer=await(this.streamerMediasoup?.produceAudio(r,n,{deviceType:t,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0})));const i=e.getVideoTracks()[0],a=await this.getTransport("video","send");this.screenshareVideoProducer=await(this.streamerMediasoup?.produceVideo(a,i,{deviceType:t,share:!0})),this.screenshareVideoProducer?.on("transportclose",(()=>{this.screenshareVideoProducer=void 0})),this.screenshareVideoProducer?.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const o=new Ho("screenshareEnabled",{detail:{}});this.dispatchEvent(o)}async disableScreenshare(){this.screenshareVideoProducer&&(this.screenshareVideoProducer.close(),this.protoo.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareVideoProducer.id}),this.screenshareVideoProducer=void 0),this.screenshareAudioProducer&&(this.screenshareAudioProducer.close(),this.protoo.connected&&await this.protoo.request("closeProducer",{producerId:this.screenshareAudioProducer.id}),this.screenshareAudioProducer=void 0);const e=new Ho("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 Ho("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}){Do.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>Do.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>Do.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else Do.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 deleteCapture(e){return await this.protoo.request("deleteCapture",{assetId:e})}async captureVideo(e){if(this.permissions.find((e=>"instant_picture"===e))){let t;if(e)t=await oo(e);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");t=await so(this.webcamProducer.track)}return t}throw new Error("feature not allowed")}requestLocalVideo(e){if(Do.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 Do.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}){const i="microphone"===r?"audio":"video",a=await this.getTransport(i,"recv"),o=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:a.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}=o;Do.log("consumeProducer","Data: ",o);try{const t=await a.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});Do.log("transport",a),Do.log("consumer",t),this.consumers.set(t.id,{mediaSoupConsumer:t,deviceType:r}),this.scaleVideoEncodingsParameter();const n=!!s&&s.muted,i=new Ho("mediaStart",{detail:{peerId:e,mediaId:t.id,deviceType:r,paused:n}});if(this.dispatchEvent(i),"audio"===t.kind){const e=this.createAudioRenderer(t.id),r=new MediaStream;r.addTrack(t.track),e.setSource(r),e.play()}"video"===t.kind&&await this.protoo.request("resumeConsumer",{consumerId:t.id})}catch(e){throw this.onCriticalError(zo),Do.error("consumeProducer","newConsumer request failed",e),e}}async setDisplayName(e){await this.setProfile({name:e});const t=new Ho("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 Ho("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 Do.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.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 Ho("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new io({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=>Do.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 Go=(0,(je=a("85Hg2")).createContext)({});je=a("85Hg2");let Zo;var Ko;(Ko=Zo||(Zo={}))[Ko.SET_STREAMS=0]="SET_STREAMS",Ko[Ko.ADD_STREAM=1]="ADD_STREAM",Ko[Ko.REMOVE_STREAM=2]="REMOVE_STREAM",Ko[Ko.DEVICE_UPDATE=3]="DEVICE_UPDATE",Ko[Ko.MUTE=4]="MUTE",Ko[Ko.UNMUTE=5]="UNMUTE",Ko[Ko.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",Ko[Ko.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",Ko[Ko.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",Ko[Ko.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const Yo={streams:[],highlightedTile:null},Qo=(e,t)=>{switch(t.type){case Zo.SET_STREAMS:return{...e,streams:t.payload};case Zo.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case Zo.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case Zo.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:a,paused:o}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=o),{...e,[i]:a?n:null,muted:t}}return e}))}}case Zo.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case Zo.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case Zo.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case Zo.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case Zo.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case Zo.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},Jo=(0,je.createContext)(void 0),Xo=({children:e})=>{const[t,r]=(0,je.useReducer)(Qo,Yo),n={state:t,dispatch:r};return(0,o.jsx)(Jo.Provider,{value:n,children:e})},es=()=>{const e=(0,je.useContext)(Jo);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 ts=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 rs=yr.path`
|
|
358
358
|
fill: ${e=>e.theme.logoColor};
|
|
359
359
|
stroke: ${e=>e.stroke?e.theme.logoColor:"unset"};
|
|
360
360
|
`,ns=()=>(0,o.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(rs,{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"})}),is=()=>(0,o.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(rs,{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"})}),as=()=>(0,o.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_243_300)",children:[(0,o.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,o.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,o.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,o.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,o.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,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_243_300",children:(0,o.jsx)("rect",{width:"48",height:"48",fill:"white"})})})]});var os=({size:e="large"})=>"small"===e?(0,o.jsx)(ns,{}):"medium"===e?(0,o.jsx)(is,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ns,{}),(0,o.jsx)(is,{})]});const ss=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),cs=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),ls=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),ds=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),us=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),ps=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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"})}),fs=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#pip)",fill:"#fff",children:[(0,o.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,o.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"})]})}),hs=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.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=a("85Hg2"),je=a("85Hg2");const ms=(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),gs=yr.div`
|
|
@@ -2072,7 +2072,7 @@ to {
|
|
|
2072
2072
|
Copyright (c) 2018 Jed Watson.
|
|
2073
2073
|
Licensed under the MIT License (MIT), see
|
|
2074
2074
|
http://jedwatson.github.io/classnames
|
|
2075
|
-
*/!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var a=typeof i;if("string"===a||"number"===a)r.push(i);else if(Array.isArray(i)){if(i.length){var o=t.apply(null,i);o&&r.push(o)}}else if("object"===a){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var s in i)e.call(i,s)&&i[s]&&r.push(s)}}}return r.join(" ")}Ih?(t.default=t,Ih=t):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return t})):window.classNames=t}();je=a("85Hg2"),je=a("85Hg2");function Dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2");const Ah={prefix:String(Math.round(1e10*Math.random())),current:0},Nh=r(je).createContext(Ah);Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function Fh(){let e=(0,je.useContext)(Nh)!==Ah,[t,r]=(0,je.useState)(e);return"undefined"!=typeof window&&e&&(0,je.useLayoutEffect)((()=>{r(!1)}),[]),t}function zh(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=zh(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}var Bh=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=zh(e))&&(n&&(n+=" "),n+=t);return n};const Uh="undefined"!=typeof window?r(je).useLayoutEffect:()=>{};let Vh=new Map;function Hh(e,t){if(e===t)return e;let r=Vh.get(e);if(r)return r(t),t;let n=Vh.get(t);return n?(n(e),e):t}function Wh(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function $h(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Wh(r,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof r||"string"!=typeof i?"id"===e&&r&&i?t.id=Hh(r,i):t[e]=void 0!==i?i:r:t[e]=Bh(r,i)}}return t}const qh=new Set(["id"]),Gh=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Zh=/^(data-.*)$/;function Kh(e,t={}){let{labelable:r,propNames:n}=t,i={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(qh.has(t)||r&&Gh.has(t)||(null==n?void 0:n.has(t))||Zh.test(t))&&(i[t]=e[t]);return i}function Yh(e){if(function(){if(null==Qh){Qh=!1;try{document.createElement("div").focus({get preventScroll(){return Qh=!0,!0}})}catch(e){}}return Qh}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft});return r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let Qh=null;let Jh=new Map,Xh=new Set;function em(){if("undefined"==typeof window)return;let e=t=>{let r=Jh.get(t.target);if(r&&(r.delete(t.propertyName),0===r.size&&(t.target.removeEventListener("transitioncancel",e),Jh.delete(t.target)),0===Jh.size)){for(let e of Xh)e();Xh.clear()}};document.body.addEventListener("transitionrun",(t=>{let r=Jh.get(t.target);r||(r=new Set,Jh.set(t.target,r),t.target.addEventListener("transitioncancel",e)),r.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function tm(e){requestAnimationFrame((()=>{0===Jh.size?e():Xh.add(e)}))}"undefined"!=typeof document&&("loading"!==document.readyState?em():document.addEventListener("DOMContentLoaded",em));function rm(){let e=(0,je.useRef)(new Map),t=(0,je.useCallback)(((t,r,n,i)=>{let a=(null==i?void 0:i.once)?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:a,options:i}),t.addEventListener(r,n,i)}),[]),r=(0,je.useCallback)(((t,r,n,i)=>{var a;let o=(null===(a=e.current.get(n))||void 0===a?void 0:a.fn)||n;t.removeEventListener(r,o,i),e.current.delete(n)}),[]),n=(0,je.useCallback)((()=>{e.current.forEach(((e,t)=>{r(e.eventTarget,e.type,t,e.options)}))}),[r]);return(0,je.useEffect)((()=>n),[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function nm(e,t){Uh((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}function im(e){for(;e&&!am(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function am(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}let om="undefined"!=typeof window&&window.visualViewport;function sm(){let[e,t]=(0,je.useState)((()=>cm()));return(0,je.useEffect)((()=>{let e=()=>{t((e=>{let t=cm();return t.width===e.width&&t.height===e.height?e:t}))};return om?om.addEventListener("resize",e):window.addEventListener("resize",e),()=>{om?om.removeEventListener("resize",e):window.removeEventListener("resize",e)}}),[]),e}function cm(){return{width:(null==om?void 0:om.width)||window.innerWidth,height:(null==om?void 0:om.height)||window.innerHeight}}new Map;function lm(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}function dm(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function um(){return dm(/^Mac/i)}function pm(){return dm(/^iPhone/i)||dm(/^iPad/i)||um()&&navigator.maxTouchPoints>1}function fm(e){return!(0!==e.mozInputSource||!e.isTrusted)||(lm(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}je=a("85Hg2");let hm="default",mm="",gm=new WeakMap;function vm(e){pm()?("default"===hm&&(mm=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),hm="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(gm.set(e,e.style.userSelect),e.style.userSelect="none")}function ym(e){if(pm()){if("disabled"!==hm)return;hm="restoring",setTimeout((()=>{tm((()=>{"restoring"===hm&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=mm||""),mm="",hm="default")}))}),300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&gm.has(e)){let t=gm.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),gm.delete(e)}}const bm=r(je).createContext(null);function wm(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:a,isDisabled:o,isPressed:s,preventFocusOnPress:c,shouldCancelOnPointerExit:l,allowTextSelectionOnPress:d,ref:u,...p}=function(e){let t=(0,je.useContext)(bm);if(t){let{register:r,...n}=t;e=$h(n,e),r()}return nm(t,e.ref),e}(e),f=(0,je.useRef)(null);f.current={onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:a,isDisabled:o,shouldCancelOnPointerExit:l};let[h,m]=(0,je.useState)(!1),g=(0,je.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=rm(),b=(0,je.useMemo)((()=>{let e=g.current,t=(t,r)=>{let{onPressStart:n,onPressChange:i,isDisabled:a}=f.current;a||e.didFirePressStart||(n&&n({type:"pressstart",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),i&&i(!0),e.didFirePressStart=!0,m(!0))},r=(t,r,n=!0)=>{let{onPressEnd:i,onPressChange:a,onPress:o,isDisabled:s}=f.current;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,i&&i({type:"pressend",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),a&&a(!1),m(!1),o&&n&&!s&&o({type:"press",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},n=(e,t)=>{let{onPressUp:r,isDisabled:n}=f.current;n||r&&r({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},i=t=>{e.isPressed&&(e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,y(),d||ym(e.target))},a={onKeyDown(r){Sm(r.nativeEvent,r.currentTarget)&&r.currentTarget.contains(r.target)?(Pm(r.target,r.key)&&r.preventDefault(),r.stopPropagation(),e.isPressed||r.repeat||(e.target=r.currentTarget,e.isPressed=!0,t(r,"keyboard"),v(document,"keyup",s,!1))):"Enter"===r.key&&xm(r.currentTarget)&&r.stopPropagation()},onKeyUp(t){Sm(t.nativeEvent,t.currentTarget)&&!t.repeat&&t.currentTarget.contains(t.target)&&n(km(e.target,t),"keyboard")},onClick(i){i&&!i.currentTarget.contains(i.target)||i&&0===i.button&&(i.stopPropagation(),o&&i.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!fm(i.nativeEvent)||(o||c||Yh(i.currentTarget),t(i,"virtual"),n(i,"virtual"),r(i,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},s=t=>{if(e.isPressed&&Sm(t,e.target)){Pm(t.target,t.key)&&t.preventDefault(),t.stopPropagation(),e.isPressed=!1;let n=t.target;r(km(e.target,t),"keyboard",e.target.contains(n)),y(),e.target instanceof HTMLElement&&e.target.contains(n)&&(xm(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!=typeof PointerEvent){a.onPointerDown=r=>{var n;0===r.button&&r.currentTarget.contains(r.target)&&(0===(n=r.nativeEvent).width&&0===n.height||1===n.width&&1===n.height&&0===n.pressure&&0===n.detail&&"mouse"===n.pointerType?e.pointerType="virtual":(Cm(r.currentTarget)&&r.preventDefault(),e.pointerType=r.pointerType,r.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=r.pointerId,e.target=r.currentTarget,o||c||Yh(r.currentTarget),d||vm(e.target),t(r,e.pointerType),v(document,"pointermove",s,!1),v(document,"pointerup",l,!1),v(document,"pointercancel",u,!1))))},a.onMouseDown=e=>{e.currentTarget.contains(e.target)&&0===e.button&&(Cm(e.currentTarget)&&e.preventDefault(),e.stopPropagation())},a.onPointerUp=t=>{t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&Em(t,t.currentTarget)&&n(t,e.pointerType||t.pointerType)};let s=n=>{n.pointerId===e.activePointerId&&(Em(n,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(km(e.target,n),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(km(e.target,n),e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(n)))},l=t=>{t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(Em(t,e.target)?r(km(e.target,t),e.pointerType):e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,y(),d||ym(e.target))},u=e=>{i(e)};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}else{a.onMouseDown=r=>{0===r.button&&r.currentTarget.contains(r.target)&&(Cm(r.currentTarget)&&r.preventDefault(),r.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=r.currentTarget,e.pointerType=fm(r.nativeEvent)?"virtual":"mouse",o||c||Yh(r.currentTarget),t(r,e.pointerType),v(document,"mouseup",s,!1)))},a.onMouseEnter=r=>{r.currentTarget.contains(r.target)&&(r.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(r,e.pointerType)))},a.onMouseLeave=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,r(t,e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(t)))},a.onMouseUp=t=>{t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||n(t,e.pointerType))};let s=t=>{0===t.button&&(e.isPressed=!1,y(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(Em(t,e.target)?r(km(e.target,t),e.pointerType):e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};a.onTouchStart=r=>{if(!r.currentTarget.contains(r.target))return;r.stopPropagation();let n=function(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}(r.nativeEvent);n&&(e.activePointerId=n.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=r.currentTarget,e.pointerType="touch",o||c||Yh(r.currentTarget),d||vm(e.target),t(r,e.pointerType),v(window,"scroll",l,!0))},a.onTouchMove=n=>{if(!n.currentTarget.contains(n.target))return;if(n.stopPropagation(),!e.isPressed)return;let a=_m(n.nativeEvent,e.activePointerId);a&&Em(a,n.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(n,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(n,e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(n))},a.onTouchEnd=t=>{if(!t.currentTarget.contains(t.target))return;if(t.stopPropagation(),!e.isPressed)return;let i=_m(t.nativeEvent,e.activePointerId);i&&Em(i,t.currentTarget)?(n(t,e.pointerType),r(t,e.pointerType)):e.isOverTarget&&r(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,d||ym(e.target),y()},a.onTouchCancel=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&i(t))};let l=t=>{e.isPressed&&t.target.contains(e.target)&&i({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}return a}),[v,o,c,y,d]);return(0,je.useEffect)((()=>()=>{d||ym(g.current.target)}),[d]),{isPressed:s||h,pressProps:$h(p,b)}}function xm(e){return"A"===e.tagName&&e.hasAttribute("href")}function Sm(e,t){const{key:r,code:n}=e,i=t,a=i.getAttribute("role");return!("Enter"!==r&&" "!==r&&"Spacebar"!==r&&"Space"!==n||i instanceof HTMLInputElement&&!Tm(i,r)||i instanceof HTMLTextAreaElement||i.isContentEditable||xm(i)&&("button"!==a||"Enter"===r)||"link"===a&&"Enter"!==r)}function _m(e,t){const r=e.changedTouches;for(let e=0;e<r.length;e++){const n=r[e];if(n.identifier===t)return n}return null}function km(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function Em(e,t){let r=t.getBoundingClientRect(),n=function(e){let t=e.width/2||e.radiusX||0,r=e.height/2||e.radiusY||0;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}(e);return a=n,!((i=r).left>a.right||a.left>i.right||i.top>a.bottom||a.top>i.bottom);var i,a}function Cm(e){return!(e instanceof HTMLElement&&e.draggable)}function Pm(e,t){return e instanceof HTMLInputElement?!Tm(e,t):!(e instanceof HTMLButtonElement)||"submit"!==e.type}bm.displayName="PressResponderContext";const Rm=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Tm(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:Rm.has(e.type)}r(je).forwardRef((({children:e,...t},n)=>{let i=(0,je.useRef)();n=null!=n?n:i;let{pressProps:a}=wm({...t,ref:n}),o=r(je).Children.only(e);return r(je).cloneElement(o,{ref:n,...$h(o.props,a)})})),r(je).forwardRef((({children:e,...t},n)=>{let i=(0,je.useRef)(!1),a=(0,je.useContext)(bm),o=$h(a||{},{...t,ref:n||(null==a?void 0:a.ref),register(){i.current=!0,a&&a.register()}});return nm(a,n),(0,je.useEffect)((()=>{i.current||console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.")}),[]),r(je).createElement(bm.Provider,{value:o},e)}));class jm{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function Om(e){let t=(0,je.useRef)({isFocused:!1,onBlur:e,observer:null});return t.current.onBlur=e,Uh((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]),(0,je.useCallback)((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,n=e=>{var n,i;t.current.isFocused=!1,r.disabled&&(null===(i=(n=t.current).onBlur)||void 0===i||i.call(n,new jm("blur",e))),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",n,{once:!0}),t.current.observer=new MutationObserver((()=>{t.current.isFocused&&r.disabled&&(t.current.observer.disconnect(),r.dispatchEvent(new FocusEvent("blur")),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})))})),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}}),[])}function Mm(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e;const a=(0,je.useCallback)((e=>{if(e.target===e.currentTarget)return n&&n(e),i&&i(!1),!0}),[n,i]),o=Om(a),s=(0,je.useCallback)((e=>{e.target===e.currentTarget&&(r&&r(e),i&&i(!0),o(e))}),[i,r,o]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:t||!n&&!i?null:a}}}let Lm=null,Im=new Set,Dm=!1,Am=!1,Nm=!1;const Fm={Tab:!0,Escape:!0};function zm(e,t){for(let r of Im)r(e,t)}function Bm(e){Am=!0,function(e){return!(e.metaKey||!um()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(Lm="keyboard",zm("keyboard",e))}function Um(e){Lm="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Am=!0,zm("pointer",e))}function Vm(e){fm(e)&&(Am=!0,Lm="virtual")}function Hm(e){e.target!==window&&e.target!==document&&(Am||Nm||(Lm="virtual",zm("virtual",e)),Am=!1,Nm=!1)}function Wm(){Am=!1,Nm=!0}function $m(){if("undefined"==typeof window||Dm)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){Am=!0,e.apply(this,arguments)},document.addEventListener("keydown",Bm,!0),document.addEventListener("keyup",Bm,!0),document.addEventListener("click",Vm,!0),window.addEventListener("focus",Hm,!0),window.addEventListener("blur",Wm,!1),"undefined"!=typeof PointerEvent?(document.addEventListener("pointerdown",Um,!0),document.addEventListener("pointermove",Um,!0),document.addEventListener("pointerup",Um,!0)):(document.addEventListener("mousedown",Um,!0),document.addEventListener("mousemove",Um,!0),document.addEventListener("mouseup",Um,!0)),Dm=!0}function qm(){return"pointer"!==Lm}function Gm(e,t,r){$m(),(0,je.useEffect)((()=>{let t=(t,n)=>{(function(e,t,r){return!(e&&"keyboard"===t&&r instanceof KeyboardEvent&&!Fm[r.key])})(null==r?void 0:r.isTextInput,t,n)&&e(qm())};return Im.add(t),()=>{Im.delete(t)}}),t)}function Zm(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=e,a=(0,je.useRef)({isFocusWithin:!1}),o=(0,je.useCallback)((e=>{a.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(a.current.isFocusWithin=!1,r&&r(e),i&&i(!1))}),[r,i,a]),s=Om(o),c=(0,je.useCallback)((e=>{a.current.isFocusWithin||(n&&n(e),i&&i(!0),a.current.isFocusWithin=!0,s(e))}),[n,i,s]);return t?{focusWithinProps:{onFocus:null,onBlur:null}}:{focusWithinProps:{onFocus:c,onBlur:o}}}"undefined"!=typeof document&&("loading"!==document.readyState?$m():document.addEventListener("DOMContentLoaded",$m));let Km=!1,Ym=0;function Qm(){Km=!0,setTimeout((()=>{Km=!1}),50)}function Jm(e){"touch"===e.pointerType&&Qm()}function Xm(){if("undefined"!=typeof document)return"undefined"!=typeof PointerEvent?document.addEventListener("pointerup",Jm):document.addEventListener("touchend",Qm),Ym++,()=>{Ym--,Ym>0||("undefined"!=typeof PointerEvent?document.removeEventListener("pointerup",Jm):document.removeEventListener("touchend",Qm))}}function eg(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[a,o]=(0,je.useState)(!1),s=(0,je.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,je.useEffect)(Xm,[]);let{hoverProps:c,triggerHoverEnd:l}=(0,je.useMemo)((()=>{let e=(e,n)=>{if(s.pointerType=n,i||"touch"===n||s.isHovered||!e.currentTarget.contains(e.target))return;s.isHovered=!0;let a=e.currentTarget;s.target=a,t&&t({type:"hoverstart",target:a,pointerType:n}),r&&r(!0),o(!0)},a=(e,t)=>{if(s.pointerType="",s.target=null,"touch"===t||!s.isHovered)return;s.isHovered=!1;let i=e.currentTarget;n&&n({type:"hoverend",target:i,pointerType:t}),r&&r(!1),o(!1)},c={};return"undefined"!=typeof PointerEvent?(c.onPointerEnter=t=>{Km&&"mouse"===t.pointerType||e(t,t.pointerType)},c.onPointerLeave=e=>{!i&&e.currentTarget.contains(e.target)&&a(e,e.pointerType)}):(c.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},c.onMouseEnter=t=>{s.ignoreEmulatedMouseEvents||Km||e(t,"mouse"),s.ignoreEmulatedMouseEvents=!1},c.onMouseLeave=e=>{!i&&e.currentTarget.contains(e.target)&&a(e,"mouse")}),{hoverProps:c,triggerHoverEnd:a}}),[t,r,n,i,s]);return(0,je.useEffect)((()=>{i&&l({currentTarget:s.target},s.pointerType)}),[i]),{hoverProps:c,isHovered:a}}function tg(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,a=(0,je.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1,onInteractOutside:r,onInteractOutsideStart:i}).current;a.onInteractOutside=r,a.onInteractOutsideStart=i,(0,je.useEffect)((()=>{if(n)return;let e=e=>{rg(e,t)&&a.onInteractOutside&&(a.onInteractOutsideStart&&a.onInteractOutsideStart(e),a.isPointerDown=!0)};if("undefined"!=typeof PointerEvent){let r=e=>{a.isPointerDown&&a.onInteractOutside&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",r,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",r,!0)}}{let r=e=>{a.ignoreEmulatedMouseEvents?a.ignoreEmulatedMouseEvents=!1:a.isPointerDown&&a.onInteractOutside&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))},n=e=>{a.ignoreEmulatedMouseEvents=!0,a.onInteractOutside&&a.isPointerDown&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))};return document.addEventListener("mousedown",e,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",n,!0),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("mouseup",r,!0),document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",n,!0)}}}),[t,a,n])}function rg(e,t){if(e.button>0)return!1;if(e.target){const t=e.target.ownerDocument;if(!t||!t.documentElement.contains(e.target))return!1}return t.current&&!t.current.contains(e.target)}function ng(e){if(!e)return;let t=!0;return r=>{let n={...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(n),t&&r.stopPropagation()}}function ig(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ng(e.onKeyDown),onKeyUp:ng(e.onKeyUp)}}}function ag(e){if("virtual"===Lm){let t=document.activeElement;tm((()=>{document.activeElement===t&&document.contains(e)&&Yh(e)}))}else Yh(e)}function og(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;let{display:t,visibility:r}=e.style,n="none"!==t&&"hidden"!==r&&"collapse"!==r;if(n){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:r,visibility:i}=t(e);n="none"!==r&&"hidden"!==i&&"collapse"!==i}return n}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||og(e.parentElement,e))}const sg=r(je).createContext(null);let cg=null;function lg(e){let{children:t,contain:n,restoreFocus:i,autoFocus:a}=e,o=(0,je.useRef)(),s=(0,je.useRef)(),c=(0,je.useRef)([]),l=(0,je.useContext)(sg);var d;let u=null!==(d=null==l?void 0:l.scopeRef)&&void 0!==d?d:null,p=(0,je.useMemo)((()=>cg&&kg.getTreeNode(cg)&&!yg(cg,u)?cg:u),[u]);Uh((()=>{let e=o.current.nextSibling,t=[];for(;e&&e!==s.current;)t.push(e),e=e.nextSibling;c.current=t}),[t,p]),kg.getTreeNode(p)&&!kg.getTreeNode(c)&&kg.addTreeNode(c,p),kg.getTreeNode(c).contain=n,function(e,t,r){Uh((()=>{if(t||r)return;let n=e.current,i=t=>{let r=t.target;gg(r,e.current)?cg=e:mg(r)||(cg=null)};return document.addEventListener("focusin",i,!1),n.forEach((e=>e.addEventListener("focusin",i,!1))),()=>{document.removeEventListener("focusin",i,!1),n.forEach((e=>e.removeEventListener("focusin",i,!1)))}}),[e,t,r])}(c,i,n),function(e,t){let r=(0,je.useRef)(),n=(0,je.useRef)(null);Uh((()=>{let i=e.current;if(!t)return void(n.current&&(cancelAnimationFrame(n.current),n.current=null));let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!hg(e))return;let r=document.activeElement,n=e.current;if(!gg(r,n))return;let i=xg(fg(n),{tabbable:!0},n);i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&bg(a,!0)},o=t=>{cg&&!yg(cg,e)||!gg(t.target,e.current)?hg(e)&&!vg(t.target,e)?r.current?r.current.focus():cg&&wg(cg.current):hg(e)&&(r.current=t.target):(cg=e,r.current=t.target)},s=t=>{n.current=requestAnimationFrame((()=>{hg(e)&&!vg(document.activeElement,e)&&(cg=e,document.body.contains(t.target)?(r.current=t.target,r.current.focus()):cg&&wg(cg.current))}))};return document.addEventListener("keydown",a,!1),document.addEventListener("focusin",o,!1),i.forEach((e=>e.addEventListener("focusin",o,!1))),i.forEach((e=>e.addEventListener("focusout",s,!1))),()=>{document.removeEventListener("keydown",a,!1),document.removeEventListener("focusin",o,!1),i.forEach((e=>e.removeEventListener("focusin",o,!1))),i.forEach((e=>e.removeEventListener("focusout",s,!1)))}}),[e,t]),(0,je.useEffect)((()=>()=>{n.current&&cancelAnimationFrame(n.current)}),[n])}(c,n),function(e,t,r){const n=(0,je.useRef)("undefined"!=typeof document?document.activeElement:null);Uh((()=>{let n=e.current;if(!t||r)return;let i=()=>{cg&&!yg(cg,e)||(cg=e)};return document.addEventListener("focusin",i,!1),n.forEach((e=>e.addEventListener("focusin",i,!1))),()=>{document.removeEventListener("focusin",i,!1),n.forEach((e=>e.removeEventListener("focusin",i,!1)))}}),[e,r]),Uh((()=>{if(!t)return;kg.getTreeNode(e).nodeToRestore=n.current;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey)return;let r=document.activeElement;if(!gg(r,e.current))return;let n=kg.getTreeNode(e).nodeToRestore,i=xg(document.body,{tabbable:!0});i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();if(document.body.contains(n)&&n!==document.body||(n=null,kg.getTreeNode(e).nodeToRestore=null),(!a||!gg(a,e.current))&&n){i.currentNode=n;do{a=t.shiftKey?i.previousNode():i.nextNode()}while(gg(a,e.current));t.preventDefault(),t.stopPropagation(),a?bg(a,!0):mg(n)?bg(n,!0):r.blur()}};return r||document.addEventListener("keydown",i,!0),()=>{r||document.removeEventListener("keydown",i,!0);let n=kg.getTreeNode(e).nodeToRestore;if(t&&n&&(gg(document.activeElement,e.current)||document.activeElement===document.body&&function(e){let t=kg.getTreeNode(cg);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=kg.clone();requestAnimationFrame((()=>{if(document.activeElement===document.body){let r=t.getTreeNode(e);for(;r;){if(r.nodeToRestore&&document.body.contains(r.nodeToRestore))return void bg(r.nodeToRestore);r=r.parent}for(r=t.getTreeNode(e);r;){if(r.scopeRef&&kg.getTreeNode(r.scopeRef))return void wg(r.scopeRef.current,!0);r=r.parent}}}))}}}),[e,t,r])}(c,i,n),function(e,t){const n=r(je).useRef(t);(0,je.useEffect)((()=>{n.current&&(cg=e,gg(document.activeElement,cg.current)||wg(e.current)),n.current=!1}),[e])}(c,a),Uh((()=>{if(c)return()=>{let e=kg.getTreeNode(c).parent.scopeRef;c!==cg&&!yg(c,cg)||e&&!kg.getTreeNode(e)||(cg=e),kg.removeTreeNode(c)}}),[c,p]);let f=function(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:a,accept:o}=t,s=n||document.activeElement,c=r[0].previousElementSibling,l=xg(fg(r),{tabbable:i,accept:o},r);l.currentNode=gg(s,r)?s:c;let d=l.nextNode();return!d&&a&&(l.currentNode=c,d=l.nextNode()),d&&bg(d,!0),d},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:a,accept:o}=t,s=n||document.activeElement,c=r[r.length-1].nextElementSibling,l=xg(fg(r),{tabbable:i,accept:o},r);l.currentNode=gg(s,r)?s:c;let d=l.previousNode();return!d&&a&&(l.currentNode=c,d=l.previousNode()),d&&bg(d,!0),d},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,a=xg(fg(r),{tabbable:n,accept:i},r);a.currentNode=r[0].previousElementSibling;let o=a.nextNode();return o&&bg(o,!0),o},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,a=xg(fg(r),{tabbable:n,accept:i},r);a.currentNode=r[r.length-1].nextElementSibling;let o=a.previousNode();return o&&bg(o,!0),o}}}(c);return r(je).createElement(sg.Provider,{value:{scopeRef:c,focusManager:f}},r(je).createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,r(je).createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const dg=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],ug=dg.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";dg.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const pg=dg.join(':not([hidden]):not([tabindex="-1"]),');function fg(e){return e[0].parentElement}function hg(e){let t=kg.getTreeNode(cg);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function mg(e){return vg(e)}function gg(e,t){return t.some((t=>t.contains(e)))}function vg(e,t=null){for(let{scopeRef:r}of kg.traverse(kg.getTreeNode(t)))if(gg(e,r.current))return!0;return!1}function yg(e,t){var r;let n=null===(r=kg.getTreeNode(t))||void 0===r?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function bg(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch(e){}}else try{ag(e)}catch(e){}}function wg(e,t=!0){let r=e[0].previousElementSibling,n=xg(fg(e),{tabbable:t},e);n.currentNode=r;let i=n.nextNode();t&&!i&&(n=xg(fg(e),{tabbable:!1},e),n.currentNode=r,i=n.nextNode()),bg(i)}function xg(e,t,r){let n=(null==t?void 0:t.tabbable)?pg:ug,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return(null==t||null===(i=t.from)||void 0===i?void 0:i.contains(e))?NodeFilter.FILTER_REJECT:!e.matches(n)||!og(e)||r&&!gg(e,r)||(null==t?void 0:t.accept)&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return(null==t?void 0:t.from)&&(i.currentNode=t.from),i}class Sg{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(null!=t?t:null),i=new _g({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e),r=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef.current&&gg(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let n=t.children;r.removeChild(t),n.length>0&&n.forEach((e=>r.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.length>0)for(let t of e.children)yield*this.traverse(t)}clone(){let e=new Sg;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent.scopeRef,t.nodeToRestore);return e}constructor(){Dh(this,"fastMap",new Map),this.root=new _g({scopeRef:null}),this.fastMap.set(null,this.root)}}class _g{addChild(e){this.children.push(e),e.parent=this}removeChild(e){this.children.splice(this.children.indexOf(e),1),e.parent=void 0}constructor(e){Dh(this,"children",[]),Dh(this,"contain",!1),this.scopeRef=e.scopeRef}}let kg=new Sg;function Eg(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,i=(0,je.useRef)({isFocused:!1,isFocusVisible:t||qm()}),[a,o]=(0,je.useState)(!1),[s,c]=(0,je.useState)((()=>i.current.isFocused&&i.current.isFocusVisible)),l=(0,je.useCallback)((()=>c(i.current.isFocused&&i.current.isFocusVisible)),[]),d=(0,je.useCallback)((e=>{i.current.isFocused=e,o(e),l()}),[l]);Gm((e=>{i.current.isFocusVisible=e,l()}),[],{isTextInput:r});let{focusProps:u}=Mm({isDisabled:n,onFocusChange:d}),{focusWithinProps:p}=Zm({isDisabled:!n,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:i.current.isFocused&&s,focusProps:n?p:u}}let Cg=r(je).createContext(null);r(je).forwardRef((function(e,t){let{children:n,...i}=e,a={...i,ref:t};return r(je).createElement(Cg.Provider,{value:a},n)}));function Pg(e,t){let{focusProps:r}=Mm(e),{keyboardProps:n}=ig(e),i=$h(r,n),a=function(e){let t=(0,je.useContext)(Cg)||{};nm(t,e);let{ref:r,...n}=t;return n}(t),o=e.isDisabled?{}:a,s=(0,je.useRef)(e.autoFocus);return(0,je.useEffect)((()=>{s.current&&t.current&&ag(t.current),s.current=!1}),[t]),{focusableProps:$h({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},o)}}function Rg(e,t){let r,{elementType:n="button",isDisabled:i,onPress:a,onPressStart:o,onPressEnd:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:d,onClick:u,href:p,target:f,rel:h,type:m="button"}=e;r="button"===n?{type:m,disabled:i}:{role:"button",tabIndex:i?void 0:0,href:"a"===n&&i?void 0:p,target:"a"===n?f:void 0,type:"input"===n?m:void 0,disabled:"input"===n?i:void 0,"aria-disabled":i&&"input"!==n?i:void 0,rel:"a"===n?h:void 0};let{pressProps:g,isPressed:v}=wm({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:a,isDisabled:i,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Pg(e,t);d&&(y.tabIndex=i?-1:y.tabIndex);let b=$h(y,g,Kh(e,{labelable:!0}));return{isPressed:v,buttonProps:$h(r,b,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:e=>{u&&(u(e),console.warn("onClick is deprecated, please use onPress"))}})}}function Tg(e,t,r){const{isSelected:n}=t,{isPressed:i,buttonProps:a}=Rg({...e,onPress:Wh(t.toggle,e.onPress)},r);return{isPressed:i,buttonProps:$h(a,{"aria-pressed":n})}}function jg(e={}){let{isReadOnly:t}=e,[r,n]=Mh(e.isSelected,e.defaultSelected||!1,e.onChange);return{isSelected:r,setSelected:function(e){t||n(e)},toggle:function(){t||n(!r)}}}function Og(e){const t=(0,je.useRef)(null);return(0,je.useEffect)((()=>{e&&("function"==typeof e?e(t.current):e.current=t.current)})),t}const Mg=(0,je.forwardRef)((function({children:e,...t},n){const i=Og(n);let a=jg(t);const{buttonProps:s}=Tg(t,a,i),{isFocusVisible:c,focusProps:l}=Eg();return(0,o.jsx)("button",{className:r(Ih)("w-[76px] h-[40px]",t.isSelected?"bg-[#FFFFFF]":"bg-[#FFFFFF] opacity-[0.4]","rounded-full","text-black","flex items-center justify-center gap-[5px]","text-base font-medium","transition-colors ease-in-out","focus:outline-none",{"ring-[3px] ring-cta":c,"cursor-not-allowed":s.disabled}),...s,...l,ref:i,children:e})}));je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2");new Map,new Map;new Map;new Map;new Map;new Map;let Lg=!1;try{Lg="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch(g){}let Ig=!1;try{Ig="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch(e){}new RegExp("^.*\\(.*\\).*$");new Map;new Set(["decimal","fraction","integer","minusSign","plusSign","group"]);const Dg=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Ag=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ng(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script;return Dg.has(t)}let t=e.split("-")[0];return Ag.has(t)}function Fg(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch(t){e="en-US"}return{locale:e,direction:Ng(e)?"rtl":"ltr"}}Fg(),new Set;r(je).createContext(null);new WeakMap;new Map;je=a("85Hg2");"undefined"!=typeof window&&window.visualViewport;new WeakMap;"undefined"!=typeof window&&window.visualViewport;const zg=[];function Bg(e,t){let{onClose:r,shouldCloseOnBlur:n,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e;(0,je.useEffect)((()=>(i&&zg.push(t),()=>{let e=zg.indexOf(t);e>=0&&zg.splice(e,1)})),[i,t]);let c=()=>{zg[zg.length-1]===t&&r&&r()};tg({ref:t,onInteractOutside:a?e=>{s&&!s(e.target)||(zg[zg.length-1]===t&&(e.stopPropagation(),e.preventDefault()),c())}:null,onInteractOutsideStart:e=>{s&&!s(e.target)||zg[zg.length-1]===t&&(e.stopPropagation(),e.preventDefault())}});let{focusWithinProps:l}=Zm({isDisabled:!n,onBlurWithin:e=>{e.relatedTarget&&vg(e.relatedTarget,cg)||(s&&!s(e.relatedTarget)||r())}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||o||(e.stopPropagation(),e.preventDefault(),c())},...l},underlayProps:{onPointerDown:e=>{e.target===e.currentTarget&&e.preventDefault()}}}}const Ug="undefined"!=typeof window&&window.visualViewport,Vg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Hg,Wg=0;function $g(e={}){let{isDisabled:t}=e;Uh((()=>{if(!t)return Wg++,1===Wg&&(Hg=pm()?function(){let e,t=0,r=r=>{e=im(r.target),e===document.documentElement&&e===document.body||(t=r.changedTouches[0].pageY)},n=r=>{if(e===document.documentElement||e===document.body)return void r.preventDefault();let n=r.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;(i<=0&&n>t||i>=a&&n<t)&&r.preventDefault(),t=n},i=e=>{let t=e.target;Kg(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame((()=>{t.style.transform=""})))},a=e=>{let t=e.target;Kg(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame((()=>{t.style.transform="",Ug&&(Ug.height<window.innerHeight?requestAnimationFrame((()=>{Zg(t)})):Ug.addEventListener("resize",(()=>Zg(t)),{once:!0}))})))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=Wh(qg(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"),qg(document.documentElement,"overflow","hidden"),qg(document.body,"marginTop",`-${c}px`));window.scrollTo(0,0);let d=Wh(Gg(document,"touchstart",r,{passive:!1,capture:!0}),Gg(document,"touchmove",n,{passive:!1,capture:!0}),Gg(document,"touchend",i,{passive:!1,capture:!0}),Gg(document,"focus",a,!0),Gg(window,"scroll",o));return()=>{l(),d(),window.scrollTo(s,c)}}():Wh(qg(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"),qg(document.documentElement,"overflow","hidden"))),()=>{Wg--,0===Wg&&Hg()}}),[t])}function qg(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Gg(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Zg(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=im(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;n>r+e.clientHeight&&(t.scrollTop+=n-r)}e=t.parentElement}}function Kg(e){return e instanceof HTMLInputElement&&!Vg.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}r(je).createContext(null);let Yg=new WeakMap,Qg=[];function Jg(e,t=document.body){let r=new Set(e),n=new Set,i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>((t instanceof HTMLElement||t instanceof SVGElement)&&"true"===t.dataset.liveAnnouncer&&r.add(t),r.has(t)||n.has(t.parentElement)&&"row"!==t.parentElement.getAttribute("role")?NodeFilter.FILTER_REJECT:e.some((e=>t.contains(e)))?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT)}),a=e=>{var t;let r=null!==(t=Yg.get(e))&&void 0!==t?t:0;"true"===e.getAttribute("aria-hidden")&&0===r||(0===r&&e.setAttribute("aria-hidden","true"),n.add(e),Yg.set(e,r+1))};Qg.length&&Qg[Qg.length-1].disconnect();let o=i.nextNode();for(;null!=o;)a(o),o=i.nextNode();let s=new MutationObserver((e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...r,...n].some((e=>e.contains(t.target))))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&"true"===e.dataset.liveAnnouncer?r.add(e):e instanceof Element&&a(e)}));s.observe(t,{childList:!0,subtree:!0});let c={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Qg.push(c),()=>{s.disconnect();for(let e of n){let t=Yg.get(e);1===t?(e.removeAttribute("aria-hidden"),Yg.delete(e)):Yg.set(e,t-1)}c===Qg[Qg.length-1]?(Qg.pop(),Qg.length&&Qg[Qg.length-1].observe()):Qg.splice(Qg.indexOf(c),1)}}const Xg=r(je).createContext(null);function ev(e){let t=Fh(),{portalContainer:n=(t?null:document.body)}=e,[i,a]=(0,je.useState)(!1),o=(0,je.useMemo)((()=>({contain:i,setContain:a})),[i,a]);if(!n)return null;let s=r(je).createElement(Xg.Provider,{value:o},r(je).createElement(lg,{restoreFocus:!0,contain:i},e.children));return r(c).createPortal(s,n)}function tv(e,t,r){let{overlayProps:n,underlayProps:i}=Bg({...e,isOpen:t.isOpen,onClose:t.close},r);return $g({isDisabled:!t.isOpen}),function(){let e=(0,je.useContext)(Xg),t=null==e?void 0:e.setContain;Uh((()=>{null==t||t(!0)}),[t])}(),(0,je.useEffect)((()=>{if(t.isOpen)return Jg([r.current])}),[t.isOpen,r]),{modalProps:$h(n),underlayProps:i}}function rv(){return rv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rv.apply(this,arguments)}function nv(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function iv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Vr(e,t)}function av(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}je=a("85Hg2"),je=a("85Hg2");var ov={disabled:!1},sv=r(je=a("85Hg2")).createContext(null),cv=function(e){return e.scrollTop},lv="unmounted",dv="exited",uv="entering",pv="entered",fv="exiting",hv=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=dv,n.appearStatus=uv):i=pv:i=t.unmountOnExit||t.mountOnEnter?lv:dv,n.state={status:i},n.nextCallback=null,n}iv(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===lv?{status:dv}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==uv&&r!==pv&&(t=uv):r!==uv&&r!==pv||(t=fv)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===uv){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:r(c).findDOMNode(this);n&&cv(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===dv&&this.setState({status:lv})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,a=this.props.nodeRef?[i]:[r(c).findDOMNode(this),i],o=a[0],s=a[1],l=this.getTimeouts(),d=i?l.appear:l.enter;!e&&!n||ov.disabled?this.safeSetState({status:pv},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,s),this.safeSetState({status:uv},(function(){t.props.onEntering(o,s),t.onTransitionEnd(d,(function(){t.safeSetState({status:pv},(function(){t.props.onEntered(o,s)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:r(c).findDOMNode(this);t&&!ov.disabled?(this.props.onExit(i),this.safeSetState({status:fv},(function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:dv},(function(){e.props.onExited(i)}))}))}))):this.safeSetState({status:dv},(function(){e.props.onExited(i)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:r(c).findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=a[0],s=a[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===lv)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,nv(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r(je).createElement(sv.Provider,{value:null},"function"==typeof n?n(e,i):r(je).cloneElement(r(je).Children.only(n),i))},t}(r(je).Component);function mv(){}hv.contextType=sv,hv.propTypes={},hv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:mv,onEntering:mv,onEntered:mv,onExit:mv,onExiting:mv,onExited:mv},hv.UNMOUNTED=lv,hv.EXITED=dv,hv.ENTERING=uv,hv.ENTERED=pv,hv.EXITING=fv;var gv=hv,vv=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},yv=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=av(r.className,n):r.setAttribute("class",av(r.className&&r.className.baseVal||"",n)));var r,n}))},bv=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1];t.removeClasses(i,"exit"),t.addClass(i,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.addClass(i,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.removeClasses(i,a),t.addClass(i,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,i=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:i,activeClassName:n?i+"-active":r[e+"Active"],doneClassName:n?i+"-done":r[e+"Done"]}},t}iv(t,e);var n=t.prototype;return n.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&cv(e),n&&(this.appliedClasses[t][r]=n,vv(e,n))},n.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,a=r.done;this.appliedClasses[t]={},n&&yv(e,n),i&&yv(e,i),a&&yv(e,a)},n.render=function(){var e=this.props,t=(e.classNames,nv(e,["classNames"]));return r(je).createElement(gv,rv({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r(je).Component);bv.defaultProps={classNames:""},bv.propTypes={};var wv=bv;const xv=(0,(je=a("85Hg2")).forwardRef)((function({children:e,variant:t="primary",size:n="medium",fullWidth:i=!1,form:a,className:s,...c},l){const d=Og(l),{buttonProps:u,isPressed:p}=Rg(c,d),{isFocusVisible:f,focusProps:h}=Eg(),{hoverProps:m,isHovered:g}=eg({isDisabled:u.disabled}),v=g||f||p,y={primary:r(Ih)(v?"bg-primaryLight":"bg-primary","text-white disabled:bg-secondaryLight"),secondary:r(Ih)(v?"bg-graySelected":"bg-transparent","text-primary border border-secondaryLight disabled:text-secondaryLight disabled:bg-graySelected"),basic:r(Ih)(v?"bg-graySelected":"bg-white","text-primary disabled:text-secondaryLight disabled:bg-graySelected"),custom:""};return(0,o.jsx)("button",{className:r(Ih)({large:"py-3 px-4 text-base rounded-lg",medium:"py-[9px] px-3.5 text-base rounded-lg",small:"py-2 px-3 text-sm rounded-lg",extraSmall:"py-1.5 px-2.5 text-xs rounded-md",custom:""}[n],y[t],"flex items-center justify-center gap-[5px] font-medium","transition-colors ease-in-out","focus:outline-none",{"ring-[3px] ring-cta":f,"cursor-not-allowed":u.disabled,"w-full":i},s),...u,...h,...m,form:a,ref:d,children:e})}));function Sv(e){const{children:t,state:n,size:i="small",title:a,description:s,primaryAction:c,secondaryAction:l,centered:d=!1}=e,u=r(je).useRef(null),{modalProps:p,underlayProps:f}=tv({isDismissable:!0,...e},n,u),[h,m]=(0,je.useState)(!n.isOpen),g=sm().height-64;return!n.isOpen&&h?null:(0,o.jsx)(ev,{children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,onEntered:()=>m(!1),onExited:()=>m(!0),timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-1 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:"fixed z-[100] inset-0 bg-black bg-opacity-90 flex justify-center items-center inter",...f,children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,nodeRef:u,timeout:{enter:0,exit:300},classNames:{appear:"translate-y-2",appearDone:"translate-y-0 transition ease-in",exit:"translate-y-2 transition ease-out"},children:(0,o.jsx)("div",{...p,ref:u,className:r(Ih)("bg-white rounded-[10px] z-[1] overflow-x-auto focus:outline-none",{small:"max-w-[400px] mx-[20px]",medium:"max-w-[600px]",large:"max-w-[800px]"}[i]),style:{maxHeight:`${g}px`},children:(0,o.jsxs)("div",{className:"flex flex-col gap-5 px-5 py-[25px] max-h-[inherit]",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-5 overflow-auto",children:[(0,o.jsxs)("div",{className:r(Ih)("flex flex-col gap-[5px]",{"text-center":d}),children:[(0,o.jsx)("h2",{className:"text-xl font-medium",children:a}),s&&(0,o.jsx)("p",{className:"text-sm text-secondary",children:s})]}),t]}),(c||l)&&(0,o.jsxs)("div",{className:r(Ih)("flex justify-end gap-2.5",d?"justify-center":"justify-end"),children:["string"==typeof l&&(0,o.jsx)(xv,{variant:"secondary",onPress:n.close,fullWidth:d,children:l}),"function"==typeof l&&l({close:n.close}),"string"==typeof c&&(0,o.jsx)(xv,{onPress:n.close,fullWidth:d,children:c}),"function"==typeof c&&c({close:n.close})]})]})})})})})})}const _v=()=>(0,o.jsxs)("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 2.167a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M6.76 5.65a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",fill:"#F12828"})]}),kv=()=>(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M7.5 6.667h5a.833.833 0 0 1 .833.833v5a.833.833 0 0 1-.834.834h-5a.833.833 0 0 1-.833-.834v-5a.833.833 0 0 1 .833-.833Z",fill:"#F12828"})]}),Ev=()=>(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.666 6.666 0 1 1 0-13.333 6.666 6.666 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M6.76 5.15a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",fill:"#1D1C20"})]}),Cv=({children:e})=>(0,o.jsx)("span",{className:"w-full text-base text-primaryLight font-normal leading-[20px]",children:e}),Pv=({children:e})=>(0,o.jsx)("span",{className:"text-primary font-medium",children:e}),Rv=({children:e,index:t})=>(0,o.jsxs)("div",{className:"flex flex-row justify-center gap-[5px]",children:[(0,o.jsx)("div",{className:"flex items-center justify-center min-w-[24px] h-[24px] rounded-[50%] bg-secondaryVLight",children:t}),e]}),Tv=({state:e,type:t})=>{const[r,n]=(0,je.useState)("idle"),[i,a]=(0,je.useState)(!1),{orientation:s}=(0,je.useContext)(Go),c="landscape"===s?"desktop":"mobile",l="granted"===r?"short":"full",d="picture"===t?"photo":"video",u=()=>n("granted"),p=()=>a(!0),f=()=>a(!1),h=(0,je.useRef)(null),m=(0,je.useMemo)((()=>"refused"===r?"Something went wrong!":"picture"===t?"Ready to take a shot?":"Ready to record a video?"),[r,t]);(0,je.useEffect)((()=>(qo.addEventListener("localVideoAvailable",u),qo.addEventListener("microphoneEnabled",u),qo.addEventListener("enterRoom",p),qo.addEventListener("leaveRoom",f),()=>{qo.removeEventListener("localVideoAvailable",u),qo.removeEventListener("microphoneEnabled",u),qo.removeEventListener("enterRoom",p),qo.removeEventListener("leaveRoom",f)})),[]);const g=Number("granted"!==r);return(0,o.jsx)(Sv,{title:m,state:e,centered:"refused"!==r,isDismissable:!1,primaryAction:()=>(0,o.jsx)(o.Fragment,{children:"refused"===r?(0,o.jsx)(xv,{fullWidth:!0,onPress:()=>window.location.reload(),children:"Allow access"}):(0,o.jsx)(o.Fragment,{children:"granted"===r?(0,o.jsx)(xv,{fullWidth:!0,onPress:e.close,children:"Okay"}):(0,o.jsxs)(xv,{fullWidth:!0,isDisabled:"requesting"===r||!1===i,onPress:async()=>{n("requesting");try{(await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})).getTracks().forEach((e=>e.stop())),await qo.enableMicrophone(),await qo.enableVideo({resolution:"vga",frameRate:20,facingMode:"environment"})}catch{n("refused")}},children:[(0,o.jsx)(Pp,{}),"Allow access to cam/mic"]})})}),children:(0,o.jsxs)("div",{className:"flex flex-col gap-[20px]",children:[(0,o.jsx)("div",{className:"flex flex-col gap-[10px]",ref:h,children:"refused"===r?(0,o.jsx)(Cv,{children:"Without camera and microphone access, you can't take photos or videos to share with the support team. Please grant access in your browser settings."}):(0,o.jsxs)(o.Fragment,{children:["granted"!==r&&(0,o.jsx)(Rv,{index:1,children:(0,o.jsxs)(Cv,{children:["When prompted, ",(0,o.jsx)(Pv,{children:"allow access"})," to camera and microphone."]})}),"picture"===t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rv,{index:1+g,children:(0,o.jsxs)(Cv,{children:["Tap the ",(0,o.jsx)(Ev,{}),(0,o.jsx)(Pv,{children:" Camera button"})," to take a photo."]})}),(0,o.jsx)(Rv,{index:2+g,children:(0,o.jsx)(Cv,{children:"Don't hesitate to take multiple photos for more detail."})}),(0,o.jsx)(Rv,{index:3+g,children:(0,o.jsxs)(Cv,{children:["You can review your photo and then ",(0,o.jsx)(Pv,{children:"send it when you're done."})]})})]}),"video"===t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rv,{index:1+g,children:(0,o.jsxs)(Cv,{children:["Tap the ",(0,o.jsx)(_v,{}),(0,o.jsx)(Pv,{children:" Record button"})," to start a recording."]})}),(0,o.jsx)(Rv,{index:2+g,children:(0,o.jsxs)(Cv,{children:["You can ",(0,o.jsx)(Pv,{children:"speak during"})," the recording for added detail."]})}),(0,o.jsx)(Rv,{index:3+g,children:(0,o.jsxs)(Cv,{children:["When you're finished, tap the ",(0,o.jsx)(kv,{}),(0,o.jsx)(Pv,{children:" Stop button"}),"."]})}),(0,o.jsx)(Rv,{index:4+g,children:(0,o.jsxs)(Cv,{children:["You can review your video and then ",(0,o.jsx)(Pv,{children:"send it when you're done"}),"."]})})]})]})}),"refused"!==r&&(0,o.jsx)("div",{className:"flex items-center justify-center rounded-[8px] overflow-hidden",children:(0,o.jsx)("video",{src:`https://stream-assets.snapcall.io/animations/${c}-assist-onboarding-${d}-${l}.mp4`,playsInline:!0,autoPlay:!0,muted:!0,loop:!0})})]})})};je=a("85Hg2");const jv=({state:e,setReady:t})=>{const r=(0,je.useRef)(null),n=(0,je.useRef)(null),[i]=As(n.current);return(0,je.useEffect)((()=>{Jl(r.current,window.location.href,{width:i>300?300:i,errorCorrectionLevel:"Q",margin:0})}),[i]),(0,o.jsx)(Sv,{centered:!0,title:"Switch to your mobile",description:"Enjoy an even more convenient experience by using your phone to take photos and record videos.",isDismissable:!1,state:e,primaryAction:()=>(0,o.jsx)(xv,{fullWidth:!0,onPress:()=>{t(!0),e.close()},children:"Use desktop version"}),children:(0,o.jsxs)("div",{className:"flex flex-col gap-[20px]",children:[(0,o.jsxs)("div",{ref:n,className:"flex flex-1 items-center justify-center relative",children:[(0,o.jsx)("div",{className:"absolute w-1/3 h-1/3 max-w-[70px] max-h-[70px] flex items-center justify-center",children:(0,o.jsx)(xp,{})}),(0,o.jsx)("canvas",{ref:r})]}),(0,o.jsx)("p",{className:"flex items-center justify-center text-xs text-primaryLight text-center",children:"Scan this QR code with a compatible device."})]})})};function Ov({mode:e}){const{orientation:t}=(0,je.useContext)(Go),r="landscape"===t,[n,i]=(0,je.useState)(!r);(0,je.useEffect)((()=>{n&&(o("photo"===e&&n),c("video"===e&&n))}),[n,e]);const[a,o]=(0,je.useState)("photo"===e&&n),[s,c]=(0,je.useState)("video"===e&&n);return{photoInstructionsModalState:Lh({isOpen:a,onOpenChange:o}),videoInstructionsModalState:Lh({isOpen:s,onOpenChange:c}),ready:n,setReady:i}}const Mv=({state:e})=>{const[t,r]=(0,je.useState)(!e.ready),n=Lh({isOpen:t,onOpenChange:r});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Tv,{state:e.photoInstructionsModalState,type:"picture"}),(0,o.jsx)(Tv,{state:e.videoInstructionsModalState,type:"video"}),(0,o.jsx)(jv,{state:n,setReady:e.setReady})]})};function Lv({photo:e=!0}){const[t,r]=(0,je.useState)(e),[n,i]=(0,je.useState)(!1);return{photo:t,setPhoto:r,streaming:n,setStreaming:i}}const Iv=e=>{const t=Ov({mode:e.state.photo?"photo":"video"});return(0,o.jsxs)("div",{className:"flex flex-col bg-primary h-[150px] w-full max-w-[400px] rounded-[15px] p-2.5 gap-2.5",children:[(0,o.jsx)(Mv,{state:t}),(0,o.jsxs)("div",{className:"flex flex-1 flex-row px-[10px] w-full",children:[(0,o.jsxs)("div",{className:"flex flex-row flex-auto items-center gap-[10px]",children:[(0,o.jsx)(as,{}),(0,o.jsx)("div",{className:" text-white text-base font-medium",children:"SnapCall"})]}),(0,o.jsxs)("div",{className:"flex flex-row justify-end flex-auto items-center gap-[10px] ",children:[(0,o.jsx)(Mg,{onPress:()=>{e.state.streaming||(e.state.setPhoto(!0),t.photoInstructionsModalState.open())},isSelected:e.state.photo,children:"Photo"}),(0,o.jsx)(Mg,{onPress:()=>{e.state.streaming||(e.state.setPhoto(!1),t.videoInstructionsModalState.open())},isSelected:!e.state.photo,children:"Video"})]})]}),(0,o.jsxs)("div",{className:"flex flex-row flex-1 items-center justify-between w-full ",children:[(0,o.jsx)("div",{className:"w-[60px] h-[60px]",children:e.thumbnail}),(0,o.jsx)("div",{className:"bg-white rounded-full w-[72px] h-[72px] p-[3px]",onClick:()=>e.onCapturePress(),children:(0,o.jsx)("div",{className:"bg-primary rounded-full w-full h-full p-[3px] flex items-center justify-center cursor-pointer",children:(0,o.jsx)("div",{className:r(Ih)("w-full h-full transition-[transform,border-radius] duration-300",e.state.photo?"bg-white":"bg-[#f12828]",e.state.streaming?"rounded-[5px] scale-[0.4]":"rounded-[60px]")})})}),(0,o.jsx)("div",{onClick:e.onSwitch,className:"bg-[#565656] rounded-full w-[56px] h-[56px] flex items-center justify-center cursor-pointer",children:(0,o.jsx)(Nl,{})})]})]})};je=a("85Hg2"),je=a("85Hg2");function Dv(e){const{children:t,state:n}=e,i=r(je).useRef(null),{orientation:a}=(0,je.useContext)(Go),{modalProps:s,underlayProps:c}=tv(e,n,i),[l,d]=(0,je.useState)(!n.isOpen),u=sm().height-64,p="landscape"===a;return!n.isOpen&&l?null:(0,o.jsx)(ev,{children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,onEntered:()=>d(!1),onExited:()=>d(!0),timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-1 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:r(Ih)("fixed z-[100] inset-0 bg-underlay flex justify-center inter",p?"items-center":"items-end"),...c,children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,nodeRef:i,timeout:{enter:0,exit:300},classNames:{appear:p?"translate-y-[200%]":"translate-y-full",appearDone:"translate-y-0 transition duration-300 ease-out",exit:r(Ih)("transition ease-out",p?"translate-y-[200%]":"translate-y-full")},children:(0,o.jsx)("div",{...s,ref:i,className:r(Ih)("bg-white z-[1] overflow-auto focus:outline-none",p?"translate-y-[200%] rounded-[15px]":"translate-y-full rounded-t-[15px]"),style:{maxHeight:`${u}px`},children:t})})})})})}const Av=()=>(0,o.jsx)("svg",{width:"12",height:"15",viewBox:"0 0 12 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M11.103 5.747 2.677.272A1.614 1.614 0 0 0 1.773 0a1.62 1.62 0 0 0-.9.288 1.886 1.886 0 0 0-.64.733A2.235 2.235 0 0 0 0 2.025v10.95c0 .352.08.699.233 1.004.154.305.375.558.64.733.273.186.584.285.9.288.317.003.63-.091.904-.272l8.426-5.475c.272-.173.498-.427.656-.736.158-.308.241-.66.241-1.017a2.24 2.24 0 0 0-.24-1.017 1.884 1.884 0 0 0-.657-.736Z",fill:"#fff"})}),Nv=({asset:e,onClick:t})=>e?(0,o.jsxs)("div",{className:"flex items-center justify-center w-[60px] h-[60px] rounded-[8px] cursor-pointer bg-white relative overflow-hidden",onClick:t,children:["picture"===e?.type&&(0,o.jsx)("img",{className:"cursor-pointer bg-white",src:e.objectUrl,alt:"last shot"}),"video"===e?.type&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("video",{src:e.objectUrl,className:"min-w-[100%] min-h-[100%] object-cover"}),(0,o.jsx)("div",{className:"absolute left-0 top-0 flex items-center justify-center w-[60px] h-[60px] bg-primary opacity-50",children:(0,o.jsx)(Av,{})})]})]}):null,Fv=()=>(0,o.jsx)("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M7.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM15 5h-3v-.75A2.25 2.25 0 0 0 9.75 2h-1.5A2.25 2.25 0 0 0 6 4.25V5H3a.75.75 0 0 0 0 1.5h.75v8.25A2.25 2.25 0 0 0 6 17h6a2.25 2.25 0 0 0 2.25-2.25V6.5H15A.75.75 0 1 0 15 5Zm-7.5-.75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75V5h-3v-.75Zm5.25 10.5a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V6.5h7.5v8.25ZM10.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z",fill:"#fff"})}),zv=new Intl.DateTimeFormat("default",{dateStyle:"short"}),Bv=new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"});function Uv(e){const t=e.getHours()%12>=12?"PM":"AM";return`${zv.format(e)} at ${Bv.format(e)} ${t}`}const Vv=({asset:e,index:t,removeAsset:r})=>{const n=Lh({});return(0,o.jsxs)("div",{className:"flex flex-row justify-between items-center",children:[(0,o.jsx)(Sv,{title:"Confirm removal",state:n,description:"Are you sure you want to remove this photo/video? This action cannot be undone.",primaryAction:({close:t})=>(0,o.jsxs)(xv,{onPress:async()=>{await r(e),t()},children:[(0,o.jsx)(Fv,{}),"Confirm"]}),secondaryAction:"Cancel"}),(0,o.jsxs)("div",{className:"flex flex-row gap-[10px] items-center",children:[(0,o.jsx)(Nv,{asset:e}),(0,o.jsxs)("span",{className:"text-sm",style:{hyphens:"manual"},children:["picture"===e.type?"Photo":"Video"," ",t+1," ·"," ",Uv(new Date(e.timestamp))]})]}),(0,o.jsx)("span",{className:"text-xs font-bold underline cursor-pointer ml-[10px]",onClick:n.open,children:"Remove"})]},e.assetId)};je=a("85Hg2");
|
|
2075
|
+
*/!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var a=typeof i;if("string"===a||"number"===a)r.push(i);else if(Array.isArray(i)){if(i.length){var o=t.apply(null,i);o&&r.push(o)}}else if("object"===a){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var s in i)e.call(i,s)&&i[s]&&r.push(s)}}}return r.join(" ")}Ih?(t.default=t,Ih=t):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return t})):window.classNames=t}();je=a("85Hg2"),je=a("85Hg2");function Dh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2");const Ah={prefix:String(Math.round(1e10*Math.random())),current:0},Nh=r(je).createContext(Ah);Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function Fh(){let e=(0,je.useContext)(Nh)!==Ah,[t,r]=(0,je.useState)(e);return"undefined"!=typeof window&&e&&(0,je.useLayoutEffect)((()=>{r(!1)}),[]),t}function zh(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=zh(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}var Bh=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=zh(e))&&(n&&(n+=" "),n+=t);return n};const Uh="undefined"!=typeof window?r(je).useLayoutEffect:()=>{};let Vh=new Map;function Hh(e,t){if(e===t)return e;let r=Vh.get(e);if(r)return r(t),t;let n=Vh.get(t);return n?(n(e),e):t}function Wh(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function $h(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Wh(r,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof r||"string"!=typeof i?"id"===e&&r&&i?t.id=Hh(r,i):t[e]=void 0!==i?i:r:t[e]=Bh(r,i)}}return t}const qh=new Set(["id"]),Gh=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Zh=/^(data-.*)$/;function Kh(e,t={}){let{labelable:r,propNames:n}=t,i={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(qh.has(t)||r&&Gh.has(t)||(null==n?void 0:n.has(t))||Zh.test(t))&&(i[t]=e[t]);return i}function Yh(e){if(function(){if(null==Qh){Qh=!1;try{document.createElement("div").focus({get preventScroll(){return Qh=!0,!0}})}catch(e){}}return Qh}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft});return r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let Qh=null;let Jh=new Map,Xh=new Set;function em(){if("undefined"==typeof window)return;let e=t=>{let r=Jh.get(t.target);if(r&&(r.delete(t.propertyName),0===r.size&&(t.target.removeEventListener("transitioncancel",e),Jh.delete(t.target)),0===Jh.size)){for(let e of Xh)e();Xh.clear()}};document.body.addEventListener("transitionrun",(t=>{let r=Jh.get(t.target);r||(r=new Set,Jh.set(t.target,r),t.target.addEventListener("transitioncancel",e)),r.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function tm(e){requestAnimationFrame((()=>{0===Jh.size?e():Xh.add(e)}))}"undefined"!=typeof document&&("loading"!==document.readyState?em():document.addEventListener("DOMContentLoaded",em));function rm(){let e=(0,je.useRef)(new Map),t=(0,je.useCallback)(((t,r,n,i)=>{let a=(null==i?void 0:i.once)?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:a,options:i}),t.addEventListener(r,n,i)}),[]),r=(0,je.useCallback)(((t,r,n,i)=>{var a;let o=(null===(a=e.current.get(n))||void 0===a?void 0:a.fn)||n;t.removeEventListener(r,o,i),e.current.delete(n)}),[]),n=(0,je.useCallback)((()=>{e.current.forEach(((e,t)=>{r(e.eventTarget,e.type,t,e.options)}))}),[r]);return(0,je.useEffect)((()=>n),[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function nm(e,t){Uh((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}function im(e){for(;e&&!am(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function am(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}let om="undefined"!=typeof window&&window.visualViewport;function sm(){let[e,t]=(0,je.useState)((()=>cm()));return(0,je.useEffect)((()=>{let e=()=>{t((e=>{let t=cm();return t.width===e.width&&t.height===e.height?e:t}))};return om?om.addEventListener("resize",e):window.addEventListener("resize",e),()=>{om?om.removeEventListener("resize",e):window.removeEventListener("resize",e)}}),[]),e}function cm(){return{width:(null==om?void 0:om.width)||window.innerWidth,height:(null==om?void 0:om.height)||window.innerHeight}}new Map;function lm(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}function dm(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function um(){return dm(/^Mac/i)}function pm(){return dm(/^iPhone/i)||dm(/^iPad/i)||um()&&navigator.maxTouchPoints>1}function fm(e){return!(0!==e.mozInputSource||!e.isTrusted)||(lm(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}je=a("85Hg2");let hm="default",mm="",gm=new WeakMap;function vm(e){pm()?("default"===hm&&(mm=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),hm="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(gm.set(e,e.style.userSelect),e.style.userSelect="none")}function ym(e){if(pm()){if("disabled"!==hm)return;hm="restoring",setTimeout((()=>{tm((()=>{"restoring"===hm&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=mm||""),mm="",hm="default")}))}),300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&gm.has(e)){let t=gm.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),gm.delete(e)}}const bm=r(je).createContext(null);function wm(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:a,isDisabled:o,isPressed:s,preventFocusOnPress:c,shouldCancelOnPointerExit:l,allowTextSelectionOnPress:d,ref:u,...p}=function(e){let t=(0,je.useContext)(bm);if(t){let{register:r,...n}=t;e=$h(n,e),r()}return nm(t,e.ref),e}(e),f=(0,je.useRef)(null);f.current={onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:a,isDisabled:o,shouldCancelOnPointerExit:l};let[h,m]=(0,je.useState)(!1),g=(0,je.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=rm(),b=(0,je.useMemo)((()=>{let e=g.current,t=(t,r)=>{let{onPressStart:n,onPressChange:i,isDisabled:a}=f.current;a||e.didFirePressStart||(n&&n({type:"pressstart",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),i&&i(!0),e.didFirePressStart=!0,m(!0))},r=(t,r,n=!0)=>{let{onPressEnd:i,onPressChange:a,onPress:o,isDisabled:s}=f.current;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,i&&i({type:"pressend",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),a&&a(!1),m(!1),o&&n&&!s&&o({type:"press",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},n=(e,t)=>{let{onPressUp:r,isDisabled:n}=f.current;n||r&&r({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},i=t=>{e.isPressed&&(e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,y(),d||ym(e.target))},a={onKeyDown(r){Sm(r.nativeEvent,r.currentTarget)&&r.currentTarget.contains(r.target)?(Pm(r.target,r.key)&&r.preventDefault(),r.stopPropagation(),e.isPressed||r.repeat||(e.target=r.currentTarget,e.isPressed=!0,t(r,"keyboard"),v(document,"keyup",s,!1))):"Enter"===r.key&&xm(r.currentTarget)&&r.stopPropagation()},onKeyUp(t){Sm(t.nativeEvent,t.currentTarget)&&!t.repeat&&t.currentTarget.contains(t.target)&&n(km(e.target,t),"keyboard")},onClick(i){i&&!i.currentTarget.contains(i.target)||i&&0===i.button&&(i.stopPropagation(),o&&i.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!fm(i.nativeEvent)||(o||c||Yh(i.currentTarget),t(i,"virtual"),n(i,"virtual"),r(i,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},s=t=>{if(e.isPressed&&Sm(t,e.target)){Pm(t.target,t.key)&&t.preventDefault(),t.stopPropagation(),e.isPressed=!1;let n=t.target;r(km(e.target,t),"keyboard",e.target.contains(n)),y(),e.target instanceof HTMLElement&&e.target.contains(n)&&(xm(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!=typeof PointerEvent){a.onPointerDown=r=>{var n;0===r.button&&r.currentTarget.contains(r.target)&&(0===(n=r.nativeEvent).width&&0===n.height||1===n.width&&1===n.height&&0===n.pressure&&0===n.detail&&"mouse"===n.pointerType?e.pointerType="virtual":(Cm(r.currentTarget)&&r.preventDefault(),e.pointerType=r.pointerType,r.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=r.pointerId,e.target=r.currentTarget,o||c||Yh(r.currentTarget),d||vm(e.target),t(r,e.pointerType),v(document,"pointermove",s,!1),v(document,"pointerup",l,!1),v(document,"pointercancel",u,!1))))},a.onMouseDown=e=>{e.currentTarget.contains(e.target)&&0===e.button&&(Cm(e.currentTarget)&&e.preventDefault(),e.stopPropagation())},a.onPointerUp=t=>{t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&Em(t,t.currentTarget)&&n(t,e.pointerType||t.pointerType)};let s=n=>{n.pointerId===e.activePointerId&&(Em(n,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(km(e.target,n),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(km(e.target,n),e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(n)))},l=t=>{t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(Em(t,e.target)?r(km(e.target,t),e.pointerType):e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,y(),d||ym(e.target))},u=e=>{i(e)};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}else{a.onMouseDown=r=>{0===r.button&&r.currentTarget.contains(r.target)&&(Cm(r.currentTarget)&&r.preventDefault(),r.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=r.currentTarget,e.pointerType=fm(r.nativeEvent)?"virtual":"mouse",o||c||Yh(r.currentTarget),t(r,e.pointerType),v(document,"mouseup",s,!1)))},a.onMouseEnter=r=>{r.currentTarget.contains(r.target)&&(r.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(r,e.pointerType)))},a.onMouseLeave=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,r(t,e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(t)))},a.onMouseUp=t=>{t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||n(t,e.pointerType))};let s=t=>{0===t.button&&(e.isPressed=!1,y(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(Em(t,e.target)?r(km(e.target,t),e.pointerType):e.isOverTarget&&r(km(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};a.onTouchStart=r=>{if(!r.currentTarget.contains(r.target))return;r.stopPropagation();let n=function(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}(r.nativeEvent);n&&(e.activePointerId=n.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=r.currentTarget,e.pointerType="touch",o||c||Yh(r.currentTarget),d||vm(e.target),t(r,e.pointerType),v(window,"scroll",l,!0))},a.onTouchMove=n=>{if(!n.currentTarget.contains(n.target))return;if(n.stopPropagation(),!e.isPressed)return;let a=_m(n.nativeEvent,e.activePointerId);a&&Em(a,n.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(n,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(n,e.pointerType,!1),f.current.shouldCancelOnPointerExit&&i(n))},a.onTouchEnd=t=>{if(!t.currentTarget.contains(t.target))return;if(t.stopPropagation(),!e.isPressed)return;let i=_m(t.nativeEvent,e.activePointerId);i&&Em(i,t.currentTarget)?(n(t,e.pointerType),r(t,e.pointerType)):e.isOverTarget&&r(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,d||ym(e.target),y()},a.onTouchCancel=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&i(t))};let l=t=>{e.isPressed&&t.target.contains(e.target)&&i({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};a.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}return a}),[v,o,c,y,d]);return(0,je.useEffect)((()=>()=>{d||ym(g.current.target)}),[d]),{isPressed:s||h,pressProps:$h(p,b)}}function xm(e){return"A"===e.tagName&&e.hasAttribute("href")}function Sm(e,t){const{key:r,code:n}=e,i=t,a=i.getAttribute("role");return!("Enter"!==r&&" "!==r&&"Spacebar"!==r&&"Space"!==n||i instanceof HTMLInputElement&&!Tm(i,r)||i instanceof HTMLTextAreaElement||i.isContentEditable||xm(i)&&("button"!==a||"Enter"===r)||"link"===a&&"Enter"!==r)}function _m(e,t){const r=e.changedTouches;for(let e=0;e<r.length;e++){const n=r[e];if(n.identifier===t)return n}return null}function km(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function Em(e,t){let r=t.getBoundingClientRect(),n=function(e){let t=e.width/2||e.radiusX||0,r=e.height/2||e.radiusY||0;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}(e);return a=n,!((i=r).left>a.right||a.left>i.right||i.top>a.bottom||a.top>i.bottom);var i,a}function Cm(e){return!(e instanceof HTMLElement&&e.draggable)}function Pm(e,t){return e instanceof HTMLInputElement?!Tm(e,t):!(e instanceof HTMLButtonElement)||"submit"!==e.type}bm.displayName="PressResponderContext";const Rm=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Tm(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:Rm.has(e.type)}r(je).forwardRef((({children:e,...t},n)=>{let i=(0,je.useRef)();n=null!=n?n:i;let{pressProps:a}=wm({...t,ref:n}),o=r(je).Children.only(e);return r(je).cloneElement(o,{ref:n,...$h(o.props,a)})})),r(je).forwardRef((({children:e,...t},n)=>{let i=(0,je.useRef)(!1),a=(0,je.useContext)(bm),o=$h(a||{},{...t,ref:n||(null==a?void 0:a.ref),register(){i.current=!0,a&&a.register()}});return nm(a,n),(0,je.useEffect)((()=>{i.current||console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.")}),[]),r(je).createElement(bm.Provider,{value:o},e)}));class jm{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function Om(e){let t=(0,je.useRef)({isFocused:!1,onBlur:e,observer:null});return t.current.onBlur=e,Uh((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]),(0,je.useCallback)((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,n=e=>{var n,i;t.current.isFocused=!1,r.disabled&&(null===(i=(n=t.current).onBlur)||void 0===i||i.call(n,new jm("blur",e))),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",n,{once:!0}),t.current.observer=new MutationObserver((()=>{t.current.isFocused&&r.disabled&&(t.current.observer.disconnect(),r.dispatchEvent(new FocusEvent("blur")),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})))})),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}}),[])}function Mm(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e;const a=(0,je.useCallback)((e=>{if(e.target===e.currentTarget)return n&&n(e),i&&i(!1),!0}),[n,i]),o=Om(a),s=(0,je.useCallback)((e=>{e.target===e.currentTarget&&(r&&r(e),i&&i(!0),o(e))}),[i,r,o]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:t||!n&&!i?null:a}}}let Lm=null,Im=new Set,Dm=!1,Am=!1,Nm=!1;const Fm={Tab:!0,Escape:!0};function zm(e,t){for(let r of Im)r(e,t)}function Bm(e){Am=!0,function(e){return!(e.metaKey||!um()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(Lm="keyboard",zm("keyboard",e))}function Um(e){Lm="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Am=!0,zm("pointer",e))}function Vm(e){fm(e)&&(Am=!0,Lm="virtual")}function Hm(e){e.target!==window&&e.target!==document&&(Am||Nm||(Lm="virtual",zm("virtual",e)),Am=!1,Nm=!1)}function Wm(){Am=!1,Nm=!0}function $m(){if("undefined"==typeof window||Dm)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){Am=!0,e.apply(this,arguments)},document.addEventListener("keydown",Bm,!0),document.addEventListener("keyup",Bm,!0),document.addEventListener("click",Vm,!0),window.addEventListener("focus",Hm,!0),window.addEventListener("blur",Wm,!1),"undefined"!=typeof PointerEvent?(document.addEventListener("pointerdown",Um,!0),document.addEventListener("pointermove",Um,!0),document.addEventListener("pointerup",Um,!0)):(document.addEventListener("mousedown",Um,!0),document.addEventListener("mousemove",Um,!0),document.addEventListener("mouseup",Um,!0)),Dm=!0}function qm(){return"pointer"!==Lm}function Gm(e,t,r){$m(),(0,je.useEffect)((()=>{let t=(t,n)=>{(function(e,t,r){return!(e&&"keyboard"===t&&r instanceof KeyboardEvent&&!Fm[r.key])})(null==r?void 0:r.isTextInput,t,n)&&e(qm())};return Im.add(t),()=>{Im.delete(t)}}),t)}function Zm(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=e,a=(0,je.useRef)({isFocusWithin:!1}),o=(0,je.useCallback)((e=>{a.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(a.current.isFocusWithin=!1,r&&r(e),i&&i(!1))}),[r,i,a]),s=Om(o),c=(0,je.useCallback)((e=>{a.current.isFocusWithin||(n&&n(e),i&&i(!0),a.current.isFocusWithin=!0,s(e))}),[n,i,s]);return t?{focusWithinProps:{onFocus:null,onBlur:null}}:{focusWithinProps:{onFocus:c,onBlur:o}}}"undefined"!=typeof document&&("loading"!==document.readyState?$m():document.addEventListener("DOMContentLoaded",$m));let Km=!1,Ym=0;function Qm(){Km=!0,setTimeout((()=>{Km=!1}),50)}function Jm(e){"touch"===e.pointerType&&Qm()}function Xm(){if("undefined"!=typeof document)return"undefined"!=typeof PointerEvent?document.addEventListener("pointerup",Jm):document.addEventListener("touchend",Qm),Ym++,()=>{Ym--,Ym>0||("undefined"!=typeof PointerEvent?document.removeEventListener("pointerup",Jm):document.removeEventListener("touchend",Qm))}}function eg(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[a,o]=(0,je.useState)(!1),s=(0,je.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,je.useEffect)(Xm,[]);let{hoverProps:c,triggerHoverEnd:l}=(0,je.useMemo)((()=>{let e=(e,n)=>{if(s.pointerType=n,i||"touch"===n||s.isHovered||!e.currentTarget.contains(e.target))return;s.isHovered=!0;let a=e.currentTarget;s.target=a,t&&t({type:"hoverstart",target:a,pointerType:n}),r&&r(!0),o(!0)},a=(e,t)=>{if(s.pointerType="",s.target=null,"touch"===t||!s.isHovered)return;s.isHovered=!1;let i=e.currentTarget;n&&n({type:"hoverend",target:i,pointerType:t}),r&&r(!1),o(!1)},c={};return"undefined"!=typeof PointerEvent?(c.onPointerEnter=t=>{Km&&"mouse"===t.pointerType||e(t,t.pointerType)},c.onPointerLeave=e=>{!i&&e.currentTarget.contains(e.target)&&a(e,e.pointerType)}):(c.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},c.onMouseEnter=t=>{s.ignoreEmulatedMouseEvents||Km||e(t,"mouse"),s.ignoreEmulatedMouseEvents=!1},c.onMouseLeave=e=>{!i&&e.currentTarget.contains(e.target)&&a(e,"mouse")}),{hoverProps:c,triggerHoverEnd:a}}),[t,r,n,i,s]);return(0,je.useEffect)((()=>{i&&l({currentTarget:s.target},s.pointerType)}),[i]),{hoverProps:c,isHovered:a}}function tg(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,a=(0,je.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1,onInteractOutside:r,onInteractOutsideStart:i}).current;a.onInteractOutside=r,a.onInteractOutsideStart=i,(0,je.useEffect)((()=>{if(n)return;let e=e=>{rg(e,t)&&a.onInteractOutside&&(a.onInteractOutsideStart&&a.onInteractOutsideStart(e),a.isPointerDown=!0)};if("undefined"!=typeof PointerEvent){let r=e=>{a.isPointerDown&&a.onInteractOutside&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",r,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",r,!0)}}{let r=e=>{a.ignoreEmulatedMouseEvents?a.ignoreEmulatedMouseEvents=!1:a.isPointerDown&&a.onInteractOutside&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))},n=e=>{a.ignoreEmulatedMouseEvents=!0,a.onInteractOutside&&a.isPointerDown&&rg(e,t)&&(a.isPointerDown=!1,a.onInteractOutside(e))};return document.addEventListener("mousedown",e,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",n,!0),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("mouseup",r,!0),document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",n,!0)}}}),[t,a,n])}function rg(e,t){if(e.button>0)return!1;if(e.target){const t=e.target.ownerDocument;if(!t||!t.documentElement.contains(e.target))return!1}return t.current&&!t.current.contains(e.target)}function ng(e){if(!e)return;let t=!0;return r=>{let n={...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(n),t&&r.stopPropagation()}}function ig(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ng(e.onKeyDown),onKeyUp:ng(e.onKeyUp)}}}function ag(e){if("virtual"===Lm){let t=document.activeElement;tm((()=>{document.activeElement===t&&document.contains(e)&&Yh(e)}))}else Yh(e)}function og(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;let{display:t,visibility:r}=e.style,n="none"!==t&&"hidden"!==r&&"collapse"!==r;if(n){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:r,visibility:i}=t(e);n="none"!==r&&"hidden"!==i&&"collapse"!==i}return n}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||og(e.parentElement,e))}const sg=r(je).createContext(null);let cg=null;function lg(e){let{children:t,contain:n,restoreFocus:i,autoFocus:a}=e,o=(0,je.useRef)(),s=(0,je.useRef)(),c=(0,je.useRef)([]),l=(0,je.useContext)(sg);var d;let u=null!==(d=null==l?void 0:l.scopeRef)&&void 0!==d?d:null,p=(0,je.useMemo)((()=>cg&&kg.getTreeNode(cg)&&!yg(cg,u)?cg:u),[u]);Uh((()=>{let e=o.current.nextSibling,t=[];for(;e&&e!==s.current;)t.push(e),e=e.nextSibling;c.current=t}),[t,p]),kg.getTreeNode(p)&&!kg.getTreeNode(c)&&kg.addTreeNode(c,p),kg.getTreeNode(c).contain=n,function(e,t,r){Uh((()=>{if(t||r)return;let n=e.current,i=t=>{let r=t.target;gg(r,e.current)?cg=e:mg(r)||(cg=null)};return document.addEventListener("focusin",i,!1),n.forEach((e=>e.addEventListener("focusin",i,!1))),()=>{document.removeEventListener("focusin",i,!1),n.forEach((e=>e.removeEventListener("focusin",i,!1)))}}),[e,t,r])}(c,i,n),function(e,t){let r=(0,je.useRef)(),n=(0,je.useRef)(null);Uh((()=>{let i=e.current;if(!t)return void(n.current&&(cancelAnimationFrame(n.current),n.current=null));let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!hg(e))return;let r=document.activeElement,n=e.current;if(!gg(r,n))return;let i=xg(fg(n),{tabbable:!0},n);i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&bg(a,!0)},o=t=>{cg&&!yg(cg,e)||!gg(t.target,e.current)?hg(e)&&!vg(t.target,e)?r.current?r.current.focus():cg&&wg(cg.current):hg(e)&&(r.current=t.target):(cg=e,r.current=t.target)},s=t=>{n.current=requestAnimationFrame((()=>{hg(e)&&!vg(document.activeElement,e)&&(cg=e,document.body.contains(t.target)?(r.current=t.target,r.current.focus()):cg&&wg(cg.current))}))};return document.addEventListener("keydown",a,!1),document.addEventListener("focusin",o,!1),i.forEach((e=>e.addEventListener("focusin",o,!1))),i.forEach((e=>e.addEventListener("focusout",s,!1))),()=>{document.removeEventListener("keydown",a,!1),document.removeEventListener("focusin",o,!1),i.forEach((e=>e.removeEventListener("focusin",o,!1))),i.forEach((e=>e.removeEventListener("focusout",s,!1)))}}),[e,t]),(0,je.useEffect)((()=>()=>{n.current&&cancelAnimationFrame(n.current)}),[n])}(c,n),function(e,t,r){const n=(0,je.useRef)("undefined"!=typeof document?document.activeElement:null);Uh((()=>{let n=e.current;if(!t||r)return;let i=()=>{cg&&!yg(cg,e)||(cg=e)};return document.addEventListener("focusin",i,!1),n.forEach((e=>e.addEventListener("focusin",i,!1))),()=>{document.removeEventListener("focusin",i,!1),n.forEach((e=>e.removeEventListener("focusin",i,!1)))}}),[e,r]),Uh((()=>{if(!t)return;kg.getTreeNode(e).nodeToRestore=n.current;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey)return;let r=document.activeElement;if(!gg(r,e.current))return;let n=kg.getTreeNode(e).nodeToRestore,i=xg(document.body,{tabbable:!0});i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();if(document.body.contains(n)&&n!==document.body||(n=null,kg.getTreeNode(e).nodeToRestore=null),(!a||!gg(a,e.current))&&n){i.currentNode=n;do{a=t.shiftKey?i.previousNode():i.nextNode()}while(gg(a,e.current));t.preventDefault(),t.stopPropagation(),a?bg(a,!0):mg(n)?bg(n,!0):r.blur()}};return r||document.addEventListener("keydown",i,!0),()=>{r||document.removeEventListener("keydown",i,!0);let n=kg.getTreeNode(e).nodeToRestore;if(t&&n&&(gg(document.activeElement,e.current)||document.activeElement===document.body&&function(e){let t=kg.getTreeNode(cg);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=kg.clone();requestAnimationFrame((()=>{if(document.activeElement===document.body){let r=t.getTreeNode(e);for(;r;){if(r.nodeToRestore&&document.body.contains(r.nodeToRestore))return void bg(r.nodeToRestore);r=r.parent}for(r=t.getTreeNode(e);r;){if(r.scopeRef&&kg.getTreeNode(r.scopeRef))return void wg(r.scopeRef.current,!0);r=r.parent}}}))}}}),[e,t,r])}(c,i,n),function(e,t){const n=r(je).useRef(t);(0,je.useEffect)((()=>{n.current&&(cg=e,gg(document.activeElement,cg.current)||wg(e.current)),n.current=!1}),[e])}(c,a),Uh((()=>{if(c)return()=>{let e=kg.getTreeNode(c).parent.scopeRef;c!==cg&&!yg(c,cg)||e&&!kg.getTreeNode(e)||(cg=e),kg.removeTreeNode(c)}}),[c,p]);let f=function(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:a,accept:o}=t,s=n||document.activeElement,c=r[0].previousElementSibling,l=xg(fg(r),{tabbable:i,accept:o},r);l.currentNode=gg(s,r)?s:c;let d=l.nextNode();return!d&&a&&(l.currentNode=c,d=l.nextNode()),d&&bg(d,!0),d},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:a,accept:o}=t,s=n||document.activeElement,c=r[r.length-1].nextElementSibling,l=xg(fg(r),{tabbable:i,accept:o},r);l.currentNode=gg(s,r)?s:c;let d=l.previousNode();return!d&&a&&(l.currentNode=c,d=l.previousNode()),d&&bg(d,!0),d},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,a=xg(fg(r),{tabbable:n,accept:i},r);a.currentNode=r[0].previousElementSibling;let o=a.nextNode();return o&&bg(o,!0),o},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,a=xg(fg(r),{tabbable:n,accept:i},r);a.currentNode=r[r.length-1].nextElementSibling;let o=a.previousNode();return o&&bg(o,!0),o}}}(c);return r(je).createElement(sg.Provider,{value:{scopeRef:c,focusManager:f}},r(je).createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,r(je).createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const dg=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],ug=dg.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";dg.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const pg=dg.join(':not([hidden]):not([tabindex="-1"]),');function fg(e){return e[0].parentElement}function hg(e){let t=kg.getTreeNode(cg);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function mg(e){return vg(e)}function gg(e,t){return t.some((t=>t.contains(e)))}function vg(e,t=null){for(let{scopeRef:r}of kg.traverse(kg.getTreeNode(t)))if(gg(e,r.current))return!0;return!1}function yg(e,t){var r;let n=null===(r=kg.getTreeNode(t))||void 0===r?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function bg(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch(e){}}else try{ag(e)}catch(e){}}function wg(e,t=!0){let r=e[0].previousElementSibling,n=xg(fg(e),{tabbable:t},e);n.currentNode=r;let i=n.nextNode();t&&!i&&(n=xg(fg(e),{tabbable:!1},e),n.currentNode=r,i=n.nextNode()),bg(i)}function xg(e,t,r){let n=(null==t?void 0:t.tabbable)?pg:ug,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return(null==t||null===(i=t.from)||void 0===i?void 0:i.contains(e))?NodeFilter.FILTER_REJECT:!e.matches(n)||!og(e)||r&&!gg(e,r)||(null==t?void 0:t.accept)&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return(null==t?void 0:t.from)&&(i.currentNode=t.from),i}class Sg{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(null!=t?t:null),i=new _g({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e),r=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef.current&&gg(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let n=t.children;r.removeChild(t),n.length>0&&n.forEach((e=>r.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.length>0)for(let t of e.children)yield*this.traverse(t)}clone(){let e=new Sg;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent.scopeRef,t.nodeToRestore);return e}constructor(){Dh(this,"fastMap",new Map),this.root=new _g({scopeRef:null}),this.fastMap.set(null,this.root)}}class _g{addChild(e){this.children.push(e),e.parent=this}removeChild(e){this.children.splice(this.children.indexOf(e),1),e.parent=void 0}constructor(e){Dh(this,"children",[]),Dh(this,"contain",!1),this.scopeRef=e.scopeRef}}let kg=new Sg;function Eg(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,i=(0,je.useRef)({isFocused:!1,isFocusVisible:t||qm()}),[a,o]=(0,je.useState)(!1),[s,c]=(0,je.useState)((()=>i.current.isFocused&&i.current.isFocusVisible)),l=(0,je.useCallback)((()=>c(i.current.isFocused&&i.current.isFocusVisible)),[]),d=(0,je.useCallback)((e=>{i.current.isFocused=e,o(e),l()}),[l]);Gm((e=>{i.current.isFocusVisible=e,l()}),[],{isTextInput:r});let{focusProps:u}=Mm({isDisabled:n,onFocusChange:d}),{focusWithinProps:p}=Zm({isDisabled:!n,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:i.current.isFocused&&s,focusProps:n?p:u}}let Cg=r(je).createContext(null);r(je).forwardRef((function(e,t){let{children:n,...i}=e,a={...i,ref:t};return r(je).createElement(Cg.Provider,{value:a},n)}));function Pg(e,t){let{focusProps:r}=Mm(e),{keyboardProps:n}=ig(e),i=$h(r,n),a=function(e){let t=(0,je.useContext)(Cg)||{};nm(t,e);let{ref:r,...n}=t;return n}(t),o=e.isDisabled?{}:a,s=(0,je.useRef)(e.autoFocus);return(0,je.useEffect)((()=>{s.current&&t.current&&ag(t.current),s.current=!1}),[t]),{focusableProps:$h({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},o)}}function Rg(e,t){let r,{elementType:n="button",isDisabled:i,onPress:a,onPressStart:o,onPressEnd:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:d,onClick:u,href:p,target:f,rel:h,type:m="button"}=e;r="button"===n?{type:m,disabled:i}:{role:"button",tabIndex:i?void 0:0,href:"a"===n&&i?void 0:p,target:"a"===n?f:void 0,type:"input"===n?m:void 0,disabled:"input"===n?i:void 0,"aria-disabled":i&&"input"!==n?i:void 0,rel:"a"===n?h:void 0};let{pressProps:g,isPressed:v}=wm({onPressStart:o,onPressEnd:s,onPressChange:c,onPress:a,isDisabled:i,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Pg(e,t);d&&(y.tabIndex=i?-1:y.tabIndex);let b=$h(y,g,Kh(e,{labelable:!0}));return{isPressed:v,buttonProps:$h(r,b,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:e=>{u&&(u(e),console.warn("onClick is deprecated, please use onPress"))}})}}function Tg(e,t,r){const{isSelected:n}=t,{isPressed:i,buttonProps:a}=Rg({...e,onPress:Wh(t.toggle,e.onPress)},r);return{isPressed:i,buttonProps:$h(a,{"aria-pressed":n})}}function jg(e={}){let{isReadOnly:t}=e,[r,n]=Mh(e.isSelected,e.defaultSelected||!1,e.onChange);return{isSelected:r,setSelected:function(e){t||n(e)},toggle:function(){t||n(!r)}}}function Og(e){const t=(0,je.useRef)(null);return(0,je.useEffect)((()=>{e&&("function"==typeof e?e(t.current):e.current=t.current)})),t}const Mg=(0,je.forwardRef)((function({children:e,...t},n){const i=Og(n);let a=jg(t);const{buttonProps:s}=Tg(t,a,i),{isFocusVisible:c,focusProps:l}=Eg();return(0,o.jsx)("button",{className:r(Ih)("w-[76px] h-[40px]",t.isSelected?"bg-[#FFFFFF]":"bg-[#FFFFFF] opacity-[0.4]","rounded-full","text-black","flex items-center justify-center gap-[5px]","text-base font-medium","transition-colors ease-in-out","focus:outline-none",{"ring-[3px] ring-cta":c,"cursor-not-allowed":s.disabled}),...s,...l,ref:i,children:e})}));je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2"),je=a("85Hg2");new Map,new Map;new Map;new Map;new Map;new Map;let Lg=!1;try{Lg="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch(g){}let Ig=!1;try{Ig="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch(e){}new RegExp("^.*\\(.*\\).*$");new Map;new Set(["decimal","fraction","integer","minusSign","plusSign","group"]);const Dg=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Ag=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ng(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script;return Dg.has(t)}let t=e.split("-")[0];return Ag.has(t)}function Fg(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch(t){e="en-US"}return{locale:e,direction:Ng(e)?"rtl":"ltr"}}Fg(),new Set;r(je).createContext(null);new WeakMap;new Map;je=a("85Hg2");"undefined"!=typeof window&&window.visualViewport;new WeakMap;"undefined"!=typeof window&&window.visualViewport;const zg=[];function Bg(e,t){let{onClose:r,shouldCloseOnBlur:n,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e;(0,je.useEffect)((()=>(i&&zg.push(t),()=>{let e=zg.indexOf(t);e>=0&&zg.splice(e,1)})),[i,t]);let c=()=>{zg[zg.length-1]===t&&r&&r()};tg({ref:t,onInteractOutside:a?e=>{s&&!s(e.target)||(zg[zg.length-1]===t&&(e.stopPropagation(),e.preventDefault()),c())}:null,onInteractOutsideStart:e=>{s&&!s(e.target)||zg[zg.length-1]===t&&(e.stopPropagation(),e.preventDefault())}});let{focusWithinProps:l}=Zm({isDisabled:!n,onBlurWithin:e=>{e.relatedTarget&&vg(e.relatedTarget,cg)||(s&&!s(e.relatedTarget)||r())}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||o||(e.stopPropagation(),e.preventDefault(),c())},...l},underlayProps:{onPointerDown:e=>{e.target===e.currentTarget&&e.preventDefault()}}}}const Ug="undefined"!=typeof window&&window.visualViewport,Vg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Hg,Wg=0;function $g(e={}){let{isDisabled:t}=e;Uh((()=>{if(!t)return Wg++,1===Wg&&(Hg=pm()?function(){let e,t=0,r=r=>{e=im(r.target),e===document.documentElement&&e===document.body||(t=r.changedTouches[0].pageY)},n=r=>{if(e===document.documentElement||e===document.body)return void r.preventDefault();let n=r.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;(i<=0&&n>t||i>=a&&n<t)&&r.preventDefault(),t=n},i=e=>{let t=e.target;Kg(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame((()=>{t.style.transform=""})))},a=e=>{let t=e.target;Kg(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame((()=>{t.style.transform="",Ug&&(Ug.height<window.innerHeight?requestAnimationFrame((()=>{Zg(t)})):Ug.addEventListener("resize",(()=>Zg(t)),{once:!0}))})))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=Wh(qg(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"),qg(document.documentElement,"overflow","hidden"),qg(document.body,"marginTop",`-${c}px`));window.scrollTo(0,0);let d=Wh(Gg(document,"touchstart",r,{passive:!1,capture:!0}),Gg(document,"touchmove",n,{passive:!1,capture:!0}),Gg(document,"touchend",i,{passive:!1,capture:!0}),Gg(document,"focus",a,!0),Gg(window,"scroll",o));return()=>{l(),d(),window.scrollTo(s,c)}}():Wh(qg(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"),qg(document.documentElement,"overflow","hidden"))),()=>{Wg--,0===Wg&&Hg()}}),[t])}function qg(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Gg(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Zg(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=im(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;n>r+e.clientHeight&&(t.scrollTop+=n-r)}e=t.parentElement}}function Kg(e){return e instanceof HTMLInputElement&&!Vg.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}r(je).createContext(null);let Yg=new WeakMap,Qg=[];function Jg(e,t=document.body){let r=new Set(e),n=new Set,i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>((t instanceof HTMLElement||t instanceof SVGElement)&&"true"===t.dataset.liveAnnouncer&&r.add(t),r.has(t)||n.has(t.parentElement)&&"row"!==t.parentElement.getAttribute("role")?NodeFilter.FILTER_REJECT:e.some((e=>t.contains(e)))?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT)}),a=e=>{var t;let r=null!==(t=Yg.get(e))&&void 0!==t?t:0;"true"===e.getAttribute("aria-hidden")&&0===r||(0===r&&e.setAttribute("aria-hidden","true"),n.add(e),Yg.set(e,r+1))};Qg.length&&Qg[Qg.length-1].disconnect();let o=i.nextNode();for(;null!=o;)a(o),o=i.nextNode();let s=new MutationObserver((e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...r,...n].some((e=>e.contains(t.target))))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&"true"===e.dataset.liveAnnouncer?r.add(e):e instanceof Element&&a(e)}));s.observe(t,{childList:!0,subtree:!0});let c={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return Qg.push(c),()=>{s.disconnect();for(let e of n){let t=Yg.get(e);1===t?(e.removeAttribute("aria-hidden"),Yg.delete(e)):Yg.set(e,t-1)}c===Qg[Qg.length-1]?(Qg.pop(),Qg.length&&Qg[Qg.length-1].observe()):Qg.splice(Qg.indexOf(c),1)}}const Xg=r(je).createContext(null);function ev(e){let t=Fh(),{portalContainer:n=(t?null:document.body)}=e,[i,a]=(0,je.useState)(!1),o=(0,je.useMemo)((()=>({contain:i,setContain:a})),[i,a]);if(!n)return null;let s=r(je).createElement(Xg.Provider,{value:o},r(je).createElement(lg,{restoreFocus:!0,contain:i},e.children));return r(c).createPortal(s,n)}function tv(e,t,r){let{overlayProps:n,underlayProps:i}=Bg({...e,isOpen:t.isOpen,onClose:t.close},r);return $g({isDisabled:!t.isOpen}),function(){let e=(0,je.useContext)(Xg),t=null==e?void 0:e.setContain;Uh((()=>{null==t||t(!0)}),[t])}(),(0,je.useEffect)((()=>{if(t.isOpen)return Jg([r.current])}),[t.isOpen,r]),{modalProps:$h(n),underlayProps:i}}function rv(){return rv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rv.apply(this,arguments)}function nv(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function iv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Vr(e,t)}function av(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}je=a("85Hg2"),je=a("85Hg2");var ov={disabled:!1},sv=r(je=a("85Hg2")).createContext(null),cv=function(e){return e.scrollTop},lv="unmounted",dv="exited",uv="entering",pv="entered",fv="exiting",hv=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=dv,n.appearStatus=uv):i=pv:i=t.unmountOnExit||t.mountOnEnter?lv:dv,n.state={status:i},n.nextCallback=null,n}iv(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===lv?{status:dv}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==uv&&r!==pv&&(t=uv):r!==uv&&r!==pv||(t=fv)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===uv){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:r(c).findDOMNode(this);n&&cv(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===dv&&this.setState({status:lv})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,a=this.props.nodeRef?[i]:[r(c).findDOMNode(this),i],o=a[0],s=a[1],l=this.getTimeouts(),d=i?l.appear:l.enter;!e&&!n||ov.disabled?this.safeSetState({status:pv},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,s),this.safeSetState({status:uv},(function(){t.props.onEntering(o,s),t.onTransitionEnd(d,(function(){t.safeSetState({status:pv},(function(){t.props.onEntered(o,s)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:r(c).findDOMNode(this);t&&!ov.disabled?(this.props.onExit(i),this.safeSetState({status:fv},(function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:dv},(function(){e.props.onExited(i)}))}))}))):this.safeSetState({status:dv},(function(){e.props.onExited(i)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:r(c).findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=a[0],s=a[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===lv)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,nv(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r(je).createElement(sv.Provider,{value:null},"function"==typeof n?n(e,i):r(je).cloneElement(r(je).Children.only(n),i))},t}(r(je).Component);function mv(){}hv.contextType=sv,hv.propTypes={},hv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:mv,onEntering:mv,onEntered:mv,onExit:mv,onExiting:mv,onExited:mv},hv.UNMOUNTED=lv,hv.EXITED=dv,hv.ENTERING=uv,hv.ENTERED=pv,hv.EXITING=fv;var gv=hv,vv=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},yv=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=av(r.className,n):r.setAttribute("class",av(r.className&&r.className.baseVal||"",n)));var r,n}))},bv=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1];t.removeClasses(i,"exit"),t.addClass(i,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.addClass(i,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.removeClasses(i,a),t.addClass(i,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,i=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:i,activeClassName:n?i+"-active":r[e+"Active"],doneClassName:n?i+"-done":r[e+"Done"]}},t}iv(t,e);var n=t.prototype;return n.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&cv(e),n&&(this.appliedClasses[t][r]=n,vv(e,n))},n.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,a=r.done;this.appliedClasses[t]={},n&&yv(e,n),i&&yv(e,i),a&&yv(e,a)},n.render=function(){var e=this.props,t=(e.classNames,nv(e,["classNames"]));return r(je).createElement(gv,rv({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r(je).Component);bv.defaultProps={classNames:""},bv.propTypes={};var wv=bv;const xv=(0,(je=a("85Hg2")).forwardRef)((function({children:e,variant:t="primary",size:n="medium",fullWidth:i=!1,form:a,className:s,...c},l){const d=Og(l),{buttonProps:u,isPressed:p}=Rg(c,d),{isFocusVisible:f,focusProps:h}=Eg(),{hoverProps:m,isHovered:g}=eg({isDisabled:u.disabled}),v=g||f||p,y={primary:r(Ih)(v?"bg-primaryLight":"bg-primary","text-white disabled:bg-secondaryLight"),secondary:r(Ih)(v?"bg-graySelected":"bg-transparent","text-primary border border-secondaryLight disabled:text-secondaryLight disabled:bg-graySelected"),basic:r(Ih)(v?"bg-graySelected":"bg-white","text-primary disabled:text-secondaryLight disabled:bg-graySelected"),custom:""};return(0,o.jsx)("button",{className:r(Ih)({large:"py-3 px-4 text-base rounded-lg",medium:"py-[9px] px-3.5 text-base rounded-lg",small:"py-2 px-3 text-sm rounded-lg",extraSmall:"py-1.5 px-2.5 text-xs rounded-md",custom:""}[n],y[t],"flex items-center justify-center gap-[5px] font-medium","transition-colors ease-in-out","focus:outline-none",{"ring-[3px] ring-cta":f,"cursor-not-allowed":u.disabled,"w-full":i},s),...u,...h,...m,form:a,ref:d,children:e})}));function Sv(e){const{children:t,state:n,size:i="small",title:a,description:s,primaryAction:c,secondaryAction:l,centered:d=!1}=e,u=r(je).useRef(null),{modalProps:p,underlayProps:f}=tv({isDismissable:!0,...e},n,u),[h,m]=(0,je.useState)(!n.isOpen),g=sm().height-64;return!n.isOpen&&h?null:(0,o.jsx)(ev,{children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,onEntered:()=>m(!1),onExited:()=>m(!0),timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-1 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:"fixed z-[100] inset-0 bg-black bg-opacity-90 flex justify-center items-center inter",...f,children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,nodeRef:u,timeout:{enter:0,exit:300},classNames:{appear:"translate-y-2",appearDone:"translate-y-0 transition ease-in",exit:"translate-y-2 transition ease-out"},children:(0,o.jsx)("div",{...p,ref:u,className:r(Ih)("bg-white rounded-[10px] z-[1] overflow-x-auto focus:outline-none",{small:"max-w-[400px] mx-[20px]",medium:"max-w-[600px]",large:"max-w-[800px]"}[i]),style:{maxHeight:`${g}px`},children:(0,o.jsxs)("div",{className:"flex flex-col gap-5 px-5 py-[25px] max-h-[inherit]",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-5 overflow-auto",children:[(0,o.jsxs)("div",{className:r(Ih)("flex flex-col gap-[5px]",{"text-center":d}),children:[(0,o.jsx)("h2",{className:"text-xl font-medium",children:a}),s&&(0,o.jsx)("p",{className:"text-sm text-secondary",children:s})]}),t]}),(c||l)&&(0,o.jsxs)("div",{className:r(Ih)("flex justify-end gap-2.5",d?"justify-center":"justify-end"),children:["string"==typeof l&&(0,o.jsx)(xv,{variant:"secondary",onPress:n.close,fullWidth:d,children:l}),"function"==typeof l&&l({close:n.close}),"string"==typeof c&&(0,o.jsx)(xv,{onPress:n.close,fullWidth:d,children:c}),"function"==typeof c&&c({close:n.close})]})]})})})})})})}const _v=()=>(0,o.jsxs)("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 2.167a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M6.76 5.65a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",fill:"#F12828"})]}),kv=()=>(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M7.5 6.667h5a.833.833 0 0 1 .833.833v5a.833.833 0 0 1-.834.834h-5a.833.833 0 0 1-.833-.834v-5a.833.833 0 0 1 .833-.833Z",fill:"#F12828"})]}),Ev=()=>(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"inline"},transform:"translate(0 -1)",children:[(0,o.jsx)("path",{d:"M10 1.667a8.333 8.333 0 1 0 0 16.666 8.333 8.333 0 0 0 0-16.666Zm0 15a6.666 6.666 0 1 1 0-13.333 6.666 6.666 0 0 1 0 13.333Z",fill:"#1D1C20"}),(0,o.jsx)("path",{d:"M6.76 5.15a5.833 5.833 0 1 1 6.481 9.7 5.833 5.833 0 0 1-6.481-9.7Z",fill:"#1D1C20"})]}),Cv=({children:e})=>(0,o.jsx)("span",{className:"w-full text-base text-primaryLight font-normal leading-[20px]",children:e}),Pv=({children:e})=>(0,o.jsx)("span",{className:"text-primary font-medium",children:e}),Rv=({children:e,index:t})=>(0,o.jsxs)("div",{className:"flex flex-row justify-center gap-[5px]",children:[(0,o.jsx)("div",{className:"flex items-center justify-center min-w-[24px] h-[24px] rounded-[50%] bg-secondaryVLight",children:t}),e]}),Tv=({state:e,type:t})=>{const[r,n]=(0,je.useState)("idle"),[i,a]=(0,je.useState)(!1),{orientation:s}=(0,je.useContext)(Go),c="landscape"===s?"desktop":"mobile",l="granted"===r?"short":"full",d="picture"===t?"photo":"video",u=()=>n("granted"),p=()=>a(!0),f=()=>a(!1),h=(0,je.useRef)(null),m=(0,je.useMemo)((()=>"refused"===r?"Something went wrong!":"picture"===t?"Ready to take a shot?":"Ready to record a video?"),[r,t]);(0,je.useEffect)((()=>(qo.addEventListener("localVideoAvailable",u),qo.addEventListener("microphoneEnabled",u),qo.addEventListener("enterRoom",p),qo.addEventListener("leaveRoom",f),()=>{qo.removeEventListener("localVideoAvailable",u),qo.removeEventListener("microphoneEnabled",u),qo.removeEventListener("enterRoom",p),qo.removeEventListener("leaveRoom",f)})),[]);const g=Number("granted"!==r);return(0,o.jsx)(Sv,{title:m,state:e,centered:"refused"!==r,isDismissable:!1,primaryAction:()=>(0,o.jsx)(o.Fragment,{children:"refused"===r?(0,o.jsx)(xv,{fullWidth:!0,onPress:()=>window.location.reload(),children:"Allow access"}):(0,o.jsx)(o.Fragment,{children:"granted"===r?(0,o.jsx)(xv,{fullWidth:!0,onPress:e.close,children:"Okay"}):(0,o.jsxs)(xv,{fullWidth:!0,isDisabled:"requesting"===r||!1===i,onPress:async()=>{n("requesting");try{(await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})).getTracks().forEach((e=>e.stop())),await qo.enableMicrophone(),await qo.enableVideo({resolution:"vga",frameRate:20,facingMode:"environment"})}catch{n("refused")}},children:[(0,o.jsx)(Pp,{}),"Allow access to cam/mic"]})})}),children:(0,o.jsxs)("div",{className:"flex flex-col gap-[20px]",children:[(0,o.jsx)("div",{className:"flex flex-col gap-[10px]",ref:h,children:"refused"===r?(0,o.jsx)(Cv,{children:"Without camera and microphone access, you can't take photos or videos to share with the support team. Please grant access in your browser settings."}):(0,o.jsxs)(o.Fragment,{children:["granted"!==r&&(0,o.jsx)(Rv,{index:1,children:(0,o.jsxs)(Cv,{children:["When prompted, ",(0,o.jsx)(Pv,{children:"allow access"})," to camera and microphone."]})}),"picture"===t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rv,{index:1+g,children:(0,o.jsxs)(Cv,{children:["Tap the ",(0,o.jsx)(Ev,{}),(0,o.jsx)(Pv,{children:" Camera button"})," to take a photo."]})}),(0,o.jsx)(Rv,{index:2+g,children:(0,o.jsx)(Cv,{children:"Don't hesitate to take multiple photos for more detail."})}),(0,o.jsx)(Rv,{index:3+g,children:(0,o.jsxs)(Cv,{children:["You can review your photo and then ",(0,o.jsx)(Pv,{children:"send it when you're done."})]})})]}),"video"===t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rv,{index:1+g,children:(0,o.jsxs)(Cv,{children:["Tap the ",(0,o.jsx)(_v,{}),(0,o.jsx)(Pv,{children:" Record button"})," to start a recording."]})}),(0,o.jsx)(Rv,{index:2+g,children:(0,o.jsxs)(Cv,{children:["You can ",(0,o.jsx)(Pv,{children:"speak during"})," the recording for added detail."]})}),(0,o.jsx)(Rv,{index:3+g,children:(0,o.jsxs)(Cv,{children:["When you're finished, tap the ",(0,o.jsx)(kv,{}),(0,o.jsx)(Pv,{children:" Stop button"}),"."]})}),(0,o.jsx)(Rv,{index:4+g,children:(0,o.jsxs)(Cv,{children:["You can review your video and then ",(0,o.jsx)(Pv,{children:"send it when you're done"}),"."]})})]})]})}),"refused"!==r&&(0,o.jsx)("div",{className:"flex items-center justify-center rounded-[8px] overflow-hidden",children:(0,o.jsx)("video",{src:`https://stream-assets.snapcall.io/animations/${c}-assist-onboarding-${d}-${l}.mp4`,playsInline:!0,autoPlay:!0,muted:!0,loop:!0})})]})})};je=a("85Hg2");const jv=({state:e,setReady:t})=>{const r=(0,je.useRef)(null),{options:n}=(0,je.useContext)(Go),[i,{width:a}]=Fs();return(0,je.useEffect)((()=>{const e=n.sharedURL||window.location.href;Jl(r.current,e,{width:a>300?300:a,errorCorrectionLevel:"Q",margin:0})}),[a,n.sharedURL]),(0,o.jsx)(Sv,{centered:!0,title:"Switch to your mobile",description:"Enjoy an even more convenient experience by using your phone to take photos and record videos.",isDismissable:!1,state:e,primaryAction:()=>(0,o.jsx)(xv,{fullWidth:!0,onPress:()=>{t(!0),e.close()},children:"Use desktop version"}),children:(0,o.jsxs)("div",{className:"flex flex-col gap-[20px]",children:[(0,o.jsxs)("div",{ref:i,className:"flex flex-1 items-center justify-center relative",children:[(0,o.jsx)("div",{className:"absolute w-1/3 h-1/3 max-w-[70px] max-h-[70px] flex items-center justify-center",children:(0,o.jsx)(xp,{})}),(0,o.jsx)("canvas",{ref:r})]}),(0,o.jsx)("p",{className:"flex items-center justify-center text-xs text-primaryLight text-center",children:"Scan this QR code with a compatible device."})]})})};function Ov({mode:e}){const{orientation:t}=(0,je.useContext)(Go),r="landscape"===t,[n,i]=(0,je.useState)(!r);(0,je.useEffect)((()=>{n&&(o("photo"===e&&n),c("video"===e&&n))}),[n,e]);const[a,o]=(0,je.useState)("photo"===e&&n),[s,c]=(0,je.useState)("video"===e&&n);return{photoInstructionsModalState:Lh({isOpen:a,onOpenChange:o}),videoInstructionsModalState:Lh({isOpen:s,onOpenChange:c}),ready:n,setReady:i}}const Mv=({state:e})=>{const[t,r]=(0,je.useState)(!e.ready),n=Lh({isOpen:t,onOpenChange:r});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Tv,{state:e.photoInstructionsModalState,type:"picture"}),(0,o.jsx)(Tv,{state:e.videoInstructionsModalState,type:"video"}),(0,o.jsx)(jv,{state:n,setReady:e.setReady})]})};function Lv({photo:e=!0}){const[t,r]=(0,je.useState)(e),[n,i]=(0,je.useState)(!1);return{photo:t,setPhoto:r,streaming:n,setStreaming:i}}const Iv=e=>{const t=Ov({mode:e.state.photo?"photo":"video"});return(0,o.jsxs)("div",{className:"flex flex-col bg-primary h-[150px] w-full max-w-[400px] rounded-[15px] p-2.5 gap-2.5",children:[(0,o.jsx)(Mv,{state:t}),(0,o.jsxs)("div",{className:"flex flex-1 flex-row px-[10px] w-full",children:[(0,o.jsxs)("div",{className:"flex flex-row flex-auto items-center gap-[10px]",children:[(0,o.jsx)(as,{}),(0,o.jsx)("div",{className:" text-white text-base font-medium",children:"SnapCall"})]}),(0,o.jsxs)("div",{className:"flex flex-row justify-end flex-auto items-center gap-[10px] ",children:[(0,o.jsx)(Mg,{onPress:()=>{e.state.streaming||(e.state.setPhoto(!0),t.photoInstructionsModalState.open())},isSelected:e.state.photo,children:"Photo"}),(0,o.jsx)(Mg,{onPress:()=>{e.state.streaming||(e.state.setPhoto(!1),t.videoInstructionsModalState.open())},isSelected:!e.state.photo,children:"Video"})]})]}),(0,o.jsxs)("div",{className:"flex flex-row flex-1 items-center justify-between w-full ",children:[(0,o.jsx)("div",{className:"w-[60px] h-[60px]",children:e.thumbnail}),(0,o.jsx)("div",{className:"bg-white rounded-full w-[72px] h-[72px] p-[3px]",onClick:()=>e.onCapturePress(),children:(0,o.jsx)("div",{className:"bg-primary rounded-full w-full h-full p-[3px] flex items-center justify-center cursor-pointer",children:(0,o.jsx)("div",{className:r(Ih)("w-full h-full transition-[transform,border-radius] duration-300",e.state.photo?"bg-white":"bg-[#f12828]",e.state.streaming?"rounded-[5px] scale-[0.4]":"rounded-[60px]")})})}),(0,o.jsx)("div",{onClick:e.onSwitch,className:"bg-[#565656] rounded-full w-[56px] h-[56px] flex items-center justify-center cursor-pointer",children:(0,o.jsx)(Nl,{})})]})]})};je=a("85Hg2"),je=a("85Hg2");function Dv(e){const{children:t,state:n}=e,i=r(je).useRef(null),{orientation:a}=(0,je.useContext)(Go),{modalProps:s,underlayProps:c}=tv(e,n,i),[l,d]=(0,je.useState)(!n.isOpen),u=sm().height-64,p="landscape"===a;return!n.isOpen&&l?null:(0,o.jsx)(ev,{children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,onEntered:()=>d(!1),onExited:()=>d(!0),timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-1 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:r(Ih)("fixed z-[100] inset-0 bg-underlay flex justify-center inter",p?"items-center":"items-end"),...c,children:(0,o.jsx)(wv,{in:n.isOpen,appear:!0,nodeRef:i,timeout:{enter:0,exit:300},classNames:{appear:p?"translate-y-[200%]":"translate-y-full",appearDone:"translate-y-0 transition duration-300 ease-out",exit:r(Ih)("transition ease-out",p?"translate-y-[200%]":"translate-y-full")},children:(0,o.jsx)("div",{...s,ref:i,className:r(Ih)("bg-white z-[1] overflow-auto focus:outline-none",p?"translate-y-[200%] rounded-[15px]":"translate-y-full rounded-t-[15px]"),style:{maxHeight:`${u}px`},children:t})})})})})}const Av=()=>(0,o.jsx)("svg",{width:"12",height:"15",viewBox:"0 0 12 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M11.103 5.747 2.677.272A1.614 1.614 0 0 0 1.773 0a1.62 1.62 0 0 0-.9.288 1.886 1.886 0 0 0-.64.733A2.235 2.235 0 0 0 0 2.025v10.95c0 .352.08.699.233 1.004.154.305.375.558.64.733.273.186.584.285.9.288.317.003.63-.091.904-.272l8.426-5.475c.272-.173.498-.427.656-.736.158-.308.241-.66.241-1.017a2.24 2.24 0 0 0-.24-1.017 1.884 1.884 0 0 0-.657-.736Z",fill:"#fff"})}),Nv=({asset:e,onClick:t})=>e?(0,o.jsxs)("div",{className:"flex items-center justify-center w-[60px] h-[60px] rounded-[8px] cursor-pointer bg-white relative overflow-hidden",onClick:t,children:["picture"===e?.type&&(0,o.jsx)("img",{className:"cursor-pointer bg-white",src:e.objectUrl,alt:"last shot"}),"video"===e?.type&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("video",{src:e.objectUrl,className:"min-w-[100%] min-h-[100%] object-cover"}),(0,o.jsx)("div",{className:"absolute left-0 top-0 flex items-center justify-center w-[60px] h-[60px] bg-primary opacity-50",children:(0,o.jsx)(Av,{})})]})]}):null,Fv=()=>(0,o.jsx)("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M7.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM15 5h-3v-.75A2.25 2.25 0 0 0 9.75 2h-1.5A2.25 2.25 0 0 0 6 4.25V5H3a.75.75 0 0 0 0 1.5h.75v8.25A2.25 2.25 0 0 0 6 17h6a2.25 2.25 0 0 0 2.25-2.25V6.5H15A.75.75 0 1 0 15 5Zm-7.5-.75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75V5h-3v-.75Zm5.25 10.5a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V6.5h7.5v8.25ZM10.5 14a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z",fill:"#fff"})}),zv=new Intl.DateTimeFormat("default",{dateStyle:"short"}),Bv=new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"});function Uv(e){const t=e.getHours()%12>=12?"PM":"AM";return`${zv.format(e)} at ${Bv.format(e)} ${t}`}const Vv=({asset:e,index:t,removeAsset:r})=>{const n=Lh({});return(0,o.jsxs)("div",{className:"flex flex-row justify-between items-center",children:[(0,o.jsx)(Sv,{title:"Confirm removal",state:n,description:"Are you sure you want to remove this photo/video? This action cannot be undone.",primaryAction:({close:t})=>(0,o.jsxs)(xv,{onPress:async()=>{await r(e),t()},children:[(0,o.jsx)(Fv,{}),"Confirm"]}),secondaryAction:"Cancel"}),(0,o.jsxs)("div",{className:"flex flex-row gap-[10px] items-center",children:[(0,o.jsx)(Nv,{asset:e}),(0,o.jsxs)("span",{className:"text-sm",style:{hyphens:"manual"},children:["picture"===e.type?"Photo":"Video"," ",t+1," ·"," ",Uv(new Date(e.timestamp))]})]}),(0,o.jsx)("span",{className:"text-xs font-bold underline cursor-pointer ml-[10px]",onClick:n.open,children:"Remove"})]},e.assetId)};je=a("85Hg2");
|
|
2076
2076
|
/*! *****************************************************************************
|
|
2077
2077
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2078
2078
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -2086,7 +2086,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
2086
2086
|
|
|
2087
2087
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
2088
2088
|
and limitations under the License.
|
|
2089
|
-
***************************************************************************** */var Hv=function(){return Hv=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Hv.apply(this,arguments)};var Wv=function(e){var t=e.animate,r=e.animateBegin,n=e.backgroundColor,i=e.backgroundOpacity,a=e.baseUrl,o=e.children,s=e.foregroundColor,c=e.foregroundOpacity,l=e.gradientRatio,d=e.gradientDirection,u=e.uniqueKey,p=e.interval,f=e.rtl,h=e.speed,m=e.style,g=e.title,v=e.beforeMask,y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["animate","animateBegin","backgroundColor","backgroundOpacity","baseUrl","children","foregroundColor","foregroundOpacity","gradientRatio","gradientDirection","uniqueKey","interval","rtl","speed","style","title","beforeMask"]),b=u||Math.random().toString(36).substring(6),w=b+"-diff",x=b+"-animated-diff",S=b+"-aria",_=f?{transform:"scaleX(-1)"}:null,k="0; "+p+"; 1",E=h+"s",C="top-bottom"===d?"rotate(90)":void 0;return(0,je.createElement)("svg",Hv({"aria-labelledby":S,role:"img",style:Hv(Hv({},m),_)},y),g?(0,je.createElement)("title",{id:S},g):null,v&&(0,je.isValidElement)(v)?v:null,(0,je.createElement)("rect",{role:"presentation",x:"0",y:"0",width:"100%",height:"100%",clipPath:"url("+a+"#"+w+")",style:{fill:"url("+a+"#"+x+")"}}),(0,je.createElement)("defs",null,(0,je.createElement)("clipPath",{id:w},o),(0,je.createElement)("linearGradient",{id:x,gradientTransform:C},(0,je.createElement)("stop",{offset:"0%",stopColor:n,stopOpacity:i},t&&(0,je.createElement)("animate",{attributeName:"offset",values:-l+"; "+-l+"; 1",keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})),(0,je.createElement)("stop",{offset:"50%",stopColor:s,stopOpacity:c},t&&(0,je.createElement)("animate",{attributeName:"offset",values:-l/2+"; "+-l/2+"; "+(1+l/2),keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})),(0,je.createElement)("stop",{offset:"100%",stopColor:n,stopOpacity:i},t&&(0,je.createElement)("animate",{attributeName:"offset",values:"0; 0; "+(1+l),keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})))))};Wv.defaultProps={animate:!0,backgroundColor:"#f5f6f7",backgroundOpacity:1,baseUrl:"",foregroundColor:"#eee",foregroundOpacity:1,gradientRatio:2,gradientDirection:"left-right",id:null,interval:.25,rtl:!1,speed:1.2,style:{},title:"Loading...",beforeMask:null};var $v=function(e){return e.children?(0,je.createElement)(Wv,Hv({},e)):(0,je.createElement)(qv,Hv({},e))},qv=function(e){return(0,je.createElement)($v,Hv({viewBox:"0 0 476 124"},e),(0,je.createElement)("rect",{x:"48",y:"8",width:"88",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"48",y:"26",width:"52",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"56",width:"410",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"72",width:"380",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"88",width:"178",height:"6",rx:"3"}),(0,je.createElement)("circle",{cx:"20",cy:"20",r:"20"}))},Gv=$v;const Zv=()=>(0,o.jsxs)("div",{className:"w-screen max-w-[400px] h-[235px] px-[20px] py-[25px] gap-[10px]",children:[(0,o.jsx)("div",{className:"w-[360px] h-[93px]",children:(0,o.jsxs)(Gv,{width:360,height:93,foregroundColor:"#EBEBEB",children:[(0,o.jsx)("rect",{x:0,y:0,rx:8,ry:8,width:230,height:16}),(0,o.jsx)("rect",{x:0,y:33,rx:8,ry:8,width:60,height:60}),(0,o.jsx)("rect",{x:70,y:56,rx:7,ry:7,width:180,height:14})]})}),(0,o.jsx)("div",{className:"flex items-center justify-center w-full h-[40px] rounded-[8px] border border-primaryLight mt-[10px]",children:(0,o.jsx)(Gv,{width:120,height:14,foregroundColor:"#EBEBEB",children:(0,o.jsx)("rect",{x:0,y:0,rx:7,ry:7,width:120,height:14})})}),(0,o.jsx)("div",{className:"flex items-center justify-center w-full h-[40px] rounded-[8px] bg-primary mt-[10px]",children:(0,o.jsx)(Gv,{width:120,height:14,foregroundColor:"#EBEBEB",children:(0,o.jsx)("rect",{x:0,y:0,rx:7,ry:7,width:120,height:14})})})]}),Kv=({assets:e,state:t,onSendAssets:n,removeAsset:i,loading:a})=>{const s=(0,je.useRef)(null),[c,l]=(0,je.useState)("picture"===e[e.length-1]?.type?"photo":"video"),{orientation:d}=(0,je.useContext)(Go),u="landscape"===d;return(0,je.useEffect)((()=>{e.length<1||l("picture"===e[e.length-1]?.type?"photo":"video")}),[e]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wv,{in:t.isOpen,appear:!0,timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-90 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:r(Ih)("fixed justify-center w-screen h-screen top-0 left-0 bg-black z-[1]",t.isOpen?"flex":"hidden"),children:a&&(0,o.jsxs)("div",{className:r(Ih)("flex mt-[50px] h-fit opacity-1",u?"flex-row items-center w-[400px]":"flex-col items-center text-center w-[320px]"),children:[(0,o.jsx)("div",{className:"w-[24px] h-[24px] m-[10px]",children:(0,o.jsx)(Ul,{})}),(0,o.jsxs)("span",{className:"text-sm text-white",children:["Please wait a moment while your ",a," is being processed...","video"===a?" It may take up to 15 seconds for a video to be ready.":""]})]})})}),(0,o.jsx)(Dv,{state:{...t,close:a?()=>{}:t.close},children:a?(0,o.jsx)(Zv,{}):(0,o.jsxs)("div",{ref:s,className:"flex flex-col w-screen max-w-[400px] text-primary",children:[(0,o.jsxs)("div",{className:"flex flex-row justify-between p-[12px]",children:[(0,o.jsxs)("h1",{className:"text-lg first-letter:capitalize",children:[c," successfully captured"]}),(0,o.jsx)("div",{className:"flex justify-center items-center rounded-full bg-[#f3f3f3] h-[30px] w-[30px] cursor-pointer",onClick:t.close,children:(0,o.jsx)(Nc,{color:"#565656"})})]}),(0,o.jsxs)("div",{className:"flex flex-col px-[20px] pb-[25px] gap-[10px]",children:[e.map(((e,t)=>(0,o.jsx)(Vv,{asset:e,index:t,removeAsset:i},e.assetId))),(0,o.jsxs)(xv,{variant:"secondary",onPress:t.close,children:["Take new ",c]}),(0,o.jsxs)(xv,{onPress:()=>{n(),t.close()},children:["Send ",e.length>1?`${e.length} elements`:c]})]})]})})]})};je=a("85Hg2");const Yv=e=>{const[t,r]=(0,je.useState)(e.initialValue);return(0,je.useEffect)((()=>{if(void 0===t)return;const n=setTimeout((()=>{1===t&&e.onFinish(),r(t-1)}),1e3);return()=>clearTimeout(n)}),[t,e]),(0,o.jsx)("div",{className:"absolute w-full h-full flex justify-center items-center bg-black/[.6] z-50",children:(0,o.jsx)("span",{className:"text-white/80 text-[112px] font-medium",children:t})})},Qv=()=>{const
|
|
2089
|
+
***************************************************************************** */var Hv=function(){return Hv=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Hv.apply(this,arguments)};var Wv=function(e){var t=e.animate,r=e.animateBegin,n=e.backgroundColor,i=e.backgroundOpacity,a=e.baseUrl,o=e.children,s=e.foregroundColor,c=e.foregroundOpacity,l=e.gradientRatio,d=e.gradientDirection,u=e.uniqueKey,p=e.interval,f=e.rtl,h=e.speed,m=e.style,g=e.title,v=e.beforeMask,y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["animate","animateBegin","backgroundColor","backgroundOpacity","baseUrl","children","foregroundColor","foregroundOpacity","gradientRatio","gradientDirection","uniqueKey","interval","rtl","speed","style","title","beforeMask"]),b=u||Math.random().toString(36).substring(6),w=b+"-diff",x=b+"-animated-diff",S=b+"-aria",_=f?{transform:"scaleX(-1)"}:null,k="0; "+p+"; 1",E=h+"s",C="top-bottom"===d?"rotate(90)":void 0;return(0,je.createElement)("svg",Hv({"aria-labelledby":S,role:"img",style:Hv(Hv({},m),_)},y),g?(0,je.createElement)("title",{id:S},g):null,v&&(0,je.isValidElement)(v)?v:null,(0,je.createElement)("rect",{role:"presentation",x:"0",y:"0",width:"100%",height:"100%",clipPath:"url("+a+"#"+w+")",style:{fill:"url("+a+"#"+x+")"}}),(0,je.createElement)("defs",null,(0,je.createElement)("clipPath",{id:w},o),(0,je.createElement)("linearGradient",{id:x,gradientTransform:C},(0,je.createElement)("stop",{offset:"0%",stopColor:n,stopOpacity:i},t&&(0,je.createElement)("animate",{attributeName:"offset",values:-l+"; "+-l+"; 1",keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})),(0,je.createElement)("stop",{offset:"50%",stopColor:s,stopOpacity:c},t&&(0,je.createElement)("animate",{attributeName:"offset",values:-l/2+"; "+-l/2+"; "+(1+l/2),keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})),(0,je.createElement)("stop",{offset:"100%",stopColor:n,stopOpacity:i},t&&(0,je.createElement)("animate",{attributeName:"offset",values:"0; 0; "+(1+l),keyTimes:k,dur:E,repeatCount:"indefinite",begin:r})))))};Wv.defaultProps={animate:!0,backgroundColor:"#f5f6f7",backgroundOpacity:1,baseUrl:"",foregroundColor:"#eee",foregroundOpacity:1,gradientRatio:2,gradientDirection:"left-right",id:null,interval:.25,rtl:!1,speed:1.2,style:{},title:"Loading...",beforeMask:null};var $v=function(e){return e.children?(0,je.createElement)(Wv,Hv({},e)):(0,je.createElement)(qv,Hv({},e))},qv=function(e){return(0,je.createElement)($v,Hv({viewBox:"0 0 476 124"},e),(0,je.createElement)("rect",{x:"48",y:"8",width:"88",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"48",y:"26",width:"52",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"56",width:"410",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"72",width:"380",height:"6",rx:"3"}),(0,je.createElement)("rect",{x:"0",y:"88",width:"178",height:"6",rx:"3"}),(0,je.createElement)("circle",{cx:"20",cy:"20",r:"20"}))},Gv=$v;const Zv=()=>(0,o.jsxs)("div",{className:"w-screen max-w-[400px] h-[235px] px-[20px] py-[25px] gap-[10px]",children:[(0,o.jsx)("div",{className:"w-[360px] h-[93px]",children:(0,o.jsxs)(Gv,{width:360,height:93,foregroundColor:"#EBEBEB",children:[(0,o.jsx)("rect",{x:0,y:0,rx:8,ry:8,width:230,height:16}),(0,o.jsx)("rect",{x:0,y:33,rx:8,ry:8,width:60,height:60}),(0,o.jsx)("rect",{x:70,y:56,rx:7,ry:7,width:180,height:14})]})}),(0,o.jsx)("div",{className:"flex items-center justify-center w-full h-[40px] rounded-[8px] border border-primaryLight mt-[10px]",children:(0,o.jsx)(Gv,{width:120,height:14,foregroundColor:"#EBEBEB",children:(0,o.jsx)("rect",{x:0,y:0,rx:7,ry:7,width:120,height:14})})}),(0,o.jsx)("div",{className:"flex items-center justify-center w-full h-[40px] rounded-[8px] bg-primary mt-[10px]",children:(0,o.jsx)(Gv,{width:120,height:14,foregroundColor:"#EBEBEB",children:(0,o.jsx)("rect",{x:0,y:0,rx:7,ry:7,width:120,height:14})})})]}),Kv=({assets:e,state:t,onSendAssets:n,removeAsset:i,loading:a})=>{const s=(0,je.useRef)(null),[c,l]=(0,je.useState)("picture"===e[e.length-1]?.type?"photo":"video"),{orientation:d}=(0,je.useContext)(Go),u="landscape"===d;return(0,je.useEffect)((()=>{e.length<1||l("picture"===e[e.length-1]?.type?"photo":"video")}),[e]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(wv,{in:t.isOpen,appear:!0,timeout:{enter:0,exit:300},classNames:{enter:"opacity-0",enterDone:"opacity-90 transition ease-in",exit:"opacity-0 transition ease-out"},children:(0,o.jsx)("div",{className:r(Ih)("fixed justify-center w-screen h-screen top-0 left-0 bg-black z-[1]",t.isOpen?"flex":"hidden"),children:a&&(0,o.jsxs)("div",{className:r(Ih)("flex mt-[50px] h-fit opacity-1",u?"flex-row items-center w-[400px]":"flex-col items-center text-center w-[320px]"),children:[(0,o.jsx)("div",{className:"w-[24px] h-[24px] m-[10px]",children:(0,o.jsx)(Ul,{})}),(0,o.jsxs)("span",{className:"text-sm text-white",children:["Please wait a moment while your ",a," is being processed...","video"===a?" It may take up to 15 seconds for a video to be ready.":""]})]})})}),(0,o.jsx)(Dv,{state:{...t,close:a?()=>{}:t.close},children:a?(0,o.jsx)(Zv,{}):(0,o.jsxs)("div",{ref:s,className:"flex flex-col w-screen max-w-[400px] text-primary",children:[(0,o.jsxs)("div",{className:"flex flex-row justify-between p-[12px]",children:[(0,o.jsxs)("h1",{className:"text-lg first-letter:capitalize",children:[c," successfully captured"]}),(0,o.jsx)("div",{className:"flex justify-center items-center rounded-full bg-[#f3f3f3] h-[30px] w-[30px] cursor-pointer",onClick:t.close,children:(0,o.jsx)(Nc,{color:"#565656"})})]}),(0,o.jsxs)("div",{className:"flex flex-col px-[20px] pb-[25px] gap-[10px]",children:[e.map(((e,t)=>(0,o.jsx)(Vv,{asset:e,index:t,removeAsset:i},e.assetId))),(0,o.jsxs)(xv,{variant:"secondary",onPress:t.close,children:["Take new ",c]}),(0,o.jsxs)(xv,{onPress:()=>{n(),t.close()},children:["Send ",e.length>1?`${e.length} elements`:c]})]})]})})]})};je=a("85Hg2");const Yv=e=>{const[t,r]=(0,je.useState)(e.initialValue);return(0,je.useEffect)((()=>{if(void 0===t)return;const n=setTimeout((()=>{1===t&&e.onFinish(),r(t-1)}),1e3);return()=>clearTimeout(n)}),[t,e]),(0,o.jsx)("div",{className:"absolute w-full h-full flex justify-center items-center bg-black/[.6] z-50",children:(0,o.jsx)("span",{className:"text-white/80 text-[112px] font-medium",children:t})})},Qv=()=>{const{options:e}=(0,je.useContext)(Go),[t,n]=(0,je.useState)(void 0),[i,a]=(0,je.useState)(0),[s,c]=(0,je.useState)(!1),l=(0,je.useRef)(null),[d,u]=(0,je.useState)([]),[p,f]=(0,je.useState)(null),[h,m]=(0,je.useState)(!1),[g,v]=(0,je.useState)("user"),y=Lh({isOpen:h,onOpenChange:m}),b=Lh({}),[w,x]=(0,je.useState)(!1),S=Lv({photo:"video"!==e?.recorder?.defaultState}),_=(0,je.useCallback)((()=>{S.setStreaming(!1),n(void 0),c(!1),a(0)}),[S]),k=e=>{if(!e.detail?.camera?.device||!l.current)return;const{facingMode:t}=qo.requestLocalVideo(l?.current);v(t)},E=(0,je.useCallback)((e=>{const{url:t,assetId:r}=e.detail;_(),f(null),u([...d,{type:"video",timestamp:Date.now(),objectUrl:t,assetId:r}])}),[d,_]),C=(0,je.useCallback)((async e=>{if(!e.assetId)return;qo.deleteCapture(e.assetId);const t=d.filter((t=>t.assetId!==e.assetId));u(t),t.length<1&&m(!1)}),[d]);return(0,je.useEffect)((()=>{if(void 0===t)return;const e=setInterval((()=>{const e=(Date.now()-t)/1e3;a(e)}),1e3);return()=>clearInterval(e)}),[t]),(0,je.useEffect)((()=>(qo.addEventListener("localVideoAvailable",k),qo.addEventListener("localVideoChange",k),qo.addEventListener("recordStopped",E),()=>{qo.removeEventListener("localVideoChange",k),qo.removeEventListener("localVideoAvailable",k),qo.removeEventListener("recordStopped",E)})),[E]),(0,o.jsxs)("div",{className:"bg-[#000] w-full h-full justify-center flex flex-col antialiased inter",children:[!S.photo&&(0,o.jsx)("div",{className:"text-base text-white text-center font-medium pt-2.5",children:(P=i,[Math.floor(P/60),Math.round(P%60)].map((e=>`${e<10?"0":""}${e}`)).join(":"))}),(0,o.jsx)("div",{className:"flex-1 min-h-0 p-2.5",children:(0,o.jsxs)("div",{className:"relative w-full h-full rounded-[10px]",children:[s&&(0,o.jsx)(Yv,{initialValue:3,onFinish:()=>{c(!1),n(Date.now()),qo.startRecord()}}),w&&(0,o.jsx)(Ec,{onAnimationEnd:()=>{x(!1),y.open()}}),(0,o.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,ref:l,className:r(Ih)("w-full h-full object-cover rounded-[inherit]",{"scale-x-[-1]":"user"===g})})]})}),(0,o.jsx)("div",{className:"flex justify-center px-2.5 pb-2.5",children:(0,o.jsx)(Iv,{state:S,thumbnail:(0,o.jsx)(Nv,{asset:d[d.length-1],onClick:y.open}),onSwitch:()=>{qo.rotateVideo()},onCapturePress:()=>{S.photo&&l.current&&((async e=>{const t=Date.now();f("picture");const r=await qo.captureVideo(e),{url:n,assetId:i}=await qo.saveCapture(r);f(null),u([...d,{type:"picture",timestamp:t,objectUrl:n,assetId:i}])})(l.current),x(!0),qo.captureVideo(l.current)),S.photo||S.streaming||(S.setStreaming(!0),a(0),c(!0)),!S.photo&&S.streaming&&(_(),t&&(qo.stopRecord(),f("video"),y.open()))}})}),(0,o.jsx)(Kv,{assets:d,state:y,onSendAssets:()=>{qo.release(),b.open()},removeAsset:C,loading:p}),(0,o.jsx)(Sv,{title:"Thank you for your submission!",state:b,isDismissable:!1,children:(0,o.jsx)("span",{className:"text-base text-primaryLight",children:"Your photo/video has been successfully sent. We will review it and get back to you soon."})})]});var P},Jv=yr.div`
|
|
2090
2090
|
border: 2px solid #ffffff;
|
|
2091
2091
|
border-top: 2px solid #000000;
|
|
2092
2092
|
border-radius: 50%;
|
|
@@ -2128,7 +2128,7 @@ and limitations under the License.
|
|
|
2128
2128
|
font-weight: 500;
|
|
2129
2129
|
font-size: 14px;
|
|
2130
2130
|
font-family: 'Lato';
|
|
2131
|
-
`,ry=()=>{const{t:e}=Ni();return(0,o.jsx)(Xv,{children:(0,o.jsxs)(ey,{children:[(0,o.jsx)(Jv,{}),(0,o.jsx)(ty,{children:e("loader.connection")})]})})},ny=(()=>{try{const e=localStorage.getItem("stream_ui_theme");return e||"dark"}catch(e){return console.warn(e),"dark"}})(),iy=bi();let ay=-1;var oy=({options:e})=>{const[t,n]=(0,je.useState)(void 0),i=(0,je.useRef)(null),a=(0,je.useRef)(null),s=(0,je.useRef)(null),[c,l]=(0,je.useState)(e.recorder?"recorder":"streaming"),[d,u]=(0,je.useState)(!1),[p,h]=(0,je.useState)(!1),[m,g]=(0,je.useState)(!1),[y,b]=(0,je.useState)(!1),[w,x]=(0,je.useState)(!1),[S,_]=(0,je.useState)(ny),[k,E]=(0,je.useState)(e.language||iy),[C,P]=(0,je.useState)({}),[R,T]=(0,je.useState)(!0),[j,O]=(0,je.useState)(!1),[M,L]=(0,je.useState)(!e.recorder),[I,D]=(0,je.useState)(!1),[A,N]=(0,je.useState)(!1),[F,z]=(0,je.useState)(!1),[B,U]=As(i.current),[V,H]=(0,je.useState)(!1),[W,$]=(0,je.useState)(!1),[q,G]=(0,je.useState)([]),[Z,K]=(0,je.useState)(void 0),Y=(B||window.screen.width)>(U||window.screen.height)?"landscape":"portrait",Q="dark"===S?vh:gh,J=e=>{"localVideoAvailable"===e.type?O(!0):O(!1)},X=e=>{"screenshareEnabled"===e.type?D(!0):D(!1)},ee=e=>{"microphoneMute"===e.type?T(!0):T(!1)},te=e=>{const t=e.detail.label;Dr(`Connected to ${t}`,{duration:3e3,icon:(0,o.jsx)(zs,{}),messageStyle:{fontWeight:600}})},re=e=>{const{profile:t}=e.detail;P(t)},ne=()=>{Rh(),l("ended"),T(!0),O(!1),D(!1),z(!1)},ie=()=>{Rh(),l("terminated")},ae=()=>{l("expired")},oe=e=>{const{success:t,email:n}=e.detail;t?(N(!0),n&&f.identify(null,{email:n})):r(v)("An error occured while trying to join the room as an agent",{className:"error"})},se=e=>{const t=Date.now();"USERLIMIT"!==e.detail.code?-1!==ay&&ay+2e4>t||(ay=t,Dr(`A critical error has occurred (error ${e.detail.code}).`,{icon:Tl,button:{text:"Reload",action:()=>{window.location.reload()}},duration:2e4})):l("full")};return(0,je.useEffect)((()=>{try{localStorage.setItem("stream_ui_theme",S)}catch(e){console.warn(e)}}),[S]),(0,je.useEffect)((()=>{try{localStorage.setItem("stream_ui_language",k),xi.changeLanguage(k)}catch(e){console.warn(e)}}),[k]),(0,je.useEffect)((()=>(qo.addEventListener("localVideoAvailable",J),qo.addEventListener("localVideoUnavailable",J),qo.addEventListener("screenshareEnabled",X),qo.addEventListener("screenshareDisabled",X),qo.addEventListener("microphoneEnabled",ee),qo.addEventListener("microphoneMute",ee),qo.addEventListener("microphoneUnmute",ee),qo.addEventListener("defaultAudioDeviceChange",te),qo.addEventListener("selfProfileUpdate",re),qo.addEventListener("terminateRoom",ie),qo.addEventListener("leaveRoom",ne),qo.addEventListener("invalidRoom",ae),qo.addEventListener("agentIdentity",oe),qo.addEventListener("criticalError",se),()=>{qo.removeEventListener("localVideoAvailable",J),qo.removeEventListener("localVideoUnavailable",J),qo.removeEventListener("screenshareEnabled",X),qo.removeEventListener("screenshareDisabled",X),qo.removeEventListener("microphoneEnabled",ee),qo.removeEventListener("microphoneMute",ee),qo.removeEventListener("microphoneUnmute",ee),qo.removeEventListener("defaultAudioDeviceChange",te),qo.removeEventListener("selfProfileUpdate",re),qo.removeEventListener("terminateRoom",ie),qo.removeEventListener("leaveRoom",ne),qo.removeEventListener("invalidRoom",ae),qo.removeEventListener("agentIdentity",oe),qo.removeEventListener("criticalError",se)})),[]),(0,je.useEffect)((()=>{const t=async t=>{const r=t.detail.peerId;if(K(t.detail.plan),G(t.detail.permissions),console.log(t.detail.permissions),n(r),!e.recorder)try{await Th(e),z(!0)}catch(e){H(!0),console.error("User interaction trigger failed",e)}finally{L(!1)}};return qo.addEventListener("enterRoom",t),()=>{qo.removeEventListener("enterRoom",t)}}),[e]),(0,o.jsx)(Go.Provider,{value:{plan:Z,permissions:q,selfPeerId:t,streamUIContainerRef:i,videosContainerRef:a,remoteTilesContainerRef:s,streamState:c,setStreamState:l,isQuickConnectPopupVisible:d,setIsQuickConnectPopupVisible:u,isSettingsMenuVisible:p,setIsSettingsMenuVisible:h,isYoutubePopupVisible:m,setIsYoutubePopupVisible:g,isLinksharePopupVisible:y,setIsLinksharePopupVisible:b,isVirtualBackgroundPopupVisible:w,setIsVirtualBackgroundPopupVisible:x,isBlockedFeaturePopupOpen:W,setBlockedFeaturePopupOpen:$,theme:S,setTheme:_,language:k,setLanguage:E,options:e,profile:C,muted:R,streaming:j,screensharing:I,isAgent:A,userInteractionTriggered:F,orientation:Y},children:(0,o.jsxs)(ur,{theme:Q,children:[(0,o.jsx)(jh,{}),(0,o.jsx)(yh,{}),(0,o.jsxs)(Oh,{ref:i,children:[M&&(0,o.jsx)(ry,{}),(0,o.jsx)(mh,{}),(0,o.jsx)(ch,{}),V&&(0,o.jsx)(kh,{close:()=>{z(!0),H(!1)}}),"recorder"===c&&(0,o.jsx)(Qv,{}),"streaming"===c&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Xo,{children:[(0,o.jsx)(Ds,{}),(0,o.jsx)(Dl,{}),(0,o.jsx)(sd,{}),(0,o.jsx)(Yf,{})]})}),("ended"===c||"terminated"===c||"full"===c||"expired"===c)&&(0,o.jsx)(rh,{})]})]})})};window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)};je=a("85Hg2");var sy=()=>(0,o.jsx)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#greetingSnapcallLogo)",children:[(0,o.jsx)("path",{d:"M0 36C0 6.354 6.354 0 36 0s36 6.354 36 36-6.354 36-36 36S0 65.646 0 36Z",fill:"#000"}),(0,o.jsx)("path",{d:"M36.225 57.428c2.367 0 4.35-1.964 3.62-4.215a13.38 13.38 0 0 0-3.133-5.203c-2.432-2.498-5.73-3.902-9.17-3.902-3.44 0-6.74 1.404-9.172 3.902a13.381 13.381 0 0 0-3.132 5.203c-.731 2.25 1.252 4.215 3.62 4.215h17.367ZM35.775 14.572c-2.367 0-4.35 1.965-3.62 4.216a13.381 13.381 0 0 0 3.133 5.203c2.432 2.498 5.73 3.901 9.17 3.901 3.44 0 6.74-1.403 9.172-3.901a13.375 13.375 0 0 0 3.132-5.203c.731-2.252-1.252-4.216-3.62-4.216H35.776ZM44.459 53.143c0 2.367 1.971 4.352 4.204 3.566a12.924 12.924 0 0 0 4.967-3.182c2.432-2.498 3.799-5.886 3.799-9.419 0-3.533-1.367-6.921-3.8-9.42a12.923 12.923 0 0 0-4.966-3.181c-2.233-.786-4.204 1.2-4.204 3.566v18.07ZM27.541 18.857c0-2.367-1.971-4.352-4.204-3.566a12.923 12.923 0 0 0-4.967 3.182c-2.432 2.498-3.799 5.886-3.799 9.42 0 3.532 1.367 6.92 3.8 9.418a12.923 12.923 0 0 0 4.966 3.182c2.233.786 4.204-1.2 4.204-3.566v-18.07Z",fill:"#fff"})]})});const cy=yr.div`
|
|
2131
|
+
`,ry=()=>{const{t:e}=Ni();return(0,o.jsx)(Xv,{children:(0,o.jsxs)(ey,{children:[(0,o.jsx)(Jv,{}),(0,o.jsx)(ty,{children:e("loader.connection")})]})})},ny=(()=>{try{const e=localStorage.getItem("stream_ui_theme");return e||"dark"}catch(e){return console.warn(e),"dark"}})(),iy=bi();let ay=-1;var oy=({options:e})=>{const[t,n]=(0,je.useState)(void 0),i=(0,je.useRef)(null),a=(0,je.useRef)(null),s=(0,je.useRef)(null),[c,l]=(0,je.useState)(e.recorder?.enabled?"recorder":"streaming"),[d,u]=(0,je.useState)(!1),[p,h]=(0,je.useState)(!1),[m,g]=(0,je.useState)(!1),[y,b]=(0,je.useState)(!1),[w,x]=(0,je.useState)(!1),[S,_]=(0,je.useState)(ny),[k,E]=(0,je.useState)(e.language||iy),[C,P]=(0,je.useState)({}),[R,T]=(0,je.useState)(!0),[j,O]=(0,je.useState)(!1),[M,L]=(0,je.useState)(!e.recorder),[I,D]=(0,je.useState)(!1),[A,N]=(0,je.useState)(!1),[F,z]=(0,je.useState)(!1),[B,U]=As(i.current),[V,H]=(0,je.useState)(!1),[W,$]=(0,je.useState)(!1),[q,G]=(0,je.useState)([]),[Z,K]=(0,je.useState)(void 0),Y=(B||window.screen.width)>(U||window.screen.height)?"landscape":"portrait",Q="dark"===S?vh:gh,J=e=>{"localVideoAvailable"===e.type?O(!0):O(!1)},X=e=>{"screenshareEnabled"===e.type?D(!0):D(!1)},ee=e=>{"microphoneMute"===e.type?T(!0):T(!1)},te=e=>{const t=e.detail.label;Dr(`Connected to ${t}`,{duration:3e3,icon:(0,o.jsx)(zs,{}),messageStyle:{fontWeight:600}})},re=e=>{const{profile:t}=e.detail;P(t)},ne=()=>{Rh(),l("ended"),T(!0),O(!1),D(!1),z(!1)},ie=()=>{Rh(),l("terminated")},ae=()=>{l("expired")},oe=e=>{const{success:t,email:n}=e.detail;t?(N(!0),n&&f.identify(null,{email:n})):r(v)("An error occured while trying to join the room as an agent",{className:"error"})},se=e=>{const t=Date.now();"USERLIMIT"!==e.detail.code?-1!==ay&&ay+2e4>t||(ay=t,Dr(`A critical error has occurred (error ${e.detail.code}).`,{icon:Tl,button:{text:"Reload",action:()=>{window.location.reload()}},duration:2e4})):l("full")};return(0,je.useEffect)((()=>{try{localStorage.setItem("stream_ui_theme",S)}catch(e){console.warn(e)}}),[S]),(0,je.useEffect)((()=>{try{localStorage.setItem("stream_ui_language",k),xi.changeLanguage(k)}catch(e){console.warn(e)}}),[k]),(0,je.useEffect)((()=>(qo.addEventListener("localVideoAvailable",J),qo.addEventListener("localVideoUnavailable",J),qo.addEventListener("screenshareEnabled",X),qo.addEventListener("screenshareDisabled",X),qo.addEventListener("microphoneEnabled",ee),qo.addEventListener("microphoneMute",ee),qo.addEventListener("microphoneUnmute",ee),qo.addEventListener("defaultAudioDeviceChange",te),qo.addEventListener("selfProfileUpdate",re),qo.addEventListener("terminateRoom",ie),qo.addEventListener("leaveRoom",ne),qo.addEventListener("invalidRoom",ae),qo.addEventListener("agentIdentity",oe),qo.addEventListener("criticalError",se),()=>{qo.removeEventListener("localVideoAvailable",J),qo.removeEventListener("localVideoUnavailable",J),qo.removeEventListener("screenshareEnabled",X),qo.removeEventListener("screenshareDisabled",X),qo.removeEventListener("microphoneEnabled",ee),qo.removeEventListener("microphoneMute",ee),qo.removeEventListener("microphoneUnmute",ee),qo.removeEventListener("defaultAudioDeviceChange",te),qo.removeEventListener("selfProfileUpdate",re),qo.removeEventListener("terminateRoom",ie),qo.removeEventListener("leaveRoom",ne),qo.removeEventListener("invalidRoom",ae),qo.removeEventListener("agentIdentity",oe),qo.removeEventListener("criticalError",se)})),[]),(0,je.useEffect)((()=>{const t=async t=>{const r=t.detail.peerId;if(K(t.detail.plan),G(t.detail.permissions),console.log(t.detail.permissions),n(r),!e.recorder?.enabled)try{await Th(e),z(!0)}catch(e){H(!0),console.error("User interaction trigger failed",e)}finally{L(!1)}};return qo.addEventListener("enterRoom",t),()=>{qo.removeEventListener("enterRoom",t)}}),[e]),(0,o.jsx)(Go.Provider,{value:{plan:Z,permissions:q,selfPeerId:t,streamUIContainerRef:i,videosContainerRef:a,remoteTilesContainerRef:s,streamState:c,setStreamState:l,isQuickConnectPopupVisible:d,setIsQuickConnectPopupVisible:u,isSettingsMenuVisible:p,setIsSettingsMenuVisible:h,isYoutubePopupVisible:m,setIsYoutubePopupVisible:g,isLinksharePopupVisible:y,setIsLinksharePopupVisible:b,isVirtualBackgroundPopupVisible:w,setIsVirtualBackgroundPopupVisible:x,isBlockedFeaturePopupOpen:W,setBlockedFeaturePopupOpen:$,theme:S,setTheme:_,language:k,setLanguage:E,options:e,profile:C,muted:R,streaming:j,screensharing:I,isAgent:A,userInteractionTriggered:F,orientation:Y},children:(0,o.jsxs)(ur,{theme:Q,children:[(0,o.jsx)(jh,{}),(0,o.jsx)(yh,{}),(0,o.jsxs)(Oh,{ref:i,children:[M&&(0,o.jsx)(ry,{}),(0,o.jsx)(mh,{}),(0,o.jsx)(ch,{}),V&&(0,o.jsx)(kh,{close:()=>{z(!0),H(!1)}}),"recorder"===c&&(0,o.jsx)(Qv,{}),"streaming"===c&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(Xo,{children:[(0,o.jsx)(Ds,{}),(0,o.jsx)(Dl,{}),(0,o.jsx)(sd,{}),(0,o.jsx)(Yf,{})]})}),("ended"===c||"terminated"===c||"full"===c||"expired"===c)&&(0,o.jsx)(rh,{})]})]})})};window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)};je=a("85Hg2");var sy=()=>(0,o.jsx)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#greetingSnapcallLogo)",children:[(0,o.jsx)("path",{d:"M0 36C0 6.354 6.354 0 36 0s36 6.354 36 36-6.354 36-36 36S0 65.646 0 36Z",fill:"#000"}),(0,o.jsx)("path",{d:"M36.225 57.428c2.367 0 4.35-1.964 3.62-4.215a13.38 13.38 0 0 0-3.133-5.203c-2.432-2.498-5.73-3.902-9.17-3.902-3.44 0-6.74 1.404-9.172 3.902a13.381 13.381 0 0 0-3.132 5.203c-.731 2.25 1.252 4.215 3.62 4.215h17.367ZM35.775 14.572c-2.367 0-4.35 1.965-3.62 4.216a13.381 13.381 0 0 0 3.133 5.203c2.432 2.498 5.73 3.901 9.17 3.901 3.44 0 6.74-1.403 9.172-3.901a13.375 13.375 0 0 0 3.132-5.203c.731-2.252-1.252-4.216-3.62-4.216H35.776ZM44.459 53.143c0 2.367 1.971 4.352 4.204 3.566a12.924 12.924 0 0 0 4.967-3.182c2.432-2.498 3.799-5.886 3.799-9.419 0-3.533-1.367-6.921-3.8-9.42a12.923 12.923 0 0 0-4.966-3.181c-2.233-.786-4.204 1.2-4.204 3.566v18.07ZM27.541 18.857c0-2.367-1.971-4.352-4.204-3.566a12.923 12.923 0 0 0-4.967 3.182c-2.432 2.498-3.799 5.886-3.799 9.42 0 3.532 1.367 6.92 3.8 9.418a12.923 12.923 0 0 0 4.966 3.182c2.233.786 4.204-1.2 4.204-3.566v-18.07Z",fill:"#fff"})]})});const cy=yr.div`
|
|
2132
2132
|
height: 100%;
|
|
2133
2133
|
display: flex;
|
|
2134
2134
|
flex-direction: column;
|
|
@@ -2308,4 +2308,4 @@ and limitations under the License.
|
|
|
2308
2308
|
background-color: #fff;
|
|
2309
2309
|
color: #1d1c20;
|
|
2310
2310
|
height: 100%;
|
|
2311
|
-
`;var Py=({onGreetingDone:e})=>{const{t:t}=Ni(),[r,{width:n,height:i}]=Fs(),a=(0,je.useRef)(null),s=(0,je.useRef)(null),[c,l]=(0,je.useState)(void 0),[d,u]=(0,je.useState)(!1),[p,f]=(0,je.useState)(!1),h=n>=i,m=async e=>{try{const t=await navigator.mediaDevices.getUserMedia(e),r=t.getVideoTracks()[0],n=t.getAudioTracks()[0];r&&l(r),n&&u(!0),n?.stop()}catch(e){console.error("Get User Media Failed: ",e)}},g=(0,je.useCallback)((async()=>{c?(c.stop(),l(void 0)):await m({video:!0})}),[c]),v=(0,je.useCallback)((async()=>{d?u(!1):await m({audio:!0})}),[d]);if((0,je.useEffect)((()=>{s.current&&(s.current.srcObject=c?new MediaStream([c]):null)}),[s,c,n,i]),(0,je.useEffect)((()=>{m({audio:!0,video:!0})}),[]),!0===p)return(0,o.jsx)(Cy,{children:(0,o.jsx)("img",{src:"https://stream-assets.snapcall.io/animations/snapcall-logo-animation.gif",alt:"Snapcall logo animation",height:40})});const y=Boolean(c);return(0,o.jsxs)(cy,{ref:r,children:[(0,o.jsx)(jh,{}),(0,o.jsx)(sy,{}),(0,o.jsx)(ly,{children:t("greeting.mainTitle")}),(0,o.jsxs)(dy,{children:[h&&(0,o.jsxs)(uy,{children:[(0,o.jsx)(py,{webcamEnabled:y,ref:s,autoPlay:!0}),(0,o.jsxs)(my,{webcamEnabled:y,children:[(0,o.jsxs)(fy,{children:[!d&&(0,o.jsx)(hy,{children:(0,o.jsx)(zs,{status:!d})}),!y&&(0,o.jsx)(hy,{children:(0,o.jsx)(Bs,{status:!y})})]}),(0,o.jsx)(vy,{children:(0,o.jsx)(Zs,{})})]}),(0,o.jsxs)(gy,{children:[(0,o.jsx)(vy,{onClick:v,danger:!d,children:(0,o.jsx)(zs,{status:!d})}),(0,o.jsx)(vy,{onClick:g,danger:!y,children:(0,o.jsx)(Bs,{status:!y})})]})]}),(0,o.jsxs)(yy,{children:[h&&(0,o.jsx)(by,{children:t("greeting.sideTitle")}),(0,o.jsx)(wy,{children:t("greeting.sideDescription")}),(0,o.jsx)(xy,{ref:a,name:"displayName",type:"text",placeholder:t("greeting.namePlaceholder"),autoFocus:!0}),(0,o.jsx)(Sy,{onClick:()=>{const t=a.current?.value,r=Boolean(c);c?.stop(),f(!0),setTimeout((()=>{e({cameraEnabled:r,micEnabled:d,displayName:t})}),4e3)},children:t("greeting.nameSubmit")})]})]}),(0,o.jsxs)(_y,{children:[(0,o.jsx)(ky,{children:t("greeting.footerTitle")}),(0,o.jsx)(Ey,{children:t("greeting.footerDescription")})]})]})};const Ry=new URL(window.location.href),Ty="0"!==Ry.searchParams.get("microphone-enabled"),jy="1"===Ry.searchParams.get("camera-enabled"),Oy={recorder:!1,sharedURL:window.location.href,showMenuButton:!0,settingsShortcuts:[{id:"pip",displayType:"icon"}],controls:{microphone:{available:!0,enabled:Ty},camera:{available:!0,enabled:jy},screenshare:{available:!0}},streamApiURL:String("https://apistream.snapcall.io"),tracking:!1},My={init:({element:e,...t})=>{if(e?.nodeType!==window.Node.ELEMENT_NODE)throw new Error('The "element" property must be a valid element!');const n=m(Oy,t),i=s(e);let a=null;a=(0,o.jsxs)(o.Fragment,{children:[t.recorder&&(0,o.jsx)("style",{children:r('*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]{display:none}')}),(0,o.jsx)("style",{children:r("*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.top-0{top:0}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1\\]{z-index:1}.m-\\[10px\\]{margin:10px}.mx-\\[20px\\]{margin-left:20px;margin-right:20px}.ml-\\[10px\\]{margin-left:10px}.mt-\\[10px\\]{margin-top:10px}.mt-\\[50px\\]{margin-top:50px}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.hidden{display:none}.h-full{height:100%}.h-\\[150px\\]{height:150px}.h-\\[60px\\]{height:60px}.h-\\[72px\\]{height:72px}.h-\\[56px\\]{height:56px}.h-\\[40px\\]{height:40px}.h-\\[235px\\]{height:235px}.h-\\[93px\\]{height:93px}.h-screen{height:100vh}.h-fit{height:-moz-fit-content;height:-moz-fit-content;height:fit-content}.h-\\[24px\\]{height:24px}.h-\\[30px\\]{height:30px}.h-1\\/3{height:33.3333%}.max-h-\\[inherit\\]{max-height:inherit}.max-h-\\[70px\\]{max-height:70px}.min-h-0{min-height:0}.min-h-\\[100\\%\\]{min-height:100%}.w-full{width:100%}.w-\\[60px\\]{width:60px}.w-\\[72px\\]{width:72px}.w-\\[56px\\]{width:56px}.w-\\[76px\\]{width:76px}.w-screen{width:100vw}.w-\\[360px\\]{width:360px}.w-\\[400px\\]{width:400px}.w-\\[320px\\]{width:320px}.w-\\[24px\\]{width:24px}.w-\\[30px\\]{width:30px}.w-1\\/3{width:33.3333%}.min-w-\\[100\\%\\]{min-width:100%}.min-w-\\[24px\\]{min-width:24px}.max-w-\\[400px\\]{max-width:400px}.max-w-\\[600px\\]{max-width:600px}.max-w-\\[800px\\]{max-width:800px}.max-w-\\[70px\\]{max-width:70px}.flex-1{flex:1}.flex-auto{flex:auto}.flex-grow{flex-grow:1}.translate-y-2{--tw-translate-y:.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-\\[200\\%\\]{--tw-translate-y:200%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-\\[0\\.4\\]{--tw-scale-x:.4;--tw-scale-y:.4;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-x-\\[-1\\]{--tw-scale-x:-1;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-\\[5px\\]{gap:5px}.gap-2\\.5{gap:.625rem}.gap-2{gap:.5rem}.gap-\\[10px\\]{gap:10px}.gap-5{gap:1.25rem}.gap-\\[20px\\]{gap:20px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-\\[15px\\]{border-radius:15px}.rounded-full{border-radius:9999px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[60px\\]{border-radius:60px}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[8px\\]{border-radius:8px}.rounded-\\[50\\%\\]{border-radius:50%}.rounded-t-\\[15px\\]{border-top-left-radius:15px;border-top-right-radius:15px}.border{border-width:1px}.border-secondaryLight{--tw-border-opacity:1;border-color:rgb(179 179 179/var(--tw-border-opacity))}.border-primaryLight{--tw-border-opacity:1;border-color:rgb(86 86 86/var(--tw-border-opacity))}.bg-primaryLight{--tw-bg-opacity:1;background-color:rgb(86 86 86/var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(29 28 32/var(--tw-bg-opacity))}.bg-graySelected{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity))}.bg-transparent{background-color:#0000}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-black\\/\\[\\.6\\]{background-color:#0009}.bg-\\[\\#f12828\\]{--tw-bg-opacity:1;background-color:rgb(241 40 40/var(--tw-bg-opacity))}.bg-\\[\\#565656\\]{--tw-bg-opacity:1;background-color:rgb(86 86 86/var(--tw-bg-opacity))}.bg-black,.bg-\\[\\#000\\]{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-underlay{background-color:#00000040}.bg-\\[\\#f3f3f3\\]{--tw-bg-opacity:1;background-color:rgb(243 243 243/var(--tw-bg-opacity))}.bg-secondaryVLight{--tw-bg-opacity:1;background-color:rgb(235 235 235/var(--tw-bg-opacity))}.bg-opacity-90{--tw-bg-opacity:.9}.object-cover{object-fit:cover}.p-2\\.5{padding:.625rem}.p-2{padding:.5rem}.p-\\[3px\\]{padding:3px}.p-\\[12px\\]{padding:12px}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-\\[9px\\]{padding-top:9px;padding-bottom:9px}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-\\[25px\\]{padding-top:25px;padding-bottom:25px}.px-\\[20px\\]{padding-left:20px;padding-right:20px}.pt-2\\.5{padding-top:.625rem}.pt-2{padding-top:.5rem}.pb-2\\.5{padding-bottom:.625rem}.pb-2{padding-bottom:.5rem}.pb-\\[25px\\]{padding-bottom:25px}.text-center{text-align:center}.text-base{letter-spacing:-.02em;font-size:16px;line-height:19px}.text-sm{letter-spacing:-.02em;font-size:14px;line-height:17px}.text-xs{letter-spacing:-.02em;font-size:12px;line-height:14px}.text-\\[112px\\]{font-size:112px}.text-xl{letter-spacing:-.02em;font-size:20px;line-height:24px}.text-lg{letter-spacing:-.02em;font-size:18px;line-height:22px}.font-medium{font-weight:500}.font-bold{font-weight:700}.font-normal{font-weight:400}.leading-\\[20px\\]{line-height:20px}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-primary{--tw-text-opacity:1;color:rgb(29 28 32/var(--tw-text-opacity))}.text-white\\/80{color:#fffc}.text-secondary{--tw-text-opacity:1;color:rgb(134 134 134/var(--tw-text-opacity))}.text-primaryLight{--tw-text-opacity:1;color:rgb(86 86 86/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-\\[0\\.4\\]{opacity:.4}.opacity-90{opacity:.9}.outline{outline-style:solid}.ring-\\[3px\\]{--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-cta{--tw-ring-opacity:1;--tw-ring-color:rgb(38 138 250/var(--tw-ring-opacity))}.blur{--tw-blur:blur(8px);filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.filter{filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[transform\\,border-radius\\]{transition-property:transform,border-radius;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.inter{font-family:Inter,sans-serif}@supports (font-variation-settings:normal){.inter{font-family:Inter var,sans-serif}}.first-letter\\:capitalize:first-letter{text-transform:capitalize}.focus\\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.disabled\\:bg-secondaryLight:disabled{--tw-bg-opacity:1;background-color:rgb(179 179 179/var(--tw-bg-opacity))}.disabled\\:bg-graySelected:disabled{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity))}.disabled\\:text-secondaryLight:disabled{--tw-text-opacity:1;color:rgb(179 179 179/var(--tw-text-opacity))}")})]}),i.render((0,o.jsxs)(o.Fragment,{children:[a,(0,o.jsx)("link",{rel:"preconnect",href:"https://rsms.me/"}),(0,o.jsx)("link",{rel:"stylesheet",href:"https://rsms.me/inter/inter.css"}),(0,o.jsx)(oy,{options:n})]})),n.tracking&&f.init(3111933,6)},initGreeting:(e,t)=>{s(e).render((0,o.jsx)(Py,{onGreetingDone:t}))},setExtraSettingsOptions:e=>{const t=new CustomEvent("streamUISetExtraSettingsOptions",{detail:{extraOptions:e}});window.dispatchEvent(t)},startRecord:qo.startRecord.bind(qo),stopRecord:qo.stopRecord.bind(qo),sendNotification:Dr,joinRoom:qo.init.bind(qo),leaveRoom:qo.endCall.bind(qo),terminateRoom:qo.terminateRoom.bind(qo),generateToken:qo.generateToken.bind(qo),addEventListener:qo.addEventListener.bind(qo),removeEventListener:qo.removeEventListener.bind(qo),dispatchEvent:qo.dispatchEvent.bind(qo),getState:qo.getState.bind(qo),setProfile:qo.setProfile.bind(qo),setConfig:qo.setConfig.bind(qo),setLogLevel:e=>Xa.setLogLevel(e),getPermissions:()=>qo.getPermissions()};window.streamUI=My,window.snapcallAPI={join:(...e)=>(console.warn("snapcallAPI.join is deprecated, please use streamUI.joinRoom instead!"),My.joinRoom(...e)),endCall:(...e)=>(console.warn("snapcallAPI.endCall is deprecated, please use streamUI.leaveRoom instead!"),My.leaveRoom(...e)),terminateRoom:(...e)=>(console.warn("snapcallAPI.terminateRoom is deprecated, please use streamUI.terminateRoom instead!"),My.terminateRoom(...e)),generateToken:(...e)=>(console.warn("snapcallAPI.generateToken is deprecated, please use streamUI.generateToken instead!"),My.generateToken(...e)),setDisplayName:(...e)=>(console.warn("snapcallAPI.setDisplayName is deprecated, please use streamUI.joinRoom options instead!"),qo.setDisplayName(...e))}})();
|
|
2311
|
+
`;var Py=({onGreetingDone:e})=>{const{t:t}=Ni(),[r,{width:n,height:i}]=Fs(),a=(0,je.useRef)(null),s=(0,je.useRef)(null),[c,l]=(0,je.useState)(void 0),[d,u]=(0,je.useState)(!1),[p,f]=(0,je.useState)(!1),h=n>=i,m=async e=>{try{const t=await navigator.mediaDevices.getUserMedia(e),r=t.getVideoTracks()[0],n=t.getAudioTracks()[0];r&&l(r),n&&u(!0),n?.stop()}catch(e){console.error("Get User Media Failed: ",e)}},g=(0,je.useCallback)((async()=>{c?(c.stop(),l(void 0)):await m({video:!0})}),[c]),v=(0,je.useCallback)((async()=>{d?u(!1):await m({audio:!0})}),[d]);if((0,je.useEffect)((()=>{s.current&&(s.current.srcObject=c?new MediaStream([c]):null)}),[s,c,n,i]),(0,je.useEffect)((()=>{m({audio:!0,video:!0})}),[]),!0===p)return(0,o.jsx)(Cy,{children:(0,o.jsx)("img",{src:"https://stream-assets.snapcall.io/animations/snapcall-logo-animation.gif",alt:"Snapcall logo animation",height:40})});const y=Boolean(c);return(0,o.jsxs)(cy,{ref:r,children:[(0,o.jsx)(jh,{}),(0,o.jsx)(sy,{}),(0,o.jsx)(ly,{children:t("greeting.mainTitle")}),(0,o.jsxs)(dy,{children:[h&&(0,o.jsxs)(uy,{children:[(0,o.jsx)(py,{webcamEnabled:y,ref:s,autoPlay:!0}),(0,o.jsxs)(my,{webcamEnabled:y,children:[(0,o.jsxs)(fy,{children:[!d&&(0,o.jsx)(hy,{children:(0,o.jsx)(zs,{status:!d})}),!y&&(0,o.jsx)(hy,{children:(0,o.jsx)(Bs,{status:!y})})]}),(0,o.jsx)(vy,{children:(0,o.jsx)(Zs,{})})]}),(0,o.jsxs)(gy,{children:[(0,o.jsx)(vy,{onClick:v,danger:!d,children:(0,o.jsx)(zs,{status:!d})}),(0,o.jsx)(vy,{onClick:g,danger:!y,children:(0,o.jsx)(Bs,{status:!y})})]})]}),(0,o.jsxs)(yy,{children:[h&&(0,o.jsx)(by,{children:t("greeting.sideTitle")}),(0,o.jsx)(wy,{children:t("greeting.sideDescription")}),(0,o.jsx)(xy,{ref:a,name:"displayName",type:"text",placeholder:t("greeting.namePlaceholder"),autoFocus:!0}),(0,o.jsx)(Sy,{onClick:()=>{const t=a.current?.value,r=Boolean(c);c?.stop(),f(!0),setTimeout((()=>{e({cameraEnabled:r,micEnabled:d,displayName:t})}),4e3)},children:t("greeting.nameSubmit")})]})]}),(0,o.jsxs)(_y,{children:[(0,o.jsx)(ky,{children:t("greeting.footerTitle")}),(0,o.jsx)(Ey,{children:t("greeting.footerDescription")})]})]})};const Ry={recorder:{enabled:!1,defaultState:"photo"},sharedURL:window.location.href,showMenuButton:!0,settingsShortcuts:[{id:"pip",displayType:"icon"}],controls:{microphone:{available:!0,enabled:!0},camera:{available:!0,enabled:!1},screenshare:{available:!0}},streamApiURL:String("https://apistream.snapcall.io"),tracking:!1},Ty={init:({element:e,...t})=>{if("boolean"==typeof t.recorder&&(t.recorder={enabled:t.recorder,defaultState:"photo"}),e?.nodeType!==window.Node.ELEMENT_NODE)throw new Error('The "element" property must be a valid element!');const n=m(Ry,t),i=s(e);let a=null;a=(0,o.jsxs)(o.Fragment,{children:[t.recorder&&(0,o.jsx)("style",{children:r('*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]{display:none}')}),(0,o.jsx)("style",{children:r("*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.top-0{top:0}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1\\]{z-index:1}.m-\\[10px\\]{margin:10px}.mx-\\[20px\\]{margin-left:20px;margin-right:20px}.ml-\\[10px\\]{margin-left:10px}.mt-\\[10px\\]{margin-top:10px}.mt-\\[50px\\]{margin-top:50px}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.hidden{display:none}.h-full{height:100%}.h-\\[150px\\]{height:150px}.h-\\[60px\\]{height:60px}.h-\\[72px\\]{height:72px}.h-\\[56px\\]{height:56px}.h-\\[40px\\]{height:40px}.h-\\[235px\\]{height:235px}.h-\\[93px\\]{height:93px}.h-screen{height:100vh}.h-fit{height:-moz-fit-content;height:-moz-fit-content;height:fit-content}.h-\\[24px\\]{height:24px}.h-\\[30px\\]{height:30px}.h-1\\/3{height:33.3333%}.max-h-\\[inherit\\]{max-height:inherit}.max-h-\\[70px\\]{max-height:70px}.min-h-0{min-height:0}.min-h-\\[100\\%\\]{min-height:100%}.w-full{width:100%}.w-\\[60px\\]{width:60px}.w-\\[72px\\]{width:72px}.w-\\[56px\\]{width:56px}.w-\\[76px\\]{width:76px}.w-screen{width:100vw}.w-\\[360px\\]{width:360px}.w-\\[400px\\]{width:400px}.w-\\[320px\\]{width:320px}.w-\\[24px\\]{width:24px}.w-\\[30px\\]{width:30px}.w-1\\/3{width:33.3333%}.min-w-\\[100\\%\\]{min-width:100%}.min-w-\\[24px\\]{min-width:24px}.max-w-\\[400px\\]{max-width:400px}.max-w-\\[600px\\]{max-width:600px}.max-w-\\[800px\\]{max-width:800px}.max-w-\\[70px\\]{max-width:70px}.flex-1{flex:1}.flex-auto{flex:auto}.flex-grow{flex-grow:1}.translate-y-2{--tw-translate-y:.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-\\[200\\%\\]{--tw-translate-y:200%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-\\[0\\.4\\]{--tw-scale-x:.4;--tw-scale-y:.4;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-x-\\[-1\\]{--tw-scale-x:-1;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skewX(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-\\[5px\\]{gap:5px}.gap-2\\.5{gap:.625rem}.gap-2{gap:.5rem}.gap-\\[10px\\]{gap:10px}.gap-5{gap:1.25rem}.gap-\\[20px\\]{gap:20px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-\\[15px\\]{border-radius:15px}.rounded-full{border-radius:9999px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[60px\\]{border-radius:60px}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[8px\\]{border-radius:8px}.rounded-\\[50\\%\\]{border-radius:50%}.rounded-t-\\[15px\\]{border-top-left-radius:15px;border-top-right-radius:15px}.border{border-width:1px}.border-secondaryLight{--tw-border-opacity:1;border-color:rgb(179 179 179/var(--tw-border-opacity))}.border-primaryLight{--tw-border-opacity:1;border-color:rgb(86 86 86/var(--tw-border-opacity))}.bg-primaryLight{--tw-bg-opacity:1;background-color:rgb(86 86 86/var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(29 28 32/var(--tw-bg-opacity))}.bg-graySelected{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity))}.bg-transparent{background-color:#0000}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-black\\/\\[\\.6\\]{background-color:#0009}.bg-\\[\\#f12828\\]{--tw-bg-opacity:1;background-color:rgb(241 40 40/var(--tw-bg-opacity))}.bg-\\[\\#565656\\]{--tw-bg-opacity:1;background-color:rgb(86 86 86/var(--tw-bg-opacity))}.bg-black,.bg-\\[\\#000\\]{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-\\[\\#FFFFFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-underlay{background-color:#00000040}.bg-\\[\\#f3f3f3\\]{--tw-bg-opacity:1;background-color:rgb(243 243 243/var(--tw-bg-opacity))}.bg-secondaryVLight{--tw-bg-opacity:1;background-color:rgb(235 235 235/var(--tw-bg-opacity))}.bg-opacity-90{--tw-bg-opacity:.9}.object-cover{object-fit:cover}.p-2\\.5{padding:.625rem}.p-2{padding:.5rem}.p-\\[3px\\]{padding:3px}.p-\\[12px\\]{padding:12px}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-\\[9px\\]{padding-top:9px;padding-bottom:9px}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-\\[25px\\]{padding-top:25px;padding-bottom:25px}.px-\\[20px\\]{padding-left:20px;padding-right:20px}.pt-2\\.5{padding-top:.625rem}.pt-2{padding-top:.5rem}.pb-2\\.5{padding-bottom:.625rem}.pb-2{padding-bottom:.5rem}.pb-\\[25px\\]{padding-bottom:25px}.text-center{text-align:center}.text-base{letter-spacing:-.02em;font-size:16px;line-height:19px}.text-sm{letter-spacing:-.02em;font-size:14px;line-height:17px}.text-xs{letter-spacing:-.02em;font-size:12px;line-height:14px}.text-\\[112px\\]{font-size:112px}.text-xl{letter-spacing:-.02em;font-size:20px;line-height:24px}.text-lg{letter-spacing:-.02em;font-size:18px;line-height:22px}.font-medium{font-weight:500}.font-bold{font-weight:700}.font-normal{font-weight:400}.leading-\\[20px\\]{line-height:20px}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-primary{--tw-text-opacity:1;color:rgb(29 28 32/var(--tw-text-opacity))}.text-white\\/80{color:#fffc}.text-secondary{--tw-text-opacity:1;color:rgb(134 134 134/var(--tw-text-opacity))}.text-primaryLight{--tw-text-opacity:1;color:rgb(86 86 86/var(--tw-text-opacity))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-\\[0\\.4\\]{opacity:.4}.opacity-90{opacity:.9}.outline{outline-style:solid}.ring-\\[3px\\]{--tw-ring-offset-shadow:var(--tw-ring-inset)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-cta{--tw-ring-opacity:1;--tw-ring-color:rgb(38 138 250/var(--tw-ring-opacity))}.blur{--tw-blur:blur(8px);filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.filter{filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[transform\\,border-radius\\]{transition-property:transform,border-radius;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.inter{font-family:Inter,sans-serif}@supports (font-variation-settings:normal){.inter{font-family:Inter var,sans-serif}}.first-letter\\:capitalize:first-letter{text-transform:capitalize}.focus\\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.disabled\\:bg-secondaryLight:disabled{--tw-bg-opacity:1;background-color:rgb(179 179 179/var(--tw-bg-opacity))}.disabled\\:bg-graySelected:disabled{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity))}.disabled\\:text-secondaryLight:disabled{--tw-text-opacity:1;color:rgb(179 179 179/var(--tw-text-opacity))}")})]}),i.render((0,o.jsxs)(o.Fragment,{children:[a,(0,o.jsx)("link",{rel:"preconnect",href:"https://rsms.me/"}),(0,o.jsx)("link",{rel:"stylesheet",href:"https://rsms.me/inter/inter.css"}),(0,o.jsx)(oy,{options:n})]})),n.tracking&&f.init(3111933,6)},initGreeting:(e,t)=>{s(e).render((0,o.jsx)(Py,{onGreetingDone:t}))},setExtraSettingsOptions:e=>{const t=new CustomEvent("streamUISetExtraSettingsOptions",{detail:{extraOptions:e}});window.dispatchEvent(t)},startRecord:qo.startRecord.bind(qo),stopRecord:qo.stopRecord.bind(qo),sendNotification:Dr,joinRoom:qo.init.bind(qo),leaveRoom:qo.endCall.bind(qo),terminateRoom:qo.terminateRoom.bind(qo),generateToken:qo.generateToken.bind(qo),addEventListener:qo.addEventListener.bind(qo),removeEventListener:qo.removeEventListener.bind(qo),dispatchEvent:qo.dispatchEvent.bind(qo),getState:qo.getState.bind(qo),setProfile:qo.setProfile.bind(qo),setConfig:qo.setConfig.bind(qo),setLogLevel:e=>Xa.setLogLevel(e),getPermissions:()=>qo.getPermissions()};window.streamUI=Ty,window.snapcallAPI={join:(...e)=>(console.warn("snapcallAPI.join is deprecated, please use streamUI.joinRoom instead!"),Ty.joinRoom(...e)),endCall:(...e)=>(console.warn("snapcallAPI.endCall is deprecated, please use streamUI.leaveRoom instead!"),Ty.leaveRoom(...e)),terminateRoom:(...e)=>(console.warn("snapcallAPI.terminateRoom is deprecated, please use streamUI.terminateRoom instead!"),Ty.terminateRoom(...e)),generateToken:(...e)=>(console.warn("snapcallAPI.generateToken is deprecated, please use streamUI.generateToken instead!"),Ty.generateToken(...e)),setDisplayName:(...e)=>(console.warn("snapcallAPI.setDisplayName is deprecated, please use streamUI.joinRoom options instead!"),qo.setDisplayName(...e))}})();
|