diff --git a/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js b/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js index fa11f45481..23aaae5b92 100644 --- a/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js +++ b/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js @@ -1,2 +1,2 @@ /*! For license information please see PydioComponents.min.js.LICENSE.txt */ -(()=>{var e,t,n,r,o={5998:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(3997),o=n(7e3),i=n(5586),a=n(2471),s=n(2137),c=n(6194),l=n(5614),u=function(e,t,n){for(var r=0,i=0;r=i,i=(0,o.fj)(),38===r&&12===i&&(t[n]=1),!(0,o.r)(i);)(0,o.lp)();return(0,o.tP)(e,o.FK)},d=new WeakMap,p=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||d.get(n))&&!r){d.set(e,!0);for(var a=[],s=function(e,t){return(0,o.cE)(function(e,t){var n=-1,r=44;do{switch((0,o.r)(r)){case 0:38===r&&12===(0,o.fj)()&&(t[n]=1),e[n]+=u(o.FK-1,t,n);break;case 2:e[n]+=(0,o.iF)(r);break;case 4:if(44===r){e[++n]=58===(0,o.fj)()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=(0,i.Dp)(r)}}while(r=(0,o.lp)());return e}((0,o.un)(e),t))}(t,a),c=n.props,l=0,p=0;l6)switch((0,i.uO)(e,t+1)){case 109:if(45!==(0,i.uO)(e,t+4))break;case 102:return(0,i.gx)(e,/(.+:)(.+)-([^]+)/,"$1"+a.G$+"$2-$3$1"+a.uj+(108==(0,i.uO)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,i.Cw)(e,"stretch")?h((0,i.gx)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,i.uO)(e,t+1))break;case 6444:switch((0,i.uO)(e,(0,i.to)(e)-3-(~(0,i.Cw)(e,"!important")&&10))){case 107:return(0,i.gx)(e,":",":"+a.G$)+e;case 101:return(0,i.gx)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a.G$+(45===(0,i.uO)(e,14)?"inline-":"")+"box$3$1"+a.G$+"$2$3$1"+a.MS+"$2box$3")+e}break;case 5936:switch((0,i.uO)(e,t+11)){case 114:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return a.G$+e+a.MS+e+e}return e}var m=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case a.h5:e.return=h(e.value,e.length);break;case a.lK:return(0,s.q)([(0,o.JG)(e,{value:(0,i.gx)(e.value,"@","@"+a.G$)})],r);case a.Fr:if(e.length)return(0,i.$e)(e.props,(function(t){switch((0,i.EQ)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,s.q)([(0,o.JG)(e,{props:[(0,i.gx)(t,/:(read-\w+)/,":"+a.uj+"$1")]})],r);case"::placeholder":return(0,s.q)([(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,":"+a.G$+"input-$1")]}),(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,":"+a.uj+"$1")]}),(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,a.MS+"input-$1")]})],r)}return""}))}}];const y=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,i,a=e.stylisPlugins||m,u={},d=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n{"use strict";n.d(t,{Z:()=>r});const r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}},7611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7702),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const i=(0,r.Z)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},7702:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},5017:(e,t,n)=>{"use strict";n.d(t,{T:()=>s,w:()=>a});var r=n(6689),o=n(5998);n(1372),n(5335);var i=(0,r.createContext)("undefined"!=typeof HTMLElement?(0,o.Z)({key:"css"}):null);i.Provider;var a=function(e){return(0,r.forwardRef)((function(t,n){var o=(0,r.useContext)(i);return e(t,o,n)}))},s=(0,r.createContext)({})},1372:(e,t,n)=>{"use strict";n.d(t,{O:()=>y});var r=n(9783),o=n(6053),i=n(7702);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},d=(0,i.Z)((function(e){return l(e)?e:e.replace(s,"-$&").toLowerCase()})),p=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(c,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===o.Z[e]||l(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(a(n)){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{"use strict";n.d(t,{m:()=>r});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t{"use strict";n.d(t,{Z:()=>m});var r=n(212),o=n(6689),i=n(7611),a=n(5017),s=n(5394),c=n(1372),l=n(5335),u=i.Z,d=function(e){return"theme"!==e},p=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?u:d},f=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},h=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,s.hC)(t,n,r),(0,l.L)((function(){return(0,s.My)(t,n,r)})),null};const m=function e(t,n){var i,l,u=t.__emotion_real===t,d=u&&t.__emotion_base||t;void 0!==n&&(i=n.label,l=n.target);var m=f(t,n,u),y=m||p(d),v=!y("as");return function(){var b=arguments,g=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&g.push("label:"+i+";"),null==b[0]||void 0===b[0].raw)g.push.apply(g,b);else{g.push(b[0][0]);for(var S=b.length,w=1;w{"use strict";n.d(t,{Z:()=>i}),n(6689);var r=n(9513),o=(n(1372),n(5335),r.Z.bind());["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){o[e]=o(e)}));const i=o},6053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},5335:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(6689),o=!!r.useInsertionEffect&&r.useInsertionEffect||function(e){return e()}},5394:(e,t,n)=>{"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n.d(t,{My:()=>i,fp:()=>r,hC:()=>o});var o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},i=function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},416:(e,t,n)=>{"use strict";var r=n(7920);t.Z=void 0;var o=r(n(531)),i=n(1827),a=(0,o.default)((0,i.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");t.Z=a},7026:(e,t,n)=>{"use strict";var r=n(7920);t.Z=void 0;var o=r(n(531)),i=n(1827),a=(0,o.default)((0,i.jsx)("path",{d:"m10 17 5-5-5-5v10z"}),"ArrowRight");t.Z=a},531:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(942)},464:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"}},4956:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={black:"#000",white:"#fff"}},1268:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"}},4301:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"}},4512:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"}},3449:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"}},9293:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"}},7436:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"}},7444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(212);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n;return(0,r.Z)({toolbar:(n={minHeight:56},i(n,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),i(n,e.up("sm"),{minHeight:64}),n)},t)}},5202:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>S});var r=n(212),o=n(305),i=n(4070),a=n(4359),s=n(4951),c=n(4956),l=n(4301),u=n(9293),d=n(7436),p=n(3449),f=n(464),h=n(4512),m=n(1268),y=["mode","contrastThreshold","tonalOffset"],v={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:c.Z.white,default:c.Z.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},b={text:{primary:c.Z.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:c.Z.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function g(e,t,n,r){var o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,s.$n)(e.main,o):"dark"===t&&(e.dark=(0,s._j)(e.main,i)))}function S(e){var t=e.mode,n=void 0===t?"light":t,S=e.contrastThreshold,w=void 0===S?3:S,k=e.tonalOffset,O=void 0===k?.2:k,P=(0,o.Z)(e,y),E=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:f.Z[200],light:f.Z[50],dark:f.Z[400]}:{main:f.Z[700],light:f.Z[400],dark:f.Z[800]}}(n),C=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:u.Z[200],light:u.Z[50],dark:u.Z[400]}:{main:u.Z[500],light:u.Z[300],dark:u.Z[700]}}(n),T=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:d.Z[500],light:d.Z[300],dark:d.Z[700]}:{main:d.Z[700],light:d.Z[400],dark:d.Z[800]}}(n),x=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h.Z[400],light:h.Z[300],dark:h.Z[700]}:{main:h.Z[700],light:h.Z[500],dark:h.Z[900]}}(n),R=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m.Z[400],light:m.Z[300],dark:m.Z[700]}:{main:m.Z[800],light:m.Z[500],dark:m.Z[900]}}(n),j=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p.Z[400],light:p.Z[300],dark:p.Z[700]}:{main:"#ed6c02",light:p.Z[500],dark:p.Z[900]}}(n);function I(e){return(0,s.mi)(e,b.text.primary)>=w?b.text.primary:v.text.primary}var _=function(e){var t=e.color,n=e.name,o=e.mainShade,a=void 0===o?500:o,s=e.lightShade,c=void 0===s?300:s,l=e.darkShade,u=void 0===l?700:l;if(!(t=(0,r.Z)({},t)).main&&t[a]&&(t.main=t[a]),!t.hasOwnProperty("main"))throw new Error((0,i.Z)(11,n?" (".concat(n,")"):"",a));if("string"!=typeof t.main)throw new Error((0,i.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return g(t,"light",c,O),g(t,"dark",u,O),t.contrastText||(t.contrastText=I(t.main)),t},A={dark:b,light:v};return(0,a.Z)((0,r.Z)({common:(0,r.Z)({},c.Z),mode:n,primary:_({color:E,name:"primary"}),secondary:_({color:C,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:_({color:T,name:"error"}),warning:_({color:j,name:"warning"}),info:_({color:x,name:"info"}),success:_({color:R,name:"success"}),grey:l.Z,contrastThreshold:w,getContrastText:I,augmentColor:_,tonalOffset:O},A[n]),P)}},8662:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(212),o=n(305),i=n(4070),a=n(4359),s=n(5156),c=n(1426),l=n(6713),u=n(7444),d=n(5202),p=n(9794),f=n(5891),h=n(4681),m=n(7308),y=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];const v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,v=e.palette,b=void 0===v?{}:v,g=e.transitions,S=void 0===g?{}:g,w=e.typography,k=void 0===w?{}:w,O=(0,o.Z)(e,y);if(e.vars)throw new Error((0,i.Z)(18));var P=(0,d.ZP)(b),E=(0,s.Z)(e),C=(0,a.Z)(E,{mixins:(0,u.Z)(E.breakpoints,n),palette:P,shadows:f.Z.slice(),typography:(0,p.Z)(P,k),transitions:(0,h.ZP)(S),zIndex:(0,r.Z)({},m.Z)});C=(0,a.Z)(C,O);for(var T=arguments.length,x=new Array(T>1?T-1:0),R=1;R{"use strict";n.d(t,{ZP:()=>u,x9:()=>s});var r=n(305),o=n(212),i=["duration","easing","delay"],a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},s={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function c(e){return"".concat(Math.round(e),"ms")}function l(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function u(e){var t=(0,o.Z)({},a,e.easing),n=(0,o.Z)({},s,e.duration);return(0,o.Z)({getAutoHeightDuration:l,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.duration,s=void 0===a?n.standard:a,l=o.easing,u=void 0===l?t.easeInOut:l,d=o.delay,p=void 0===d?0:d;return(0,r.Z)(o,i),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof s?s:c(s)," ").concat(u," ").concat("string"==typeof p?p:c(p))})).join(",")}},e,{easing:t,duration:n})}},9794:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(212),o=n(305),i=n(4359),a=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"],s={textTransform:"uppercase"},c='"Roboto", "Helvetica", "Arial", sans-serif';function l(e,t){var n="function"==typeof t?t(e):t,l=n.fontFamily,u=void 0===l?c:l,d=n.fontSize,p=void 0===d?14:d,f=n.fontWeightLight,h=void 0===f?300:f,m=n.fontWeightRegular,y=void 0===m?400:m,v=n.fontWeightMedium,b=void 0===v?500:v,g=n.fontWeightBold,S=void 0===g?700:g,w=n.htmlFontSize,k=void 0===w?16:w,O=n.allVariants,P=n.pxToRem,E=(0,o.Z)(n,a),C=p/14,T=P||function(e){return"".concat(e/k*C,"rem")},x=function(e,t,n,o,i){return(0,r.Z)({fontFamily:u,fontWeight:e,fontSize:T(t),lineHeight:n},u===c?{letterSpacing:"".concat((a=o/t,Math.round(1e5*a)/1e5),"em")}:{},i,O);var a},R={h1:x(h,96,1.167,-1.5),h2:x(h,60,1.2,-.5),h3:x(y,48,1.167,0),h4:x(y,34,1.235,.25),h5:x(y,24,1.334,0),h6:x(b,20,1.6,.15),subtitle1:x(y,16,1.75,.15),subtitle2:x(b,14,1.57,.1),body1:x(y,16,1.5,.15),body2:x(y,14,1.43,.15),button:x(b,14,1.75,.4,s),caption:x(y,12,1.66,.4),overline:x(y,12,2.66,1,s)};return(0,i.Z)((0,r.Z)({htmlFontSize:k,pxToRem:T,fontFamily:u,fontSize:p,fontWeightLight:h,fontWeightRegular:y,fontWeightMedium:b,fontWeightBold:S},R),E,{clone:!1})}},6651:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(0,n(8662).Z)()},5891:(e,t,n)=>{"use strict";function r(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}n.d(t,{Z:()=>o});const o=["none",r(0,2,1,-1,0,1,1,0,0,1,3,0),r(0,3,1,-2,0,2,2,0,0,1,5,0),r(0,3,3,-2,0,3,4,0,0,1,8,0),r(0,2,4,-1,0,4,5,0,0,1,10,0),r(0,3,5,-1,0,5,8,0,0,1,14,0),r(0,3,5,-1,0,6,10,0,0,1,18,0),r(0,4,5,-2,0,7,10,1,0,2,16,1),r(0,5,5,-3,0,8,10,1,0,3,14,2),r(0,5,6,-3,0,9,12,1,0,3,16,2),r(0,6,6,-3,0,10,14,1,0,4,18,3),r(0,6,7,-4,0,11,15,1,0,4,20,3),r(0,7,8,-4,0,12,17,2,0,5,22,4),r(0,7,8,-4,0,13,19,2,0,5,24,4),r(0,7,9,-4,0,14,21,2,0,5,26,4),r(0,8,9,-5,0,15,22,2,0,6,28,5),r(0,8,10,-5,0,16,24,2,0,6,30,5),r(0,8,11,-5,0,17,26,2,0,6,32,5),r(0,9,11,-5,0,18,28,2,0,7,34,6),r(0,9,12,-6,0,19,29,2,0,7,36,6),r(0,10,13,-6,0,20,31,3,0,8,38,7),r(0,10,13,-6,0,21,33,3,0,8,40,7),r(0,10,14,-6,0,22,35,3,0,8,42,7),r(0,11,14,-7,0,23,36,3,0,9,44,8),r(0,11,15,-7,0,24,38,3,0,9,46,8)]},9812:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>i});var r=n(8045),o=n(6651);const i=(0,r.ZP)({defaultTheme:o.Z,rootShouldForwardProp:function(e){return(0,r.x9)(e)&&"classes"!==e}})},5670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9420),o=n(6651);function i(e){var t=e.props,n=e.name;return(0,r.Z)({props:t,name:n,defaultTheme:o.Z})}},7308:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},942:(e,t,n)=>{"use strict";n.r(t),n.d(t,{capitalize:()=>o,createChainedFunction:()=>i,createSvgIcon:()=>w,debounce:()=>k,deprecatedPropType:()=>O,isMuiElement:()=>P,ownerDocument:()=>E.Z,ownerWindow:()=>T,requirePropFactory:()=>x,setRef:()=>R,unstable_ClassNameGenerator:()=>q,unstable_useEnhancedEffect:()=>j.Z,unstable_useId:()=>I.Z,unsupportedProp:()=>_,useControlled:()=>A.Z,useEventCallback:()=>N,useForkRef:()=>L.Z,useIsFocusVisible:()=>H});var r=n(611);const o=n(994).Z,i=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=this,o=arguments.length,i=new Array(o),a=0;a{"use strict";n.d(t,{Z:()=>r});const r=n(1788).Z},7181:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(9767).Z},4017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(7116).Z},8241:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(127).Z},9813:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(1822).Z},7809:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(6689).createContext(null)},2292:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689),o=n(7809);function i(){return r.useContext(o.Z)}},254:(e,t,n)=>{"use strict";n.d(t,{Co:()=>i,ZP:()=>o});var r=n(5040);function o(e,t){return(0,r.Z)(e,t)}var i=function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},2455:(e,t,n)=>{"use strict";n.d(t,{E0:()=>b,NL:()=>s});var r=n(5770),o=n(5115),i=n(7654),a=n(1250);function s(e){return"number"!=typeof e?e:"".concat(e,"px solid")}var c=(0,r.ZP)({prop:"border",themeKey:"borders",transform:s}),l=(0,r.ZP)({prop:"borderTop",themeKey:"borders",transform:s}),u=(0,r.ZP)({prop:"borderRight",themeKey:"borders",transform:s}),d=(0,r.ZP)({prop:"borderBottom",themeKey:"borders",transform:s}),p=(0,r.ZP)({prop:"borderLeft",themeKey:"borders",transform:s}),f=(0,r.ZP)({prop:"borderColor",themeKey:"palette"}),h=(0,r.ZP)({prop:"borderTopColor",themeKey:"palette"}),m=(0,r.ZP)({prop:"borderRightColor",themeKey:"palette"}),y=(0,r.ZP)({prop:"borderBottomColor",themeKey:"palette"}),v=(0,r.ZP)({prop:"borderLeftColor",themeKey:"palette"}),b=function(e){if(void 0!==e.borderRadius&&null!==e.borderRadius){var t=(0,i.eI)(e.theme,"shape.borderRadius",4,"borderRadius");return(0,a.k9)(e,e.borderRadius,(function(e){return{borderRadius:(0,i.NA)(t,e)}}))}return null};b.propTypes={},b.filterProps=["borderRadius"],(0,o.Z)(c,l,u,d,p,f,h,m,y,v,b)},1250:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{L7:()=>c,VO:()=>o,W8:()=>s,k9:()=>a}),n(580);var o={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(o[e],"px)")}};function a(e,t,n){var a=e.theme||{};if(Array.isArray(t)){var s=a.breakpoints||i;return t.reduce((function(e,r,o){return e[s.up(s.keys[o])]=n(t[o]),e}),{})}if("object"===r(t)){var c=a.breakpoints||i;return Object.keys(t).reduce((function(e,r){if(-1!==Object.keys(c.values||o).indexOf(r))e[c.up(r)]=n(t[r],r);else{var i=r;e[i]=t[i]}return e}),{})}return n(t)}function s(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{}))||{}}function c(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}},4951:(e,t,n)=>{"use strict";n.d(t,{$n:()=>d,Fq:()=>l,_j:()=>u,mi:()=>c});var r=n(4070);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));var o,a=e.substring(t+1,e.length-1);if("color"===n){if(o=(a=a.split(" ")).shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o))throw new Error((0,r.Z)(10,o))}else a=a.split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)})),colorSpace:o}}function a(e){var t=e.type,n=e.colorSpace,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function s(e){var t="hsl"===(e=i(e)).type||"hsla"===e.type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,s=r*Math.min(o,1-o),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-s*Math.max(Math.min(t-3,9-t,1),-1)},l="rgb",u=[Math.round(255*c(0)),Math.round(255*c(8)),Math.round(255*c(4))];return"hsla"===e.type&&(l+="a",u.push(t[3])),a({type:l,values:u})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){var n=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e,t){return e=i(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,a(e)}function u(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function d(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return a(e)}},5115:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(1403);const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{ZP:()=>w,x9:()=>g});var r=n(9807),o=n(633),i=n(254),a=n(5156),s=n(1195),c=n(6713);function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=void 0===t?S:t,a=e.rootShouldForwardProp,s=void 0===a?g:a,d=e.slotShouldForwardProp,w=void 0===d?g:d,k=function(e){var t=m(e.theme)?n:e.theme;return(0,c.Z)((0,o.Z)({},e,{theme:t}))};return k.__mui_systemSx=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Co)(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var a=t.name,c=t.slot,d=t.skipVariantsResolver,S=t.skipSx,O=t.overridesResolver,P=(0,r.Z)(t,p),E=void 0!==d?d:c&&"Root"!==c||!1,C=S||!1,T=g;"Root"===c?T=s:c?T=w:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(T=void 0);var x=(0,i.ZP)(e,(0,o.Z)({shouldForwardProp:T,label:void 0},P)),R=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s0){var g=new Array(p).fill("");(d=[].concat(l(e),l(g))).raw=[].concat(l(e.raw),l(g))}else"function"==typeof e&&e.__emotion_real!==e&&(d=function(t){var i=t.theme,a=(0,r.Z)(t,h);return e((0,o.Z)({theme:m(i)?n:i},a))});return x.apply(void 0,[d].concat(l(c)))};return x.withConfig&&(R.withConfig=x.withConfig),R}}},6828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(9807),o=n(633);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=["values","unit","step"],s=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,o.Z)({},e,function(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t.key,t.val))}),{})};function c(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,i=e.unit,c=void 0===i?"px":i,l=e.step,u=void 0===l?5:l,d=(0,r.Z)(e,a),p=s(n),f=Object.keys(p);function h(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(c,")")}function m(e){var t="number"==typeof n[e]?n[e]:e;return"@media (max-width:".concat(t-u/100).concat(c,")")}function y(e,t){var r=f.indexOf(t);return"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(c,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[f[r]]?n[f[r]]:t)-u/100).concat(c,")")}return(0,o.Z)({keys:f,values:p,up:h,down:m,between:y,only:function(e){return f.indexOf(e)+1{"use strict";n.d(t,{Z:()=>o});var r=n(7654);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,r.hB)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r{"use strict";n.d(t,{Z:()=>p});var r=n(633),o=n(9807),i=n(4359),a=n(6828),s=n(1202),c=n(2500),l=n(6713),u=n(1426),d=["breakpoints","palette","spacing","shape"];const p=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,p=e.palette,f=void 0===p?{}:p,h=e.spacing,m=e.shape,y=void 0===m?{}:m,v=(0,o.Z)(e,d),b=(0,a.Z)(n),g=(0,c.Z)(h),S=(0,i.Z)({breakpoints:b,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},f),spacing:g,shape:(0,r.Z)({},s.Z,y)},v),w=arguments.length,k=new Array(w>1?w-1:0),O=1;O{"use strict";n.d(t,{Z:()=>r});const r={borderRadius:4}},5607:(e,t,n)=>{"use strict";n.d(t,{SG:()=>s,e$:()=>c,s2:()=>l});var r=n(5770),o=n(5115),i=n(7654),a=n(1250),s=function(e){if(void 0!==e.gap&&null!==e.gap){var t=(0,i.eI)(e.theme,"spacing",8,"gap");return(0,a.k9)(e,e.gap,(function(e){return{gap:(0,i.NA)(t,e)}}))}return null};s.propTypes={},s.filterProps=["gap"];var c=function(e){if(void 0!==e.columnGap&&null!==e.columnGap){var t=(0,i.eI)(e.theme,"spacing",8,"columnGap");return(0,a.k9)(e,e.columnGap,(function(e){return{columnGap:(0,i.NA)(t,e)}}))}return null};c.propTypes={},c.filterProps=["columnGap"];var l=function(e){if(void 0!==e.rowGap&&null!==e.rowGap){var t=(0,i.eI)(e.theme,"spacing",8,"rowGap");return(0,a.k9)(e,e.rowGap,(function(e){return{rowGap:(0,i.NA)(t,e)}}))}return null};l.propTypes={},l.filterProps=["rowGap"];var u=(0,r.ZP)({prop:"gridColumn"}),d=(0,r.ZP)({prop:"gridRow"}),p=(0,r.ZP)({prop:"gridAutoFlow"}),f=(0,r.ZP)({prop:"gridAutoColumns"}),h=(0,r.ZP)({prop:"gridAutoRows"}),m=(0,r.ZP)({prop:"gridTemplateColumns"}),y=(0,r.ZP)({prop:"gridTemplateRows"}),v=(0,r.ZP)({prop:"gridTemplateAreas"}),b=(0,r.ZP)({prop:"gridArea"});(0,o.Z)(s,c,l,u,d,p,f,h,m,y,v,b)},8838:(e,t,n)=>{"use strict";function r(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{Z:()=>r})},1403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4359);const o=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},9598:(e,t,n)=>{"use strict";n.d(t,{Sh:()=>i});var r=n(5770),o=n(5115);function i(e,t){return"grey"===t?t:e}var a=(0,r.ZP)({prop:"color",themeKey:"palette",transform:i}),s=(0,r.ZP)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i}),c=(0,r.ZP)({prop:"backgroundColor",themeKey:"palette",transform:i});(0,o.Z)(a,s,c)},1195:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9807),o=n(994),i=["variant"];function a(e){return 0===e.length}function s(e){var t=e.variant,n=(0,r.Z)(e,i),s=t||"";return Object.keys(n).sort().forEach((function(t){s+="color"===t?a(s)?e[t]:(0,o.Z)(e[t]):"".concat(a(s)?t:(0,o.Z)(t)).concat((0,o.Z)(e[t].toString()))})),s}},1384:(e,t,n)=>{"use strict";n.d(t,{EB:()=>a,kk:()=>c});var r=n(5770),o=n(5115),i=n(1250);function a(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}var s=(0,r.ZP)({prop:"width",transform:a}),c=function(e){return void 0!==e.maxWidth&&null!==e.maxWidth?(0,i.k9)(e,e.maxWidth,(function(t){var n,r,o;return{maxWidth:(null==(n=e.theme)||null==(r=n.breakpoints)||null==(o=r.values)?void 0:o[t])||i.VO[t]||a(t)}})):null};c.filterProps=["maxWidth"];var l=(0,r.ZP)({prop:"minWidth",transform:a}),u=(0,r.ZP)({prop:"height",transform:a}),d=(0,r.ZP)({prop:"maxHeight",transform:a}),p=(0,r.ZP)({prop:"minHeight",transform:a}),f=((0,r.ZP)({prop:"size",cssProperty:"width",transform:a}),(0,r.ZP)({prop:"size",cssProperty:"height",transform:a}),(0,r.ZP)({prop:"boxSizing"}));(0,o.Z)(s,c,l,u,d,p,f)},7654:(e,t,n)=>{"use strict";n.d(t,{NA:()=>v,e6:()=>g,eI:()=>m,hB:()=>y,o3:()=>S});var r=n(1250),o=n(5770),i=n(1403),a=n(8838);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2){if(!u[e])return[e];e=u[e]}var t,n,r=(t=e.split(""),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(t,n)||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.")}()),o=r[0],i=r[1],a=c[o],d=l[i]||"";return Array.isArray(d)?d.map((function(e){return a+e})):[a+d]})),p=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],f=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[].concat(p,f);function m(e,t,n,r){var i,a=null!=(i=(0,o.DW)(e,t,!1))?i:n;return"number"==typeof a?function(e){return"string"==typeof e?e:a*e}:Array.isArray(a)?function(e){return"string"==typeof e?e:a[e]}:"function"==typeof a?a:function(){}}function y(e){return m(e,"spacing",8)}function v(e,t){if("string"==typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}function b(e,t){var n=y(e.theme);return Object.keys(e).map((function(o){return function(e,t,n,o){if(-1===t.indexOf(n))return null;var i=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=v(t,n),e}),{})}}(d(n),o),a=e[n];return(0,r.k9)(e,a,i)}(e,t,o,n)})).reduce(i.Z,{})}function g(e){return b(e,p)}function S(e){return b(e,f)}function w(e){return b(e,h)}g.propTypes={},g.filterProps=p,S.propTypes={},S.filterProps=f,w.propTypes={},w.filterProps=h},5770:(e,t,n)=>{"use strict";n.d(t,{DW:()=>a,Jq:()=>s,ZP:()=>c});var r=n(994),o=n(1250);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){var r="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=r)return r}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function s(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"==typeof e?e(n):Array.isArray(e)?e[n]||o:a(e,n)||o,t&&(r=t(r,o,e)),r}const c=function(e){var t=e.prop,n=e.cssProperty,c=void 0===n?e.prop:n,l=e.themeKey,u=e.transform,d=function(e){if(null==e[t])return null;var n=e[t],d=a(e.theme,l)||{};return(0,o.k9)(e,n,(function(e){var n=s(d,u,e);return e===n&&"string"==typeof e&&(n=s(d,u,"".concat(t).concat("default"===e?"":(0,r.Z)(e)),e)),!1===c?n:function(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},c,n)}))};return d.propTypes={},d.filterProps=[t],d}},1426:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7654),o=n(2455),i=n(5607),a=n(9598),s=n(1384);const c={border:{themeKey:"borders",transform:o.NL},borderTop:{themeKey:"borders",transform:o.NL},borderRight:{themeKey:"borders",transform:o.NL},borderBottom:{themeKey:"borders",transform:o.NL},borderLeft:{themeKey:"borders",transform:o.NL},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:o.E0},color:{themeKey:"palette",transform:a.Sh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:a.Sh},backgroundColor:{themeKey:"palette",transform:a.Sh},p:{style:r.o3},pt:{style:r.o3},pr:{style:r.o3},pb:{style:r.o3},pl:{style:r.o3},px:{style:r.o3},py:{style:r.o3},padding:{style:r.o3},paddingTop:{style:r.o3},paddingRight:{style:r.o3},paddingBottom:{style:r.o3},paddingLeft:{style:r.o3},paddingX:{style:r.o3},paddingY:{style:r.o3},paddingInline:{style:r.o3},paddingInlineStart:{style:r.o3},paddingInlineEnd:{style:r.o3},paddingBlock:{style:r.o3},paddingBlockStart:{style:r.o3},paddingBlockEnd:{style:r.o3},m:{style:r.e6},mt:{style:r.e6},mr:{style:r.e6},mb:{style:r.e6},ml:{style:r.e6},mx:{style:r.e6},my:{style:r.e6},margin:{style:r.e6},marginTop:{style:r.e6},marginRight:{style:r.e6},marginBottom:{style:r.e6},marginLeft:{style:r.e6},marginX:{style:r.e6},marginY:{style:r.e6},marginInline:{style:r.e6},marginInlineStart:{style:r.e6},marginInlineEnd:{style:r.e6},marginBlock:{style:r.e6},marginBlockStart:{style:r.e6},marginBlockEnd:{style:r.e6},displayPrint:{cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:i.SG},rowGap:{style:i.s2},columnGap:{style:i.e$},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:s.EB},maxWidth:{style:s.kk},minWidth:{transform:s.EB},height:{transform:s.EB},maxHeight:{transform:s.EB},minHeight:{transform:s.EB},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}},6713:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(994),o=n(1403),i=n(5770),a=n(1250),s=n(1426);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(){function e(e,t,n,o){var s,c=(l(s={},e,t),l(s,"theme",n),s),u=o[e];if(!u)return l({},e,t);var d=u.cssProperty,p=void 0===d?e:d,f=u.themeKey,h=u.transform,m=u.style;if(null==t)return null;var y=(0,i.DW)(n,f)||{};return m?m(c):(0,a.k9)(c,t,(function(t){var n=(0,i.Jq)(y,h,t);return t===n&&"string"==typeof t&&(n=(0,i.Jq)(y,h,"".concat(e).concat("default"===t?"":(0,r.Z)(t)),t)),!1===p?n:l({},p,n)}))}return function t(n){var r,i=n||{},u=i.sx,d=i.theme,p=void 0===d?{}:d;if(!u)return null;var f=null!=(r=p.unstable_sxConfig)?r:s.Z;function h(n){var r=n;if("function"==typeof n)r=n(p);else if("object"!==c(n))return n;if(!r)return null;var i=(0,a.W8)(p.breakpoints),s=Object.keys(i),u=i;return Object.keys(r).forEach((function(n){var i,s="function"==typeof(i=r[n])?i(p):i;if(null!=s)if("object"===c(s))if(f[n])u=(0,o.Z)(u,e(n,s,p,f));else{var d=(0,a.k9)({theme:p},s,(function(e){return l({},n,e)}));!function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{Z:()=>a});var r=n(5156),o=n(4313),i=(0,r.Z)();const a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,o.Z)(e)}},3002:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(848);function o(e){var t=e.theme,n=e.name,o=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,o):o}},9420:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(3002),o=n(2957);function i(e){var t=e.props,n=e.name,i=e.defaultTheme,a=(0,o.Z)(i);return(0,r.Z)({theme:a,name:n,props:t})}},4313:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(2292);const o=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=(0,r.Z)();return n&&(e=n,0!==Object.keys(e).length)?n:t}},611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r,o=function(e){return e};const i=(r=o,{configure:function(e){r=e},generate:function(e){return r(e)},reset:function(){r=o}})},994:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4070);function o(e){if("string"!=typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},7283:(e,t,n)=>{"use strict";function r(e,t,n){var r={};return Object.keys(e).forEach((function(o){r[o]=e[o].reduce((function(e,r){return r&&(e.push(t(r)),n&&n[r]&&e.push(n[r])),e}),[]).join(" ")})),r}n.d(t,{Z:()=>r})},4359:(e,t,n)=>{"use strict";n.d(t,{P:()=>i,Z:()=>s});var r=n(633);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e){return null!==e&&"object"===o(e)&&e.constructor===Object}function a(e){if(!i(e))return e;var t={};return Object.keys(e).forEach((function(n){t[n]=a(e[n])})),t}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},o=n.clone?(0,r.Z)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e&&i(e[r])?o[r]=s(e[r],t[r],n):n.clone?o[r]=i(t[r])?a(t[r]):t[r]:o[r]=t[r])})),o}},4070:(e,t,n)=>{"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;nr})},9691:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(611),o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",i=o[t];return i?"".concat(n,"-").concat(i):"".concat(r.Z.generate(e),"-").concat(t)}},4177:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9691);function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",o={};return t.forEach((function(t){o[t]=(0,r.Z)(e,t,n)})),o}},1788:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:()=>r})},848:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(633);function o(e,t){var n=(0,r.Z)({},t);return Object.keys(e).forEach((function(i){if(i.toString().match(/^(components|slots)$/))n[i]=(0,r.Z)({},e[i],n[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){var a=e[i]||{},s=t[i];n[i]={},s&&Object.keys(s)?a&&Object.keys(a)?(n[i]=(0,r.Z)({},s),Object.keys(a).forEach((function(e){n[i][e]=o(a[e],s[e])}))):n[i]=s:n[i]=a}else void 0===n[i]&&(n[i]=e[i])})),n}},7630:(e,t,n)=>{"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:()=>r})},9767:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{Z:()=>o});var r=n(6689);const o="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},127:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689),o=n(7630);function i(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{Z:()=>s});var r=n(6689);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";var r=n(8754),o=n(3700),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},3700:(e,t,n)=>{"use strict";var r=n(298),o=n(8754),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,a,arguments);return c&&l&&c(t,"length").configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},2053:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==r(e))if(Array.isArray(e))for(t=0;ti});const i=function(){for(var e,t,n=0,r="";n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(6205),i=n(8317),a=n(6232),s=n(5142),c=n(1881),l=n(9318),u=n(9490),d=n(2228),p=n(8754),f=n(5554),h=n(2567),m=n(3634),y=n(9238),v=n(5056),b=n(4545),g=f("Date.prototype.getTime"),S=Object.getPrototypeOf,w=f("Object.prototype.toString"),k=p("%Set%",!0),O=f("Map.prototype.has",!0),P=f("Map.prototype.get",!0),E=f("Map.prototype.size",!0),C=f("Set.prototype.add",!0),T=f("Set.prototype.delete",!0),x=f("Set.prototype.has",!0),R=f("Set.prototype.size",!0);function j(e,t,n,r){for(var o,i=m(e);(o=i.next())&&!o.done;)if(N(t,o.value,n,r))return T(e,o.value),!0;return!1}function I(e){return void 0===e?null:"object"!==r(e)?"symbol"!==r(e)&&("string"!=typeof e&&"number"!=typeof e||+e==+e):void 0}function _(e,t,n,r,o,i){var a=I(n);if(null!=a)return a;var s=P(t,a),c=b({},o,{strict:!1});return!(void 0===s&&!O(t,a)||!N(r,s,c,i))&&!O(e,a)&&N(r,s,c,i)}function A(e,t,n){var r=I(n);return null!=r?r:x(t,r)&&!x(e,r)}function M(e,t,n,r,o,i){for(var a,s,c=m(e);(a=c.next())&&!a.done;)if(N(n,s=a.value,o,i)&&N(r,P(t,s),o,i))return T(e,s),!0;return!1}function N(e,t,n,p){var f=n||{};if(f.strict?a(e,t):e===t)return!0;if(d(e)!==d(t))return!1;if(!e||!t||"object"!==r(e)&&"object"!==r(t))return f.strict?a(e,t):e==t;var y,T=p.has(e),I=p.has(t);if(T&&I){if(p.get(e)===p.get(t))return!0}else y={};return T||p.set(e,y),I||p.set(t,y),function(e,t,n,a){var d,p;if(r(e)!==r(t))return!1;if(null==e||null==t)return!1;if(w(e)!==w(t))return!1;if(i(e)!==i(t))return!1;if(l(e)!==l(t))return!1;var f=e instanceof Error,y=t instanceof Error;if(f!==y)return!1;if((f||y)&&(e.name!==t.name||e.message!==t.message))return!1;var T=s(e),I=s(t);if(T!==I)return!1;if((T||I)&&(e.source!==t.source||c(e)!==c(t)))return!1;var L=u(e),U=u(t);if(L!==U)return!1;if((L||U)&&g(e)!==g(t))return!1;if(n.strict&&S&&S(e)!==S(t))return!1;if(v(e)!==v(t))return!1;var B=D(e),F=D(t);if(B!==F)return!1;if(B||F){if(e.length!==t.length)return!1;for(d=0;d=0;d--)if(z[d]!=W[d])return!1;for(d=z.length-1;d>=0;d--)if(!N(e[p=z[d]],t[p],n,a))return!1;var Z=h(e),H=h(t);return Z===H&&("Set"===Z||"Set"===H?function(e,t,n,o){if(R(e)!==R(t))return!1;for(var i,a,s,c=m(e),l=m(t);(i=c.next())&&!i.done;)if(i.value&&"object"===r(i.value))s||(s=new k),C(s,i.value);else if(!x(t,i.value)){if(n.strict)return!1;if(!A(e,t,i.value))return!1;s||(s=new k),C(s,i.value)}if(s){for(;(a=l.next())&&!a.done;)if(a.value&&"object"===r(a.value)){if(!j(s,a.value,n.strict,o))return!1}else if(!n.strict&&!x(e,a.value)&&!j(s,a.value,n.strict,o))return!1;return 0===R(s)}return!0}(e,t,n,a):"Map"!==Z||function(e,t,n,o){if(E(e)!==E(t))return!1;for(var i,a,s,c,l,u,d=m(e),p=m(t);(i=d.next())&&!i.done;)if(c=i.value[0],l=i.value[1],c&&"object"===r(c))s||(s=new k),C(s,c);else if(void 0===(u=P(t,c))&&!O(t,c)||!N(l,u,n,o)){if(n.strict)return!1;if(!_(e,t,c,l,n,o))return!1;s||(s=new k),C(s,c)}if(s){for(;(a=p.next())&&!a.done;)if(c=a.value[0],u=a.value[1],c&&"object"===r(c)){if(!M(s,e,c,u,n,o))return!1}else if(!(n.strict||e.has(c)&&N(P(e,c),u,n,o)||M(s,e,c,u,b({},n,{strict:!1}),o)))return!1;return 0===R(s)}return!0}(e,t,n,a))}(e,t,f,p)}function D(e){return!(!e||"object"!==r(e)||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0]||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))}e.exports=function(e,t,n){return N(e,t,n,y())}},3510:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(6205),i="function"==typeof Symbol&&"symbol"===r(Symbol("foo")),a=Object.prototype.toString,s=Array.prototype.concat,c=Object.defineProperty,l=c&&function(){var e={};try{for(var t in c(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(l?c(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},d=function(e,t){var n=arguments.length>2?arguments[2]:{},r=o(t);i&&(r=s.call(r,Object.getOwnPropertySymbols(t)));for(var a=0;a{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(e,r,o){if("[object Function]"!==n.call(r))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a{"use strict";var t=Array.prototype.slice,n=Object.prototype.toString;e.exports=function(e){var r=this;if("function"!=typeof r||"[object Function]"!==n.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var o,i=t.call(arguments,1),a=Math.max(0,r.length-i.length),s=[],c=0;c{"use strict";var r=n(2859);e.exports=Function.prototype.bind||r},9045:e=>{"use strict";var t=function(){return"string"==typeof function(){}.name},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch(e){n=null}t.functionsHaveConfigurableNames=function(){return t()&&n&&!!n((function(){}),"name").configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},e.exports=t},8754:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o,i=SyntaxError,a=Function,s=TypeError,c=function(e){try{return a('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var u=function(){throw new s},d=l?function(){try{return u}catch(e){try{return l(arguments,"callee").get}catch(e){return u}}}():u,p=n(8921)(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},m="undefined"==typeof Uint8Array?o:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):o,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":r(JSON))?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):o,"%Symbol%":p?Symbol:o,"%SyntaxError%":i,"%ThrowTypeError%":d,"%TypedArray%":m,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},v=function e(t){var n;if("%AsyncFunction%"===t)n=c("async function () {}");else if("%GeneratorFunction%"===t)n=c("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=c("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=f(o.prototype))}return y[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=n(298),S=n(6841),w=g.call(Function.call,Array.prototype.concat),k=g.call(Function.apply,Array.prototype.splice),O=g.call(Function.call,String.prototype.replace),P=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,T=function(e,t){var n,r=e;if(S(b,r)&&(r="%"+(n=b[r])[0]+"%"),S(y,r)){var o=y[r];if(o===h&&(o=v(r)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var n=function(e){var t=P(e,0,1),n=P(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return O(e,E,(function(e,t,n,o){r[r.length]=n?O(o,C,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=T("%"+r+"%",t),a=o.name,c=o.value,u=!1,d=o.alias;d&&(r=d[0],k(n,w([0,1],d)));for(var p=1,f=!0;p=n.length){var b=l(c,h);c=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[h]}else f=S(c,h),c=c[h];f&&!u&&(y[a]=c)}}return c}},4521:(e,t)=>{},8921:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="undefined"!=typeof Symbol&&Symbol,i=n(17);e.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===r(o("foo"))&&"symbol"===r(Symbol("bar"))&&i()}},17:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===t(Symbol.iterator))return!0;var e={},n=Symbol("test"),r=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,n);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6841:(e,t,n)=>{"use strict";var r=n(298);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},8317:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="function"==typeof Symbol&&"symbol"===r(Symbol.toStringTag),i=n(5554)("Object.prototype.toString"),a=function(e){return!(o&&e&&"object"===r(e)&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!a(e)||null!==e&&"object"===r(e)&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},c=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=c?a:s},999:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}if("function"==typeof BigInt){var n=BigInt.prototype.valueOf;e.exports=function(e){return null!=e&&"boolean"!=typeof e&&"string"!=typeof e&&"number"!=typeof e&&"symbol"!==t(e)&&"function"!=typeof e&&("bigint"==typeof e||function(e){try{return n.call(e),!0}catch(e){}return!1}(e))}}else e.exports=function(e){return!1}},5217:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(5554),i=o("Boolean.prototype.toString"),a=o("Object.prototype.toString"),s="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"boolean"==typeof e||null!==e&&"object"===r(e)&&(s&&Symbol.toStringTag in e?function(e){try{return i(e),!0}catch(e){return!1}}(e):"[object Boolean]"===a(e))}},9490:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Date.prototype.getDay,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"object"===t(e)&&null!==e&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===r.call(e))}},7233:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;r||(n=function(e){return!1});var i=r?Map.prototype.has:null,a=o?Set.prototype.has:null;n||i||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(i.call(e),a)try{a.call(e)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},2869:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Number.prototype.toString,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"number"==typeof e||"object"===t(e)&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Number]"===r.call(e))}},5142:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o,i,a,s,c=n(5554),l=n(17)()&&!!Symbol.toStringTag;if(l){o=c("Object.prototype.hasOwnProperty"),i=c("RegExp.prototype.exec"),a={};var u=function(){throw a};s={toString:u,valueOf:u},"symbol"===r(Symbol.toPrimitive)&&(s[Symbol.toPrimitive]=u)}var d=c("Object.prototype.toString"),p=Object.getOwnPropertyDescriptor;e.exports=l?function(e){if(!e||"object"!==r(e))return!1;var t=p(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{i(e,s)}catch(e){return e===a}}:function(e){return!(!e||"object"!==r(e)&&"function"!=typeof e)&&"[object RegExp]"===d(e)}},1189:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;o||(n=function(e){return!1});var i=r?Map.prototype.has:null,a=o?Set.prototype.has:null;n||a||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(a.call(e),i)try{i.call(e)}catch(e){return!0}return e instanceof o}catch(e){}return!1}},373:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=String.prototype.valueOf,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"===t(e)&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===r.call(e))}},5490:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=Object.prototype.toString;if(n(8921)()){var i=Symbol.prototype.toString,a=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"===r(e))return!0;if("[object Symbol]"!==o.call(e))return!1;try{return function(e){return"symbol"===r(e.valueOf())&&a.test(i.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},5924:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(1203),i=n(5696),a=n(5554),s=a("Object.prototype.toString"),c=n(8921)()&&"symbol"===r(Symbol.toStringTag),l=i(),u=a("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1}return!!f&&function(e){var t=!1;return o(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(e){}})),t}(e)}},6494:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof WeakMap&&WeakMap.prototype?WeakMap:null,o="function"==typeof WeakSet&&WeakSet.prototype?WeakSet:null;r||(n=function(e){return!1});var i=r?r.prototype.has:null,a=o?o.prototype.has:null;n||i||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(i.call(e,i),a)try{a.call(e,a)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},5478:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(8754),i=n(5554),a=o("%WeakSet%",!0),s=i("WeakSet.prototype.has",!0);if(s){var c=i("WeakMap.prototype.has",!0);e.exports=function(e){if(!e||"object"!==r(e))return!1;try{if(s(e,s),c)try{c(e,c)}catch(e){return!0}return e instanceof a}catch(e){}return!1}}else e.exports=function(e){return!1}},9318:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},8804:function(e,t,n){var r,o;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}!function(a,s){"use strict";r=function(){var e=function(){},t="undefined",n=("undefined"==typeof window?"undefined":i(window))!==t&&i(window.navigator)!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(t,n){for(var o=0;o=0&&n<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==o&&function(e){var n=(r[e]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":i(window))!==t&&u){try{return void(window.localStorage[u]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(u)+"="+n+";"}catch(e){}}}(n),s.call(c,n,e),("undefined"==typeof console?"undefined":i(console))===t&&n{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=o&&i&&"function"==typeof i.get?i.get:null,s=o&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=c&&l&&"function"==typeof l.get?l.get:null,d=c&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,y=Object.prototype.toString,v=Function.prototype.toString,b=String.prototype.match,g="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,w="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"===r(Symbol.iterator),O=Object.prototype.propertyIsEnumerable,P=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),E=n(5863).custom,C=E&&I(E)?E:null,T="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function x(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function R(e){return String(e).replace(/"/g,""")}function j(e){return!("[object Array]"!==M(e)||T&&"object"===r(e)&&T in e)}function I(e){if(k)return e&&"object"===r(e)&&e instanceof Symbol;if("symbol"===r(e))return!0;if(!e||"object"!==r(e)||!w)return!1;try{return w.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,i){var c=n||{};if(A(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(A(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!A(c,"customInspect")||c.customInspect;if("boolean"!=typeof l&&"symbol"!==l)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(A(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return D(t,c);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var y=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=y&&y>0&&"object"===r(t))return j(t)?"[Array]":"[Object]";var S,O=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(c,o);if(void 0===i)i=[];else if(N(i,t)>=0)return"[Circular]";function E(t,n,r){if(n&&(i=i.slice()).push(n),r){var a={depth:c.depth};return A(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),e(t,a,o+1,i)}return e(t,c,o+1,i)}if("function"==typeof t){var _=function(e){if(e.name)return e.name;var t=b.call(v.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),L=W(t,E);return"[Function"+(_?": "+_:" (anonymous)")+"]"+(L.length>0?" { "+L.join(", ")+" }":"")}if(I(t)){var Z=k?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):w.call(t);return"object"!==r(t)||k?Z:U(Z)}if((S=t)&&"object"===r(S)&&("undefined"!=typeof HTMLElement&&S instanceof HTMLElement||"string"==typeof S.nodeName&&"function"==typeof S.getAttribute)){for(var H="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],$=0;$"}if(j(t)){if(0===t.length)return"[]";var V=W(t,E);return O&&!function(e){for(var t=0;t=0)return!1;return!0}(V)?"["+z(V,O)+"]":"[ "+V.join(", ")+" ]"}if(function(e){return!("[object Error]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)){var G=W(t,E);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"===r(t)&&l){if(C&&"function"==typeof t[C])return t[C]();if("symbol"!==l&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==r(e))return!1;try{a.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var J=[];return s.call(t,(function(e,n){J.push(E(n,t,!0)+" => "+E(e,t))})),F("Map",a.call(t),J,O)}if(function(e){if(!u||!e||"object"!==r(e))return!1;try{u.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var K=[];return d.call(t,(function(e){K.push(E(e,t))})),F("Set",u.call(t),K,O)}if(function(e){if(!p||!e||"object"!==r(e))return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return B("WeakMap");if(function(e){if(!f||!e||"object"!==r(e))return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return B("WeakSet");if(function(e){if(!h||!e||"object"!==r(e))return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return B("WeakRef");if(function(e){return!("[object Number]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(E(Number(t)));if(function(e){if(!e||"object"!==r(e)||!g)return!1;try{return g.call(e),!0}catch(e){}return!1}(t))return U(E(g.call(t)));if(function(e){return!("[object Boolean]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(m.call(t));if(function(e){return!("[object String]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(E(String(t)));if(!function(e){return!("[object Date]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)&&!function(e){return!("[object RegExp]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)){var Y=W(t,E),Q=P?P(t)===Object.prototype:t instanceof Object||t.constructor===Object,X=t instanceof Object?"":"null prototype",ee=!Q&&T&&Object(t)===t&&T in t?M(t).slice(8,-1):X?"Object":"",te=(Q||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ee||X?"["+[].concat(ee||[],X||[]).join(": ")+"] ":"");return 0===Y.length?te+"{}":O?te+"{"+z(Y,O)+"}":te+"{ "+Y.join(", ")+" }"}return String(t)};var _=Object.prototype.hasOwnProperty||function(e){return e in this};function A(e,t){return _.call(e,t)}function M(e){return y.call(e)}function N(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return D(e.slice(0,t.maxStringLength),t)+r}return x(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function U(e){return"Object("+e+")"}function B(e){return e+" { ? }"}function F(e,t,n,r){return e+" ("+t+") {"+(r?z(n,r):n.join(", "))+"}"}function z(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function W(e,t){var n=j(e),r=[];if(n){r.length=e.length;for(var o=0;o{"use strict";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},6232:(e,t,n)=>{"use strict";var r=n(3510),o=n(3700),i=n(2679),a=n(79),s=n(3025),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},79:(e,t,n)=>{"use strict";var r=n(2679);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},3025:(e,t,n)=>{"use strict";var r=n(79),o=n(3510);e.exports=function(){var e=r();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6016:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=n(2762),c=Object.prototype.propertyIsEnumerable,l=!c.call({toString:null},"toString"),u=c.call((function(){}),"prototype"),d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===r(window[e]))try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();o=function(e){var t=null!==e&&"object"===r(e),n="[object Function]"===a.call(e),o=s(e),c=t&&"[object String]"===a.call(e),f=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var m=u&&n;if(c&&e.length>0&&!i.call(e,0))for(var y=0;y0)for(var v=0;v{"use strict";var r=Array.prototype.slice,o=n(2762),i=Object.keys,a=i?function(e){return i(e)}:n(6016),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},2762:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Object.prototype.toString;e.exports=function(e){var r=n.call(e),o="[object Arguments]"===r;return o||(o="[object Array]"!==r&&null!==e&&"object"===t(e)&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),o}},4609:(e,t,n)=>{"use strict";var r=n(6205),o=n(17)(),i=n(5554),a=Object,s=i("Array.prototype.push"),c=i("Object.prototype.propertyIsEnumerable"),l=o?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var n,i,u,d,p,f,h,m=a(e);for(n=1;n{"use strict";var r=n(3510),o=n(3700),i=n(4609),a=n(1785),s=n(8507),c=o.apply(a()),l=function(e,t){return c(Object,arguments)};r(l,{getPolyfill:a,implementation:i,shim:s}),e.exports=l},1785:(e,t,n)=>{"use strict";var r=n(4609);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{"use strict";var r=n(3510),o=n(1785);e.exports=function(){var e=o();return r(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},7108:function(e,t,n){var r,o,i,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=n.nmd(e),a=function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(31);var r=function(e){return e&&e.__esModule?e:{default:e}}(n(13));t.default=r.default},function(t,n){t.exports=e},function(e,t,n){e.exports=n(19)()},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t},e.exports=t.default},function(e,t,n){(function(t){(function(){var n,r,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-o)/1e6},r=t.hrtime,n=function(){var e;return 1e9*(e=r())[0]+e[1]},o=n()):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(10))},function(e,t,n){(function(t){for(var r=n(23),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],c=o["cancel"+a]||o["cancelRequest"+a],l=0;!s&&l child into a function."))},t.warnAboutElementChild=function(){!a&&i&&(a=!0,console.error("With React 0.13, you need to wrap child into a function."))},t.positiveOrZero=function(e){return e<0?0:e},t.modifyObjValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n},t.isReact13=r;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=r(o.default),a=!1},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(){h&&p&&(h=!1,p.length?f=p.concat(f):m=-1,f.length&&a())}function a(){if(!h){var e=o(i);h=!0;for(var t=f.length;t;){for(p=f,f=[];++m1)for(var n=1;nt.realHeight-t.containerHeight&&(e=t.realHeight-t.containerHeight),e<0&&(e=0),e}},{key:"normalizeLeftPosition",value:function(e,t){return e>t.realWidth-t.containerWidth?e=t.realWidth-t.containerWidth:e<0&&(e=0),e}},{key:"computeSizes",value:function(){return{realHeight:this.content.offsetHeight,containerHeight:this.wrapper.offsetHeight,realWidth:this.content.offsetWidth,containerWidth:this.wrapper.offsetWidth}}},{key:"setSizesToState",value:function(){var e=this.computeSizes();e.realHeight===this.state.realHeight&&e.realWidth===this.state.realWidth||this.setStateFromEvent(this.getModifiedPositionsIfNeeded(e))}},{key:"scrollTop",value:function(){this.scrollYTo(0)}},{key:"scrollBottom",value:function(){this.scrollYTo(this.state.realHeight-this.state.containerHeight)}},{key:"scrollLeft",value:function(){this.scrollXTo(0)}},{key:"scrollRight",value:function(){this.scrollXTo(this.state.realWidth-this.state.containerWidth)}},{key:"scrollYTo",value:function(e){if(this.canScrollY()){var t=this.normalizeTopPosition(e,this.computeSizes());this.setStateFromEvent({topPosition:t},m)}}},{key:"scrollXTo",value:function(e){if(this.canScrollX()){var t=this.normalizeLeftPosition(e,this.computeSizes());this.setStateFromEvent({leftPosition:t},m)}}},{key:"canScrollY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return e.realHeight>e.containerHeight&&this.props.vertical}},{key:"canScrollX",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return e.realWidth>e.containerWidth&&this.props.horizontal}},{key:"canScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return this.canScrollY(e)||this.canScrollX(e)}},{key:"getModifiedPositionsIfNeeded",value:function(e){var t=e.realHeight-e.containerHeight;this.state.topPosition>=t&&(e.topPosition=this.canScrollY(e)?(0,p.positiveOrZero)(t):0);var n=e.realWidth-e.containerWidth;return this.state.leftPosition>=n&&(e.leftPosition=this.canScrollX(e)?(0,p.positiveOrZero)(n):0),e}},{key:"focusContent",value:function(){this.content&&(0,p.findDOMNode)(this.content).focus()}}]),t}(c.default.Component);t.default=b,b.childContextTypes={scrollArea:l.default.object},b.propTypes={className:l.default.string,style:l.default.object,speed:l.default.number,contentClassName:l.default.string,contentStyle:l.default.object,vertical:l.default.bool,verticalContainerStyle:l.default.object,verticalScrollbarStyle:l.default.object,horizontal:l.default.bool,horizontalContainerStyle:l.default.object,horizontalScrollbarStyle:l.default.object,onScroll:l.default.func,contentWindow:l.default.any,ownerDocument:l.default.any,smoothScrolling:l.default.bool,minScrollSize:l.default.number,swapWheelAxes:l.default.bool,stopScrollPropagation:l.default.bool,focusableTabIndex:l.default.number},b.defaultProps={speed:1,vertical:!0,horizontal:!0,smoothScrolling:!1,swapWheelAxes:!1,contentWindow:"object"===("undefined"==typeof window?"undefined":o(window))?window:void 0,ownerDocument:"object"===("undefined"==typeof document?"undefined":o(document))?document:void 0,focusableTabIndex:1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t10*m&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();var i=(r.accumulatedTime-Math.floor(r.accumulatedTime/m)*m)/m,a=Math.floor(r.accumulatedTime/m),s={},c={},d={},f={};for(var h in t)if(Object.prototype.hasOwnProperty.call(t,h)){var y=t[h];if("number"==typeof y)d[h]=y,f[h]=0,s[h]=y,c[h]=0;else{for(var v=r.state.lastIdealStyle[h],b=r.state.lastIdealVelocity[h],g=0;g10*y&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var a=(r.accumulatedTime-Math.floor(r.accumulatedTime/y)*y)/y,s=Math.floor(r.accumulatedTime/y),c=[],l=[],p=[],f=[],h=0;h10*g&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var l=(r.accumulatedTime-Math.floor(r.accumulatedTime/g)*g)/g,u=Math.floor(r.accumulatedTime/g),d=a(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,n,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),f=d[0],m=d[1],y=d[2],v=d[3],b=d[4],S=0;Sr[u])return-1;if(o>i[u]&&cr[u])return 1;if(a>i[u]&&s=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,r,o;if(t.singleton){var i=b++;n=v||(v=s(t)),r=u.bind(null,n,i,!1),o=u.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=p.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function u(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=S(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var f={},h=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},m=h((function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())})),y=h((function(){return document.head||document.getElementsByTagName("head")[0]})),v=null,b=0,g=[];e.exports=function(e,t){void 0===(t=t||{}).singleton&&(t.singleton=m()),void 0===t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a{"use strict";var r=n(6689),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,i={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:l,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},1827:(e,t,n)=>{"use strict";e.exports=n(2451)},1223:e=>{"use strict";var t=function(e){return e&&2===e.CLOSING},n=function(e,t,n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})},r=function(e){return e.minReconnectionDelay+Math.random()*e.minReconnectionDelay},o=["onopen","onclose","onmessage","onerror"];e.exports=function e(i,a,s){var c,l,u=this;void 0===s&&(s={});var d=0,p=0,f=!0,h=null,m={};if(!(this instanceof e))throw new TypeError("Failed to construct 'ReconnectingWebSocket': Please use the 'new' operator");var y={constructor:"undefined"!=typeof WebSocket&&t(WebSocket)?WebSocket:null,maxReconnectionDelay:1e4,minReconnectionDelay:1500,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,debug:!1};if(Object.keys(y).filter((function(e){return s.hasOwnProperty(e)})).forEach((function(e){return y[e]=s[e]})),!t(y.constructor))throw new TypeError("Invalid WebSocket constructor. Set `options.constructor`");var v=y.debug?function(){for(var e=[],t=0;ty.maxRetries?b("EHOSTDOWN","Too many failed connection attempts"):(d=d?function(e,t){var n=t*e.reconnectionDelayGrowFactor;return n>e.maxReconnectionDelay?e.maxReconnectionDelay:n}(y,d):r(y),v("handleClose - reconnectDelay:",d),f&&setTimeout(S,d))},S=function(){if(f){v("connect");var e=c,t="function"==typeof i?i():i;for(var s in c=new y.constructor(t,a),l=setTimeout((function(){v("timeout"),c.close(),b("ETIMEDOUT","Connection timeout")}),y.connectionTimeout),v("bypass properties"),c)["addEventListener","removeEventListener","close","send"].indexOf(s)<0&&n(c,u,s);c.addEventListener("open",(function(){clearTimeout(l),v("open"),d=r(y),v("reconnectDelay:",d),p=0})),c.addEventListener("close",g),function(e,t,n){Object.keys(n).forEach((function(t){n[t].forEach((function(n){var r=n[0],o=n[1];e.addEventListener(t,r,o)}))})),t&&o.forEach((function(n){e[n]=t[n]}))}(c,e,m),c.onclose=c.onclose||h,h=null}};v("init"),S(),this.close=function(e,t,n){void 0===e&&(e=1e3),void 0===t&&(t="");var r=void 0===n?{}:n,o=r.keepClosed,i=void 0!==o&&o,a=r.fastClose,s=void 0===a||a,l=r.delay,u=void 0===l?0:l;if(v("close - params:",{reason:t,keepClosed:i,fastClose:s,delay:u,retriesCount:p,maxRetries:y.maxRetries}),f=!i&&p<=y.maxRetries,u&&(d=u),c.close(e,t),s){var b={code:e,reason:t,wasClean:!0};g(),c.removeEventListener("close",g),Array.isArray(m.close)&&m.close.forEach((function(e){var t=e[0],n=e[1];t(b),c.removeEventListener("close",t,n)})),c.onclose&&(h=c.onclose,c.onclose(b),c.onclose=null)}},this.send=function(e){c.send(e)},this.addEventListener=function(e,t,n){Array.isArray(m[e])?m[e].some((function(e){return e[0]===t}))||m[e].push([t,n]):m[e]=[[t,n]],c.addEventListener(e,t,n)},this.removeEventListener=function(e,t,n){Array.isArray(m[e])&&(m[e]=m[e].filter((function(e){return e[0]!==t}))),c.removeEventListener(e,t,n)}}},4363:(e,t,n)=>{"use strict";var r=n(9045).functionsHaveConfigurableNames(),o=Object,i=TypeError;e.exports=function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e},r&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})},1881:(e,t,n)=>{"use strict";var r=n(3510),o=n(3700),i=n(4363),a=n(6598),s=n(3262),c=o(a());r(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},6598:(e,t,n)=>{"use strict";var r=n(4363),o=n(3510).supportsDescriptors,i=Object.getOwnPropertyDescriptor;e.exports=function(){if(o&&"gim"===/a/gim.flags){var e=i(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(n,"sticky",{get:function(){t+="y"}}),"dy"===t)return e.get}}return r}},3262:(e,t,n)=>{"use strict";var r=n(3510).supportsDescriptors,o=n(6598),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,c=Object.getPrototypeOf,l=/a/;e.exports=function(){if(!r||!c)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=o(),t=c(l),n=i(t,"flags");return n&&n.get===e||a(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},9238:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(8754),i=n(5554),a=n(3055),s=o("%TypeError%"),c=o("%WeakMap%",!0),l=o("%Map%",!0),u=i("WeakMap.prototype.get",!0),d=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),f=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),m=i("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,o={assert:function(e){if(!o.has(e))throw new s("Side channel does not contain "+a(e))},get:function(o){if(c&&o&&("object"===r(o)||"function"==typeof o)){if(e)return u(e,o)}else if(l){if(t)return f(t,o)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,o)},has:function(o){if(c&&o&&("object"===r(o)||"function"==typeof o)){if(e)return p(e,o)}else if(l){if(t)return m(t,o)}else if(n)return function(e,t){return!!y(e,t)}(n,o);return!1},set:function(o,i){c&&o&&("object"===r(o)||"function"==typeof o)?(e||(e=new c),d(e,o,i)):l?(t||(t=new l),h(t,o,i)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,o,i))}};return o}},2228:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(373),i=n(2869),a=n(5217),s=n(5490),c=n(999);e.exports=function(e){return null==e||"object"!==r(e)&&"function"!=typeof e?null:o(e)?"String":i(e)?"Number":a(e)?"Boolean":s(e)?"Symbol":c(e)?"BigInt":void 0}},5056:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(1203),i=n(5696),a=n(5554),s=a("Object.prototype.toString"),c=n(8921)()&&"symbol"===r(Symbol.toStringTag),l=i(),u=a("String.prototype.slice"),d={},p=n(8114),f=Object.getPrototypeOf;c&&p&&f&&o(l,(function(e){if("function"==typeof n.g[e]){var t=new n.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var r=f(t),o=p(r,Symbol.toStringTag);if(!o){var i=f(r);o=p(i,Symbol.toStringTag)}d[e]=o.get}}));var h=n(5924);e.exports=function(e){return!!h(e)&&(c?function(e){var t=!1;return o(d,(function(n,r){if(!t)try{var o=n.call(e);o===r&&(t=o)}catch(e){}})),t}(e):u(s(e),8,-1))}},9003:e=>{"use strict";e.exports=require("classnames")},9105:e=>{"use strict";e.exports=require("color")},4305:e=>{"use strict";e.exports=require("lodash.debounce")},9455:e=>{"use strict";e.exports=require("material-ui")},3173:e=>{"use strict";e.exports=require("material-ui/styles")},580:e=>{"use strict";e.exports=require("prop-types")},757:e=>{"use strict";e.exports=require("pydio")},6880:e=>{"use strict";e.exports=require("pydio/http/api")},5829:e=>{"use strict";e.exports=require("pydio/http/meta-cache-service")},2610:e=>{"use strict";e.exports=require("pydio/http/resources-manager")},2702:e=>{"use strict";e.exports=require("pydio/http/users-api")},2282:e=>{"use strict";e.exports=require("pydio/model/controller")},4603:e=>{"use strict";e.exports=require("pydio/model/data-model")},7180:e=>{"use strict";e.exports=require("pydio/util/func")},4021:e=>{"use strict";e.exports=require("pydio/util/periodical-executer")},6689:e=>{"use strict";e.exports=require("react")},6405:e=>{"use strict";e.exports=require("react-dom")},192:e=>{"use strict";e.exports=require("react-draggable")},5863:()=>{},7920:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},5696:(e,t,n)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];e.exports=function(){for(var e=[],t=0;t{"use strict";var r=n(8754)("%Object.getOwnPropertyDescriptor%");if(r)try{r([],"length")}catch(e){r=null}e.exports=r},3634:(e,t,n)=>{"use strict";var r=n(8317);if(n(8921)()||n(17)()){var o=Symbol.iterator;e.exports=function(e){return null!=e&&void 0!==e[o]?e[o]():r(e)?Array.prototype[o].call(e):void 0}}else{var i=n(9318),a=n(373),s=n(8754),c=s("%Map%",!0),l=s("%Set%",!0),u=n(5554),d=u("Array.prototype.push"),p=u("String.prototype.charCodeAt"),f=u("String.prototype.slice"),h=function(e){var t=0;return{next:function(){var n,r=t>=e.length;return r||(n=e[t],t+=1),{done:r,value:n}}}},m=function(e,t){if(i(e)||r(e))return h(e);if(a(e)){var n=0;return{next:function(){var t=function(e,t){if(t+1>=e.length)return t+1;var n=p(e,t);if(n<55296||n>56319)return t+1;var r=p(e,t+1);return r<56320||r>57343?t+1:t+2}(e,n),r=f(e,n,t);return n=t,{done:t>e.length,value:r}}}}return t&&void 0!==e["_es6-shim iterator_"]?e["_es6-shim iterator_"]():void 0};if(c||l){var y=n(7233),v=n(1189),b=u("Map.prototype.forEach",!0),g=u("Set.prototype.forEach",!0);if("undefined"==typeof process||!process.versions||!process.versions.node)var S=u("Map.prototype.iterator",!0),w=u("Set.prototype.iterator",!0),k=function(e){var t=!1;return{next:function(){try{return{done:t,value:t?void 0:e.next()}}catch(e){return t=!0,{done:!0,value:void 0}}}}};var O=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),P=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0);e.exports=function(e){return function(e){if(y(e)){if(S)return k(S(e));if(O)return O(e);if(b){var t=[];return b(e,(function(e,n){d(t,[n,e])})),h(t)}}if(v(e)){if(w)return k(w(e));if(P)return P(e);if(g){var n=[];return g(e,(function(e){d(n,e)})),h(n)}}}(e)||m(e)}}else e.exports=function(e){if(null!=e)return m(e,!0)}}},2567:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(7233),i=n(1189),a=n(6494),s=n(5478);e.exports=function(e){if(e&&"object"===r(e)){if(o(e))return"Map";if(i(e))return"Set";if(a(e))return"WeakMap";if(s(e))return"WeakSet"}return!1}},212:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},305:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,{Z:()=>r})},633:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},9807:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,{Z:()=>r})},2471:(e,t,n)=>{"use strict";n.d(t,{Ab:()=>a,Fr:()=>s,G$:()=>i,K$:()=>l,MS:()=>r,h5:()=>c,lK:()=>u,uj:()=>o});var r="-ms-",o="-moz-",i="-webkit-",a="comm",s="rule",c="decl",l="@import",u="@keyframes"},6194:(e,t,n)=>{"use strict";n.d(t,{cD:()=>i,qR:()=>o});var r=n(5586);function o(e){var t=(0,r.Ei)(e);return function(n,r,o,i){for(var a="",s=0;s{"use strict";n.d(t,{MY:()=>a});var r=n(2471),o=n(5586),i=n(7e3);function a(e){return(0,i.cE)(s("",null,null,null,[""],e=(0,i.un)(e),0,[0],e))}function s(e,t,n,r,a,d,p,f,h){for(var m=0,y=0,v=p,b=0,g=0,S=0,w=1,k=1,O=1,P=0,E="",C=a,T=d,x=r,R=E;k;)switch(S=P,P=(0,i.lp)()){case 40:if(108!=S&&58==(0,o.uO)(R,v-1)){-1!=(0,o.Cw)(R+=(0,o.gx)((0,i.iF)(P),"&","&\f"),"&\f")&&(O=-1);break}case 34:case 39:case 91:R+=(0,i.iF)(P);break;case 9:case 10:case 13:case 32:R+=(0,i.Qb)(S);break;case 92:R+=(0,i.kq)((0,i.Ud)()-1,7);continue;case 47:switch((0,i.fj)()){case 42:case 47:(0,o.R3)(l((0,i.q6)((0,i.lp)(),(0,i.Ud)()),t,n),h);break;default:R+="/"}break;case 123*w:f[m++]=(0,o.to)(R)*O;case 125*w:case 59:case 0:switch(P){case 0:case 125:k=0;case 59+y:g>0&&(0,o.to)(R)-v&&(0,o.R3)(g>32?u(R+";",r,n,v-1):u((0,o.gx)(R," ","")+";",r,n,v-2),h);break;case 59:R+=";";default:if((0,o.R3)(x=c(R,t,n,m,y,a,f,E,C=[],T=[],v),d),123===P)if(0===y)s(R,t,x,x,C,d,v,f,T);else switch(99===b&&110===(0,o.uO)(R,3)?100:b){case 100:case 109:case 115:s(e,x,x,r&&(0,o.R3)(c(e,x,x,0,0,a,f,E,a,C=[],v),T),a,T,v,f,r?C:T);break;default:s(R,x,x,x,[""],T,0,f,T)}}m=y=g=0,w=O=1,E=R="",v=p;break;case 58:v=1+(0,o.to)(R),g=S;default:if(w<1)if(123==P)--w;else if(125==P&&0==w++&&125==(0,i.mp)())continue;switch(R+=(0,o.Dp)(P),P*w){case 38:O=y>0?1:(R+="\f",-1);break;case 44:f[m++]=((0,o.to)(R)-1)*O,O=1;break;case 64:45===(0,i.fj)()&&(R+=(0,i.iF)((0,i.lp)())),b=(0,i.fj)(),y=v=(0,o.to)(E=R+=(0,i.QU)((0,i.Ud)())),P++;break;case 45:45===S&&2==(0,o.to)(R)&&(w=0)}}return d}function c(e,t,n,a,s,c,l,u,d,p,f){for(var h=s-1,m=0===s?c:[""],y=(0,o.Ei)(m),v=0,b=0,g=0;v0?m[S]+" "+w:(0,o.gx)(w,/&\f/g,m[S])))&&(d[g++]=k);return(0,i.dH)(e,t,n,0===s?r.Fr:u,d,p,f)}function l(e,t,n){return(0,i.dH)(e,t,n,r.Ab,(0,o.Dp)((0,i.Tb)()),(0,o.tb)(e,2,-2),0)}function u(e,t,n,a){return(0,i.dH)(e,t,n,r.h5,(0,o.tb)(e,0,a),(0,o.tb)(e,a+1,-1),a)}},2137:(e,t,n)=>{"use strict";n.d(t,{P:()=>a,q:()=>i});var r=n(2471),o=n(5586);function i(e,t){for(var n="",r=(0,o.Ei)(e),i=0;i{"use strict";n.d(t,{FK:()=>s,JG:()=>d,QU:()=>C,Qb:()=>k,Tb:()=>p,Ud:()=>y,cE:()=>S,dH:()=>u,fj:()=>m,iF:()=>w,kq:()=>O,lp:()=>h,mp:()=>f,q6:()=>E,r:()=>b,tP:()=>v,un:()=>g});var r=n(5586),o=1,i=1,a=0,s=0,c=0,l="";function u(e,t,n,r,a,s,c){return{value:e,root:t,parent:n,type:r,props:a,children:s,line:o,column:i,length:c,return:""}}function d(e,t){return(0,r.f0)(u("",null,null,"",null,null,0),e,{length:-e.length},t)}function p(){return c}function f(){return c=s>0?(0,r.uO)(l,--s):0,i--,10===c&&(i=1,o--),c}function h(){return c=s2||b(c)>3?"":" "}function O(e,t){for(;--t&&h()&&!(c<48||c>102||c>57&&c<65||c>70&&c<97););return v(e,y()+(t<6&&32==m()&&32==h()))}function P(e){for(;h();)switch(c){case e:return s;case 34:case 39:34!==e&&39!==e&&P(c);break;case 40:41===e&&P(e);break;case 92:h()}return s}function E(e,t){for(;h()&&e+c!==57&&(e+c!==84||47!==m()););return"/*"+v(t,s-1)+"*"+(0,r.Dp)(47===e?e:h())}function C(e){for(;!b(m());)h();return v(e,s)}},5586:(e,t,n)=>{"use strict";n.d(t,{$e:()=>y,Cw:()=>u,Dp:()=>o,EQ:()=>c,Ei:()=>h,R3:()=>m,Wn:()=>r,f0:()=>i,fy:()=>s,gx:()=>l,tb:()=>p,to:()=>f,uO:()=>d,vp:()=>a});var r=Math.abs,o=String.fromCharCode,i=Object.assign;function a(e,t){return 45^d(e,0)?(((t<<2^d(e,0))<<2^d(e,1))<<2^d(e,2))<<2^d(e,3):0}function s(e){return e.trim()}function c(e,t){return(e=t.exec(e))?e[0]:e}function l(e,t,n){return e.replace(t,n)}function u(e,t){return e.indexOf(t)}function d(e,t){return 0|e.charCodeAt(t)}function p(e,t,n){return e.slice(t,n)}function f(e){return e.length}function h(e){return e.length}function m(e,t){return t.push(e),e}function y(e,t){return e.map(t).join("")}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>"rgl.min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="gui.ajax:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="plug/gui.ajax/res/dist/libs/",(()=>{var e={543:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=a.p+a.u(t),s=new Error;a.l(i,(n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,s,c]=n,l=0;if(i.some((t=>0!==e[t]))){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);c&&c(a)}for(t&&t(n);l{"use strict";a.r(s),a.d(s,{default:()=>y_});var e=a(6689),t=a.n(e),n=a(6405),r=a.n(n),o=a(4603),i=a.n(o);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ee);return t().createElement("div",n)};pe=ue(pe),de.propTypes={showSelector:z().bool,selected:z().bool,selectorDisabled:z().bool,onSelect:z().func,onClick:z().func,iconCell:z().element,mainIcon:z().string,firstLine:z().node,secondLine:z().node,thirdLine:z().node,actions:z().element,activeDroppable:z().bool,className:z().string,style:z().object,noHover:z().bool},de=(0,K.muiThemeable)()(de);var fe=(0,S.flow)((0,S.DragSource)(p.NODE_PROVIDER,v,f),(0,S.DropTarget)(p.NODE_PROVIDER,b,h))(de);const he=require("pydio/util/path");var me=a.n(he),ye=a(212),ve=a(305),be=a(633),ge=a(9807),Se=a(127),we=a(7116),ke=a(1788);function Oe(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Pe(e){return e instanceof Oe(e).Element||e instanceof Element}function Ee(e){return e instanceof Oe(e).HTMLElement||e instanceof HTMLElement}function Ce(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Oe(e).ShadowRoot||e instanceof ShadowRoot)}var Te=Math.max,xe=Math.min,Re=Math.round;function je(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Ie(){return!/^((?!chrome|android).)*safari/i.test(je())}function _e(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Ee(e)&&(o=e.offsetWidth>0&&Re(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Re(r.height)/e.offsetHeight||1);var a=(Pe(e)?Oe(e):window).visualViewport,s=!Ie()&&n,c=(r.left+(s&&a?a.offsetLeft:0))/o,l=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function Ae(e){var t=Oe(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Me(e){return e?(e.nodeName||"").toLowerCase():null}function Ne(e){return((Pe(e)?e.ownerDocument:e.document)||window.document).documentElement}function De(e){return _e(Ne(e)).left+Ae(e).scrollLeft}function Le(e){return Oe(e).getComputedStyle(e)}function Ue(e){var t=Le(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Be(e,t,n){void 0===n&&(n=!1);var r,o,i=Ee(t),a=Ee(t)&&function(e){var t=e.getBoundingClientRect(),n=Re(t.width)/e.offsetWidth||1,r=Re(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Ne(t),c=_e(e,a,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==Me(t)||Ue(s))&&(l=(r=t)!==Oe(r)&&Ee(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:Ae(r)),Ee(t)?((u=_e(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=De(s))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function Fe(e){var t=_e(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ze(e){return"html"===Me(e)?e:e.assignedSlot||e.parentNode||(Ce(e)?e.host:null)||Ne(e)}function We(e){return["html","body","#document"].indexOf(Me(e))>=0?e.ownerDocument.body:Ee(e)&&Ue(e)?e:We(ze(e))}function Ze(e,t){var n;void 0===t&&(t=[]);var r=We(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Oe(r),a=o?[i].concat(i.visualViewport||[],Ue(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Ze(ze(a)))}function He(e){return["table","td","th"].indexOf(Me(e))>=0}function qe(e){return Ee(e)&&"fixed"!==Le(e).position?e.offsetParent:null}function $e(e){for(var t=Oe(e),n=qe(e);n&&He(n)&&"static"===Le(n).position;)n=qe(n);return n&&("html"===Me(n)||"body"===Me(n)&&"static"===Le(n).position)?t:n||function(e){var t=/firefox/i.test(je());if(/Trident/i.test(je())&&Ee(e)&&"fixed"===Le(e).position)return null;var n=ze(e);for(Ce(n)&&(n=n.host);Ee(n)&&["html","body"].indexOf(Me(n))<0;){var r=Le(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Ve="top",Ge="bottom",Je="right",Ke="left",Ye="auto",Qe=[Ve,Ge,Je,Ke],Xe="start",et="end",tt="viewport",nt="popper",rt=Qe.reduce((function(e,t){return e.concat([t+"-"+Xe,t+"-"+et])}),[]),ot=[].concat(Qe,[Ye]).reduce((function(e,t){return e.concat([t,t+"-"+Xe,t+"-"+et])}),[]),it=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function at(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var st={placement:"bottom",modifiers:[],strategy:"absolute"};function ct(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ht(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?dt(o):null,a=o?pt(o):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case Ve:t={x:s,y:n.y-r.height};break;case Ge:t={x:s,y:n.y+n.height};break;case Je:t={x:n.x+n.width,y:c};break;case Ke:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=i?ft(i):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case Xe:t[l]=t[l]-(n[u]/2-r[u]/2);break;case et:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var mt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,f=void 0===p?0:p,h=a.y,m=void 0===h?0:h,y="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),g=Ke,S=Ve,w=window;if(l){var k=$e(n),O="clientHeight",P="clientWidth";k===Oe(n)&&"static"!==Le(k=Ne(n)).position&&"absolute"===s&&(O="scrollHeight",P="scrollWidth"),(o===Ve||(o===Ke||o===Je)&&i===et)&&(S=Ge,m-=(d&&k===w&&w.visualViewport?w.visualViewport.height:k[O])-r.height,m*=c?1:-1),o!==Ke&&(o!==Ve&&o!==Ge||i!==et)||(g=Je,f-=(d&&k===w&&w.visualViewport?w.visualViewport.width:k[P])-r.width,f*=c?1:-1)}var E,C=Object.assign({position:s},l&&mt),T=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Re(t*r)/r||0,y:Re(n*r)/r||0}}({x:f,y:m}):{x:f,y:m};return f=T.x,m=T.y,c?Object.assign({},C,((E={})[S]=b?"0":"",E[g]=v?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[S]=b?m+"px":"",t[g]=v?f+"px":"",t.transform="",t))}const vt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];Ee(o)&&Me(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ee(r)&&Me(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},bt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=ot.reduce((function(e,n){return e[n]=function(e,t,n){var r=dt(e),o=[Ke,Ve].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Ke,Je].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}};var gt={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e){return e.replace(/left|right|bottom|top/g,(function(e){return gt[e]}))}var wt={start:"end",end:"start"};function kt(e){return e.replace(/start|end/g,(function(e){return wt[e]}))}function Ot(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ce(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Pt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Et(e,t,n){return t===tt?Pt(function(e,t){var n=Oe(e),r=Ne(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;var l=Ie();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s+De(e),y:c}}(e,n)):Pe(t)?function(e,t){var n=_e(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Pt(function(e){var t,n=Ne(e),r=Ae(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Te(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Te(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+De(e),c=-r.scrollTop;return"rtl"===Le(o||n).direction&&(s+=Te(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}(Ne(e)))}function Ct(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Tt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function xt(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,c=void 0===s?"clippingParents":s,l=n.rootBoundary,u=void 0===l?tt:l,d=n.elementContext,p=void 0===d?nt:d,f=n.altBoundary,h=void 0!==f&&f,m=n.padding,y=void 0===m?0:m,v=Ct("number"!=typeof y?y:Tt(y,Qe)),b=p===nt?"reference":nt,g=e.rects.popper,S=e.elements[h?b:p],w=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=Ze(ze(e)),n=["absolute","fixed"].indexOf(Le(e).position)>=0&&Ee(e)?$e(e):e;return Pe(n)?t.filter((function(e){return Pe(e)&&Ot(e,n)&&"body"!==Me(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=Et(e,n,r);return t.top=Te(o.top,t.top),t.right=xe(o.right,t.right),t.bottom=xe(o.bottom,t.bottom),t.left=Te(o.left,t.left),t}),Et(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(Pe(S)?S:S.contextElement||Ne(e.elements.popper),c,u,a),k=_e(e.elements.reference),O=ht({reference:k,element:g,strategy:"absolute",placement:o}),P=Pt(Object.assign({},g,O)),E=p===nt?P:k,C={top:w.top-E.top+v.top,bottom:E.bottom-w.bottom+v.bottom,left:w.left-E.left+v.left,right:E.right-w.right+v.right},T=e.modifiersData.offset;if(p===nt&&T){var x=T[o];Object.keys(C).forEach((function(e){var t=[Je,Ge].indexOf(e)>=0?1:-1,n=[Ve,Ge].indexOf(e)>=0?"y":"x";C[e]+=x[n]*t}))}return C}const Rt={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,y=t.options.placement,v=dt(y),b=c||(v!==y&&h?function(e){if(dt(e)===Ye)return[];var t=St(e);return[kt(e),t,kt(t)]}(y):[St(y)]),g=[y].concat(b).reduce((function(e,n){return e.concat(dt(n)===Ye?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?ot:c,u=pt(r),d=u?s?rt:rt.filter((function(e){return pt(e)===u})):Qe,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=xt(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[dt(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),S=t.rects.reference,w=t.rects.popper,k=new Map,O=!0,P=g[0],E=0;E=0,j=R?"width":"height",I=xt(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),_=R?x?Je:Ke:x?Ge:Ve;S[j]>w[j]&&(_=St(_));var A=St(_),M=[];if(i&&M.push(I[T]<=0),s&&M.push(I[_]<=0,I[A]<=0),M.every((function(e){return e}))){P=C,O=!1;break}k.set(C,M)}if(O)for(var N=function(e){var t=g.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return P=t,"break"},D=h?3:1;D>0&&"break"!==N(D);D--);t.placement!==P&&(t.modifiersData[r]._skip=!0,t.placement=P,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jt(e,t,n){return Te(e,xe(t,n))}const It={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,y=xt(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),v=dt(t.placement),b=pt(t.placement),g=!b,S=ft(v),w="x"===S?"y":"x",k=t.modifiersData.popperOffsets,O=t.rects.reference,P=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,x={x:0,y:0};if(k){if(i){var R,j="y"===S?Ve:Ke,I="y"===S?Ge:Je,_="y"===S?"height":"width",A=k[S],M=A+y[j],N=A-y[I],D=f?-P[_]/2:0,L=b===Xe?O[_]:P[_],U=b===Xe?-P[_]:-O[_],B=t.elements.arrow,F=f&&B?Fe(B):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=z[j],Z=z[I],H=jt(0,O[_],F[_]),q=g?O[_]/2-D-H-W-C.mainAxis:L-H-W-C.mainAxis,$=g?-O[_]/2+D+H+Z+C.mainAxis:U+H+Z+C.mainAxis,V=t.elements.arrow&&$e(t.elements.arrow),G=V?"y"===S?V.clientTop||0:V.clientLeft||0:0,J=null!=(R=null==T?void 0:T[S])?R:0,K=A+$-J,Y=jt(f?xe(M,A+q-J-G):M,A,f?Te(N,K):N);k[S]=Y,x[S]=Y-A}if(s){var Q,X="x"===S?Ve:Ke,ee="x"===S?Ge:Je,te=k[w],ne="y"===w?"height":"width",re=te+y[X],oe=te-y[ee],ie=-1!==[Ve,Ke].indexOf(v),ae=null!=(Q=null==T?void 0:T[w])?Q:0,se=ie?re:te-O[ne]-P[ne]-ae+C.altAxis,ce=ie?te+O[ne]+P[ne]-ae-C.altAxis:oe,le=f&&ie?function(e,t,n){var r=jt(e,t,n);return r>n?n:r}(se,te,ce):jt(f?se:re,te,f?ce:oe);k[w]=le,x[w]=le-te}t.modifiersData[r]=x}},requiresIfExists:["offset"]};function _t(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function At(e){return[Ve,Je,Ge,Ke].some((function(t){return e[t]>=0}))}var Mt=lt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,c=Oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,ut)})),s&&c.addEventListener("resize",n.update,ut),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,ut)})),s&&c.removeEventListener("resize",n.update,ut)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ht({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,l={placement:dt(t.placement),variation:pt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,yt(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,yt(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},vt,bt,Rt,It,{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=dt(n.placement),c=ft(s),l=[Ke,Je].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return Ct("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Tt(e,Qe))}(o.padding,n),d=Fe(i),p="y"===c?Ve:Ke,f="y"===c?Ge:Je,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],y=$e(i),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=h/2-m/2,g=u[p],S=v-d[l]-u[f],w=v/2-d[l]/2+b,k=jt(g,w,S),O=c;n.modifiersData[r]=((t={})[O]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Ot(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=xt(t,{elementContext:"reference"}),s=xt(t,{altBoundary:!0}),c=_t(a,r),l=_t(s,o,i),u=At(c),d=At(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),Nt=a(7283),Dt=a(7630),Lt=a(1827);function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(c.className=a),Object.keys(s).length>0&&(c.style=s),{props:c,internalRef:void 0}}var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};var n={};return Object.keys(e).filter((function(n){return n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)})).forEach((function(t){n[t]=e[t]})),n}((0,be.Z)({},o,r)),u=Ht(r),d=Ht(o),p=t(l),f=(0,Zt.Z)(null==p?void 0:p.className,null==n?void 0:n.className,i,null==o?void 0:o.className,null==r?void 0:r.className),h=(0,be.Z)({},null==p?void 0:p.style,null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),m=(0,be.Z)({},p,n,d,u);return f.length>0&&(m.className=f),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:p.ref}}((0,be.Z)({},i,{externalSlotProps:a})),c=s.props,l=s.internalRef,u=(0,Se.Z)(l,null==a?void 0:a.ref,null==(t=e.additionalProps)?void 0:t.ref),d=function(e,t,n){return void 0===e||"string"==typeof e?t:(0,be.Z)({},t,{ownerState:(0,be.Z)({},t.ownerState,n)})}(n,(0,be.Z)({},c,{ref:u}),o);return d}function Vt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(e,t):void 0}}(e,t)||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.")}()}function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.setState({value:e,errorString:null,warningString:null});var n=Z().getMessages(),r=bn.ApplyChecks(this.errorChecks,this.warningChecks,e),o=r.error,i=r.warning;o?this.setState({errorString:n[o]},t):i?this.setState({warningString:n[i]},t):t&&t()}},{key:"submit",value:function(){var e=this.state,t=e.value;e.errorString||(this.props.callback(t),this.props.onClose())}},{key:"catchClicks",value:function(e){e.stopPropagation()}},{key:"onKeyDown",value:function(e){e.stopPropagation(),"Enter"===e.key?this.submit():"Escape"===e.key&&this.props.onClose()}},{key:"render",value:function(){var e=this,n=Z().getMessages(),r=this.props,o=r.node,i=r.onClose,a=r.anchor,s=r.muiTheme,c=r.editorStyle,l=void 0===c?{}:c,u=this.state,d=u.value,p=u.errorString,f=u.warningString;return t().createElement(sn,{id:"rename-popper:"+o.getPath(),open:!0,anchorEl:a,placement:"bottom-start"},t().createElement(Sn,{style:un({width:320,padding:8,fontWeight:"initial",background:s.palette.mui3?s.palette.mui3["surface-2"]:"white"},l),zDepth:2},t().createElement(kn,{value:d,onChange:function(t,n){return e.setValue(n)},onClick:function(t){return e.catchClicks(t)},onDoubleClick:function(t){return e.catchClicks(t)},tabIndex:"0",onKeyDown:function(t){return e.onKeyDown(t)},selectBaseOnMount:!0,hintText:n[6],variant:"v2",fullWidth:!0}),p&&t().createElement("div",{style:{color:"var(--md-sys-color-error)",fontSize:13,padding:"0 6px"}},p),f&&t().createElement("div",{style:{fontSize:13,padding:"0 6px",opacity:.73}},f),t().createElement("div",{style:{textAlign:"right",paddingTop:8}},t().createElement(wn,{style:{height:32,lineHeight:"32px"},label:n[54],onClick:i}),t().createElement(wn,{style:{height:32,lineHeight:"32px"},label:n[48],onClick:function(){e.setValue(d,(function(){return e.submit()}))}}))))}}],r&&pn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function Pn(e){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pn(e)}function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:void 0,o=function(o){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tn(e,t)}(u,o);var i,a,s,c,l=(s=u,c=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}}(),function(){var e,t=Rn(s);if(c){var n=Rn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xn(e)}(this,e)});function u(){var e,t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var o=arguments.length,i=new Array(o),a=0;a-1&&(f=p.fromNow()),n=f}else n="bytesize"===e?parseInt(u.get(e))?me().roundFileSize(parseInt(u.get(e))):"-":u.get(e);o=u.get(e);var h=null;l&&(h=a),c.push(t().createElement("span",{key:e,className:"cell cell-"+e,title:o,style:d,"data-label":s.label,ref:h},n)),l=!1})),t().createElement(fe,_n({},n,{iconCell:null,firstLine:c,actions:s}))}));function Nn(e){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(e)}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Nn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Nn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Un={pydioActionsToItems:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],r=!1,o=Z().getMessages();return t.map(function(t){if(t.separator){if(r)return;return n.push(t),void(r=!0)}var i;r=!1,i=t.label_id&&o[t.label_id]?o[t.label_id]:t.raw_name?t.raw_name:t.name;var a=t.icon_class;if(t.subMenu){var s=t.subMenuBeforeShow?e(t.subMenuBeforeShow()):t.subMenu;n.push({text:i,iconClassName:a,subItems:s})}else n.push({text:i,iconClassName:a,payload:t.callback})}.bind(this)),r&&(n=n.slice(0,n.length-1)),n.length&&n[0]&&n[0].separator&&n.shift(),n},itemsToMenu:function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};o=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,o=function(){r&&r.notify("actions_refreshed")},i=this.props,a=i.tableKeys,s=i.sortingInfo;return Object.keys(a).map((function(r){var i,c,l=a[r],u=l.width?{width:l.width}:null,d="cell header_cell cell-"+r;return l.sortType&&(d+=" sortable",s&&(s.attribute===r||s.remote&&l.remoteSortAttribute&&s.attribute===l.remoteSortAttribute)&&(i="number"===l.sortType?"asc"===s.direction?"mdi mdi-sort-numeric-ascending":"mdi mdi-sort-numeric-descending":"asc"===s.direction?"mdi mdi-sort-alphabetical-ascending":"mdi mdi-sort-alphabetical-descending",d+=" active-sort-"+s.direction,c=!0)),"menu"===e?(l.name=r,{payload:l,text:l.label,iconClassName:i}):"menu_data"===e?{name:t().createElement("span",{style:{display:"flex"}},t().createElement("span",{style:{flex:1,fontWeight:c?500:"inherit"}},l.label),c&&t().createElement("span",{className:"mdi mdi-checkbox-marked-circle-outline"})),callback:function(){n.onHeaderClick(r,o)},icon_class:i||"mdi mdi-sort"}:t().createElement("span",{key:r,className:d,style:u,onClick:function(){n.onHeaderClick(r,o)}},l.label)}))}},{key:"buildSortingMenuItems",value:function(e){return this.getColumnsItems("menu_data",e)}},{key:"componentDidMount",value:function(){var e=new Action({name:"sort_action",icon_class:"mdi mdi-sort-descending",text_id:450,title_id:450,text:this.props.getMessage(450),title:this.props.getMessage(450),hasAccessKey:!1,subMenu:!0,subMenuUpdateImage:!0,weight:50},{selection:!1,dir:!0,actionBar:!0,actionBarGroup:"display_toolbar",contextMenu:!1,infoPanel:!1},{},{},{dynamicBuilder:this.buildSortingMenuItems.bind(this)}),t=new Map;t.set("sort_action",e),this.props.pydio.getController().updateGuiActions(t)}},{key:"componentWillUnmount",value:function(){this.props.pydio.getController().deleteFromGuiActions("sort_action")}},{key:"render",value:function(){var e=this;return"hidden"===this.props.displayMode?null:"menu"===this.props.displayMode?t().createElement(ir,{buttonTitle:"Sort by...",buttonClassName:"mdi mdi-sort-descending",menuItems:this.getColumnsItems("menu",this.props.pydio.getController()),onMenuClicked:function(t){return e.onMenuClicked(t)}}):t().createElement("div",{className:"mui-toolbar-group mui-left"},this.getColumnsItems("header",this.props.pydio.getController()))}}],r&&sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function pr(e){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(e)}function fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t0,S=[],w=Z().getMessages()[331];if(b){for(var k=1;k<=v;k++)S.push(t().createElement(g.MenuItem,{value:k,primaryText:w+" "+k+(k===y?" / "+v:"")}));if(S.length<=1)return null}return o&&(i&&(p={color:i}),a&&(f={fontSize:13},h={fontSize:20})),d=t().createElement(g.IconButton,{onClick:function(){e.onMenuChange(null,0,y-1)},iconClassName:"mdi mdi-chevron-left",disabled:1===y,iconStyle:hr(hr({},p),h),style:a?{marginRight:-10,marginTop:-2,width:40,height:40}:null}),u=t().createElement(g.IconButton,{onClick:function(){e.onMenuChange(null,0,y+1)},iconClassName:"mdi mdi-chevron-right",disabled:v>-1&&y===v,style:a?{marginLeft:-40,marginTop:-2,width:40,height:40}:{marginLeft:-20},iconStyle:hr(hr({},p),h)}),t().createElement("div",{id:l,style:hr({display:"flex",alignItems:"center"},s)},d,b&&t().createElement(g.DropDownMenu,{style:{width:150,marginTop:-6},onChange:this.onMenuChange.bind(this),value:y,underlineStyle:{display:"none"},labelStyle:hr(hr({},p),f),menuStyle:c},S),!b&&t().createElement("div",{style:{width:100,paddingLeft:10}},w+" "+y),u)}}],r&&yr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function wr(e){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(e)}function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&(e=t().createElement(Sr,{dataModel:this.props.dm,node:this.props.node})),t().createElement("div",{className:"mui-toolbar toolbarTableHeader"},t().createElement(dr,kr({displayMode:"tableHeader"},this.props,{columnClicked:this.props.onHeaderClick})),t().createElement("div",{className:"mui-toolbar-group mui-right"},e,t().createElement(g.FontIcon,{key:1,title:Z().getMessages[149],className:"mdi mdi-refresh"+(this.props.loading?" rotating":""),onClick:this.props.reload,style:{padding:16,display:"block",cursor:"pointer",fontSize:24,color:"#9E9E9E"}}),this.props.additionalActions))}}])&&Or(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component),Tr=a(6880),xr=a.n(Tr);const Rr=require("pydio/model/node");var jr=a.n(Rr);function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.props,a=i.node,s=i.pydio,c=i.defaultSortingInfo,l=i.sortingPreferenceKey,u=s.user,d=a.getMetadata(),p=d.get("paginationData");if(e.remoteSortAttribute&&p&&p.get("total")>1){var f=d.get("remoteOrder")||new Map,h="asc"===f.get("order_direction")?"desc":"asc";if(f.get("order_column")===e.remoteSortAttribute&&("asc"===h&&r||o))d.delete("remoteOrder"),this.setState({sortingInfo:null},(function(){return t.sortingInfoChange({})}));else{var m=new Map;m.set("order_column",e.remoteSortAttribute),m.set("order_direction",h),d.set("remoteOrder",m)}this.props.dataModel.requireContextChange(a,!0)}else{d.has("remoteOrder")&&d.delete("remoteOrder");var y,v=e.sortAttribute?e.sortAttribute:e.name,b=this.state.sortingInfo,g=b.attribute,S=b.direction;g===v&&S?(console.log(S,r,o,e),y=o||"desc"===S&&r?c||{}:{attribute:v,sortType:e.sortType,direction:"asc"===S?"desc":"asc"}):y={attribute:v,sortType:e.sortType,direction:"asc"},this.setState({sortingInfo:y},(function(){if(t.rebuildLoadedElements(),null!==n&&n instanceof Function&&n(),l){var e=u.getActiveRepositoryObject().getSlug(),r=u.getGUIPreference(l)||{};r[e]=y,u.setGUIPreference(l,r,!0)}t.sortingInfoChange(y)}))}},computeSelectionFromCurrentPlusTargetNode:function(e,t){var n,r,o=!1;if(!this.indexedElements)return[];for(var i=e[0],a=e[e.length-1],s=[],c=0;c1&&("ArrowRight"===a?d=n+1:"ArrowLeft"===a&&(d=t-1)),i&&void 0!==d){var h=Math.min(t,n,d),m=Math.max(t,n,d);if(h!==m){for(var y=[],v=h;v0&&void 0!==arguments[0]&&arguments[0],r=t.props.sortKeys,o=e.remote?{remoteSortAttribute:e.attribute}:r[e.attribute];console.log("TOGGLE",o,n),t.onColumnSort(o,null,!1,n)}})):o({}))},observeNodeChildren:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&!this._childrenObserver||(this._childrenObserver||(this._childrenObserver=function(){this.indexedElements=null,this.rebuildLoadedElements()}.bind(this)),t?(e.stopObserving("child_added",this._childrenObserver),e.stopObserving("child_removed",this._childrenObserver),e.stopObserving("child_replaced",this._childrenObserver)):(e.observe("child_added",this._childrenObserver),e.observe("child_removed",this._childrenObserver),e.observe("child_replaced",this._childrenObserver)))},_loadNodeIfNotLoaded:function(){var e=this.props.node;e.isLoaded()?this.observeNodeChildren(e):(e.observeOnce("loaded",function(){this.props.node===e&&(this.observeNodeChildren(e),this.setState({loaded:!0,loading:!1,elements:this.buildElements()}))}.bind(this)),e.load())},_loadingListener:function(){this.observeNodeChildren(this.props.node,!0),this.setState({loaded:!1,loading:!0}),this.indexedElements=null},_loadedListener:function(){this.setState({loading:!1,elements:this.buildElements()}),this.observeNodeChildren(this.props.node)},reload:function(){this.props.reloadAtCursor&&this._currentCursor?this.loadStartingAtCursor():(this.props.clearSelectionOnReload&&this.props.dataModel.setSelectedNodes([]),this._loadingListener(),this.props.node.observeOnce("loaded",this._loadedListener),this.props.node.reload())},loadStartingAtCursor:function(){this._loadingListener();var e=this.props.node,t=e.getChildren(),n=[];e.observeOnce("loaded",function(){var r=new Map;n.map((function(e){r.set(e.getPath(),e)})),t.forEach((function(e){r.set(e.getPath(),e)})),e._children=r,this._loadedListener()}.bind(this)),e.setLoaded(!1),e.observe("child_added",(function(t){n.push(e._children.get(t))})),this.props.node.load(null,{cursor:this._currentCursor})},wireReloadListeners:function(){this.wrappedLoading=this._loadingListener,this.wrappedLoaded=this._loadedListener,this.props.node.observe("loading",this.wrappedLoading),this.props.node.observe("loaded",this.wrappedLoaded)},stopReloadListeners:function(){this.props.node.stopObserving("loading",this.wrappedLoading),this.props.node.stopObserving("loaded",this.wrappedLoaded)},toggleSelector:function(){this.setState({showSelector:!this.state.showSelector,selection:new Map,bulkSelectorChecked:!1},this.rebuildLoadedElements)},toggleSelection:function(e){var t=this.state.selection||new Map;t.get(e)?t.delete(e):t.set(e,!0),this.setState({selection:t,bulkSelectorChecked:!1},this.rebuildLoadedElements)},selectAll:function(e){if(e){var t=new Map;this.props.node.getChildren().forEach(function(e){this.props.filterNodes&&!this.props.filterNodes(e)||e.isLeaf()&&t.set(e,!0)}.bind(this)),this.setState({selection:t,bulkSelectorChecked:!0},this.rebuildLoadedElements)}else this.setState({selection:new Map,bulkSelectorChecked:!1},this.rebuildLoadedElements)},applyMultipleAction:function(e){if(this.state.selection&&this.state.selection.size){var t=e.currentTarget.getAttribute("data-action"),n=this.dm||new Io;n.setContextNode(this.props.node);var r=[];this.state.selection.forEach((function(e,t){r.push(t)})),n.setSelectedNodes(r);var o=this.props.pydio.Controller.getActionByName(t);o.fireContextChange(n,!0,this.props.pydio.user),o.apply([n]),e.stopPropagation(),e.preventDefault()}},getActionsForNode:function(e,t){var n=this.props,r=n.computeActionsForNode,o=n.pydio;if(!r)return[];var i=t.isLeaf()?"file-"+t.getAjxpMime():"folder",a=t.isLeaf()?"file":"dir",s=[];return this.actionsCache[i]?s=this.actionsCache[i]:(e.setSelectedNodes([t]),o.Controller.actions.forEach(function(n){n.fireContextChange(e,!0,o.user),!(n.context.selection&&n.context.actionBar&&n.selectionContext[a]&&!n.deny&&n.options.icon_class)||this.props.actionBarGroups&&-1===this.props.actionBarGroups.indexOf(n.context.actionBarGroup)||n.selectionContext.allowedMimes.length&&-1===n.selectionContext.allowedMimes.indexOf(t.getAjxpMime())||(s.push(n),t.isLeaf()&&!1===n.selectionContext.unique&&this.actionsCache.multiple.set(n.options.name,n))}.bind(this)),this.actionsCache[i]=s),s},patchInfiniteGrid:function(e){this.infinite.current&&e>1&&(this.infinite.current.state.infiniteComputer.__proto__.getDisplayIndexStart=function(t){return e*Math.floor(t/this.heightData/e)},this.infinite.current.state.infiniteComputer.__proto__.getDisplayIndexEnd=function(t){return e*Math.ceil(t/this.heightData/e)})},componentWillMount:function(){this.infinite=(0,e.createRef)()},componentDidMount:function(){var e=this;this.props.delayInitialLoad?setTimeout((function(){e._loadNodeIfNotLoaded()}),this.props.delayInitialLoad):this._loadNodeIfNotLoaded(),this.patchInfiniteGrid(this.props.elementsPerLine),this.props.autoRefresh&&(this.refreshInterval=window.setInterval(this.reload,this.props.autoRefresh)),this.props.observeNodeReload&&this.wireReloadListeners(),this.props.dataModel.observe("root_node_changed",(function(t){e.rootNodeChangedFlag=!0})),this.props.dataModel.observe("selection_changed",function(){var e=this;if(this.isMounted()){var t=new Map,n=this.props.dataModel.getSelectedNodes();n.map((function(e){t.set(e,!0)})),this.setState({selection:t},(function(){e.rebuildLoadedElements(),1===n.length&&e.scrollToView(n[0])}))}}.bind(this));var t=new Map,n=this.props.dataModel.getSelectedNodes();n.length&&(n.map((function(e){t.set(e,!0)})),this.setState({selection:t},(function(){setTimeout((function(){e.scrollToView(n[0])}),500)})))},componentWillUnmount:function(){this.refreshInterval&&window.clearInterval(this.refreshInterval),this.props.observeNodeReload&&this.stopReloadListeners(),this.props.node&&this.observeNodeChildren(this.props.node,!0)},componentDidUpdate:function(e,t){!this.rootNodeChangedFlag&&e.node&&this.props.node&&e.node.getPath()===this.props.node.getPath()||(this._loadNodeIfNotLoaded(),this.rootNodeChangedFlag=!1)},onScroll:function(e){if(this.props.onScroll&&this.props.onScroll(e),this.props.passScrollingStateToChildren){this.state.scrollTimeout&&clearTimeout(this.state.scrollTimeout);var t=this,n=setTimeout((function(){t.setState({isScrolling:!1,scrollTimeout:void 0})}),150);this.setState({isScrolling:!0,scrollTimeout:n})}},scrollToLast:function(){this.indexedElements&&this.indexedElements[this.indexedElements.length-1].node&&this.scrollToView(this.indexedElements[this.indexedElements.length-1].node)},scrollToView:function(e){var t=this;if(this.indexedElements&&this.infinite.current&&this.infinite.current.scrollable){var n=r().findDOMNode(this.infinite.current),o=this.infinite.current.scrollable,i=o.scrollTop+this.props.elementHeight/2,a=o.scrollTop+n.clientHeight-this.props.elementHeight/2,s=this.indexedElements.length*this.props.elementHeight-n.clientHeight,c=-1;if(this.indexedElements.forEach((function(t,n){t.node&&t.node===e&&(c=n)})),-1!==c){var l=this.props.elementHeight,u=c*l;u>i&&u=a&&(u-=n.clientHeight-2*l),u=Math.min(u,s),o.scrollTop=u,this._manualScrollPe&&this._manualScrollPe.stop(),o.scrollHeight=u&&(t._manualScrollPe.stop(),t._manualScrollPe=null)}),.25)))}}},buildElementsFromNodeEntries:function(e,n){var r=[],o=e.length,i=this.props,a=i.entriesProps,s=i.elementStyle,c=i.tableKeys,l=i.passScrollingStateToChildren;return a=To(To({},a),{},{style:s}),l&&(a.parentIsScrolling=this.state.isScrolling),e.forEach(function(e,i){var s;if(e.parent)s=To({node:e.node,key:i+":"+e.node.getPath(),id:e.node.getPath(),mainIcon:Mo.PARENT_FOLDER_ICON,firstLine:"..",className:"list-parent-node",secondLine:this.getMessage("react.1"),onClick:this.clickRow.bind(this),onDoubleClick:this.doubleClickRow.bind(this),showSelector:!1,selectorDisabled:!0,noHover:!1},a),this.props.entryRenderParentIcon&&!this.props.tableKeys?s.iconCell=this.props.entryRenderParentIcon(e.node,e):s.mainIcon=Mo.PARENT_FOLDER_ICON,c&&(s.onClick=s.onDoubleClick),r.push(t().createElement(de,s));else if(e.groupHeader){var l=e.groupHeader,u=e.groupHeaderLabel;this.props.entryRenderGroupHeader&&(u=this.props.entryRenderGroupHeader(l,u)),s=To({node:null,key:i+":"+l,id:l,mainIcon:null,firstLine:u,className:"list-group-header",onClick:null,showSelector:!1,selectorDisabled:!0,noHover:!0},a),e.groupFill&&(s.style=To(To({},s.style),{},{visibility:"hidden"})),r.push(t().createElement(de,s))}else(s=To({node:e.node,onClick:this.clickRow.bind(this),onDoubleClick:this.doubleClickRow.bind(this),onSelect:this.toggleSelection.bind(this),key:i+":"+e.node.getPath(),id:e.node.getPath(),renderIcon:this.props.entryRenderIcon,renderFirstLine:this.props.entryRenderFirstLine,renderSecondLine:this.props.entryRenderSecondLine,renderThirdLine:this.props.entryRenderThirdLine,renderActions:this.props.entryRenderActions,showSelector:n,selected:!(!this.state||!this.state.selection)&&this.state.selection.get(e.node),actions:t().createElement(Vr,{node:e.node,actions:e.actions,dataModel:this.dm}),selectorDisabled:!(this.props.entryEnableSelector?this.props.entryEnableSelector(e.node):e.node.isLeaf())},a)).isFirst=0===i,s.isLast=i===o-1,i++,this.props.renderCustomEntry?r.push(this.props.renderCustomEntry(s)):c?(this.props.defaultGroupBy?(s.tableKeys=To({},c),delete s.tableKeys[this.props.defaultGroupBy]):s.tableKeys=c,r.push(t().createElement(Mn,s))):!e.node.isLeaf()||e.node.getMetadata().has("local:dropFunc")?r.push(t().createElement(Ur,s)):r.push(t().createElement(Lr,s))}.bind(this)),r},prepareSortFunction:function(){var e=(this.state||{}).sortingInfo;if(!e)return null;var t,n=e.attribute,r=e.direction,o=e.sortType;return t="file-natural"===o?bo:function(e,t,n){return function(r,o){if(r.getMetadata().has("local:pinSort")&&!o.getMetadata().has("local:pinSort"))return-1;if(o.getMetadata().has("local:pinSort")&&!r.getMetadata().has("local:pinSort"))return 1;var i;if("number"===t){var a=r.getMetadata().get(e)||0,s=o.getMetadata().get(e)||0;a=parseFloat(a),s=parseFloat(s),i="asc"===n?a-s:s-a}else if("string"===t){var c=r.getMetadata().get(e)||"",l=o.getMetadata().get(e)||"";i="asc"===n?c.localeCompare(l):l.localeCompare(c)}if(0===i){var u=r.getLabel().localeCompare(o.getLabel(),void 0,{numeric:!0});i="asc"===n?u:-u}return i}}(n,o,r),function(e,n){return e.parent?-1:n.parent?1:t(e.node,n.node)}},buildElements:function(){var e,t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0)||this.props.node,i=r||this.props,a=this.prepareSortFunction();if(!this.indexedElements||this.indexedElements.length!==o.getChildren().size){this.indexedElements=[];var s,c,l,u,d=i.defaultGroupBy,p=i.groupByLabel,f=void 0!==p&&p;d&&(s={},c=[],l={}),i.skipParentNavigation||!o.getParent()||i.dataModel.getContextNode()===o&&!i.skipInternalDataModel||(t=!0,this.indexedElements.push({node:o.getParent(),parent:!0,actions:null})),o.getChildren().forEach(function(e){if(e.getMetadata().has("cursor")){var t=parseInt(e.getMetadata().get("cursor"));this._currentCursor=Math.max(this._currentCursor?this._currentCursor:0,t)}if(!i.filterNodes||i.filterNodes(e)){var n,r=this.getActionsForNode(this.dm,e);d?(n=i.groupByValueFunc?i.groupByValueFunc(e.getMetadata().get(d))||"N/A":e.getMetadata().get(d)||"N/A",s[n]||(s[n]=[],c.push(n)),f&&e.getMetadata().has(f)&&!l[n]&&(l[n]=e.getMetadata().get(f)),s[n].push({node:e,parent:!1,actions:r})):this.indexedElements.push({node:e,parent:!1,actions:r})}}.bind(this)),d&&(i.groupSkipUnique&&1===c.length?(u=this.indexedElements).push.apply(u,function(e){if(Array.isArray(e))return jo(e)}(n=s[c[0]])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||Ro(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):(e=!0,(c=c.sort()).map(function(e,n){var r=e;if(l[e]?r=l[e]:i.renderGroupLabels&&(r=i.renderGroupLabels(d,e)),this.indexedElements.push({node:null,groupHeader:e,groupHeaderLabel:r,parent:!1,actions:null}),a&&s[e].sort(a),this.indexedElements=this.indexedElements.concat(s[e]),i.elementsPerLine>1){var o=i.elementsPerLine-s[e].length%i.elementsPerLine-1;0===n&&t&&(o-=1);for(var c=0;c1?r.has("order_column")&&r.has("order_direction")?{remote:!0,attribute:r.get("order_column"),direction:r.get("order_direction")}:-1:0},renderToolbar:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.state.sortingInfo;if(n)return this.props.sortKeys?t().createElement(dr,{displayMode:"hidden",tableKeys:this.props.sortKeys,columnClicked:this.onColumnSort,sortingInfo:r}):null;var o,i,a=[t().createElement(g.FontIcon,{key:1,tooltip:"Reload",className:"mdi mdi-reload"+(this.state.loading?" rotating":""),onClick:this.reload})],s=2;if(this.props.sortKeys&&(a.push(t().createElement(dr,{key:s,displayMode:"menu",tableKeys:this.props.sortKeys,columnClicked:this.onColumnSort,sortingInfo:r})),s++),this.props.additionalActions&&a.push(this.props.additionalActions),this.props.node.getMetadata().get("paginationData")&&this.props.node.getMetadata().get("paginationData").get("total")>1&&(i=t().createElement(Sr,{dataModel:this.dm,node:this.props.node})),this.props.listTitle&&(o=t().createElement(g.ToolbarGroup,{key:0,float:"left"},t().createElement("div",{className:"list-title"},this.props.listTitle))),this.props.searchResultData)o=t().createElement(g.ToolbarGroup,{key:0,float:"left"},t().createElement("div",{style:{fontSize:12,fontWeight:500,color:"#9e9e9e"}},this.getMessage("searchengine.topbar.title")+" "+this.props.searchResultData.term)),a=t().createElement(g.RaisedButton,{key:1,label:this.getMessage("86"),primary:!0,onClick:this.props.searchResultData.toggleState,style:{marginRight:-10}});else if(this.actionsCache.multiple.size||this.props.multipleActions){var c=this.getMessage("react.2"),l={transform:"translateX(-80px)"},u=To({width:24},l),d=To({},l),p=this.state,f=p.showSelector,h=p.selection,m=p.bulkSelectorChecked;f&&(u={width:24,transform:"translateX(-12px)"},d={transform:"translateX(-40px)"}),h&&f&&(c+=" ("+h.size+")"),o=t().createElement(g.ToolbarGroup,{key:0,float:"left",className:"hide-on-vertical-layout"},t().createElement(g.Checkbox,{checked:m,onCheck:function(t,n){return e.selectAll(n)},style:u}),t().createElement(g.FlatButton,{label:c,onClick:function(){return e.toggleSelector()},style:d})),f&&(a=[],(this.props.multipleActions||this.actionsCache.multiple).forEach(function(e){a.push(t().createElement(g.RaisedButton,{key:0,label:e.options.text,"data-action":e.options.name,onClick:this.applyMultipleAction,primary:!0,disabled:!h||!h.size,style:{marginLeft:5}}))}.bind(this)),a=t().createElement("span",null,a))}return t().createElement(g.Toolbar,{style:this.props.toolbarStyle},o,t().createElement(g.ToolbarGroup,{key:1,float:"right"},i,a))},render:function(){var e,n,r,o=this,i="material-list vertical-layout layout-fill",a=this.props,s=a.className,c=a.showSelector,l=a.tableKeys,u=a.defaultGroupBy,d=a.dataModel,p=a.node,f=a.additionalActions,h=a.customToolbar,m=a.hideToolbar,y=a.emptyStateProps,v=a.entryHandleClicks;if(s&&(i+=" "+s),c&&(i+=" list-show-selectors"),l&&(i+=" table-mode"),l){var b;u?delete(b=To({},l))[u]:b=this.props.tableKeys;var g=this.state,S=g.sortingInfo,w=g.loading;e=t().createElement(Cr,{tableKeys:b,loading:w,reload:this.reload,ref:"loading_indicator",dm:d,node:p,additionalActions:f,onHeaderClick:this.onColumnSort,sortingInfo:S})}else e=h||(m?null:this.renderToolbar()),(m||h)&&(n=this.renderToolbar(!0));if(y&&p.isLoaded()&&!p.isLoading()&&(!this.state.elements.length||1===this.state.elements.length&&this.state.elements[0].parent)){var k={};if(1===this.state.elements.length&&this.state.elements[0].parent){var O=this.state.elements[0].node;k={actionLabelId:"react.1",actionIconClassName:Mo.PARENT_FOLDER_ICON,actionCallback:function(e){v&&v(O,Mo.CLICK_TYPE_DOUBLE,e)}}}r=t().createElement(po,Eo({},y,k))}else y&&y.checkEmptyState&&y.checkEmptyState(p)&&(r=t().createElement(po,y));var P,E,C=this.buildElementsFromNodeEntries(this.state.elements,this.state.showSelector),T=this.props,x=T.verticalScroller,R=T.usePlaceHolder,j=C;if(!C.length&&R&&(j=t().createElement(vo,this.props)),r)j=r;else if(x)P=function(e){return t().createElement(V(),{speed:.8,horizontalScroll:!1,style:{height:e},verticalScrollbarStyle:{borderRadius:10,width:6},verticalContainerStyle:{width:8}},t().createElement("div",null,j))};else{if(l)return t().createElement("div",{className:i,tabIndex:"0",onKeyDown:this.onKeyDown,style:To(To({},this.props.style),{},{overflowX:"auto"})},n,t().createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,height:"100%",width:"100%",minWidth:"fit-content"}},e,t().createElement(Ao,{className:r?"layout-fill vertical_layout":"layout-fill"},(function(e){return t().createElement(q(),{elementHeight:o.state.elementHeight?o.state.elementHeight:o.props.elementHeight,containerHeight:e||1,handleScroll:o.onScroll,ref:o.infinite},j)}))));E=function(e){return t().createElement(q(),{elementHeight:o.state.elementHeight?o.state.elementHeight:o.props.elementHeight,containerHeight:e||1,handleScroll:o.onScroll,ref:o.infinite},P?P(e):j)}}return t().createElement("div",{className:i,tabIndex:"0",onKeyDown:this.onKeyDown,style:this.props.style},e,n,t().createElement(Ao,{className:r?"layout-fill vertical_layout":"layout-fill"},E||function(){return j}))}});function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Yo(this,e),this.state=Jo({},t),!t.sortCol&&r&&(this.state.sortCol=r,this.state.sortDir=o||"asc"),this.onSort=n}return Xo(e,[{key:"renderHeader",value:function(e,n){var r=this,o=this.state,i=o.sortCol,a=o.sortDir,s={cursor:"pointer",position:"relative"},c={left:-17,position:"absolute"};if(i!==e||""===a)return t().createElement("span",{onClick:function(){r.onSort(e,"asc")},style:s},n);var l=n;return"asc"===a?l=t().createElement("span",{onClick:function(){r.onSort(e,"desc")},style:s},n," ",t().createElement("span",{style:c,className:"mdi mdi-arrow-up"})):"desc"===a&&(l=t().createElement("span",{onClick:function(){r.onSort(e,"")},style:s},n," ",t().createElement("span",{style:c,className:"mdi mdi-arrow-down"}))),l}},{key:"setData",value:function(e,t){this.columns=e,this.data=t}},{key:"sorted",value:function(){var e=this.state,t=e.sortCol,n=e.sortDir;if(!t||!n)return this.data;var r,o=function(e){if(Array.isArray(e))return Vo(e)}(r=this.data)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return Vo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vo(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=this.columns.filter((function(e){return e.name===t}))[0],a=i.sorter;return a?(o.sort((function(e,r){var o,s;return a.value?(o=a.value(e),s=a.value(r)):i.renderCell?(o=i.renderCell(e),s=i.renderCell(r)):(o=e[t],s=r[t]),"string"===a.type?(o||(o=""),s||(s=""),o=o.toLowerCase(),s=s.toLowerCase()):"number"===a.type&&(o=parseInt(o),s=parseInt(s)),"asc"===n?o>s?1:os?-1:0})),o):this.data}}]),e}(),oi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(i,e);var n,r,o=(n=i,r=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}}(),function(){var e,t=qo(n);if(r){var o=qo(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function i(e){var t;return Yo(this,i),(t=o.call(this,e)).state={},t}return Xo(i,[{key:"onRowSelection",value:function(e){var t=this.props,n=t.data,r=t.onSelectRows;if(r)if("none"===e)r([]);else if("all"===e)r(n);else{var o=n,i=this.computeSorter();i&&(o=i.sorted());var a=this.computePagination();a.use&&(o=o.slice(a.sliceStart,a.sliceEnd));var s=[];e.map((function(e){var t=o.slice(0,e).filter((function(e){return e.expandedRow})).length;t&&(e-=t),s.push(o[e])})),r(s)}}},{key:"loadStoredValue",value:function(){var e=this.props,t=e.storageKey,n=e.columns;if(!t)return null;if(!localStorage.getItem(t+".sort"))return null;try{var r=JSON.parse(localStorage.getItem(t+".sort")),o=r.col,i=r.dir;return 0===n.filter((function(e){return e.name===o})).length||-1===["asc","desc",""].indexOf(i)?null:{col:o,dir:i}}catch(e){return null}}},{key:"computeSorter",value:function(){var e,t=this,n=this.props,r=n.columns,o=n.data,i=n.storageKey,a=r.filter((function(e){return e.sorter}));if(a.length){var s,c=a[0].name,l=a.filter((function(e){return e.sorter.default})),u=this.loadStoredValue();u?(c=u.col,s=u.dir):l.length&&(c=l[0].name,l[0].sorter.defaultDir&&(s=l[0].sorter.defaultDir)),(e=new ri(this.state,(function(e,n){t.setState({sortCol:e,sortDir:n}),i&&localStorage.setItem(i+".sort",JSON.stringify({col:e,dir:n}))}),c,s)).setData(r,o)}return e}},{key:"computePagination",value:function(){var e=this.props,t=e.data,n=e.paginate,r=e.defaultPageSize,o=e.pagination;if(o)return Jo(Jo({},o),{},{use:!0});if(!n||!t||!t.length)return{use:!1};var i=this.state.pageSize||r||n[0];if(t.length<=i)return{use:!1};for(var a=this.state.page,s=void 0===a?1:a,c=Math.ceil(t.length/i),l=(s-1)*i,u=Math.min(s*i,t.length),d=[],p=1;p<=c;p++)d.push(p);return{use:!0,sliceStart:l,sliceEnd:u,pages:d,page:s,pageSize:i,pageSizes:n}}},{key:"renderPagination",value:function(e){var n=this,r=this.props,o=r.data,i=r.muiTheme,a=e.page,s=e.pageSize,c=e.pages,l=e.pageSizes,u=e.sliceStart,d=e.sliceEnd,p=e.nextDisabled,f=e.prevDisabled,h=e.onPageNext,m=e.onPagePrev,y=e.onPageSizeChange;return t().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",color:"#757575"}},l.length>1&&t().createElement("div",{style:{paddingRight:10}},Z().getMessages()["material.paginator.rows"]," :"),l.length>1&&t().createElement("div",{style:{width:90}},t().createElement(g.SelectField,Zo({},ni(i).selectField,{fullWidth:!0,value:s,onChange:function(e,t,r){y?y(r):n.setState({page:1,pageSize:r})}}),l.map((function(e){return t().createElement(g.MenuItem,{value:e,primaryText:e})})))),m&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-left",disabled:f,onClick:function(){return m()}}),!m&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-left",disabled:1===a,onClick:function(){return n.setState({page:a-1})}}),(u||d)&&t().createElement("div",null,u+1,"-",d," ",Z().getMessages()["material.paginator.of"]," ",o.length),h&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-right",disabled:p,onClick:function(){return h()}}),!h&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-right",disabled:a===c.length,onClick:function(){return n.setState({page:a+1})}}))}},{key:"render",value:function(){var e=this.props,n=e.columns,r=e.deselectOnClickAway,o=e.emptyStateString,i=e.masterStyles,a=void 0===i?{}:i,s=e.emptyStateStyle,c=e.onSelectRows,l=e.computeRowStyle,u=e.rowSelected,d=this.props,p=d.actions,f=d.hideHeaders,h=this.props,m=h.data,y=h.showCheckboxes,v=a.actionsColor||"rgba(0,0,0,.33)",b=this.computeSorter();b&&(m=b.sorted());var S,w=this.computePagination();w.use&&(m=m.slice(w.sliceStart,w.sliceEnd),S=this.renderPagination(w));var k,O=0;p&&p.length&&(k=!0,O=1);var P=[];m.map((function(e){var r;if(l&&(r=l(e)),e.Subheader){var o=Jo({fontSize:12,color:"#616161",backgroundColor:"#FAFAFA",fontWeight:500},e.style);P.push(t().createElement(g.TableRow,{className:"media-small-hide",style:Jo({},a.row)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:o},e.Subheader)))}else if(e.colSpan)P.push(t().createElement(g.TableRow,{style:Jo(Jo({},e.rowStyle),a.row)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:Jo({height:"auto",paddingLeft:0,paddingRight:0,backgroundColor:"transparent"},e.cellStyle)},e.element)));else{var i=Jo(Jo({},r),a.row);e.expandedRow&&(i=Jo(Jo({},i),a.expanderRow)),P.push(t().createElement(g.TableRow,{selectable:void 0!==c,style:i,selected:u&&u(e)},n.map((function(n){var r=e[n.name],o=r;return n.useMoment&&r?o=r=ti(new Date(1e3*parseInt(r))).fromNow():n.renderCell&&(r=n.renderCell(e))&&"object"===$o(r)&&r.element&&r.text&&(o=r.text,r=r.element),t().createElement(g.TableRowColumn,{style:n.style||{},title:"object"===$o(o)?null:o,className:n.hideSmall?"media-small-hide":null},r)})),k&&t().createElement(g.TableRowColumn,{style:{overflow:"visible",textOverflow:"none",width:48*p.length+32}},p.map((function(n){var r=!!n.disable&&n.disable(e);return t().createElement(g.IconButton,{style:{padding:14,opacity:r?.5:null},iconStyle:{fontSize:20,color:v},onClick:function(t){t.stopPropagation(),n.onClick(e)},iconClassName:n.iconClassName,tooltip:n.tooltip,disabled:r})}))))),e.expandedRow&&P.push(t().createElement(g.TableRow,{selectable:!1,style:Jo(Jo({},a.row),a.expandedRow)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:Jo({height:"auto",paddingLeft:0,paddingRight:0,backgroundColor:"transparent"},e.cellStyle)},e.expandedRow)))}}));var E=n.map((function(e){var n=e.label;return b&&e.sorter&&(n=b.renderHeader(e.name,e.label)),t().createElement(g.TableHeaderColumn,{style:Jo(Jo({},e.headerStyle),{},{height:48,backgroundColor:"#F5F5F5",fontWeight:500},a.head),className:e.hideSmall?"media-small-hide":null},n)}));return k&&E.push(t().createElement(g.TableHeaderColumn,{style:Jo({width:48*p.length+32,height:48,backgroundColor:"#F5F5F5"},a.head)})),o&&!P.length&&(y=!1,P=[t().createElement(g.TableRow,null,t().createElement(g.TableRowColumn,{colSpan:n.length,style:s},o))]),(m.length&&m[0].Subheader||o&&!P.length)&&P.unshift(t().createElement(g.TableRow,{style:Jo({borderBottom:"none",height:0},a.row)},n.map((function(e){var n=e.style||{};return t().createElement(g.TableRowColumn,{style:Jo(Jo({},n),{},{height:0}),className:e.hideSmall?"media-small-hide":null})})))),t().createElement(g.Table,{onRowSelection:this.onRowSelection.bind(this),multiSelectable:y},!f&&t().createElement(g.TableHeader,{displaySelectAll:y,adjustForCheckbox:y,enableSelectAll:y},t().createElement(g.TableRow,{style:a.row},E)),t().createElement(g.TableBody,{deselectOnClickaway:r,displayRowCheckbox:y},P),S&&t().createElement(g.TableFooter,null,t().createElement(g.TableRow,{style:{backgroundColor:"#fafafa"}},t().createElement(g.TableRowColumn,{colSpan:n.length},S))))}}]),i}(t().Component);(oi=(0,K.muiThemeable)()(oi)).PropTypes={data:z().array,columns:z().array,onSelectRows:z().func,emptyStateString:z().string};const ii=t()["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"],ai=function(t,n,r,o){var i=e.useRef(r),a=e.useRef(o);ii((function(){i.current=r,a.current=o})),ii((function(){var e=t&&"current"in t?t.current:t;if(e){var r=0;e.addEventListener(n,s);var o=a.current;return function(){r=1,e.removeEventListener(n,s),o&&o()}}function s(){if(!r){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=gi(t),i=1e3/n,a=e.useRef(0),s=e.useRef(),c=function(){return s.current&&clearTimeout(s.current)},l=[n,r,o];function u(){a.current=0,c()}return e.useEffect((function(){return u}),l),e.useCallback((function(){var e=arguments,t=wi(),n=function(){a.current=t,c(),o.current.apply(null,e)},l=a.current;if(r&&0===l)return n();if(t-l>i){if(l>0)return n();a.current=t}c(),s.current=setTimeout((function(){n(),a.current=0}),i)}),l)}function Oi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pi(e,t):void 0}}(e,t)||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.")}()}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=n.offset,o=void 0===r?0:r,i=n.fps,a=void 0===i?12:i,s=t&&"current"in t?t.current:t,c=function(){return s?"scrollTop"in s?s.scrollTop:s.pageYOffset||s.scrollY:0},l=function(t,n,r){var o=e.useState(t);return[o[0],ki(o[1],n,void 0)]}(c,a),u=Oi(l,2),d=u[0],p=u[1],f=Oi(e.useState(!1),2),h=f[0],m=f[1];function y(){m(!1)}return ii((function(){if(s){var e,t=!1,n=function(){return e&&void vi(e.v||-1)},r=function(){t||(p(c()),m(!0),n(),e=function(e,t){var n=pi(),r={};return r.v=yi((function o(){pi()-n>=t?e.call(null):r.v=yi(o)})),r}(y,1e3/a))};return s.addEventListener("scroll",r),function(){s.removeEventListener("scroll",r),n(),t=!0}}}),[s,a]),{scrollTop:Math.max(0,d-o),isScrolling:h}}var Ci={low:0,max:0,high:0,C:2,P:void 0,R:void 0,L:void 0,list:void 0};function Ti(e){var t=e.high;e.L===Ci&&e.R===Ci?e.max=t:e.L===Ci?e.max=Math.max(e.R.max,t):e.R===Ci?e.max=Math.max(e.L.max,t):e.max=Math.max(Math.max(e.L.max,e.R.max),t)}function xi(e){for(var t=e;t.P!==Ci;)Ti(t.P),t=t.P}function Ri(e,t){if(t.R!==Ci){var n=t.R;t.R=n.L,n.L!==Ci&&(n.L.P=t),n.P=t.P,t.P===Ci?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,Ti(t),Ti(n)}}function ji(e,t){if(t.L!==Ci){var n=t.L;t.L=n.R,n.R!==Ci&&(n.R.P=t),n.P=t.P,t.P===Ci?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,Ti(t),Ti(n)}}function Ii(e,t,n){t.P===Ci?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:0,r=function(){var e={root:Ci,size:0},t={};return{insert:function(n,r,o){for(var i=e.root,a=Ci;i!==Ci&&n!==(a=i).low;)i=no.high)break;r=o,o=o.next}return r||(e.list={index:n,high:t,next:o}),r&&(r.next={index:n,high:t,next:r.next}),!0}(a,r,o))return;return a.high=Math.max(a.high,r),Ti(a),xi(a),t[o]=a,void e.size++}var s={low:n,high:r,max:r,C:0,P:a,L:Ci,R:Ci,list:{index:o,high:r,next:null}};a===Ci?e.root=s:(s.lowi.max)&&(i.L!==Ci&&o.push(i.L),i.R!==Ci&&o.push(i.R),i.low<=n&&i.high>=t))for(var a=i.list;null!==a;)a.high>=t&&r(a.index,i.low),a=a.next}},get size(){return e.size}}}(),o=new Array(e),i=[],a=new Array(e),s=0;s1&&void 0!==arguments[1]?arguments[1]:0,c=0,l=1;l1?Math.min.apply(null,o):o[0]||0},size:function(){return r.size}}},Mi=function(e,t){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>>1,i=e[o];if(i===t)return o;i<=t?n=o+1:r=o-1}return-1},Ni=[],Di=function(e){try{return new e}catch(e){var t={};return{set:function(e,n){t[e]=n},get:function(e){return t[e]}}}};const Li=function(e,t){var n,r=function(e){var t,n,r,o,i=e.length,a=Di(e[0]),s=1===i;return i<3?{g:function(e){return void 0===(t=a.get(e[0]))||s?t:t.get(e[1])},s:function(r,o){return s?a.set(r[0],o):void 0===(t=a.get(r[0]))?((n=Di(e[1])).set(r[1],o),a.set(r[0],n)):t.set(r[1],o),o}}:{g:function(e){for(o=a,r=0;r0},e.prototype.connect_=function(){Bi&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zi?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Bi&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=Wi.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),qi=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),na="undefined"!=typeof WeakMap?new WeakMap:new Ui,ra=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Hi.getInstance(),r=new ta(t,n,this);na.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){ra.prototype[e]=function(){var t;return(t=na.get(this))[e].apply(t,arguments)}}));const oa=void 0!==Fi.ResizeObserver?Fi.ResizeObserver:ra;var ia=new WeakMap;function aa(){var t=e.useState(sa)[1];return e.useRef((function(){return t({})})).current}var sa={},ca=Li([WeakMap],(function(e,t){var n,r,o,i,a=(n=function(n){for(var r=[],o=0;o0){var s=ia.get(i.target);if(void 0!==s){var c=e.get(s);void 0!==c&&a!==c.height&&r.push(s,a)}}}r.length>0&&(e.update(r),t(r))},r=[],o=null,i=function(){for(var e=arguments.length,t=new Array(e),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1),2),h=f[0],m=f[1],y=_a((0,e.useState)(!1),2),v=y[0],b=y[1];(0,e.useEffect)((function(){var e=function(){m(s.getSelectedNodes().indexOf(i)>-1)};return s.observe("selection_changed",e),function(){s.stopObserving("selection_changed",e)}}),[h,i]);var g=c.handleClicks,S=c.renderIcon,w=c.renderActions,k=Z().getMessages()["react.1"],O={};if(p&&d&&i.getMetadata().get("image_exif_orientation")){var P=parseInt(i.getMetadata().get("image_exif_orientation"));if(Na[P]){var E=ja({},Na[P]);if(P<5)O={transform:Da(E)};else{var C=r*(d=1/d),T=(r-C)/2;E.translateX=T*E.tX,E.translateY=T*E.tY,O={transform:Da(E),width:C}}}}var x=["masonry-card"];v&&x.push("hover"),h&&x.push("selected"),p&&x.push("has-src");var R=(0,e.useRef)(null);return(0,e.useEffect)((function(){l&&R.current&&l(R.current)}),[i]),t().createElement(pe,{node:i,style:{width:r,height:r*d,position:"relative"},className:x.join(" "),onClick:function(e){return g(i,a?Mo.CLICK_TYPE_DOUBLE:Mo.CLICK_TYPE_SIMPLE,e)},onDoubleClick:function(e){return g(i,Mo.CLICK_TYPE_DOUBLE,e)},onMouseOver:function(){return b(!0)},onMouseOut:function(){return b(!1)}},p&&t().createElement(Ba,{className:"masonry-image",src:p,alt:i.getPath(),style:ja({width:r},O)}),a&&t().createElement("div",{className:"mimefont-container"},t().createElement("div",{className:"mimefont mdi mdi-chevron-left"})),!a&&!p&&S(i),!a&&t().createElement("div",{style:{position:"absolute",top:0,left:0}},w(i)),p&&t().createElement("div",{className:"masonry-label-overlay",style:{position:"absolute",bottom:0,left:0,right:0,height:50}}),t().createElement("div",{className:"masonry-label",ref:R,style:ja({display:v||h||!p?"block":"none"},{position:"absolute",bottom:0,left:0,right:0,height:32,padding:"6px 10px",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:"0 0 2px 2px"})},a?k:i.getLabel()))}),(function(e){return e.data.node})),Ba=function(n){var r=n.src,o=n.alt,i=n.style,a=n.className,s=(0,e.useRef)(),c=function(t){var n=_a((0,e.useState)(!1),2),r=n[0],o=n[1];return(0,e.useEffect)((function(){var e=new IntersectionObserver((function(e){var t,n,r=_a(e,1)[0];if(!(r.target&&!r.rootBounds&&(t=r.target,n=t.getBoundingClientRect(),n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth))))return r.isIntersecting?o(r.isIntersecting):void 0;o(!0)}),{threshold:.1,root:null});return e.observe(t.current),function(){e.disconnect()}}),[t]),r}(s),l=ja({},i);return l.transition="opacity 550ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",c||(l.opacity=0),t().createElement("img",{ref:s,alt:o,src:c?r:null,style:l,className:a})};function Fa(e,t){var n=[];return e.getChildren().forEach((function(e,r){n.push(ja({id:"item-"+r,node:e},t))})),n.sort((function(e,t){return bo(e.node,t.node)})),e.getParent()&&n.unshift(ja({id:"item-parent",parent:!0,node:e.getParent()},t)),n}const za=t().memo((function(n){var r=n.className,o=n.dataModel,i=n.entryProps,a=n.emptyStateProps,s=n.containerStyle,c=void 0===s?{}:s,l=n.columnWidth,u=void 0===l?220:l,d=n.onScroll,p={dataModel:o,entryProps:i},f=function(){return Fa(o.getContextNode(),p)},h=_a((0,e.useState)(f),2),m=h[0],y=h[1],v=_a((0,e.useState)(o.getContextNode()),2),b=v[0],g=v[1];(0,e.useEffect)((function(){var e=function(){var e=o.getContextNode();e.isLoaded()?g(e):e.observeOnce("loaded",(function(){return g(e)}))};return o.observe("context_changed",e),function(){o.stopObserving("context_changed",e)}})),(0,e.useEffect)((function(){y(f());var e=function(){y(Fa(b,p)),La()},t=function(){y(Fa(b,p)),window.dispatchEvent(new Event("resize")),La()};return b.observe("child_added",t),b.observe("child_removed",e),b.observe("child_replaced",t),function(){b.stopObserving("child_added",t),b.stopObserving("child_removed",e),b.stopObserving("child_replaced",t)}}),[b]),b.isLoaded()||(b.observeOnce("loaded",(function(){y(Fa(b,p))})),b.load());var S,w,k,O,P,E,C=(0,e.useRef)(null),T=(S=C,w=function(){var e=S.current;if(e){var t=getComputedStyle(e),n=parseFloat;return{width:e.clientWidth-n(t.paddingTop)-n(t.paddingBottom),height:e.clientHeight-n(t.paddingLeft)-n(t.paddingRight)}}return{width:0,height:0}},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(e,t):void 0}}(e,t)||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.")}()}(e.useState(w),2),O=k[0],P=k[1],E=function(){return P(w())},ai(window,"resize",E),ai(window,"orientationchange",E),ii((function(){P(w())}),[]),O),x=T.width,R=T.height,j=Ei(C),I=j.scrollTop,_=j.isScrolling;(0,e.useEffect)((function(){La()}),[c.marginLeft]),d&&(0,e.useEffect)((function(){d({scrollTop:I})}),[I]);var A=function(t){var n=t.width,r=t.columnWidth,o=void 0===r?200:r,i=t.columnGutter,a=void 0===i?0:i,s=t.columnCount,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ni,l=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}(e,t)||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.")}()}(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3?arguments[3]:void 0;return r=r||Math.floor(e/(t+n))||1,[Math.floor((e-n*(r-1))/r),r]}(n,o,a,s),2),t=e[0],r=e[1];return Ai(r,t,a)},u=e.useRef();void 0===u.current&&(u.current=l());var d=e.useRef(c),p=[n,o,a,s],f=e.useRef(p),h=!p.every((function(e,t){return f.current[t]===e}));if(h||!c.every((function(e,t){return d.current[t]===e}))){var m=u.current,y=l();if(d.current=c,f.current=p,h)for(var v=m.size(),b=0;b0?i[o-1]:null,next:o1&&t().createElement(bs,{node:o,dataModel:i,depth:f+1,offsetSize:m,paddingOffset:h}),F))}}),vs=ys;w()&&(vs=w().flow(w().DragSource(p.NODE_PROVIDER,v,f),w().DropTarget(p.NODE_PROVIDER,b,h))(ys));var bs=function(e){is(r,e);var n=ss(r);function r(){return ns(this,r),n.apply(this,arguments)}return os(r,[{key:"goTo",value:function(e){var t=this.props,n=t.dataModel,r=t.node;r.getMetadata().get("paginationData").set("new_page",e),n.requireContextChange(r)}},{key:"render",value:function(){var e=this,n=this.props,r=n.node,o=n.depth,i=n.paddingOffset,a=n.offsetSize,s={style:{width:24,height:24,padding:0}},c=r.getMetadata().get("paginationData"),l=c.get("current"),u=c.get("total"),d=Z().getMessages()[331]+" "+l+" / "+u;return t().createElement("li",null,t().createElement("div",{style:{paddingLeft:i+o*a+5,paddingTop:5,paddingBottom:5,display:"flex",alignItems:"center"}},t().createElement("div",{style:{paddingLeft:14,paddingRight:6},className:"mdi mdi-format-list-bulleted"}),t().createElement("div",{style:{display:"flex",alignItems:"center",borderRadius:3,marginRight:10}},t().createElement(g.IconButton,ts({iconClassName:"mdi mdi-chevron-left",onClick:function(){e.goTo(l-1)},disabled:1===l},s)),t().createElement("div",{style:{padding:"0 20px",flex:1,textAlign:"center",fontSize:13}},d),t().createElement(g.IconButton,ts({iconClassName:"mdi mdi-chevron-right",onClick:function(){e.goTo(l+1)},disabled:l===u},s)))))}}]),r}(t().Component);bs=(0,K.muiThemeable)()(bs);var gs=function(e){is(r,e);var n=ss(r);function r(){var e;ns(this,r);for(var t=arguments.length,o=new Array(t),i=0;i0&&t().createElement(g.IconMenu,{anchorOrigin:{vertical:"top",horizontal:d?"right":"left"},targetOrigin:{vertical:"top",horizontal:d?"right":"left"},iconButtonElement:t().createElement(g.IconButton,{style:w.button.style,iconStyle:w.button.iconStyle,iconClassName:"mdi mdi-dots-vertical"})},s),r&&t().createElement(g.IconButton,{style:oc(oc({},w.button.style),{},{backgroundColor:l.palette.mui3["surface-variant"],borderRadius:"50%"}),iconStyle:w.button.iconStyle,iconClassName:"mdi mdi-close",onClick:r})),!d&&t().createElement("div",{style:w.title},n)),t().createElement("div",{style:oc({paddingTop:12,paddingBottom:8,position:"relative"},w.childrenContainer)},!m&&o&&!d&&t().createElement(g.FloatingActionButton,{onClick:o,backgroundColor:l.palette.mui3.tertiary,mini:!0,style:{position:"absolute",top:-20,left:10}},t().createElement(g.FontIcon,{className:"mdi mdi-pencil",style:{color:l.palette.mui3["on-tertiary"]}})),c),(o||i)&&!d&&m&&t().createElement("div",{style:{padding:"12px 0",margin:"0 20px",display:"flex",borderTop:"1px solid "+l.palette.mui3["outline-variant"]}},t().createElement("span",{style:{flex:1}}),i&&t().createElement(g.FlatButton,{label:f,onClick:function(){return i()}}),o&&t().createElement(g.RaisedButton,{style:{marginLeft:5},label:p,onClick:function(){return o()}})))}}]),r}(t().Component);function mc(e){return mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mc(e)}function yc(e,t){for(var n=0;n90?s="#e53935":a>60&&(s="#ff9800");var c=Z().getMessages()["workspace.quota-usage"]+" ("+me().roundFileSize(i)+")",l=t().createElement("div",{style:{display:"flex",maxWidth:200,alignItems:"center",marginTop:5}},t().createElement("div",{style:{flex:1,paddingRight:12}},t().createElement(g.LinearProgress,{mode:"determinate",min:0,max:i,value:o,color:s})),t().createElement("div",{style:{color:"#bdbdbd",fontWeight:500,fontSize:15}},a,"%"));return r?t().createElement(pc,{legend:c,data:l}):t().createElement(fc,{iconClassName:"mdi mdi-gauge",legend:c,data:l,iconStyle:{marginTop:30}})}}])&&yc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function wc(e){return wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wc(e)}var kc=["style","titleStyle","iconStyleRight","iconStyleLeft"];function Oc(){return Oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=LangUtils.computeStringSlug(e.title);t&&(n+="-"+Math.round(100*Math.random()+10));var r=!1;return this._cards.map(function(e){e.id==n&&(r=!0)}.bind(this)),r&&(n=this.createCardId(e,!0)),n}},{key:"addCard",value:function(e){e.id=this.createCardId(e),this.setCards(this._cards.concat([e]))}}],n&&Fc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}();function qc(e){return qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qc(e)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=[],n=[];return this.props.namespaces.map((function(e){if(a.g[e]){for(var r in a.g[e])if(a.g[e].hasOwnProperty(r)){var o=a.g[e][r];o.hasBuilderFields&&o.hasBuilderFields()&&t.push({reactClass:o,fullName:e+"."+o.displayName})}}else n.push(e)})),n.length&&!e&&ResourcesManager.loadClassesAndApply(n,function(){this.setState({availableWidgets:this.listAvailableWidgets(!0)})}.bind(this)),t}},{key:"onDropDownChange",value:function(e,t,n){var r={};0!=t&&n.payload.reactClass.getBuilderFields().map((function(e){e.default&&(r[e.name]=e.default)})),this.props.onEditStatusChange&&this.props.onEditStatusChange(0!=t),this.setState({selectedIndex:t,selectedWidget:n.payload,currentFormValues:r})}},{key:"cancel",value:function(){this.props.onEditStatusChange&&this.props.onEditStatusChange(!1),this.setState({selectedIndex:0})}},{key:"onFormValueChange",value:function(e){this.setState({currentFormValues:e})}},{key:"onFormSubmit",value:function(){var e=this.state.currentFormValues,t=this.state.selectedWidget,n=e.title?e.title:e.legend;n||(n=this.state.selectedWidget.reactClass.builderDisplayName),this.props.onCreateCard({componentClass:t.fullName,title:n,props:e}),this.cancel()}},{key:"resetLayout",value:function(){window.confirm(this.props.getMessage("home.51"))&&this.props.onResetLayout()}},{key:"render",value:function(){var e,t,n=this.props.getMessage,r=([{payload:0,text:n("home.50")}].concat(this.state.availableWidgets.map((function(e,t){return{payload:e,text:e.reactClass.builderDisplayName}}))),Yc.createElement("div",null,"DropDownMenu (to be re-implemented)"));if(0!==this.state.selectedIndex){var o=this.state.selectedWidget.reactClass.getBuilderFields(),i={};o.map((function(e){e.default&&(i[e.name]=e.default)})),this.state.currentFormValues&&(i=LangUtils.mergeObjectsRecursive(i,this.state.currentFormValues)),e=Yc.createElement(el,{namespace:"PydioForm",componentName:"FormPanel",parameters:o,depth:-1,values:i,onChange:this.onFormValueChange}),t=Yc.createElement("div",{style:{textAlign:"center",paddingBottom:100}},Yc.createElement(g.RaisedButton,{label:n("home.52"),onClick:this.onFormSubmit})," ",Yc.createElement(g.RaisedButton,{label:n("54",""),onClick:this.cancel}))}return Yc.createElement(g.Paper,$c({},this.props,{zDepth:3}),Yc.createElement("h3",null,n("home.53")),Yc.createElement("div",{className:"legend"},n("home.54"),Yc.createElement("br",null),n("home.55")),r,e,t,Yc.createElement("div",{style:{position:"absolute",bottom:30,left:10}},Yc.createElement(g.FlatButton,{disabled:0!=this.state.selectedIndex,label:n("home.56"),secondary:!0,onClick:this.resetLayout})))}}],n&&Vc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(Yc.Component);function nl(e){return nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nl(e)}function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"ajxp_admin";return t.props.getMessage(e,n)}}));var r=this.props.rglStyle||{};return ml.createElement("div",{style:ol(ol({},this.props.style),{},{width:"100%",flex:"1"}),className:this.state.editMode?"builder-open":""},!this.props.disableEdit&&ml.createElement("div",{style:{position:"absolute",bottom:30,right:18,zIndex:11}},ml.createElement(g.FloatingActionButton,{tooltip:this.props.getMessage("home.49"),onClick:this.toggleEditMode.bind(this),iconClassName:this.state.editMode?"mdi mdi-check":"mdi mdi-pencil",mini:this.state.editMode,disabled:this.state.editMode&&this.state.widgetEditing})),e,ml.createElement("div",{className:"home-dashboard",style:{height:"100%"}},ml.createElement(vl,{disableDrag:this.props.disableDrag,cols:this.props.cols,store:this.state.store,style:r,pydio:this.props.pydio,editMode:this.state.editMode,removeCard:this.removeCard.bind(this)})))}}]),n}(ml.Component);function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e?this.setState({showCloseAction:!(this.state&&this.state.showCloseAction)}):this.setState({showCloseAction:e})},getCloseButton:function(){if(this.state&&this.state.showCloseAction){var e=this.props.onCloseAction||function(){};return React.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(0,0,0,0.53)",zIndex:10,top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center"}},React.createElement(g.FlatButton,{label:Z().getInstance().MessageHash["ajxp_admin.home.48"],className:"card-close-button",onClick:e,style:{color:"white"}}))}return null},statics:{getGridLayout:function(e,t){return{x:e||0,y:t||0,w:this.gridWidth||4,h:this.gridHeight||12,isResizable:!1}},hasBuilderFields:function(){return!!this.builderFields},getBuilderFields:function(){return this.builderFields}}};function Pl(e){return Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pl(e)}function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props={pydio:t,cellModel:n,acl:r,addressBookItem:o}}var t,n;return t=e,n=[{key:"createCell",value:function(){var e,t=this.props,n=t.addressBookItem,r=t.pydio,o=r.MessageHash;n.IdmUser?e=n.IdmUser:n.IdmRole&&(e=n.IdmRole),e&&r.user.getIdmUser().then((function(t){var i=su().extractLabelFromIdmObject(t),a=su().extractLabelFromIdmObject(n.IdmUser||n.IdmRole),s=new(lu());s.setLabel(i+", "+a),s.setDescription("Created by "+i),s.addUser(e),s.save().then((function(e){r.UI.displayMessage("SUCCESS",o[643].replace("%s",a))})).catch((function(e){r.UI.displayMessage("ERROR",o[644].replace("%s",e.message))}))}))}},{key:"addToCell",value:function(){var e,t=this.props,n=t.addressBookItem,r=t.cellModel;n.IdmUser?e=n.IdmUser:n.IdmRole&&(e=n.IdmRole),e&&(r.addUser(e),r.save())}},{key:"removeFromCell",value:function(){var e=this.props,t=e.acl,n=e.cellModel;n.removeUser(t.RoleId),n.save()}},{key:"renderItems",value:function(){var e,t,n,r=this.props,o=r.pydio,i=r.cellModel,a=r.acl,s=r.addressBookItem,c=o.MessageHash,l=[];if(a?a.User&&a.User.Login===o.user.id:"user"===t&&o.user.id===e)return l;if(s&&(e=s.id,"group"===(t=s.type)&&s.IdmRole&&(e=s.IdmRole.Uuid,t="team")),n=a?su().extractLabel(o,a):s.label,!0===i)return o.getPluginConfigs("auth").get("USER_CREATE_CELLS")?[React.createElement(g.MenuItem,{primaryText:c[640].replace("%s",n),onClick:this.createCell.bind(this)})]:[];var u,d=i.isEditable(),p=i.getAcls();return Object.keys(p).map((function(n){var r=p[n];(a?a.RoleId===r.RoleId:"user"===t&&r.User&&r.User.Login===e||"group"===t&&r.Group&&r.Group.Uuid===e||"team"===t&&r.Role&&r.Role.Uuid===e)&&(u=!0)})),u?l.push(React.createElement(g.MenuItem,{primaryText:c[641],disabled:!d,onClick:this.removeFromCell.bind(this)})):l.push(React.createElement(g.MenuItem,{primaryText:c[642],disabled:!d,onClick:this.addToCell.bind(this)})),o.getPluginConfigs("auth").get("USER_CREATE_CELLS")&&l.push(React.createElement(g.Divider,null),React.createElement(g.MenuItem,{primaryText:c[640].replace("%s",n),onClick:this.createCell.bind(this)})),l}}],n&&du(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const hu=fu,mu={list:{},listItem:{style:{fontSize:13},innerDivStyle:{padding:"10px 56px 10px 62px"}},avatar:{avatarSize:26,style:{top:5}},iconMenu:{style:{top:4,right:8}},iconButton:{style:{width:26,height:26,padding:5,right:8},iconStyle:{color:"rgba(0,0,0,.33)",fontSize:20}},divider:{style:{marginLeft:62}},className:"compact"},yu=require("pydio/lang/observable");var vu=a.n(yu);function bu(e){return bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(e)}function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Su(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=e.childrenLoader,r=e.itemsLoader,o=e.leafLoaded,i=e.collectionsLoaded,a=e.leafs,s=e.collections,c=t?r:n,l=t?o:i;return new Promise((function(n,r){!l&&c?c(e,(function(r){t?(e.leafs=r,e.leafLoaded=!0):(e.collections=r,e.collectionsLoaded=!0),n(r)})):n((t?a:s)||[])}))}},{key:"computePagination",value:function(e){var t;return e.Users?t=e.Users.length:e.Groups?t=e.Groups.length:e.Teams&&(t=e.Teams.length),e.Total>t?{start:e.Offset,end:e.Offset+e.Limit,max:e.Total,interval:e.Limit}:null}},{key:"prepareIdmUser",value:function(e){var t;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var n=[];n.push(Z().getMessages()[e.Attributes&&"shared"===e.Attributes.profile?"589":"590"]),"/"!==e.GroupPath&&n.push(e.GroupPath),t=n.join(" - ")}return{id:e.Login,label:e.Attributes&&e.Attributes.displayName?e.Attributes.displayName:e.Login,avatar:e.Attributes&&e.Attributes.avatar?e.Attributes.avatar:void 0,type:"user",IdmUser:e,secondaryText:t}}},{key:"prepareIdmGroup",value:function(e){var t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(t=e.GroupPath+e.GroupLabel),{id:e.Uuid,label:e.Attributes&&e.Attributes.displayName?e.Attributes.displayName:e.GroupLabel,type:"group",icon:"mdi mdi-account-multiple",secondaryText:t,IdmUser:e}}},{key:"prepareTeam",value:function(t){var n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(n=Z().getMessages()[603]),{id:t.Uuid,label:t.Label,type:"team",icon:"mdi mdi-account-multiple-outline",itemsLoader:e.loadTeamUsers,_notSelectable:!0,secondaryText:n,IdmRole:t}}},{key:"loadTeams",value:function(t,n){var r=0,o=50;if(t.range){var i=ku(t.range.split("-"),2),a=i[0],s=i[1];r=parseInt(a),o=(s=parseInt(s))-r}var c={};Z().getInstance().getController().actions.has("user_team_create")&&(c={type:"team",remove:"574",multiple:!0}),Cu.listTeams("",r,o).then((function(r){t.pagination=e.computePagination(r);var o=r.Teams.map((function(n){return Su(Su({_parent:t},e.prepareTeam(n)),{},{actions:c})}));n(o)}))}},{key:"loadGroups",value:function(t,n){var r="/",o="";t.IdmUser&&(r=J().trimRight(t.IdmUser.GroupPath,"/")+"/"+t.IdmUser.GroupLabel),t.currentParams&&t.currentParams.has_search&&(o=t.currentParams.value),Cu.listGroups(r,o,!1,0,1e3).then((function(r){var o=r.Groups.map((function(n){return Su(Su({_parent:t},e.prepareIdmGroup(n)),{},{childrenLoader:t.childrenLoader?e.loadGroups:null,itemsLoader:t.itemsLoader?e.loadGroupUsers:null,currentParams:t.currentParams&&t.currentParams.alpha_pages?Su({},t.currentParams):{}})}));n(o)}))}},{key:"loadExternalUsers",value:function(t,n){var r="",o=0,i=50;if(t.currentParams&&t.currentParams.alpha_pages&&(r=t.currentParams.value),t.range){var a=ku(t.range.split("-"),2),s=a[0],c=a[1];o=parseInt(s),i=(c=parseInt(c))-o}var l=xr().getClient().getPydioObject();Cu.listUsers("/",r,!0,o,i,"shared").then((function(r){t.pagination=e.computePagination(r);var o=r.Users.filter((function(e){return e.Login!==l.user.id})).map((function(n){return Su(Su({_parent:t},e.prepareIdmUser(n)),{},{external:!0})}));n(o)}))}},{key:"loadGroupUsers",value:function(t,n){var r="/",o="",i=0,a=50;if(t.IdmUser&&(r=J().trimRight(t.IdmUser.GroupPath,"/")+"/"+t.IdmUser.GroupLabel),t.currentParams&&(t.currentParams.alpha_pages||t.currentParams.has_search)&&(o=t.currentParams.value),t.range){var s=ku(t.range.split("-"),2),c=s[0],l=s[1];i=parseInt(c),a=(l=parseInt(l))-i}var u=xr().getClient().getPydioObject();Cu.listUsers(r,o,!1,i,a,"!shared").then((function(r){t.pagination=e.computePagination(r);var o=r.Users.filter((function(e){return e.Login!==u.user.id&&"pydio.anon.user"!==e.Login})).map((function(n){return Su({_parent:t},e.prepareIdmUser(n))}));n(o)}))}},{key:"loadTeamUsers",value:function(t,n){var r=0,o=50,i="";if(t.range){var a=ku(t.range.split("-"),2),s=a[0],c=a[1];r=parseInt(s),o=(c=parseInt(c))-r}t.currentParams&&(t.currentParams.alpha_pages||t.currentParams.has_search)&&(i=t.currentParams.value),Cu.listUsersWithRole(t.IdmRole.Uuid,r,o,i).then((function(r){t.pagination=e.computePagination(r);var o=r.Users.map((function(n){return Su({_parent:t},e.prepareIdmUser(n))}));n(o)}))}},{key:"globalSearch",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];t="*"+t;var c=xr().getClient().getPydioObject(),l=[];if(i||a){var u=i?a?"":"shared":"!shared",d=Cu.listUsers("/",t,!0,r,o,u).then((function(t){return t.Users.filter((function(e){return e.Login!==c.user.id&&"pydio.anon.user"!==e.Login})).map((function(t){return Su(Su({},e.prepareIdmUser(t,!0)),{},{external:t.Attributes&&"shared"===t.Attributes.profile})}))})).then((function(e){return{users:e}}));l.push(d);var p=Cu.listGroups("/",t,!0,r,o).then((function(t){return t.Groups.map((function(t){return Su(Su({},e.prepareIdmGroup(t,!0)),{},{childrenLoader:e.loadGroups,itemsLoader:e.loadGroupUsers})}))})).then((function(e){return{groups:e}}));l.push(p)}if(s){var f=Cu.listTeams(t,r,o).then((function(t){return t.Teams.map((function(t){return Su({},e.prepareTeam(t,!0))}))})).then((function(e){return{teams:e}}));l.push(f)}return Promise.all(l).then((function(e){var t=e.reduce((function(e,t){return Su(Su({},e),t)}),{});return n(t),t}))}}],null&&Pu(t.prototype,null),n&&Pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),xu=a(2702);function Ru(e){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(e)}function ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"local",s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),Uu(Du(n=i.call(this)),"pydio",null),Uu(Du(n),"mode","book"),Uu(Du(n),"teamsOnly",!1),Uu(Du(n),"usersOnly",!1),Uu(Du(n),"usersFrom","local"),Uu(Du(n),"loading",!1),Uu(Du(n),"root",null),Uu(Du(n),"selectedItem",null),Uu(Du(n),"rightPanelItem",null),Uu(Du(n),"onItemSelected",null),Uu(Du(n),"pendingCreateItem",null),Uu(Du(n),"searchTerm",""),Uu(Du(n),"searchMode",!1),Uu(Du(n),"searchItem",null),Uu(Du(n),"selectionMode",!1),Uu(Du(n),"multipleSelection",[]),Uu(Du(n),"reloadCurrentAtPage",(function(e){var t=n.selectedItem;t.leafLoaded=!1,t.collectionsLoaded=!1,-1===e?t.currentParams=null:-1!==e.indexOf("-")?t.range=e:(t.range=null,t.currentParams={alpha_pages:"true",value:e}),n.setContext(t)})),Uu(Du(n),"reloadCurrentWithSearch",(function(e){if(e){var t=n.selectedItem;t.leafLoaded=!1,t.collectionsLoaded=!1,t.currentParams={has_search:!0,value:e,existing_only:!0},n.setContext(t)}else n.reloadCurrentAtPage(-1)})),Uu(Du(n),"deleteItems",(function(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||confirm(n.m(278)))switch(e.actions.type){case"users":Promise.all(t.map((function(e){return n.rightPanelItem===e&&(n.rightPanelItem=null),xr().getRestClient().getIdmApi().deleteIdmUser(e.IdmUser)}))).then((function(){n.reloadContext()}));break;case"teams":Promise.all(t.map((function(e){return n.rightPanelItem===e&&(n.rightPanelItem=null),xr().getRestClient().getIdmApi().deleteRole(e.IdmRole.Uuid)}))).then((function(){n.reloadContext()}));break;case"team":Promise.all(t.map((function(t){return xr().getRestClient().getIdmApi().removeUserFromTeam(e.IdmRole.Uuid,t.IdmUser.Login)}))).then((function(){n.reloadContext()}))}})),n.pydio=e,n.mode=t,n.teamsOnly=s,n.usersOnly=r,n.usersFrom=o,n.onItemSelected=c;var l=n.pydio.getPluginConfigs("core.auth");return n._teamsEditable=n.pydio.getController().actions.has("user_team_create"),n._externalsAllowed=l.get("USER_CREATE_USERS"),n}return t=a,n=[{key:"getRoot",value:function(){return this.searchMode&&this.searchItem?this.searchItem:this.root}},{key:"contextItem",value:function(){return this.selectedItem}},{key:"setContext",value:function(e,t){var n=this;return"selector"===this.mode&&e.IdmRole&&e.IdmRole.IsTeam?(this.leafItemClicked(e),Promise.resolve()):(this.loading=!0,this.notify("update"),Tu.childrenAsPromise(e,!1).then((function(){Tu.childrenAsPromise(e,!0).then((function(){n.selectedItem=e,n.loading=!1,n.notify("update")})).then((function(){t&&t()}))})))}},{key:"contextIsGroup",value:function(){return this.selectedItem&&(this.selectedItem.IdmUser&&this.selectedItem.IdmUser.IsGroup||"PYDIO_GRP_/"===this.selectedItem.id)}},{key:"contextIsTeam",value:function(){return this.selectedItem&&this.selectedItem.IdmRole&&this.selectedItem.IdmRole.IsTeam}},{key:"reloadContext",value:function(){var e=this;return this.selectedItem?(this.selectedItem.leafLoaded=!1,this.selectedItem.collectionsLoaded=!1,this.setContext(this.selectedItem,(function(){if(e.rightPanelItem){var t=e.rightPanelItem.id,n=null,r=e.selectedItem.leafs||[],o=e.selectedItem.collections||[];[].concat(_u(r),_u(o)).forEach((function(e){e.id===t&&(n=e)})),e.rightPanelItem=n,e.notify("update")}}))):Promise.resolve}},{key:"setGlobalSearch",value:function(e,t){var n=this;e!==this.searchMode&&(e?(this.searchItem||(this.searchItem={id:"search",label:this.m("583"),type:"root"}),this.savedContext=this.contextItem(),this.searchItem.collections=[],this.setContext(this.searchItem)):(this.searchItem.collections=[],this.setContext(this.savedContext))),this.searchMode=e,this.searchTerm=t,this.searchTerm&&Fu(t,(function(e){n.searchItem.collections=[];var t,r,o=n.prepareTopFolders(n.searchItem);e.users&&(t=e.users.filter((function(e){return e.external})),r=e.users.filter((function(e){return!e.external}))),void 0!==t&&n.searchItem.collections.push(Iu(Iu({},o.shared),{},{leafs:t})),e.teams&&n.searchItem.collections.push(Iu(Iu({},o.teams),{},{collections:e.teams})),(void 0!==r||e.groups)&&(r&&r.length,e.groups&&e.groups.length,n.searchItem.collections.push(Iu(Iu({},o.directory),{},{collections:e.groups,leafs:r})));var i=Iu({},o.results);n.searchItem.collections.forEach((function(e){var t,n;(t=i.collections).push.apply(t,_u(e.collections.map((function(t){return t._parent=e,Iu(Iu({},t),{},{_parent:i})})))),(n=i.leafs).push.apply(n,_u(e.leafs.map((function(t){return t._parent=e,Iu(Iu({},t),{},{_parent:i})})))),e.notExpandable=!0,e.label+=" (".concat(e.collections.length+e.leafs.length,")")})),i.label+=" (".concat(i.collections.length+i.leafs.length,")"),n.searchItem.collections.unshift(i),n.setContext(i),n.notify("update")}),0,50,this._externalsAllowed),this.notify("update")}},{key:"getSearchStatus",value:function(){return{searchMode:this.searchMode,searchTerm:this.searchTerm}}},{key:"rightItem",value:function(){return this.rightPanelItem}},{key:"leafItemClicked",value:function(e){if(this.onItemSelected){var t=new xu.User(e.id,e.label,e.type,e.group,e.avatar,e.temporary,e.external);return e.trusted_server_id&&(t.trustedServerId=e.trusted_server_id,t.trustedServerLabel=e.trusted_server_label),t._uuid=e.uuid,e.IdmUser&&(t.IdmUser=e.IdmUser),e.IdmRole&&(t.IdmRole=e.IdmRole),void this.onItemSelected(t)}this.rightPanelItem=e,this.notify("update")}},{key:"clearRightItem",value:function(){this.rightPanelItem=null,this.notify("update")}},{key:"teamsEditable",value:function(){return this._teamsEditable}},{key:"deleteMultipleSelection",value:function(){this.selectionMode=!1,this.deleteItems(this.selectedItem,this.multipleSelection)}},{key:"setCreateItem",value:function(){this.pendingCreateItem=this.selectedItem,this.notify("update")}},{key:"clearCreateItem",value:function(){this.pendingCreateItem=null,this.notify("update")}},{key:"createItem",value:function(){return this.pendingCreateItem}},{key:"setSelectionMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.selectionMode=void 0===e?!this.selectionMode:e,this.multipleSelection=[],this.notify("update")}},{key:"getSelectionMode",value:function(){return this.selectionMode}},{key:"setMultipleSelection",value:function(e){this.multipleSelection=e,this.notify("update")}},{key:"getMultipleSelection",value:function(){return this.multipleSelection}},{key:"initTree",value:function(){var e={};if(this._teamsEditable&&(e={type:"teams",create:"+ "+this.m(569),remove:this.m(570),multiple:!0}),this.teamsOnly)return this.root=Iu(Iu({},this.prepareTopFolders(null).teams),{},{childrenLoader:Tu.loadTeams,actions:e}),void(this.selectedItem=this.root);this.root={id:"root",label:this.m(592),type:"root",collections:[]};var t=this.prepareTopFolders(this.root);"remote"!==this.usersFrom&&(this._externalsAllowed&&this.root.collections.push(Iu(Iu({},t.shared),{},{itemsLoader:Tu.loadExternalUsers,actions:{type:"users",create:"+ "+this.m(484),remove:this.m(582),multiple:!0}})),this.usersOnly||this.root.collections.push(Iu(Iu({},t.teams),{},{childrenLoader:Tu.loadTeams,actions:e})),this.root.collections.push(Iu(Iu({},t.directory),{},{childrenLoader:Tu.loadGroups,itemsLoader:Tu.loadGroupUsers}))),this.selectedItem="selector"===this.mode?this.root:this.root.collections[0]}},{key:"prepareTopFolders",value:function(e){return{shared:{id:"ext",label:this.m(593),icon:"mdi mdi-account-network",_parent:e,_notSelectable:!0,collections:[],leafs:[]},teams:{id:"teams",label:this.m(568),icon:"mdi mdi-account-multiple",_parent:e,_notSelectable:!0,collections:[],leafs:[]},directory:{id:"PYDIO_GRP_/",label:this.m(584),icon:"mdi mdi-account-box",_parent:e,_notSelectable:!0,collections:[],leafs:[]},results:{id:"results",label:this.m("599-a"),icon:"mdi mdi-magnify",_parent:e,notExpandable:!0,collections:[],leafs:[]}}}},{key:"m",value:function(e){return this.pydio.MessageHash[e]||e}}],n&&Mu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(vu());const Wu=zu;function Zu(e){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zu(e)}function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qu(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1?(c=function(t){t.stopPropagation(),h.setContext(e)},"selector"!==o||e._notSelectable||this.props.usersOnly||(a=t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-account-multiple-plus",tooltip:u("addressbook.pick.group"),tooltipPosition:"top-left",iconStyle:{color:"rgba(0,0,0,0.33)"},onClick:function(){i.props.onItemClicked(e)}},b.iconButton)))):"inner"===o&&this.props.onDeleteAction&&(a=t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-delete",tooltip:u(257),tooltipPosition:"top-left",iconStyle:{color:"rgba(0,0,0,0.13)",hoverColor:"rgba(0,0,0,0.53)"},onClick:function(){i.props.onDeleteAction(i.props.item,[e])}},b.iconButton))),d&&this.props.actionsForCell&&e.type){var l=new hu(n,this.props.actionsForCell,null,e).renderItems();a=l.length?t().createElement(g.IconMenu,Ju({},b.iconMenu,{iconButtonElement:t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-dots-vertical",iconStyle:{color:"rgba(0,0,0,.33)"}},b.iconButton)),targetOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},desktop:!0}),l):null}var p,f={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};e.secondaryText&&(f.fontWeight=500,p=t().createElement("span",{style:{fontSize:13,color:"var(--md-sys-color-on-surface-variant)"}},e.secondaryText)),A.push(t().createElement(g.ListItem,Ju({key:e.id,primaryText:t().createElement("div",{style:f},e.label),secondaryText:p,onClick:c,disabled:"inner"===o,leftAvatar:!y&&s,rightIconButton:a,leftCheckbox:y&&t().createElement(g.Checkbox,{checked:m.indexOf(e)>-1,onCheck:function(t,n){if(n)h.setMultipleSelection([].concat(Vu(m),[e]));else{var r=[].concat(Vu(m.slice(0,m.indexOf(e))),Vu(m.slice(m.indexOf(e)+1)));h.setMultipleSelection(r)}}})},b.listItem))),"inner"!==o&&r<_-1&&A.push(t().createElement(g.Divider,Ju({inset:!0,key:e.id+"-divider"},b.divider)))}}.bind(this)),!A.length){var M={style:{backgroundColor:"transparent",minHeight:300},iconClassName:"mdi mdi-account-off",primaryTextId:S||u(629),secondaryTextId:"book"===o&&w||null};"book"===o&&r.actions&&r.actions.create&&(M=qu(qu({},M),{},{actionLabelId:u(r.actions.create),actionCallback:function(){return h.setCreateItem()}})),"compact"===O&&(M=qu(qu({},M),{},{style:{backgroundColor:"transparent",minHeight:150},iconStyle:{fontSize:40},legendStyle:{fontSize:13}})),j=t().createElement(po,M)}return t().createElement("div",{style:qu({flex:1,flexDirection:"column",display:"flex",width:"100%",overflowX:"hidden"},f),onClick:this.props.onClick,className:O},p,!j&&!i&&t().createElement(g.List,{style:{flex:1,overflowY:"inner"!==o?"auto":"initial"}},this.props.subHeader&&t().createElement(g.Subheader,null,this.props.subHeader),A),i&&t().createElement(td,{style:{flex:1}}),!i&&j,"selector"===o&&s&&d&&t().createElement(iu,{searchLabel:c,onSearch:l,style:{padding:"0 20px",minWidth:null},underlineShow:!1}))}}],r&&Ku(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function od(e){return od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},od(e)}function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Td(e){for(var t=1;tO&&(V.split(" ").length>1?(N=V,V=V.split(" ").map((function(e){return e[0]})).join("")):V.split("@").length>1&&(N=V,V=V.split("@")[0].split(".").length>1?V.split("@")[0].split(".").map((function(e){return e[0]})).join(""):V.split("@")[0])),_&&(j=!0,I=!0,C=!0),j&&!o&&V&&(!C||I)){var K,Y=A.palette.avatarsColor;switch("group"!==p&&"team"!==p&&0!==d.indexOf("PYDIO_GRP_/")&&0!==d.indexOf("/USER_TEAM/")||(Y=Md(Y).darken(.2).toString()),p){case"group":K="mdi mdi-account-multiple",D="289",F="folder-avatar";break;case"team":K="mdi mdi-account-multiple-outline",D="603",F="folder-avatar";break;case"remote":K="mdi mdi-account-network",D="604",F="folder-avatar";break;default:K="mdi mdi-account",r?r.getExternal()?(D="589",r.isPublic()&&(D="589",V=u.MessageHash.public_link_user,K="mdi mdi-link")):D="590":D="288"}f&&(K=f),D&&(D=u.MessageHash[D]),_?(B=t().createElement(Dd,{className:K,style:{color:Y}}),U="#f5f5f5"):(U=Y,K&&!y?B=t().createElement(Dd,{className:K}):(L=V.split(" ").map((function(e){return e[0]})).join("").substring(0,2)).length<2&&(L=V.substring(0,2)))}if(_){j=!0,h=Td(Td({},h),{},{flexDirection:"column"}),void 0===b&&(b=50),v=Td({position:"absolute",right:16,top:12},v);var Q=function(){zd.getInstance().deleteKey("user_public_data-graph",e.props.userId),e.loadPublicData(e.props.userId,e.props.idmUser)};z=function(){Q(),e.props.reloadAction&&e.props.reloadAction()},W=function(){Q(),e.props.onEditAction&&e.props.onEditAction()}}else if(a||G||J||!this.props.richOnHover){if(!a&&!G&&!J&&this.props.richOnClick){H=Ad(H=function(){e.lockedBySubPopover||e.setState({showPopover:!1})},350),q=function(t){e.setState({showPopover:!0,popoverAnchor:t.currentTarget}),H.cancel()};var X=function(t){e.setState({showPopover:!0}),H.cancel()},ee=this.props,te=(ee.style,Ed(ee,Od));$=t().createElement(Zd,{open:this.state.showPopover,anchorEl:this.state.popoverAnchor,onRequestClose:function(t){"clickAway"===t&&e.lockedBySubPopover||e.setState({showPopover:!1})},anchorOrigin:{horizontal:"left",vertical:"bottom"},targetOrigin:{horizontal:"left",vertical:"top"},useLayerForClickAway:!1},t().createElement(Ld,{zDepth:2,style:{width:220,height:320,overflowY:"auto"},onMouseOver:X,onMouseOut:H},t().createElement(s,Pd({},te,{richCard:!0,richOnHover:!1,cardSize:220,lockOnSubPopoverOpen:function(t){e.lockedBySubPopover=t,X()}}))))}}else{H=Ad(H=function(){e.lockedBySubPopover||e.setState({showPopover:!1})},350),Z=function(t){e.setState({showPopover:!0,popoverAnchor:t.currentTarget}),H.cancel()};var ne=function(t){e.setState({showPopover:!0}),H.cancel()},re=this.props,oe=(re.style,Ed(re,kd));$=t().createElement(Zd,{open:this.state.showPopover,anchorEl:this.state.popoverAnchor,onRequestClose:function(t){"clickAway"===t&&e.lockedBySubPopover||e.setState({showPopover:!1})},anchorOrigin:{horizontal:"left",vertical:"center"},targetOrigin:{horizontal:"right",vertical:"center"},useLayerForClickAway:!1},t().createElement(Ld,{zDepth:2,style:{width:220,height:320,overflowY:"auto"},onMouseOver:ne,onMouseOut:H},t().createElement(s,Pd({},oe,{richCard:!0,richOnHover:!1,cardSize:220,lockOnSubPopoverOpen:function(t){e.lockedBySubPopover=t,ne()}}))))}if(o){var ie=o;ie.indexOf("?")>=0?ie+="&dim="+b:ie+="?dim="+b,B=t().createElement(Dd,{style:{backgroundImage:"url("+ie+")",backgroundSize:"cover",margin:0,width:"100%",height:"100%",borderRadius:"50%",backgroundPosition:"center"}})}var ae,se=t().createElement(Ud,{icon:B,size:b,style:this.props.avatarOnly?this.props.style:v,backgroundColor:U,className:F||E},L);return this.props.avatarOnly?se:(_?se=t().createElement("div",{style:{textAlign:"center"}},se):G&&(V=u.MessageHash["user.unknown"]),C&&x&&(ae=t().createElement("span",{className:"mdi mdi-chevron-down",style:Td(Td({},R),{},{marginLeft:4,fontSize:"0.8em"})})),t().createElement("div",{className:k,style:h,onMouseOver:Z,onMouseOut:H,onClick:q},j&&(o||L||B)&&se,C&&!_&&t().createElement("div",{title:N,className:P,style:m},V),ae,C&&_&&t().createElement(Bd,{style:Td({textAlign:"center"},g),title:V,subtitle:D,titleStyle:Td({},S),subtitleStyle:Td({},w)}),_&&r&&this.props.actionsPanel,_&&i&&!M&&t().createElement(Sd,Pd({graph:i},this.props,{userLabel:V,reloadAction:z,onEditAction:W})),this.props.children,$))}}],r&&Rd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);Hd.propTypes={userId:z().string.isRequired,pydio:z().instanceOf(Z()),userLabel:z().string,userType:z().oneOf(["user","group","remote","team"]),icon:z().string,richCard:z().bool,richOnHover:z().bool,richOnClick:z().bool,userEditable:z().bool,onEditAction:z().func,onDeleteAction:z().func,reloadAction:z().func,displayLabel:z().bool,displayLocalLabel:z().bool,displayAvatar:z().bool,avatarOnly:z().bool,useDefaultAvatar:z().bool,avatarSize:z().number,avatarLetters:z().bool,noActionsPanel:z().bool,className:z().string,labelClassName:z().string,avatarClassName:z().string,style:z().object,labelStyle:z().object,avatarStyle:z().object},Hd.defaultProps={displayLabel:!0,displayAvatar:!0,avatarSize:40,userType:"user",className:"user-avatar-widget",labelClassName:"user-label"},Hd=Fd()(Hd);var qd=a(7180),$d=a.n(qd);const Vd=require("pydio/util/pass");var Gd=a.n(Vd);const Jd=require("pydio/http/policies");var Kd=a.n(Jd);const Yd=require("cells-sdk");function Qd(e){return Qd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qd(e)}function Xd(e){return function(e){if(Array.isArray(e))return ep(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ep(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ep(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],r=this.state,o=r.policies,i=r.dirtyPolicies,a=r.resourceUuid,s=r.diffPolicies,c=Xd(i||o),l=new Yd.ServiceResourcePolicy;l.Resource=a,l.Effect="allow",l.Subject=t,l.Action=e,c.push(l),s.add[e+"///"+t]=!0,s.remove[e+"///"+t]&&delete s.remove[e+"///"+t],n?this.setState({dirtyPolicies:c,diffPolicies:s,pickedUser:null,pickedLabel:null}):this.setState({dirtyPolicies:c,diffPolicies:s})}},{key:"hasOneWrite",value:function(e){var t=this.state.idmUser,n=t.Roles.map((function(e){return"role:"+e.Uuid}));n.push("user:"+t.Login);for(var r=0;r-1}));return r.length?r[0].Subject:n[0]}},{key:"listUserRoles",value:function(e){var t=this.state,n=t.hideGroups,r=t.idmUser,o=this.findCrtUserSubject(e),i=this.hasOneWrite(e),a={};r.Roles.map((function(e){e.GroupRole&&!n&&(a["role:"+e.Uuid]=e.Label)})),(a=np(np({},this.listOtherUsersSubjects(e,o)),a))[o]="You";for(var s=Object.keys(a),c=[],l=s.length-1;l>=0;l--){var u=s[l],d=a[u];c.push(this.renderLine(u,d,e,!i||u===o))}return{groupBlocks:c,hasWrite:i}}},{key:"listUserTeams",value:function(e,t,n){var r=this;return e.map((function(e){return r.renderLine("role:"+e.Uuid,e.Label,t,n)}))}},{key:"listOtherUsersSubjects",value:function(e,t){var n=this.props,r=n.resourceId,o=n.cellAcls,i=this.state.hideGroups,a={};return e.map((function(e){if(0===e.Subject.indexOf("user:")&&e.Subject!==t&&e.Subject!=="user:"+r&&(a[e.Subject]=e.Subject.substr(5)),o&&0===e.Subject.indexOf("role:")&&o[e.Subject.substr(5)]){var n=e.Subject.substr(5);if(o[n].User){var s=o[n].User;t!=="user:"+s.Login&&t!=="role:"+s.Uuid&&(a[e.Subject]=s.Attributes&&s.Attributes.displayName?s.Attributes.displayName:s.Login)}else if(o[n].Group&&!i){var c=o[n].Group;a[e.Subject]=c.Attributes&&c.Attributes.displayName?c.Attributes.displayName:c.GroupLabel}}})),a}},{key:"pickUser",value:function(e){var t,n;if(e.IdmUser){var r=e.IdmUser,o=r.Attributes||{};r.IsGroup?(t="role:"+r.Uuid,n=o.displayName||r.GroupLabel):(t="user:"+r.Login,n=o.displayName||r.Login)}else{var i=e.IdmRole;t="role:"+i.Uuid,n=i.Label}this.setState({pickedUser:t,pickedLabel:n})}},{key:"renderLine",value:function(e,n,r,o){var i=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.props,c=s.subjectsDisabled,l=s.subjectsHidden,u=s.readonly;if(l&&l[e])return null;var d=!1,p=!1,f=function(){i.addPolicy("READ",e,a)},h=function(){i.addPolicy("WRITE",e,a)};r.map((function(t){t.Subject===e&&("WRITE"===t.Action?(p="WRITE"===t.Action,h=function(){i.removePolicy("WRITE",e)}):"READ"===t.Action&&(d="READ"===t.Action,f=function(){i.removePolicy("READ",e)}))}));var m=o,y=o;return u?(y=!0,m=!0):(c&&c.READ&&c.READ[e]&&(y=!0),c&&c.WRITE&&c.WRITE[e]&&(m=!0)),t().createElement("div",{style:{display:"flex",margin:10,marginRight:0}},t().createElement("div",{style:{flex:1}},n),t().createElement(g.Checkbox,{checked:d,disabled:y,style:{width:40},onCheck:f}),t().createElement(g.Checkbox,{checked:p,disabled:m,style:{width:40},onCheck:h}))}},{key:"render",value:function(){var e=this,n=this.props.muiTheme,r=n.appBar,o=n.palette.mui3,i=void 0===o?{}:o,a={title:{paddingLeft:10,backgroundColor:r.color,display:"flex",alignItems:"center",fontSize:16,color:r.textColor},subheader:{margin:10,fontWeight:500,color:i["on-surface-variant"],display:"flex"},subject:{margin:10},head:{display:"inline-block",width:40,textAlign:"center",fontSize:10}},s=this.state,c=s.edit,l=s.policies,u=s.dirtyPolicies,d=s.error,p=s.idmUser,f=s.userTeams,h=s.loading,m=s.pickedUser,y=s.pickedLabel,v=this.props,b=v.onDismiss,S=v.style,w=v.skipTitle,k=v.resourceId,O=v.pydio,P=v.userListExcludes,E=void 0===P?[]:P,C=v.readonly,T=v.description,x=[],R=O.MessageHash;if(!c)return t().createElement("div",{style:S},!w&&t().createElement("div",{style:np(np({},a.title),{},{height:48})},t().createElement("span",{style:{flex:1}},R["visibility.panel.title"]),b&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-close",onClick:b,iconStyle:{color:r.textColor}})),t().createElement("div",{style:{padding:20,fontWeight:500,textAlign:"justify"}},t().createElement("div",{style:{paddingBottom:20}},T),t().createElement("div",{style:{textAlign:"center"}},t().createElement(g.RaisedButton,{label:R["visibility.panel.edit"],primary:!0,onClick:function(){e.setState({edit:!0})}}))));if(!h&&!d){var j=this.listUserRoles(u||l),I=j.groupBlocks,_=j.hasWrite,A=this.listUserTeams(f,u||l,!_),M=t().createElement("div",null,t().createElement("span",{style:a.head},R["visibility.panel.right-read"]),t().createElement("span",{style:a.head},R["visibility.panel.right-edit"]));if(I.length&&(x.push(t().createElement("div",{style:a.subheader},t().createElement("span",{style:{flex:1}},R["visibility.panel.list.users"]),M)),x.push(I),x.push(t().createElement(g.Divider,null))),A.length&&(x.push(t().createElement("div",{style:a.subheader},t().createElement("span",{style:{flex:1}},R["visibility.panel.list.teams"]),M)),x.push(A),x.push(t().createElement(g.Divider,null))),m)x.push(t().createElement("div",{style:a.subheader},R["visibility.panel.setvisible"])),x.push(this.renderLine(m,y,l,!1,!0)),x.push(t().createElement("div",{style:{textAlign:"right"}},t().createElement(g.FlatButton,{label:R[54],onClick:function(){e.setState({pickedUser:null,pickedLabel:null})}}))),x.push(t().createElement(g.Divider,null));else if(!C){var N="user:"+p.Login,D=this.listOtherUsersSubjects(u||l,N),L=[];Object.keys(D).map((function(e){L.push(D[e])})),x.push(t().createElement("div",{style:a.subheader},R["visibility.panel.setvisible"])),x.push(t().createElement("div",{style:{margin:"-10px 10px 0"}},t().createElement(tv,{className:"share-form-users",fieldLabel:R["visibility.panel.pickuser"],renderSuggestion:function(e){return t().createElement("div",{style:{fontSize:13}},e.getExtendedLabel())},onValueSelected:this.pickUser.bind(this),usersOnly:!1,existingOnly:!0,excludes:[k].concat(Xd(E),L),pydio:O,showAddressBook:!1,usersFrom:"local"}))),x.push(t().createElement(g.Divider,null))}x.pop()}return t().createElement("div",{style:S},t().createElement("div",{style:a.title},t().createElement("span",{style:{flex:1}},w?"":R["visibility.panel.title"]),u&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-undo-variant",tooltip:R["visibility.panel.revert"],onClick:this.revert.bind(this),iconStyle:{color:r.textColor}}),u&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-content-save",tooltip:R["visibility.panel.save"],onClick:this.save.bind(this),iconStyle:{color:r.textColor}}),!u&&b&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-close",onClick:b,iconStyle:{color:r.textColor}})),d&&t().createElement("div",null,R["visibility.panel.error"],": ",d),t().createElement("div",null,x))}}],r&&op(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function lp(e){return lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lp(e)}function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(p,Rp)),h={};return"mui3"!==u.userTheme&&(h={borderTop:"1px solid #e0e0e0",borderBottom:"1px solid #e0e0e0"}),t().createElement("div",null,t().createElement("div",{style:{paddingBottom:4}},e,t().createElement(Tp,jp({},f,d,{style:_p({paddingLeft:8},h)}))),t().createElement(rd,{model:o,subHeader:s(575),onItemClicked:function(){},item:i,mode:"inner",onDeleteAction:a}))}}],r&&Mp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function Hp(e){return Hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hp(e)}function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $p(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=[],n=this.props.pydio,r=n.MessageHash,o=n.getPluginConfigs("action.share").get("SHARED_USERS_TMP_PREFIX");t.push({IdmUserField:"Login",description:r[533],readonly:e,expose:"true",label:r[522],name:e?"existing_user_id":"new_user_id",scope:"user",type:"valid-login",mandatory:!0,default:o||""},{IdmUserField:"Password",description:r[534],editable:"true",expose:"true",label:r[523],name:"new_password",scope:"user",type:"valid-password",mandatory:!0,direction:"column"});for(var i=n.getPluginConfigs("auth").get("NEWUSERS_EDIT_PARAMETERS").split(","),a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=t.defaultTheme,r=t.defaultClassName,o=void 0===r?"MuiBox-root":r,i=t.generateClassName,a=(0,gh.ZP)("div",{shouldForwardProp:function(e){return"theme"!==e&&"sx"!==e&&"as"!==e}})(Sh.Z),s=e.forwardRef((function(e,t){var r,s,c,l,u,d,p,f=(0,Eh.Z)(n),h=(l=(r=e).sx,u=function(e){var t,n,r={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:kh.Z;return Object.keys(e).forEach((function(t){o[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]})),r}((0,ge.Z)(r,Ph)),d=u.systemProps,p=u.otherProps,s=Array.isArray(l)?[d].concat(function(e){if(Array.isArray(e))return Oh(e)}(c=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return Oh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oh(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):"function"==typeof l?function(){var e=l.apply(void 0,arguments);return(0,wh.P)(e)?(0,be.Z)({},d,e):d}:(0,be.Z)({},d,l),(0,be.Z)({},p,{sx:s})),m=h.className,y=h.component,v=void 0===y?"div":y,b=(0,ge.Z)(h,Ch);return(0,Lt.jsx)(a,(0,be.Z)({as:v,ref:t,className:(0,Zt.Z)(m,i?i(o):o),theme:f},b))}));return s}({defaultTheme:(0,a(8662).Z)(),defaultClassName:"MuiBox-root",generateClassName:Th.Z.generate});const Rh=xh;var jh=a(6651);function Ih(){return(0,Eh.Z)(jh.Z)}function _h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r={};return Object.keys(e).forEach((function(o){r[o]=e[o].reduce((function(e,r){if(r){var o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}var Ah=a(9813),Mh=a(8241),Nh=a(7181),Dh=a(3499);const Lh=e.createContext({});var Uh=a(4017);function Bh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fh(e,t):void 0}}(e,t)||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.")}()}function Fh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return Q(e)[0];for(var t=B.current[e];null!=t;){var n=Q(t.parentId),r=n[n.indexOf(t.id)+1];if(r)return r;t=B.current[t.parentId]}return null},ee=function(e){var t=B.current[e],n=Q(t.parentId),r=n.indexOf(e);if(0===r)return t.parentId;for(var o=n[r-1];V(o)&&Q(o).length>0;)o=Q(o).pop();return o},te=function(){for(var e=Q(null).pop();V(e);)e=Q(e).pop();return e},ne=function(){return Q(null)[0]},re=function(e,t){t&&(U(t),E&&E(e,t))},oe=function(e,t){return re(e,X(t))},ie=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;t=-1!==W.indexOf(n)?W.filter((function(e){return e!==n})):[n].concat(W),T&&T(e,t),Z(t)},ae=e.useRef(null),se=e.useRef(!1),ce=e.useRef([]),le=function(e,t){return!!t&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(e,t){var n;n=-1!==q.indexOf(t)?q.filter((function(e){return e!==t})):[t].concat(q),C&&C(e,n),$(n)}(e,t):function(e,t){var n=w?[t]:t;C&&C(e,n),$(n)}(e,t),ae.current=t,se.current=!1,ce.current=[],!0)},ue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.start,o=void 0===r?ae.current:r,i=t.end,a=t.current;n?function(e,t){var n=q.slice(),r=t.start,o=t.next,i=t.current;o&&i&&(-1===ce.current.indexOf(i)&&(ce.current=[]),se.current?-1!==ce.current.indexOf(o)?(n=n.filter((function(e){return e===r||e!==i})),ce.current=ce.current.filter((function(e){return e===r||e!==i}))):(n.push(o),ce.current.push(o)):(n.push(o),ce.current.push(i,o)),C&&C(e,n),$(n))}(e,{start:o,next:i,current:a}):null!=o&&null!=i&&function(e,t){var n=q.slice(),r=t.start,o=t.end;se.current&&(n=n.filter((function(e){return-1===ce.current.indexOf(e)})));var i=function(e,t){for(var n=function(e,t){if(e===t)return[e,t];var n=B.current[e],r=B.current[t];if(n.parentId===r.id||r.parentId===n.id)return r.parentId===n.id?[n.id,r.id]:[r.id,n.id];for(var o=[n.id],i=[r.id],a=n.parentId,s=r.parentId,c=-1!==i.indexOf(a),l=-1!==o.indexOf(s),u=!0,d=!0;!l&&!c;)u&&(o.push(a),u=null!==a,!(c=-1!==i.indexOf(a))&&u&&(a=B.current[a].parentId)),d&&!c&&(i.push(s),d=null!==s,!(l=-1!==o.indexOf(s))&&d&&(s=B.current[s].parentId));var p=c?a:s,f=Y(p),h=o[o.indexOf(p)-1],m=i[i.indexOf(p)-1];return f.indexOf(h)0&&(Z(o),T&&T(e,o))}(e,L),t=!0):w&&o&&"a"===n.toLowerCase()&&!v?(function(e){ue(e,{start:ne(),end:te()})}(e),t=!0):!o&&!e.shiftKey&&(r=n)&&1===r.length&&r.match(/\S/)&&(function(e,t,n){var r,o,i=n.toLowerCase(),a=[],s=[];Object.keys(F.current).forEach((function(e){var t=F.current[e],n=B.current[e],r=!n.parentId||V(n.parentId),o=!m&&K(e);r&&!o&&(a.push(e),s.push(t))})),(r=a.indexOf(t)+1)>=a.length&&(r=0),-1===(o=Kh(s,r,i))&&(o=Kh(s,0,i)),o>-1&&re(e,a[o])}(e,L,n),t=!0)}t&&(e.preventDefault(),e.stopPropagation()),P&&P(e)}},onFocus:function(e){if(e.target===e.currentTarget){var t=Array.isArray(q)?q[0]:q;re(e,t||Q(null)[0])}O&&O(e)},onBlur:function(e){U(null),k&&k(e)},ownerState:I},R,{children:o}))})})}));const tm=em;function nm(e,t){return nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nm(e,t)}const rm=t().createContext(null);var om="unmounted",im="exited",am="entering",sm="entered",cm="exiting",lm=function(e){var n,o;function i(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=im,r.appearStatus=am):o=sm:o=t.unmountOnExit||t.mountOnEnter?om:im,r.state={status:o},r.nextCallback=null,r}o=e,(n=i).prototype=Object.create(o.prototype),n.prototype.constructor=n,nm(n,o),i.getDerivedStateFromProps=function(e,t){return e.in&&t.status===om?{status:im}:null};var a=i.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==am&&n!==sm&&(t=am):n!==am&&n!==sm||(t=cm)}this.updateStatus(!1,t)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},a.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===am){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:r().findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===im&&this.setState({status:om})},a.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,i=this.props.nodeRef?[o]:[r().findDOMNode(this),o],a=i[0],s=i[1],c=this.getTimeouts(),l=o?c.appear:c.enter;e||n?(this.props.onEnter(a,s),this.safeSetState({status:am},(function(){t.props.onEntering(a,s),t.onTransitionEnd(l,(function(){t.safeSetState({status:sm},(function(){t.props.onEntered(a,s)}))}))}))):this.safeSetState({status:sm},(function(){t.props.onEntered(a)}))},a.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:r().findDOMNode(this);t?(this.props.onExit(o),this.safeSetState({status:cm},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:im},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:im},(function(){e.props.onExited(o)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},a.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},a.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:r().findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],s=i[1];this.props.addEndListener(a,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},a.render=function(){var e=this.state.status;if(e===om)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,(0,ge.Z)(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t().createElement(rm.Provider,{value:null},"function"==typeof r?r(e,o):t().cloneElement(t().Children.only(r),o))},i}(t().Component);function um(){}lm.contextType=rm,lm.propTypes={},lm.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:um,onEntering:um,onEntered:um,onExit:um,onExiting:um,onExited:um},lm.UNMOUNTED=om,lm.EXITED=im,lm.ENTERING=am,lm.ENTERED=sm,lm.EXITING=cm;const dm=lm;var pm=a(4681);function fm(e){return fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fm(e)}function hm(e,t){var n,r,o=e.timeout,i=e.easing,a=e.style,s=void 0===a?{}:a;return{duration:null!=(n=s.transitionDuration)?n:"number"==typeof o?o:o[t.mode]||0,easing:null!=(r=s.transitionTimingFunction)?r:"object"===fm(i)?i[t.mode]:i,delay:s.transitionDelay}}function mm(e){return(0,Ft.Z)("MuiCollapse",e)}function ym(e){return ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ym(e)}function vm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ym(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ym(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ym(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,zt.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var bm=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],gm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.orientation],"entered"===n.state&&t.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&t.hidden]}})((function(e){var t=e.theme,n=e.ownerState;return(0,ye.Z)({height:0,overflow:"hidden",transition:t.transitions.create("height")},"horizontal"===n.orientation&&{height:"auto",width:0,transition:t.transitions.create("width")},"entered"===n.state&&(0,ye.Z)({height:"auto",overflow:"visible"},"horizontal"===n.orientation&&{width:"auto"}),"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&{visibility:"hidden"})})),Sm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:function(e,t){return t.wrapper}})((function(e){var t=e.ownerState;return(0,ye.Z)({display:"flex",width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),wm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:function(e,t){return t.wrapperInner}})((function(e){var t=e.ownerState;return(0,ye.Z)({width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),km=e.forwardRef((function(t,n){var r=(0,rn.Z)({props:t,name:"MuiCollapse"}),o=r.addEndListener,i=r.children,a=r.className,s=r.collapsedSize,c=void 0===s?"0px":s,l=r.component,u=r.easing,d=r.in,p=r.onEnter,f=r.onEntered,h=r.onEntering,m=r.onExit,y=r.onExited,v=r.onExiting,b=r.orientation,g=void 0===b?"vertical":b,S=r.style,w=r.timeout,k=void 0===w?pm.x9.standard:w,O=r.TransitionComponent,P=void 0===O?dm:O,E=(0,ve.Z)(r,bm),C=(0,ye.Z)({},r,{orientation:g,collapsedSize:c}),T=function(e){var t=e.orientation,n=e.classes,r={root:["root","".concat(t)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(t)],wrapperInner:["wrapperInner","".concat(t)]};return(0,Nt.Z)(r,mm,n)}(C),x=Ih(),R=e.useRef(),j=e.useRef(null),I=e.useRef(),_="number"==typeof c?"".concat(c,"px"):c,A="horizontal"===g,M=A?"width":"height";e.useEffect((function(){return function(){clearTimeout(R.current)}}),[]);var N=e.useRef(null),D=(0,Mh.Z)(n,N),L=function(e){return function(t){if(e){var n=N.current;void 0===t?e(n):e(n,t)}}},U=function(){return j.current?j.current[A?"clientWidth":"clientHeight"]:0},B=L((function(e,t){j.current&&A&&(j.current.style.position="absolute"),e.style[M]=_,p&&p(e,t)})),F=L((function(e,t){var n=U();j.current&&A&&(j.current.style.position="");var r=hm({style:S,timeout:k,easing:u},{mode:"enter"}),o=r.duration,i=r.easing;if("auto"===k){var a=x.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(a,"ms"),I.current=a}else e.style.transitionDuration="string"==typeof o?o:"".concat(o,"ms");e.style[M]="".concat(n,"px"),e.style.transitionTimingFunction=i,h&&h(e,t)})),z=L((function(e,t){e.style[M]="auto",f&&f(e,t)})),W=L((function(e){e.style[M]="".concat(U(),"px"),m&&m(e)})),Z=L(y),H=L((function(e){var t=U(),n=hm({style:S,timeout:k,easing:u},{mode:"exit"}),r=n.duration,o=n.easing;if("auto"===k){var i=x.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(i,"ms"),I.current=i}else e.style.transitionDuration="string"==typeof r?r:"".concat(r,"ms");e.style[M]=_,e.style.transitionTimingFunction=o,v&&v(e)}));return(0,Lt.jsx)(P,(0,ye.Z)({in:d,onEnter:B,onEntered:z,onEntering:F,onExit:W,onExited:Z,onExiting:H,addEndListener:function(e){"auto"===k&&(R.current=setTimeout(e,I.current||0)),o&&o(N.current,e)},nodeRef:N,timeout:"auto"===k?null:k},E,{children:function(e,t){return(0,Lt.jsx)(gm,(0,ye.Z)({as:l,className:(0,Zt.Z)(T.root,a,{entered:T.entered,exited:!d&&"0px"===_&&T.hidden}[e]),style:(0,ye.Z)(vm({},A?"minWidth":"minHeight",_),S),ownerState:(0,ye.Z)({},C,{state:e}),ref:D},t,{children:(0,Lt.jsx)(Sm,{ownerState:(0,ye.Z)({},C,{state:e}),className:T.wrapper,ref:j,children:(0,Lt.jsx)(wm,{ownerState:(0,ye.Z)({},C,{state:e}),className:T.wrapperInner,children:i})})}))}}))}));km.muiSupportAuto=!0;const Om=km;var Pm=a(4951),Em=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"];const Cm=e.forwardRef((function(t,n){var r=t.classes,o=t.className,i=t.displayIcon,a=t.expansionIcon,s=t.icon,c=t.label,l=t.nodeId,u=t.onClick,d=t.onMouseDown,p=(0,ge.Z)(t,Em),f=function(t){var n=e.useContext(Lh),r=n.focus,o=n.isExpanded,i=n.isExpandable,a=n.isFocused,s=n.isDisabled,c=n.isSelected,l=n.multiSelect,u=n.selectNode,d=n.selectRange,p=n.toggleExpansion,f=!!i&&i(t),h=!!o&&o(t),m=!!a&&a(t),y=!!s&&s(t),v=!!c&&c(t);return{disabled:y,expanded:h,selected:v,focused:m,handleExpansion:function(e){if(!y){m||r(e,t);var n=l&&(e.shiftKey||e.ctrlKey||e.metaKey);!f||n&&o(t)||p(e,t)}},handleSelection:function(e){y||(m||r(e,t),l&&(e.shiftKey||e.ctrlKey||e.metaKey)?e.shiftKey?d(e,{end:t}):u(e,t,!0):u(e,t))},preventSelection:function(e){(e.shiftKey||e.ctrlKey||e.metaKey||y)&&e.preventDefault()}}}(l),h=f.disabled,m=f.expanded,y=f.selected,v=f.focused,b=f.handleExpansion,g=f.handleSelection,S=f.preventSelection,w=s||a||i;return(0,Lt.jsxs)("div",(0,be.Z)({className:(0,Zt.Z)(o,r.root,m&&r.expanded,y&&r.selected,v&&r.focused,h&&r.disabled),onClick:function(e){b(e),g(e),u&&u(e)},onMouseDown:function(e){S(e),d&&d(e)},ref:n},p,{children:[(0,Lt.jsx)("div",{className:r.iconContainer,children:w}),(0,Lt.jsx)("div",{className:r.label,children:c})]}))}));function Tm(e){return(0,Ft.Z)("MuiTreeItem",e)}const xm=(0,zt.Z)("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]);function Rm(e){return Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rm(e)}function jm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Fm);return t().createElement(Hm,Wm({label:t().createElement(Rh,{sx:{display:"flex",alignItems:"center",p:.5,pr:0}},n,t().createElement("span",{style:{flex:1,fontWeight:"inherit",flexGrow:1}},o),t().createElement("span",null,r)),style:{color:"inherit"}},i))}function $m(e){e.pydio;var n=e.muiTheme,r=e.style,o=e.model,i={},a=function e(r){return!r.collections||r.notExpandable?[]:r.collections.map((function(r){return i[r.id]=r,t().createElement(qm,{muiTheme:n,nodeId:r.id,labelText:r.label,labelIcon:t().createElement("span",{style:{fontSize:16,marginRight:10},className:r.icon})},e(r))}))}(o.getRoot());return t().createElement(tm,{"aria-label":"gmail",defaultExpanded:["3"],defaultCollapseIcon:t().createElement(Um.Z,null),defaultExpandIcon:t().createElement(Bm.Z,null),defaultEndIcon:t().createElement("div",{style:{width:24}}),selected:o.contextItem().id,onNodeSelect:function(e,t){i[t]&&o.setContext(i[t])},style:r},a)}qm.propTypes={labelIcon:z().object.isRequired,labelInfo:z().string,labelText:z().string.isRequired};var Vm=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gm=function(){return Gm=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1)})).filter((function(e){return!s||(e.IdmUser&&e.IdmUser.IsGroup?0===s.filter((function(t){return t===e.IdmUser.Uuid})).length:e.IdmUser?0===s.filter((function(t){return t===e.IdmUser.Login})).length:0===s.filter((function(t){return t===e.IdmRole.Uuid})).length)})).map((function(e){var r,i,a;return e.IdmUser&&e.IdmUser.IsGroup?(r=e.IdmUser.GroupLabel,a=e.IdmUser.Attributes&&e.IdmUser.Attributes.displayName?e.IdmUser.Attributes.displayName:r,i="mdi mdi-folder-account"):e.IdmUser?(r=e.IdmUser.Login,a=e.IdmUser.Attributes&&e.IdmUser.Attributes.displayName?e.IdmUser.Attributes.displayName:r,i=e.IdmUser.Attributes&&"shared"===e.IdmUser.Attributes.profile?"mdi mdi-account":"mdi mdi-account-box-outline"):(r=e.IdmRole.Uuid,a=e.IdmRole.Label,i="mdi mdi-account-multiple-outline"),o|=a===n,{userObject:e,text:r,value:t().createElement(g.MenuItem,{primaryText:a,leftIcon:t().createElement(g.FontIcon,{className:i,style:{margin:"0 12px"}})})}}));if(n||(this._emptyValueList=c),n&&!o&&(!i||a)){n=this.slugLogin(n);var l=Z().getMessages()[448]||"create",u=t().createElement(g.MenuItem,{primaryText:n+(a?"":" ("+l+")"),leftIcon:t().createElement(g.FontIcon,{className:"mdi mdi-account-plus",style:{margin:"0 12px"}})});c=[{text:n,value:u}].concat(Zy(c))}this.setState({dataSource:c,loading:!1})}.bind(this))}.bind(Gy(e)))}else e.setState({dataSource:e._emptyValueList})})),Ky(Gy(e),"onCompleterRequest",(function(t,n){var r=e.props,o=r.freeValueAllowed,i=r.onValueSelected;if(-1===n&&(e.state.dataSource.map((function(e){e.text===t&&(t=e)})),t&&!t.userObject&&o))return i({FreeValue:t.text}),void e.setState({searchText:"",dataSource:[]});t&&(t.userObject?i(t.userObject):o?i({FreeValue:t.text}):e.setState({createUser:t.text}),e.setState({searchText:"",dataSource:[]}))})),Ky(Gy(e),"onUserCreated",(function(t){e.props.onValueSelected(t),e.setState({createUser:null})})),Ky(Gy(e),"onCreationCancelled",(function(){e.setState({createUser:null})})),Ky(Gy(e),"openAddressBook",(function(t){e.setState({addressBookOpen:!0,addressBookAnchor:t.currentTarget})})),Ky(Gy(e),"closeAddressBook",(function(){e.setState({addressBookOpen:!1})})),Ky(Gy(e),"onAddressBookItemSelected",(function(t){e.props.onValueSelected(t)})),e}return n=s,(r=[{key:"componentWillReceiveProps",value:function(){this._emptyValueList=null}},{key:"slugLogin",value:function(e){return e=e.toLowerCase(),""===Gd().isValidLogin(e)?e:J().computeStringSlug(e)}},{key:"render",value:function(){var e=this,n=this.props,r=n.pydio,o=n.className,i=n.fieldLabel,a=n.underlineHide,s=n.showAddressBook,c=n.usersFrom,l=this.state,u=l.dataSource,d=l.createUser;return t().createElement("div",{style:{position:"relative",overflow:"visible"},ref:function(t){e._popoverAnchor=t}},t().createElement(Xy,{filter:g.AutoComplete.noFilter,dataSource:u,searchText:this.state.searchText,onUpdateInput:this.textFieldUpdate,className:o,openOnFocus:!0,floatingLabelText:i,floatingLabelFixed:!0,underlineShow:!a,fullWidth:!0,onNewRequest:this.onCompleterRequest,listStyle:{maxHeight:350,overflowY:"auto"},onFocus:function(){e.loadBuffered(e.state.searchText,100)},disabled:d,hintText:d?r.MessageHash[485]+" ("+d+")":null}),!d&&t().createElement("div",{style:{position:"absolute",right:s?44:10,bottom:14,height:20,width:20}},t().createElement(g.RefreshIndicator,{size:20,left:0,top:0,status:this.state.loading?"loading":"hide"})),!d&&s&&t().createElement(zy,{mode:"popover",pydio:r,loaderStyle:{width:320,height:420},onItemSelected:this.onAddressBookItemSelected,usersFrom:c,disableSearch:!0}),t().createElement(ev,{open:d,anchorEl:this._popoverAnchor,anchorOrigin:{horizontal:"left",vertical:"bottom"},targetOrigin:{horizontal:"left",vertical:"top"},onRequestClose:this.onCreationCancelled,canAutoPosition:!1,style:this._popoverAnchor?{width:this._popoverAnchor.clientWidth}:{},zDepth:3},d&&t().createElement(tf,{onUserCreated:this.onUserCreated.bind(this),onCancel:this.onCreationCancelled.bind(this),style:{width:"100%",height:320},newUserName:d,pydio:r})))}}])&&$y(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function nv(e){return nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nv(e)}function rv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ov(e){for(var t=1;t1?m["share_center.cell.participant.other.multiple"].replace("%d",i):m["share_center.cell.participant.other.single"]:su().extractLabelFromIdmObject(i),t().createElement(av,{PopperProps:{style:{zIndex:2200}},placement:"bottom",title:t().createElement("div",{style:{padding:"0 6px"}},h)},n)}return n}));function cv(e){return cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cv(e)}function lv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t-1)&&(a.border="2px solid #4caf50");else if(s.Group)r="group",o=s.Group;else{if(!s.Role)return null;r="team",o=s.Role}return{type:r,object:o,style:a,online:i}})).filter((function(e){return null!==e}));if(void 0!==c&&u.sort((function(e,t){return e.online?-1:t.online?1:0})),u=u.map((function(e,t){return t>0&&(e.style=uv(uv({},e.style),{},{marginLeft:-10,zIndex:2*t})),e})),u.length>o){var d=u.length-o;(u=u.slice(0,o)).push({type:"more",object:d,style:uv(uv({},l),{},{marginLeft:-10,zIndex:16,fontWeight:500,fontSize:14})})}return t().createElement("div",{style:{display:"flex",height:a}},u.map((function(e){var n=e.type,r=e.object,o=e.style;return t().createElement(sv,{size:a,type:n,idmObject:r,style:o,tooltip:!0})})))};function fv(e){return fv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fv(e)}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.setState({showMenu:!0,style:e,menuItems:t||n.state.menuItems})})),Nv(Av(n),"hideMenu",(function(e){if(!e)return n.setState({showMenu:!1}),void(n.props.onMenuClosed&&n.props.onMenuClosed());if(void 0===e||2!==e.button||"contextmenu"===e.type){var t=Uv.findDOMNode(n.menuRef.current);t&&t.contains(e.target)||t===e.target||(n.setState({showMenu:!1}),n.props.onMenuClosed&&n.props.onMenuClosed())}})),Nv(Av(n),"menuClicked",(function(e,t,r){n.hideMenu()})),n.menuRef=(0,e.createRef)(),n.state={showMenu:!1,menuItems:t.menuItems},n}return r=c,(o=[{key:"componentDidMount",value:function(){this._observer=this.hideMenu.bind(this)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this._observer,!1)}},{key:"componentWillReceiveProps",value:function(e){e.menuItems&&this.setState({menuItems:e.menuItems})}},{key:"componentDidUpdate",value:function(e,t){this.state.showMenu?document.addEventListener("click",this._observer,!1):document.removeEventListener("click",this._observer,!1)}},{key:"render",value:function(){var e=this.props,n=e.menuProps,r=e.zDepth,o=void 0===r?1:r,i=this.state,a=i.style,s=void 0===a?{}:a,c=i.menuItems,l=jv(jv({},s),{},{zIndex:1e3}),u=Un.itemsToMenu(c,this.menuClicked.bind(this),!1,jv({ref:this.menuRef,desktop:!0,display:"right",width:250},n));return this.state.showMenu?t().createElement(Bv,{zDepth:o||1,ref:"menuContainer",className:"menu-positioner",style:l},u):null}}])&&Iv(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);function zv(e){return zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zv(e)}function Wv(e,t){for(var n=0;nr?e.x=Math.max(e.x-250,10)-8:e.x+=8,e.y+n>o?e.y=Math.max(e.y-n,10)-8:e.y+=8,e}},{key:"componentDidMount",value:function(){this._modelOpen=this.modelOpen.bind(this),Tv().getInstance().observe("open",this._modelOpen)}},{key:"componentWillUnmount",value:function(){Tv().getInstance().stopObserving("open",this._modelOpen)}},{key:"render",value:function(){var e=this.props.pydio.UI.MOBILE_EXTENSIONS;return React.createElement(Fv,{ref:this.menu,menuItems:this._items||[],onMenuClosed:this.props.onMenuClosed,menuProps:e?{width:600,autoWidth:!1,desktop:!1}:{},zDepth:e?2:1})}}],n&&Wv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Vv);function Kv(e){return Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(e)}function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:0,a=this.getIdentifier(e,t);if(this.subscriptions[a]){var s=!1;return this.subscriptions[a].map((function(e){e.messageHandler===n&&(s=!0)})),s||this.subscriptions[a].push({messageHandler:n,roomUpdateHandler:r}),this.roomInfos[a]}if(this.connecting){if(i<3)return setTimeout((function(){o.joinRoom(e,t,n,r,i+1)}),1500),null}else if(!this.connOpen)return this.open(),setTimeout((function(){o.joinRoom(e,t,n,r,i+1)}),1500),null;this.subscriptions[e+":"+t]=[{messageHandler:n,roomUpdateHandler:r}];var c={"@type":"JOIN",Room:{Type:e,RoomTypeObject:t}};return this.ws.send(JSON.stringify(c)),this.roomInfos[a]}},{key:"loadHistory",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.connecting&&i<3)setTimeout((function(){n.loadHistory(e,t,r,o,i+1)}),1500);else{var a={"@type":"HISTORY",Room:{Type:e,RoomTypeObject:t},Message:{Message:JSON.stringify({Offset:r,Limit:o})}};this.ws.send(JSON.stringify(a))}}},{key:"leaveRoom",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=!1,i=this.getIdentifier(e,t);if(this.subscriptions[i]&&(r?(this.subscriptions[i]=this.subscriptions[i].filter((function(e){return e.messageHandler!==r})),this.subscriptions[i].length?o=!0:delete this.subscriptions[i]):delete this.subscriptions[i]),!o&&(Object.keys(this.rooms).map((function(e){n.rooms[e]===i&&delete n.rooms[e]})),this.connOpen)){var a={"@type":"LEAVE",Room:{Type:e,RoomTypeObject:t}};this.ws.send(JSON.stringify(a))}}},{key:"handleMessageReceived",value:function(e){var t=JSON.parse(e.data);if("ROOM_UPDATE"===t["@type"]){var n=this.getIdentifier(t.Room.Type,t.Room.RoomTypeObject);this.subscriptions[n]&&(this.rooms[t.Room.Uuid]||(this.rooms[t.Room.Uuid]=n),this.onRoomMessage(t),this.subscriptions[n].map((function(e){if(e.roomUpdateHandler)try{e.roomUpdateHandler(t)}catch(e){}})))}else{var r,o=!1;if("DELETE_MSG"===t["@type"]?(o=!0,r=t.Message):r=t,r.RoomUuid&&this.rooms[r.RoomUuid]){var i=this.subscriptions[this.rooms[r.RoomUuid]],a=i.filter((function(e){return e.roomUpdateHandler}));a.length&&(i=a),i.map((function(e){try{e.messageHandler(r,o)}catch(e){}}))}}}},{key:"send",value:function(e){this.ws.send(e)}},{key:"open",value:function(){var e=this;if(this.close(),this.currentRepo){var t=this.pydio.Parameters.get("ENDPOINT_WEBSOCKET").replace("/event","/chat");t&&"/"===t[0]&&(t=t.substr(1));var n=this.pydio.getFrontendUrl(),r="https:"===n.protocol?"wss":"ws",o="".concat(r,"://").concat(n.host,"/")+t;this.ws=new(_b())(o,[],{maxReconnectionDelay:6e4,reconnectionDelayGrowFactor:1.6,maxRetries:10}),this.connecting=!0,this.ws.addEventListener("open",(function(){jb().subscribeJWT(e.ws).then((function(){e.connecting=!1,e.connOpen=!0})).catch((function(){e.connecting=!1,e.connOpen=!1}))})),this.ws.addEventListener("message",(function(t){e.handleMessageReceived(t)})),this.ws.addEventListener("close",(function(t){e.connOpen=!1,e.connecting=!1,jb().logClose(t)})),this.ws.addEventListener("error",(function(e){"EHOSTDOWN"===e.code&&console.error("WebSocket maxRetries reached, host is down!")})),this.hbInterval=setInterval((function(){return e.heartbeat()}),15e3),window.onbeforeunload=function(){e.close()}}}},{key:"close",value:function(){var e=this;null!==this.ws&&(Object.keys(this.subscriptions).map((function(t){var n=e.getRoomInfoFromIdentifier(t),r=n.roomType,o=n.objectId;e.leaveRoom(r,o)})),this.ws.close(1e3,"Closing",{keepClosed:!0}),this.hbInterval&&clearInterval(this.hbInterval))}},{key:"heartbeat",value:function(){var e=this;Object.keys(this.subscriptions).map((function(t){var n=e.getRoomInfoFromIdentifier(t),r={"@type":"JOIN",Room:{Type:n.roomType,RoomTypeObject:n.objectId},Message:{Message:"PING"}};try{e.ws.send(JSON.stringify(r))}catch(e){}}))}}],r=[{key:"getInstance",value:function(e){return void 0!==s._instance||(s._instance=new s(e)),s._instance}}],n&&Nb(t.prototype,n),r&&Nb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(jb());const zb=require("pydio/util/dom");var Wb=a.n(zb);const Zb=require("react-markdown");var Hb=a.n(Zb);function qb(e){return qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qb(e)}function $b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vb(e){for(var t=1;t=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==o&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),a.call(s,n,e),typeof console===t&&n>>=0)&&e<256)&&(r=bg[e])?r:(n=wg(e,(0|e)<0?-1:0,!0),o&&(bg[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=vg[e])?r:(n=wg(e,e<0?-1:0,!1),o&&(vg[e]=n),n)}function Sg(e,t){if(isNaN(e))return t?jg:Rg;if(t){if(e<0)return jg;if(e>=Cg)return Ng}else{if(e<=-Tg)return Dg;if(e+1>=Tg)return Mg}return e<0?Sg(-e,t).neg():wg(e%Eg|0,e/Eg|0,t)}function wg(e,t,n){return new mg(e,t,n)}mg.fromInt=gg,mg.fromNumber=Sg,mg.fromBits=wg;var kg=Math.pow;function Og(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return Rg;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return Og(e.substring(1),t,n).neg();for(var o=Sg(kg(n,8)),i=Rg,a=0;a>>0:this.low},Lg.toNumber=function(){return this.unsigned?(this.high>>>0)*Eg+(this.low>>>0):this.high*Eg+(this.low>>>0)},Lg.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},Lg.getHighBits=function(){return this.high},Lg.getHighBitsUnsigned=function(){return this.high>>>0},Lg.getLowBits=function(){return this.low},Lg.getLowBitsUnsigned=function(){return this.low>>>0},Lg.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Dg)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},Lg.isOdd=function(){return 1==(1&this.low)},Lg.isEven=function(){return 0==(1&this.low)},Lg.equals=function(e){return yg(e)||(e=Pg(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},Lg.eq=Lg.equals,Lg.notEquals=function(e){return!this.eq(e)},Lg.neq=Lg.notEquals,Lg.ne=Lg.notEquals,Lg.lessThan=function(e){return this.comp(e)<0},Lg.lt=Lg.lessThan,Lg.lessThanOrEqual=function(e){return this.comp(e)<=0},Lg.lte=Lg.lessThanOrEqual,Lg.le=Lg.lessThanOrEqual,Lg.greaterThan=function(e){return this.comp(e)>0},Lg.gt=Lg.greaterThan,Lg.greaterThanOrEqual=function(e){return this.comp(e)>=0},Lg.gte=Lg.greaterThanOrEqual,Lg.ge=Lg.greaterThanOrEqual,Lg.compare=function(e){if(yg(e)||(e=Pg(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Lg.comp=Lg.compare,Lg.negate=function(){return!this.unsigned&&this.eq(Dg)?Dg:this.not().add(Ig)},Lg.neg=Lg.negate,Lg.add=function(e){yg(e)||(e=Pg(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,l=0,u=0,d=0;return u+=(d+=o+(65535&e.low))>>>16,l+=(u+=r+s)>>>16,c+=(l+=n+a)>>>16,c+=t+i,wg((u&=65535)<<16|(d&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},Lg.subtract=function(e){return yg(e)||(e=Pg(e)),this.add(e.neg())},Lg.sub=Lg.subtract,Lg.multiply=function(e){if(this.isZero())return Rg;if(yg(e)||(e=Pg(e)),hg)return wg(hg.mul(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned);if(e.isZero())return Rg;if(this.eq(Dg))return e.isOdd()?Dg:Rg;if(e.eq(Dg))return this.isOdd()?Dg:Rg;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(xg)&&e.lt(xg))return Sg(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=65535&e.low,l=0,u=0,d=0,p=0;return d+=(p+=o*c)>>>16,u+=(d+=r*c)>>>16,d&=65535,u+=(d+=o*s)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=r*s)>>>16,u&=65535,l+=(u+=o*a)>>>16,l+=t*c+n*s+r*a+o*i,wg((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(u&=65535),this.unsigned)},Lg.mul=Lg.multiply,Lg.divide=function(e){if(yg(e)||(e=Pg(e)),e.isZero())throw Error("division by zero");var t,n,r;if(hg)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?wg((this.unsigned?hg.div_u:hg.div_s)(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?jg:Rg;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return jg;if(e.gt(this.shru(1)))return _g;r=jg}else{if(this.eq(Dg))return e.eq(Ig)||e.eq(Ag)?Dg:e.eq(Dg)?Ig:(t=this.shr(1).div(e).shl(1)).eq(Rg)?e.isNegative()?Ig:Ag:(n=this.sub(e.mul(t)),r=t.add(n.div(e)));if(e.eq(Dg))return this.unsigned?jg:Rg;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=Rg}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),i=o<=48?1:kg(2,o-48),a=Sg(t),s=a.mul(e);s.isNegative()||s.gt(n);)s=(a=Sg(t-=i,this.unsigned)).mul(e);a.isZero()&&(a=Ig),r=r.add(a),n=n.sub(s)}return r},Lg.div=Lg.divide,Lg.modulo=function(e){return yg(e)||(e=Pg(e)),hg?wg((this.unsigned?hg.rem_u:hg.rem_s)(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Lg.mod=Lg.modulo,Lg.rem=Lg.modulo,Lg.not=function(){return wg(~this.low,~this.high,this.unsigned)},Lg.and=function(e){return yg(e)||(e=Pg(e)),wg(this.low&e.low,this.high&e.high,this.unsigned)},Lg.or=function(e){return yg(e)||(e=Pg(e)),wg(this.low|e.low,this.high|e.high,this.unsigned)},Lg.xor=function(e){return yg(e)||(e=Pg(e)),wg(this.low^e.low,this.high^e.high,this.unsigned)},Lg.shiftLeft=function(e){return yg(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?wg(this.low<>>32-e,this.unsigned):wg(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):wg(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Lg.shr=Lg.shiftRight,Lg.shiftRightUnsigned=function(e){if(yg(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?wg(this.low>>>e|t<<32-e,t>>>e,this.unsigned):wg(32===e?t:t>>>e-32,0,this.unsigned)},Lg.shru=Lg.shiftRightUnsigned,Lg.shr_u=Lg.shiftRightUnsigned,Lg.toSigned=function(){return this.unsigned?wg(this.low,this.high,!1):this},Lg.toUnsigned=function(){return this.unsigned?this:wg(this.low,this.high,!0)},Lg.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Lg.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Lg.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},mg.fromBytes=function(e,t,n){return n?mg.fromBytesLE(e,t):mg.fromBytesBE(e,t)},mg.fromBytesLE=function(e,t){return new mg(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},mg.fromBytesBE=function(e,t){return new mg(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var Ug,Bg,Fg,zg,Wg,Zg,Hg,qg,$g,Vg,Gg,Jg,Kg,Yg,Qg,Xg=ig(fg),eS={},tS={},nS={},rS={};function oS(){return Qg||(Qg=1,function(e){var t=e;function n(e,t,n){for(var r=Object.keys(t),o=0;o1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),r=new Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t>2],o=(3&l)<<4,c=1;break;case 1:a[s++]=n[o|l>>4],o=(15&l)<<2,c=2;break;case 2:a[s++]=n[o|l>>6],a[s++]=n[63&l],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var o,a=n,s=0,c=0;c1)break;if(void 0===(l=r[l]))throw Error(i);switch(s){case 0:o=l,s=1;break;case 1:t[n++]=o<<2|(48&l)>>4,o=l,s=2;break;case 2:t[n++]=(15&o)<<4|(60&l)>>2,o=l,s=3;break;case 3:t[n++]=(3&o)<<6|l,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(nS)),nS),t.EventEmitter=function(){if(Wg)return zg;function e(){this._listeners={}}return Wg=1,zg=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,r),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function i(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=r*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,c=a>>>20&2047,l=4294967296*(1048575&a)+i;return 2047===c?l?NaN:s*(1/0):0===c?5e-324*s*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,r,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return Hg=1,Zg=e(e)}(),t.inquire=$g?qg:($g=1,qg=function(e){return null}),t.utf8=(Vg||(Vg=1,function(e){var t=e;t.length=function(e){for(var t=0,n=0,r=0;r191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,n){for(var r,o,i=n,a=0;a>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}}(rS)),rS),t.pool=(Jg||(Jg=1,Gg=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}),Gg),t.LongBits=function(){if(Yg)return Kg;Yg=1,Kg=t;var e=oS();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var r=e<0;r&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return r&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(r){if("number"==typeof r)return t.fromNumber(r);if(e.isString(r)){if(!e.Long)return t.fromNumber(parseInt(r,10));r=e.Long.fromString(r)}return r.low||r.high?new t(r.low>>>0,r.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===r?n:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},Kg}(),t.isNode=Boolean(void 0!==og&&og&&og.process&&og.process.versions&&og.process.versions.node),t.global=t.isNode&&og||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||og,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function gS(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}hS.create=mS(),hS.alloc=function(e){return new sS.Array(e)},sS.Array!==Array&&(hS.alloc=sS.pool(hS.alloc,sS.Array.prototype.subarray)),hS.prototype._push=function(e,t,n){return this.tail=this.tail.next=new dS(e,t,n),this.len+=t,this},vS.prototype=Object.create(dS.prototype),vS.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},hS.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new vS((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},hS.prototype.int32=function(e){return e<0?this._push(bS,10,cS.fromNumber(e)):this.uint32(e)},hS.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},hS.prototype.uint64=function(e){var t=cS.from(e);return this._push(bS,t.length(),t)},hS.prototype.int64=hS.prototype.uint64,hS.prototype.sint64=function(e){var t=cS.from(e).zzEncode();return this._push(bS,t.length(),t)},hS.prototype.bool=function(e){return this._push(yS,1,e?1:0)},hS.prototype.fixed32=function(e){return this._push(gS,4,e>>>0)},hS.prototype.sfixed32=hS.prototype.fixed32,hS.prototype.fixed64=function(e){var t=cS.from(e);return this._push(gS,4,t.lo)._push(gS,4,t.hi)},hS.prototype.sfixed64=hS.prototype.fixed64,hS.prototype.float=function(e){return this._push(sS.float.writeFloatLE,4,e)},hS.prototype.double=function(e){return this._push(sS.float.writeDoubleLE,8,e)};var SS=sS.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(yS,1,0);if(sS.isString(e)){var n=hS.alloc(t=lS.length(e));lS.decode(e,n,0),e=n}return this.uint32(t)._push(SS,t,e)},hS.prototype.string=function(e){var t=uS.length(e);return t?this.uint32(t)._push(uS.write,t,e):this._push(yS,1,0)},hS.prototype.fork=function(){return this.states=new fS(this),this.head=this.tail=new dS(pS,0,0),this.len=0,this},hS.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new dS(pS,0,0),this.len=0),this},hS.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},hS.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},hS._configure=function(e){iS=e,hS.create=mS(),iS._configure()};var wS=PS,kS=aS;(PS.prototype=Object.create(kS.prototype)).constructor=PS;var OS=oS();function PS(){kS.call(this)}function ES(e,t,n){e.length<40?OS.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}PS._configure=function(){PS.alloc=OS._Buffer_allocUnsafe,PS.writeBytesBuffer=OS.Buffer&&OS.Buffer.prototype instanceof Uint8Array&&"set"===OS.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(PS.writeBytesBuffer,t,e),this},PS.prototype.string=function(e){var t=OS.Buffer.byteLength(e);return this.uint32(t),t&&this._push(ES,t,e),this},PS._configure();var CS,TS=_S,xS=oS(),RS=xS.LongBits,jS=xS.utf8;function IS(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function _S(e){this.buf=e,this.pos=0,this.len=e.length}var AS="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new _S(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new _S(e);throw Error("illegal buffer")},MS=function(){return xS.Buffer?function(e){return(_S.create=function(e){return xS.Buffer.isBuffer(e)?new CS(e):AS(e)})(e)}:AS};function NS(){var e=new RS(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw IS(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw IS(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function DS(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function LS(){if(this.pos+8>this.len)throw IS(this,8);return new RS(DS(this.buf,this.pos+=4),DS(this.buf,this.pos+=4))}_S.create=MS(),_S.prototype._slice=xS.Array.prototype.subarray||xS.Array.prototype.slice,_S.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,IS(this,10);return e}}(),_S.prototype.int32=function(){return 0|this.uint32()},_S.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},_S.prototype.bool=function(){return 0!==this.uint32()},_S.prototype.fixed32=function(){if(this.pos+4>this.len)throw IS(this,4);return DS(this.buf,this.pos+=4)},_S.prototype.sfixed32=function(){if(this.pos+4>this.len)throw IS(this,4);return 0|DS(this.buf,this.pos+=4)},_S.prototype.float=function(){if(this.pos+4>this.len)throw IS(this,4);var e=xS.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},_S.prototype.double=function(){if(this.pos+8>this.len)throw IS(this,4);var e=xS.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},_S.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw IS(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},_S.prototype.string=function(){var e=this.bytes();return jS.read(e,0,e.length)},_S.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw IS(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw IS(this)}while(128&this.buf[this.pos++]);return this},_S.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},_S._configure=function(e){CS=e,_S.create=MS(),CS._configure();var t=xS.Long?"toLong":"toNumber";xS.merge(_S.prototype,{int64:function(){return NS.call(this)[t](!1)},uint64:function(){return NS.call(this)[t](!0)},sint64:function(){return NS.call(this).zzDecode()[t](!1)},fixed64:function(){return LS.call(this)[t](!0)},sfixed64:function(){return LS.call(this)[t](!1)}})};var US=zS,BS=TS;(zS.prototype=Object.create(BS.prototype)).constructor=zS;var FS=oS();function zS(e){BS.call(this,e)}zS._configure=function(){FS.Buffer&&(zS.prototype._slice=FS.Buffer.prototype.slice)},zS.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},zS._configure();var WS={},ZS=qS,HS=oS();function qS(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");HS.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(qS.prototype=Object.create(HS.EventEmitter.prototype)).constructor=qS,qS.prototype.rpcCall=function e(t,n,r,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return HS.asPromise(e,a,t,n,r,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof r))try{n=r[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},qS.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},WS.Service=ZS;var $S={};!function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=aS,t.BufferWriter=wS,t.Reader=TS,t.BufferReader=US,t.util=oS(),t.rpc=WS,t.roots=$S,t.configure=n,n()}(eS);var VS,GS,JS,KS,YS,QS,XS,ew,tw,nw,rw,ow,iw,aw,sw,cw=ig(eS);function lw(e){switch(e){case 0:case"AUDIO":return JS.AUDIO;case 1:case"VIDEO":return JS.VIDEO;case 2:case"DATA":return JS.DATA;default:return JS.UNRECOGNIZED}}function uw(e){switch(e){case JS.AUDIO:return"AUDIO";case JS.VIDEO:return"VIDEO";case JS.DATA:return"DATA";case JS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function dw(e){switch(e){case 0:case"UNKNOWN":return KS.UNKNOWN;case 1:case"CAMERA":return KS.CAMERA;case 2:case"MICROPHONE":return KS.MICROPHONE;case 3:case"SCREEN_SHARE":return KS.SCREEN_SHARE;case 4:case"SCREEN_SHARE_AUDIO":return KS.SCREEN_SHARE_AUDIO;default:return KS.UNRECOGNIZED}}function pw(e){switch(e){case KS.UNKNOWN:return"UNKNOWN";case KS.CAMERA:return"CAMERA";case KS.MICROPHONE:return"MICROPHONE";case KS.SCREEN_SHARE:return"SCREEN_SHARE";case KS.SCREEN_SHARE_AUDIO:return"SCREEN_SHARE_AUDIO";case KS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function fw(e){switch(e){case 0:case"LOW":return YS.LOW;case 1:case"MEDIUM":return YS.MEDIUM;case 2:case"HIGH":return YS.HIGH;case 3:case"OFF":return YS.OFF;default:return YS.UNRECOGNIZED}}function hw(e){switch(e){case YS.LOW:return"LOW";case YS.MEDIUM:return"MEDIUM";case YS.HIGH:return"HIGH";case YS.OFF:return"OFF";case YS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function mw(e){switch(e){case 0:case"POOR":return QS.POOR;case 1:case"GOOD":return QS.GOOD;case 2:case"EXCELLENT":return QS.EXCELLENT;default:return QS.UNRECOGNIZED}}function yw(e){switch(e){case 0:case"UNSET":return XS.UNSET;case 1:case"DISABLED":return XS.DISABLED;case 2:case"ENABLED":return XS.ENABLED;default:return XS.UNRECOGNIZED}}function vw(e){switch(e){case XS.UNSET:return"UNSET";case XS.DISABLED:return"DISABLED";case XS.ENABLED:return"ENABLED";case XS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function bw(e){switch(e){case 0:case"UNKNOWN_REASON":return ew.UNKNOWN_REASON;case 1:case"CLIENT_INITIATED":return ew.CLIENT_INITIATED;case 2:case"DUPLICATE_IDENTITY":return ew.DUPLICATE_IDENTITY;case 3:case"SERVER_SHUTDOWN":return ew.SERVER_SHUTDOWN;case 4:case"PARTICIPANT_REMOVED":return ew.PARTICIPANT_REMOVED;case 5:case"ROOM_DELETED":return ew.ROOM_DELETED;case 6:case"STATE_MISMATCH":return ew.STATE_MISMATCH;case 7:case"JOIN_FAILURE":return ew.JOIN_FAILURE;default:return ew.UNRECOGNIZED}}function gw(e){switch(e){case 0:case"JOINING":return nw.JOINING;case 1:case"JOINED":return nw.JOINED;case 2:case"ACTIVE":return nw.ACTIVE;case 3:case"DISCONNECTED":return nw.DISCONNECTED;default:return nw.UNRECOGNIZED}}function Sw(e){switch(e){case 0:case"NONE":return rw.NONE;case 1:case"GCM":return rw.GCM;case 2:case"CUSTOM":return rw.CUSTOM;default:return rw.UNRECOGNIZED}}function ww(e){switch(e){case rw.NONE:return"NONE";case rw.GCM:return"GCM";case rw.CUSTOM:return"CUSTOM";case rw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function kw(e){switch(e){case 0:case"RELIABLE":return ow.RELIABLE;case 1:case"LOSSY":return ow.LOSSY;default:return ow.UNRECOGNIZED}}function Ow(e){switch(e){case 0:case"Standard":return iw.Standard;case 1:case"Cloud":return iw.Cloud;default:return iw.UNRECOGNIZED}}function Pw(e){switch(e){case 0:case"UNKNOWN":return aw.UNKNOWN;case 1:case"JS":return aw.JS;case 2:case"SWIFT":return aw.SWIFT;case 3:case"ANDROID":return aw.ANDROID;case 4:case"FLUTTER":return aw.FLUTTER;case 5:case"GO":return aw.GO;case 6:case"UNITY":return aw.UNITY;case 7:case"REACT_NATIVE":return aw.REACT_NATIVE;case 8:case"RUST":return aw.RUST;default:return aw.UNRECOGNIZED}}(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})(),cw.util.Long!==Xg&&(cw.util.Long=Xg,cw.configure()),function(e){e[e.DEFAULT_AC=0]="DEFAULT_AC",e[e.OPUS=1]="OPUS",e[e.AAC=2]="AAC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(VS||(VS={})),function(e){e[e.DEFAULT_VC=0]="DEFAULT_VC",e[e.H264_BASELINE=1]="H264_BASELINE",e[e.H264_MAIN=2]="H264_MAIN",e[e.H264_HIGH=3]="H264_HIGH",e[e.VP8=4]="VP8",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(GS||(GS={})),function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO",e[e.DATA=2]="DATA",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(JS||(JS={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.CAMERA=1]="CAMERA",e[e.MICROPHONE=2]="MICROPHONE",e[e.SCREEN_SHARE=3]="SCREEN_SHARE",e[e.SCREEN_SHARE_AUDIO=4]="SCREEN_SHARE_AUDIO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(KS||(KS={})),function(e){e[e.LOW=0]="LOW",e[e.MEDIUM=1]="MEDIUM",e[e.HIGH=2]="HIGH",e[e.OFF=3]="OFF",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(YS||(YS={})),function(e){e[e.POOR=0]="POOR",e[e.GOOD=1]="GOOD",e[e.EXCELLENT=2]="EXCELLENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(QS||(QS={})),function(e){e[e.UNSET=0]="UNSET",e[e.DISABLED=1]="DISABLED",e[e.ENABLED=2]="ENABLED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(XS||(XS={})),function(e){e[e.UNKNOWN_REASON=0]="UNKNOWN_REASON",e[e.CLIENT_INITIATED=1]="CLIENT_INITIATED",e[e.DUPLICATE_IDENTITY=2]="DUPLICATE_IDENTITY",e[e.SERVER_SHUTDOWN=3]="SERVER_SHUTDOWN",e[e.PARTICIPANT_REMOVED=4]="PARTICIPANT_REMOVED",e[e.ROOM_DELETED=5]="ROOM_DELETED",e[e.STATE_MISMATCH=6]="STATE_MISMATCH",e[e.JOIN_FAILURE=7]="JOIN_FAILURE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(ew||(ew={})),function(e){e[e.RR_UNKOWN=0]="RR_UNKOWN",e[e.RR_SIGNAL_DISCONNECTED=1]="RR_SIGNAL_DISCONNECTED",e[e.RR_PUBLISHER_FAILED=2]="RR_PUBLISHER_FAILED",e[e.RR_SUBSCRIBER_FAILED=3]="RR_SUBSCRIBER_FAILED",e[e.RR_SWITCH_CANDIDATE=4]="RR_SWITCH_CANDIDATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(tw||(tw={})),function(e){e[e.JOINING=0]="JOINING",e[e.JOINED=1]="JOINED",e[e.ACTIVE=2]="ACTIVE",e[e.DISCONNECTED=3]="DISCONNECTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(nw||(nw={})),function(e){e[e.NONE=0]="NONE",e[e.GCM=1]="GCM",e[e.CUSTOM=2]="CUSTOM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(rw||(rw={})),(sw=ow||(ow={}))[sw.RELIABLE=0]="RELIABLE",sw[sw.LOSSY=1]="LOSSY",sw[sw.UNRECOGNIZED=-1]="UNRECOGNIZED",function(e){e[e.Standard=0]="Standard",e[e.Cloud=1]="Cloud",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(iw||(iw={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JS=1]="JS",e[e.SWIFT=2]="SWIFT",e[e.ANDROID=3]="ANDROID",e[e.FLUTTER=4]="FLUTTER",e[e.GO=5]="GO",e[e.UNITY=6]="UNITY",e[e.REACT_NATIVE=7]="REACT_NATIVE",e[e.RUST=8]="RUST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(aw||(aw={}));const Ew={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),""!==e.name&&t.uint32(18).string(e.name),0!==e.emptyTimeout&&t.uint32(24).uint32(e.emptyTimeout),0!==e.maxParticipants&&t.uint32(32).uint32(e.maxParticipants),0!==e.creationTime&&t.uint32(40).int64(e.creationTime),""!==e.turnPassword&&t.uint32(50).string(e.turnPassword);for(const n of e.enabledCodecs)Cw.encode(n,t.uint32(58).fork()).ldelim();return""!==e.metadata&&t.uint32(66).string(e.metadata),0!==e.numParticipants&&t.uint32(72).uint32(e.numParticipants),!0===e.activeRecording&&t.uint32(80).bool(e.activeRecording),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",name:"",emptyTimeout:0,maxParticipants:0,creationTime:0,turnPassword:"",enabledCodecs:[],metadata:"",numParticipants:0,activeRecording:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue;case 3:if(24!=e)break;o.emptyTimeout=n.uint32();continue;case 4:if(32!=e)break;o.maxParticipants=n.uint32();continue;case 5:if(40!=e)break;o.creationTime=qw(n.int64());continue;case 6:if(50!=e)break;o.turnPassword=n.string();continue;case 7:if(58!=e)break;o.enabledCodecs.push(Cw.decode(n,n.uint32()));continue;case 8:if(66!=e)break;o.metadata=n.string();continue;case 9:if(72!=e)break;o.numParticipants=n.uint32();continue;case 10:if(80!=e)break;o.activeRecording=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",name:$w(e.name)?String(e.name):"",emptyTimeout:$w(e.emptyTimeout)?Number(e.emptyTimeout):0,maxParticipants:$w(e.maxParticipants)?Number(e.maxParticipants):0,creationTime:$w(e.creationTime)?Number(e.creationTime):0,turnPassword:$w(e.turnPassword)?String(e.turnPassword):"",enabledCodecs:Array.isArray(null==e?void 0:e.enabledCodecs)?e.enabledCodecs.map((e=>Cw.fromJSON(e))):[],metadata:$w(e.metadata)?String(e.metadata):"",numParticipants:$w(e.numParticipants)?Number(e.numParticipants):0,activeRecording:!!$w(e.activeRecording)&&Boolean(e.activeRecording)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.name&&(t.name=e.name),void 0!==e.emptyTimeout&&(t.emptyTimeout=Math.round(e.emptyTimeout)),void 0!==e.maxParticipants&&(t.maxParticipants=Math.round(e.maxParticipants)),void 0!==e.creationTime&&(t.creationTime=Math.round(e.creationTime)),void 0!==e.turnPassword&&(t.turnPassword=e.turnPassword),e.enabledCodecs?t.enabledCodecs=e.enabledCodecs.map((e=>e?Cw.toJSON(e):void 0)):t.enabledCodecs=[],void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.numParticipants&&(t.numParticipants=Math.round(e.numParticipants)),void 0!==e.activeRecording&&(t.activeRecording=e.activeRecording),t},create:e=>Ew.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sid:"",name:"",emptyTimeout:0,maxParticipants:0,creationTime:0,turnPassword:"",enabledCodecs:[],metadata:"",numParticipants:0,activeRecording:!1};return d.sid=null!==(t=e.sid)&&void 0!==t?t:"",d.name=null!==(n=e.name)&&void 0!==n?n:"",d.emptyTimeout=null!==(r=e.emptyTimeout)&&void 0!==r?r:0,d.maxParticipants=null!==(o=e.maxParticipants)&&void 0!==o?o:0,d.creationTime=null!==(i=e.creationTime)&&void 0!==i?i:0,d.turnPassword=null!==(a=e.turnPassword)&&void 0!==a?a:"",d.enabledCodecs=(null===(s=e.enabledCodecs)||void 0===s?void 0:s.map((e=>Cw.fromPartial(e))))||[],d.metadata=null!==(c=e.metadata)&&void 0!==c?c:"",d.numParticipants=null!==(l=e.numParticipants)&&void 0!==l?l:0,d.activeRecording=null!==(u=e.activeRecording)&&void 0!==u&&u,d}},Cw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.mime&&t.uint32(10).string(e.mime),""!==e.fmtpLine&&t.uint32(18).string(e.fmtpLine),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={mime:"",fmtpLine:""};for(;n.pos>>3){case 1:if(10!=e)break;o.mime=n.string();continue;case 2:if(18!=e)break;o.fmtpLine=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({mime:$w(e.mime)?String(e.mime):"",fmtpLine:$w(e.fmtpLine)?String(e.fmtpLine):""}),toJSON(e){const t={};return void 0!==e.mime&&(t.mime=e.mime),void 0!==e.fmtpLine&&(t.fmtpLine=e.fmtpLine),t},create:e=>Cw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={mime:"",fmtpLine:""};return r.mime=null!==(t=e.mime)&&void 0!==t?t:"",r.fmtpLine=null!==(n=e.fmtpLine)&&void 0!==n?n:"",r}},Tw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();!0===e.canSubscribe&&t.uint32(8).bool(e.canSubscribe),!0===e.canPublish&&t.uint32(16).bool(e.canPublish),!0===e.canPublishData&&t.uint32(24).bool(e.canPublishData),t.uint32(74).fork();for(const n of e.canPublishSources)t.int32(n);return t.ldelim(),!0===e.hidden&&t.uint32(56).bool(e.hidden),!0===e.recorder&&t.uint32(64).bool(e.recorder),!0===e.canUpdateMetadata&&t.uint32(80).bool(e.canUpdateMetadata),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={canSubscribe:!1,canPublish:!1,canPublishData:!1,canPublishSources:[],hidden:!1,recorder:!1,canUpdateMetadata:!1};for(;n.pos>>3){case 1:if(8!=e)break;o.canSubscribe=n.bool();continue;case 2:if(16!=e)break;o.canPublish=n.bool();continue;case 3:if(24!=e)break;o.canPublishData=n.bool();continue;case 9:if(72==e){o.canPublishSources.push(n.int32());continue}if(74==e){const e=n.uint32()+n.pos;for(;n.pos({canSubscribe:!!$w(e.canSubscribe)&&Boolean(e.canSubscribe),canPublish:!!$w(e.canPublish)&&Boolean(e.canPublish),canPublishData:!!$w(e.canPublishData)&&Boolean(e.canPublishData),canPublishSources:Array.isArray(null==e?void 0:e.canPublishSources)?e.canPublishSources.map((e=>dw(e))):[],hidden:!!$w(e.hidden)&&Boolean(e.hidden),recorder:!!$w(e.recorder)&&Boolean(e.recorder),canUpdateMetadata:!!$w(e.canUpdateMetadata)&&Boolean(e.canUpdateMetadata)}),toJSON(e){const t={};return void 0!==e.canSubscribe&&(t.canSubscribe=e.canSubscribe),void 0!==e.canPublish&&(t.canPublish=e.canPublish),void 0!==e.canPublishData&&(t.canPublishData=e.canPublishData),e.canPublishSources?t.canPublishSources=e.canPublishSources.map((e=>pw(e))):t.canPublishSources=[],void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.recorder&&(t.recorder=e.recorder),void 0!==e.canUpdateMetadata&&(t.canUpdateMetadata=e.canUpdateMetadata),t},create:e=>Tw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={canSubscribe:!1,canPublish:!1,canPublishData:!1,canPublishSources:[],hidden:!1,recorder:!1,canUpdateMetadata:!1};return c.canSubscribe=null!==(t=e.canSubscribe)&&void 0!==t&&t,c.canPublish=null!==(n=e.canPublish)&&void 0!==n&&n,c.canPublishData=null!==(r=e.canPublishData)&&void 0!==r&&r,c.canPublishSources=(null===(o=e.canPublishSources)||void 0===o?void 0:o.map((e=>e)))||[],c.hidden=null!==(i=e.hidden)&&void 0!==i&&i,c.recorder=null!==(a=e.recorder)&&void 0!==a&&a,c.canUpdateMetadata=null!==(s=e.canUpdateMetadata)&&void 0!==s&&s,c}},xw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),""!==e.identity&&t.uint32(18).string(e.identity),0!==e.state&&t.uint32(24).int32(e.state);for(const n of e.tracks)jw.encode(n,t.uint32(34).fork()).ldelim();return""!==e.metadata&&t.uint32(42).string(e.metadata),0!==e.joinedAt&&t.uint32(48).int64(e.joinedAt),""!==e.name&&t.uint32(74).string(e.name),0!==e.version&&t.uint32(80).uint32(e.version),void 0!==e.permission&&Tw.encode(e.permission,t.uint32(90).fork()).ldelim(),""!==e.region&&t.uint32(98).string(e.region),!0===e.isPublisher&&t.uint32(104).bool(e.isPublisher),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",identity:"",state:0,tracks:[],metadata:"",joinedAt:0,name:"",version:0,permission:void 0,region:"",isPublisher:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(18!=e)break;o.identity=n.string();continue;case 3:if(24!=e)break;o.state=n.int32();continue;case 4:if(34!=e)break;o.tracks.push(jw.decode(n,n.uint32()));continue;case 5:if(42!=e)break;o.metadata=n.string();continue;case 6:if(48!=e)break;o.joinedAt=qw(n.int64());continue;case 9:if(74!=e)break;o.name=n.string();continue;case 10:if(80!=e)break;o.version=n.uint32();continue;case 11:if(90!=e)break;o.permission=Tw.decode(n,n.uint32());continue;case 12:if(98!=e)break;o.region=n.string();continue;case 13:if(104!=e)break;o.isPublisher=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",identity:$w(e.identity)?String(e.identity):"",state:$w(e.state)?gw(e.state):0,tracks:Array.isArray(null==e?void 0:e.tracks)?e.tracks.map((e=>jw.fromJSON(e))):[],metadata:$w(e.metadata)?String(e.metadata):"",joinedAt:$w(e.joinedAt)?Number(e.joinedAt):0,name:$w(e.name)?String(e.name):"",version:$w(e.version)?Number(e.version):0,permission:$w(e.permission)?Tw.fromJSON(e.permission):void 0,region:$w(e.region)?String(e.region):"",isPublisher:!!$w(e.isPublisher)&&Boolean(e.isPublisher)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.identity&&(t.identity=e.identity),void 0!==e.state&&(t.state=function(e){switch(e){case nw.JOINING:return"JOINING";case nw.JOINED:return"JOINED";case nw.ACTIVE:return"ACTIVE";case nw.DISCONNECTED:return"DISCONNECTED";case nw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.state)),e.tracks?t.tracks=e.tracks.map((e=>e?jw.toJSON(e):void 0)):t.tracks=[],void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.joinedAt&&(t.joinedAt=Math.round(e.joinedAt)),void 0!==e.name&&(t.name=e.name),void 0!==e.version&&(t.version=Math.round(e.version)),void 0!==e.permission&&(t.permission=e.permission?Tw.toJSON(e.permission):void 0),void 0!==e.region&&(t.region=e.region),void 0!==e.isPublisher&&(t.isPublisher=e.isPublisher),t},create:e=>xw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sid:"",identity:"",state:0,tracks:[],metadata:"",joinedAt:0,name:"",version:0,permission:void 0,region:"",isPublisher:!1};return d.sid=null!==(t=e.sid)&&void 0!==t?t:"",d.identity=null!==(n=e.identity)&&void 0!==n?n:"",d.state=null!==(r=e.state)&&void 0!==r?r:0,d.tracks=(null===(o=e.tracks)||void 0===o?void 0:o.map((e=>jw.fromPartial(e))))||[],d.metadata=null!==(i=e.metadata)&&void 0!==i?i:"",d.joinedAt=null!==(a=e.joinedAt)&&void 0!==a?a:0,d.name=null!==(s=e.name)&&void 0!==s?s:"",d.version=null!==(c=e.version)&&void 0!==c?c:0,d.permission=void 0!==e.permission&&null!==e.permission?Tw.fromPartial(e.permission):void 0,d.region=null!==(l=e.region)&&void 0!==l?l:"",d.isPublisher=null!==(u=e.isPublisher)&&void 0!==u&&u,d}},Rw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.mimeType&&t.uint32(10).string(e.mimeType),""!==e.mid&&t.uint32(18).string(e.mid),""!==e.cid&&t.uint32(26).string(e.cid);for(const n of e.layers)Iw.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={mimeType:"",mid:"",cid:"",layers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.mimeType=n.string();continue;case 2:if(18!=e)break;o.mid=n.string();continue;case 3:if(26!=e)break;o.cid=n.string();continue;case 4:if(34!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({mimeType:$w(e.mimeType)?String(e.mimeType):"",mid:$w(e.mid)?String(e.mid):"",cid:$w(e.cid)?String(e.cid):"",layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mid&&(t.mid=e.mid),void 0!==e.cid&&(t.cid=e.cid),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],t},create:e=>Rw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i={mimeType:"",mid:"",cid:"",layers:[]};return i.mimeType=null!==(t=e.mimeType)&&void 0!==t?t:"",i.mid=null!==(n=e.mid)&&void 0!==n?n:"",i.cid=null!==(r=e.cid)&&void 0!==r?r:"",i.layers=(null===(o=e.layers)||void 0===o?void 0:o.map((e=>Iw.fromPartial(e))))||[],i}},jw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),0!==e.type&&t.uint32(16).int32(e.type),""!==e.name&&t.uint32(26).string(e.name),!0===e.muted&&t.uint32(32).bool(e.muted),0!==e.width&&t.uint32(40).uint32(e.width),0!==e.height&&t.uint32(48).uint32(e.height),!0===e.simulcast&&t.uint32(56).bool(e.simulcast),!0===e.disableDtx&&t.uint32(64).bool(e.disableDtx),0!==e.source&&t.uint32(72).int32(e.source);for(const n of e.layers)Iw.encode(n,t.uint32(82).fork()).ldelim();""!==e.mimeType&&t.uint32(90).string(e.mimeType),""!==e.mid&&t.uint32(98).string(e.mid);for(const n of e.codecs)Rw.encode(n,t.uint32(106).fork()).ldelim();return!0===e.stereo&&t.uint32(112).bool(e.stereo),!0===e.disableRed&&t.uint32(120).bool(e.disableRed),0!==e.encryption&&t.uint32(128).int32(e.encryption),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",type:0,name:"",muted:!1,width:0,height:0,simulcast:!1,disableDtx:!1,source:0,layers:[],mimeType:"",mid:"",codecs:[],stereo:!1,disableRed:!1,encryption:0};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(16!=e)break;o.type=n.int32();continue;case 3:if(26!=e)break;o.name=n.string();continue;case 4:if(32!=e)break;o.muted=n.bool();continue;case 5:if(40!=e)break;o.width=n.uint32();continue;case 6:if(48!=e)break;o.height=n.uint32();continue;case 7:if(56!=e)break;o.simulcast=n.bool();continue;case 8:if(64!=e)break;o.disableDtx=n.bool();continue;case 9:if(72!=e)break;o.source=n.int32();continue;case 10:if(82!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue;case 11:if(90!=e)break;o.mimeType=n.string();continue;case 12:if(98!=e)break;o.mid=n.string();continue;case 13:if(106!=e)break;o.codecs.push(Rw.decode(n,n.uint32()));continue;case 14:if(112!=e)break;o.stereo=n.bool();continue;case 15:if(120!=e)break;o.disableRed=n.bool();continue;case 16:if(128!=e)break;o.encryption=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",type:$w(e.type)?lw(e.type):0,name:$w(e.name)?String(e.name):"",muted:!!$w(e.muted)&&Boolean(e.muted),width:$w(e.width)?Number(e.width):0,height:$w(e.height)?Number(e.height):0,simulcast:!!$w(e.simulcast)&&Boolean(e.simulcast),disableDtx:!!$w(e.disableDtx)&&Boolean(e.disableDtx),source:$w(e.source)?dw(e.source):0,layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[],mimeType:$w(e.mimeType)?String(e.mimeType):"",mid:$w(e.mid)?String(e.mid):"",codecs:Array.isArray(null==e?void 0:e.codecs)?e.codecs.map((e=>Rw.fromJSON(e))):[],stereo:!!$w(e.stereo)&&Boolean(e.stereo),disableRed:!!$w(e.disableRed)&&Boolean(e.disableRed),encryption:$w(e.encryption)?Sw(e.encryption):0}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.type&&(t.type=uw(e.type)),void 0!==e.name&&(t.name=e.name),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.simulcast&&(t.simulcast=e.simulcast),void 0!==e.disableDtx&&(t.disableDtx=e.disableDtx),void 0!==e.source&&(t.source=pw(e.source)),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mid&&(t.mid=e.mid),e.codecs?t.codecs=e.codecs.map((e=>e?Rw.toJSON(e):void 0)):t.codecs=[],void 0!==e.stereo&&(t.stereo=e.stereo),void 0!==e.disableRed&&(t.disableRed=e.disableRed),void 0!==e.encryption&&(t.encryption=ww(e.encryption)),t},create:e=>jw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y;const v={sid:"",type:0,name:"",muted:!1,width:0,height:0,simulcast:!1,disableDtx:!1,source:0,layers:[],mimeType:"",mid:"",codecs:[],stereo:!1,disableRed:!1,encryption:0};return v.sid=null!==(t=e.sid)&&void 0!==t?t:"",v.type=null!==(n=e.type)&&void 0!==n?n:0,v.name=null!==(r=e.name)&&void 0!==r?r:"",v.muted=null!==(o=e.muted)&&void 0!==o&&o,v.width=null!==(i=e.width)&&void 0!==i?i:0,v.height=null!==(a=e.height)&&void 0!==a?a:0,v.simulcast=null!==(s=e.simulcast)&&void 0!==s&&s,v.disableDtx=null!==(c=e.disableDtx)&&void 0!==c&&c,v.source=null!==(l=e.source)&&void 0!==l?l:0,v.layers=(null===(u=e.layers)||void 0===u?void 0:u.map((e=>Iw.fromPartial(e))))||[],v.mimeType=null!==(d=e.mimeType)&&void 0!==d?d:"",v.mid=null!==(p=e.mid)&&void 0!==p?p:"",v.codecs=(null===(f=e.codecs)||void 0===f?void 0:f.map((e=>Rw.fromPartial(e))))||[],v.stereo=null!==(h=e.stereo)&&void 0!==h&&h,v.disableRed=null!==(m=e.disableRed)&&void 0!==m&&m,v.encryption=null!==(y=e.encryption)&&void 0!==y?y:0,v}},Iw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.quality&&t.uint32(8).int32(e.quality),0!==e.width&&t.uint32(16).uint32(e.width),0!==e.height&&t.uint32(24).uint32(e.height),0!==e.bitrate&&t.uint32(32).uint32(e.bitrate),0!==e.ssrc&&t.uint32(40).uint32(e.ssrc),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={quality:0,width:0,height:0,bitrate:0,ssrc:0};for(;n.pos>>3){case 1:if(8!=e)break;o.quality=n.int32();continue;case 2:if(16!=e)break;o.width=n.uint32();continue;case 3:if(24!=e)break;o.height=n.uint32();continue;case 4:if(32!=e)break;o.bitrate=n.uint32();continue;case 5:if(40!=e)break;o.ssrc=n.uint32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({quality:$w(e.quality)?fw(e.quality):0,width:$w(e.width)?Number(e.width):0,height:$w(e.height)?Number(e.height):0,bitrate:$w(e.bitrate)?Number(e.bitrate):0,ssrc:$w(e.ssrc)?Number(e.ssrc):0}),toJSON(e){const t={};return void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.bitrate&&(t.bitrate=Math.round(e.bitrate)),void 0!==e.ssrc&&(t.ssrc=Math.round(e.ssrc)),t},create:e=>Iw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i;const a={quality:0,width:0,height:0,bitrate:0,ssrc:0};return a.quality=null!==(t=e.quality)&&void 0!==t?t:0,a.width=null!==(n=e.width)&&void 0!==n?n:0,a.height=null!==(r=e.height)&&void 0!==r?r:0,a.bitrate=null!==(o=e.bitrate)&&void 0!==o?o:0,a.ssrc=null!==(i=e.ssrc)&&void 0!==i?i:0,a}},_w={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(0!==e.kind&&t.uint32(8).int32(e.kind),null===(n=e.value)||void 0===n?void 0:n.$case){case"user":Dw.encode(e.value.user,t.uint32(18).fork()).ldelim();break;case"speaker":Aw.encode(e.value.speaker,t.uint32(26).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={kind:0,value:void 0};for(;n.pos>>3){case 1:if(8!=e)break;o.kind=n.int32();continue;case 2:if(18!=e)break;o.value={$case:"user",user:Dw.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.value={$case:"speaker",speaker:Aw.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({kind:$w(e.kind)?kw(e.kind):0,value:$w(e.user)?{$case:"user",user:Dw.fromJSON(e.user)}:$w(e.speaker)?{$case:"speaker",speaker:Aw.fromJSON(e.speaker)}:void 0}),toJSON(e){var t,n,r,o,i,a;const s={};return void 0!==e.kind&&(s.kind=function(e){switch(e){case ow.RELIABLE:return"RELIABLE";case ow.LOSSY:return"LOSSY";case ow.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.kind)),"user"===(null===(t=e.value)||void 0===t?void 0:t.$case)&&(s.user=(null===(n=e.value)||void 0===n?void 0:n.user)?Dw.toJSON(null===(r=e.value)||void 0===r?void 0:r.user):void 0),"speaker"===(null===(o=e.value)||void 0===o?void 0:o.$case)&&(s.speaker=(null===(i=e.value)||void 0===i?void 0:i.speaker)?Aw.toJSON(null===(a=e.value)||void 0===a?void 0:a.speaker):void 0),s},create:e=>_w.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={kind:0,value:void 0};return c.kind=null!==(t=e.kind)&&void 0!==t?t:0,"user"===(null===(n=e.value)||void 0===n?void 0:n.$case)&&void 0!==(null===(r=e.value)||void 0===r?void 0:r.user)&&null!==(null===(o=e.value)||void 0===o?void 0:o.user)&&(c.value={$case:"user",user:Dw.fromPartial(e.value.user)}),"speaker"===(null===(i=e.value)||void 0===i?void 0:i.$case)&&void 0!==(null===(a=e.value)||void 0===a?void 0:a.speaker)&&null!==(null===(s=e.value)||void 0===s?void 0:s.speaker)&&(c.value={$case:"speaker",speaker:Aw.fromPartial(e.value.speaker)}),c}},Aw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.speakers)Mw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={speakers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.speakers.push(Mw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({speakers:Array.isArray(null==e?void 0:e.speakers)?e.speakers.map((e=>Mw.fromJSON(e))):[]}),toJSON(e){const t={};return e.speakers?t.speakers=e.speakers.map((e=>e?Mw.toJSON(e):void 0)):t.speakers=[],t},create:e=>Aw.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={speakers:[]};return n.speakers=(null===(t=e.speakers)||void 0===t?void 0:t.map((e=>Mw.fromPartial(e))))||[],n}},Mw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.sid&&t.uint32(10).string(e.sid),0!==e.level&&t.uint32(21).float(e.level),!0===e.active&&t.uint32(24).bool(e.active),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",level:0,active:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(21!=e)break;o.level=n.float();continue;case 3:if(24!=e)break;o.active=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",level:$w(e.level)?Number(e.level):0,active:!!$w(e.active)&&Boolean(e.active)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.level&&(t.level=e.level),void 0!==e.active&&(t.active=e.active),t},create:e=>Mw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={sid:"",level:0,active:!1};return o.sid=null!==(t=e.sid)&&void 0!==t?t:"",o.level=null!==(n=e.level)&&void 0!==n?n:0,o.active=null!==(r=e.active)&&void 0!==r&&r,o}};function Nw(){return{participantSid:"",payload:new Uint8Array,destinationSids:[],topic:void 0}}const Dw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid),0!==e.payload.length&&t.uint32(18).bytes(e.payload);for(const n of e.destinationSids)t.uint32(26).string(n);return void 0!==e.topic&&t.uint32(34).string(e.topic),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o=Nw();for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.payload=n.bytes();continue;case 3:if(26!=e)break;o.destinationSids.push(n.string());continue;case 4:if(34!=e)break;o.topic=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:$w(e.participantSid)?String(e.participantSid):"",payload:$w(e.payload)?Hw(e.payload):new Uint8Array,destinationSids:Array.isArray(null==e?void 0:e.destinationSids)?e.destinationSids.map((e=>String(e))):[],topic:$w(e.topic)?String(e.topic):void 0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.payload&&(t.payload=function(e){if(Zw.Buffer)return Zw.Buffer.from(e).toString("base64");{const t=[];return e.forEach((e=>{t.push(String.fromCharCode(e))})),Zw.btoa(t.join(""))}}(void 0!==e.payload?e.payload:new Uint8Array)),e.destinationSids?t.destinationSids=e.destinationSids.map((e=>e)):t.destinationSids=[],void 0!==e.topic&&(t.topic=e.topic),t},create:e=>Dw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i=Nw();return i.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",i.payload=null!==(n=e.payload)&&void 0!==n?n:new Uint8Array,i.destinationSids=(null===(r=e.destinationSids)||void 0===r?void 0:r.map((e=>e)))||[],i.topic=null!==(o=e.topic)&&void 0!==o?o:void 0,i}},Lw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid);for(const n of e.trackSids)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSids:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSids.push(n.string());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:$w(e.participantSid)?String(e.participantSid):"",trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[]}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],t},create:e=>Lw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={participantSid:"",trackSids:[]};return r.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",r.trackSids=(null===(n=e.trackSids)||void 0===n?void 0:n.map((e=>e)))||[],r}},Uw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.edition&&t.uint32(8).int32(e.edition),""!==e.version&&t.uint32(18).string(e.version),0!==e.protocol&&t.uint32(24).int32(e.protocol),""!==e.region&&t.uint32(34).string(e.region),""!==e.nodeId&&t.uint32(42).string(e.nodeId),""!==e.debugInfo&&t.uint32(50).string(e.debugInfo),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={edition:0,version:"",protocol:0,region:"",nodeId:"",debugInfo:""};for(;n.pos>>3){case 1:if(8!=e)break;o.edition=n.int32();continue;case 2:if(18!=e)break;o.version=n.string();continue;case 3:if(24!=e)break;o.protocol=n.int32();continue;case 4:if(34!=e)break;o.region=n.string();continue;case 5:if(42!=e)break;o.nodeId=n.string();continue;case 6:if(50!=e)break;o.debugInfo=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({edition:$w(e.edition)?Ow(e.edition):0,version:$w(e.version)?String(e.version):"",protocol:$w(e.protocol)?Number(e.protocol):0,region:$w(e.region)?String(e.region):"",nodeId:$w(e.nodeId)?String(e.nodeId):"",debugInfo:$w(e.debugInfo)?String(e.debugInfo):""}),toJSON(e){const t={};return void 0!==e.edition&&(t.edition=function(e){switch(e){case iw.Standard:return"Standard";case iw.Cloud:return"Cloud";case iw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.edition)),void 0!==e.version&&(t.version=e.version),void 0!==e.protocol&&(t.protocol=Math.round(e.protocol)),void 0!==e.region&&(t.region=e.region),void 0!==e.nodeId&&(t.nodeId=e.nodeId),void 0!==e.debugInfo&&(t.debugInfo=e.debugInfo),t},create:e=>Uw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a;const s={edition:0,version:"",protocol:0,region:"",nodeId:"",debugInfo:""};return s.edition=null!==(t=e.edition)&&void 0!==t?t:0,s.version=null!==(n=e.version)&&void 0!==n?n:"",s.protocol=null!==(r=e.protocol)&&void 0!==r?r:0,s.region=null!==(o=e.region)&&void 0!==o?o:"",s.nodeId=null!==(i=e.nodeId)&&void 0!==i?i:"",s.debugInfo=null!==(a=e.debugInfo)&&void 0!==a?a:"",s}},Bw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.sdk&&t.uint32(8).int32(e.sdk),""!==e.version&&t.uint32(18).string(e.version),0!==e.protocol&&t.uint32(24).int32(e.protocol),""!==e.os&&t.uint32(34).string(e.os),""!==e.osVersion&&t.uint32(42).string(e.osVersion),""!==e.deviceModel&&t.uint32(50).string(e.deviceModel),""!==e.browser&&t.uint32(58).string(e.browser),""!==e.browserVersion&&t.uint32(66).string(e.browserVersion),""!==e.address&&t.uint32(74).string(e.address),""!==e.network&&t.uint32(82).string(e.network),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sdk:0,version:"",protocol:0,os:"",osVersion:"",deviceModel:"",browser:"",browserVersion:"",address:"",network:""};for(;n.pos>>3){case 1:if(8!=e)break;o.sdk=n.int32();continue;case 2:if(18!=e)break;o.version=n.string();continue;case 3:if(24!=e)break;o.protocol=n.int32();continue;case 4:if(34!=e)break;o.os=n.string();continue;case 5:if(42!=e)break;o.osVersion=n.string();continue;case 6:if(50!=e)break;o.deviceModel=n.string();continue;case 7:if(58!=e)break;o.browser=n.string();continue;case 8:if(66!=e)break;o.browserVersion=n.string();continue;case 9:if(74!=e)break;o.address=n.string();continue;case 10:if(82!=e)break;o.network=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sdk:$w(e.sdk)?Pw(e.sdk):0,version:$w(e.version)?String(e.version):"",protocol:$w(e.protocol)?Number(e.protocol):0,os:$w(e.os)?String(e.os):"",osVersion:$w(e.osVersion)?String(e.osVersion):"",deviceModel:$w(e.deviceModel)?String(e.deviceModel):"",browser:$w(e.browser)?String(e.browser):"",browserVersion:$w(e.browserVersion)?String(e.browserVersion):"",address:$w(e.address)?String(e.address):"",network:$w(e.network)?String(e.network):""}),toJSON(e){const t={};return void 0!==e.sdk&&(t.sdk=function(e){switch(e){case aw.UNKNOWN:return"UNKNOWN";case aw.JS:return"JS";case aw.SWIFT:return"SWIFT";case aw.ANDROID:return"ANDROID";case aw.FLUTTER:return"FLUTTER";case aw.GO:return"GO";case aw.UNITY:return"UNITY";case aw.REACT_NATIVE:return"REACT_NATIVE";case aw.RUST:return"RUST";case aw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.sdk)),void 0!==e.version&&(t.version=e.version),void 0!==e.protocol&&(t.protocol=Math.round(e.protocol)),void 0!==e.os&&(t.os=e.os),void 0!==e.osVersion&&(t.osVersion=e.osVersion),void 0!==e.deviceModel&&(t.deviceModel=e.deviceModel),void 0!==e.browser&&(t.browser=e.browser),void 0!==e.browserVersion&&(t.browserVersion=e.browserVersion),void 0!==e.address&&(t.address=e.address),void 0!==e.network&&(t.network=e.network),t},create:e=>Bw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sdk:0,version:"",protocol:0,os:"",osVersion:"",deviceModel:"",browser:"",browserVersion:"",address:"",network:""};return d.sdk=null!==(t=e.sdk)&&void 0!==t?t:0,d.version=null!==(n=e.version)&&void 0!==n?n:"",d.protocol=null!==(r=e.protocol)&&void 0!==r?r:0,d.os=null!==(o=e.os)&&void 0!==o?o:"",d.osVersion=null!==(i=e.osVersion)&&void 0!==i?i:"",d.deviceModel=null!==(a=e.deviceModel)&&void 0!==a?a:"",d.browser=null!==(s=e.browser)&&void 0!==s?s:"",d.browserVersion=null!==(c=e.browserVersion)&&void 0!==c?c:"",d.address=null!==(l=e.address)&&void 0!==l?l:"",d.network=null!==(u=e.network)&&void 0!==u?u:"",d}},Fw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return void 0!==e.video&&zw.encode(e.video,t.uint32(10).fork()).ldelim(),void 0!==e.screen&&zw.encode(e.screen,t.uint32(18).fork()).ldelim(),0!==e.resumeConnection&&t.uint32(24).int32(e.resumeConnection),void 0!==e.disabledCodecs&&Ww.encode(e.disabledCodecs,t.uint32(34).fork()).ldelim(),0!==e.forceRelay&&t.uint32(40).int32(e.forceRelay),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={video:void 0,screen:void 0,resumeConnection:0,disabledCodecs:void 0,forceRelay:0};for(;n.pos>>3){case 1:if(10!=e)break;o.video=zw.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.screen=zw.decode(n,n.uint32());continue;case 3:if(24!=e)break;o.resumeConnection=n.int32();continue;case 4:if(34!=e)break;o.disabledCodecs=Ww.decode(n,n.uint32());continue;case 5:if(40!=e)break;o.forceRelay=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({video:$w(e.video)?zw.fromJSON(e.video):void 0,screen:$w(e.screen)?zw.fromJSON(e.screen):void 0,resumeConnection:$w(e.resumeConnection)?yw(e.resumeConnection):0,disabledCodecs:$w(e.disabledCodecs)?Ww.fromJSON(e.disabledCodecs):void 0,forceRelay:$w(e.forceRelay)?yw(e.forceRelay):0}),toJSON(e){const t={};return void 0!==e.video&&(t.video=e.video?zw.toJSON(e.video):void 0),void 0!==e.screen&&(t.screen=e.screen?zw.toJSON(e.screen):void 0),void 0!==e.resumeConnection&&(t.resumeConnection=vw(e.resumeConnection)),void 0!==e.disabledCodecs&&(t.disabledCodecs=e.disabledCodecs?Ww.toJSON(e.disabledCodecs):void 0),void 0!==e.forceRelay&&(t.forceRelay=vw(e.forceRelay)),t},create:e=>Fw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={video:void 0,screen:void 0,resumeConnection:0,disabledCodecs:void 0,forceRelay:0};return r.video=void 0!==e.video&&null!==e.video?zw.fromPartial(e.video):void 0,r.screen=void 0!==e.screen&&null!==e.screen?zw.fromPartial(e.screen):void 0,r.resumeConnection=null!==(t=e.resumeConnection)&&void 0!==t?t:0,r.disabledCodecs=void 0!==e.disabledCodecs&&null!==e.disabledCodecs?Ww.fromPartial(e.disabledCodecs):void 0,r.forceRelay=null!==(n=e.forceRelay)&&void 0!==n?n:0,r}},zw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.hardwareEncoder&&t.uint32(8).int32(e.hardwareEncoder),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={hardwareEncoder:0};for(;n.pos>>3){case 1:if(8!=e)break;o.hardwareEncoder=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({hardwareEncoder:$w(e.hardwareEncoder)?yw(e.hardwareEncoder):0}),toJSON(e){const t={};return void 0!==e.hardwareEncoder&&(t.hardwareEncoder=vw(e.hardwareEncoder)),t},create:e=>zw.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={hardwareEncoder:0};return n.hardwareEncoder=null!==(t=e.hardwareEncoder)&&void 0!==t?t:0,n}},Ww={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.codecs)Cw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codecs:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.codecs.push(Cw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codecs:Array.isArray(null==e?void 0:e.codecs)?e.codecs.map((e=>Cw.fromJSON(e))):[]}),toJSON(e){const t={};return e.codecs?t.codecs=e.codecs.map((e=>e?Cw.toJSON(e):void 0)):t.codecs=[],t},create:e=>Ww.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={codecs:[]};return n.codecs=(null===(t=e.codecs)||void 0===t?void 0:t.map((e=>Cw.fromPartial(e))))||[],n}};var Zw=(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function Hw(e){if(Zw.Buffer)return Uint8Array.from(Zw.Buffer.from(e,"base64"));{const t=Zw.atob(e),n=new Uint8Array(t.length);for(let e=0;e=n&&parseInt(r[n],10)}function rk(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);const i=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,i),o.apply(this,[e,i])};const i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(n))return i.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,i.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function ok(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(ek=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function ik(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(tk=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ak(){if("object"==typeof window){if(ek)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function sk(e,t){tk&&console.warn(e+" is deprecated, please use "+t+" instead.")}function ck(e){return"[object Object]"===Object.prototype.toString.call(e)}function lk(e){return ck(e)?Object.keys(e).reduce((function(t,n){const r=ck(e[n]),o=r?lk(e[n]):e[n],i=r&&!Object.keys(o).length;return void 0===o||i?t:Object.assign(t,{[n]:o})}),{}):e}function uk(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((r=>{r.endsWith("Id")?uk(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((t=>{uk(e,e.get(t),n)}))})))}function dk(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;const i=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((t=>{e.forEach((n=>{n.type===r&&n.trackId===t.id&&uk(e,n,o)}))})),o}const pk=ak;function fk(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[o("min",n)]=r.ideal,t.optional.push(e),e={},e[o("max",n)]=r.ideal,t.optional.push(e)):(e[o("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach((e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,o){if(t.version>=61)return o(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let i=e.video.facingMode;i=i&&("object"==typeof i?i:{ideal:i});const a=t.version<66;if(i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===i.exact||"environment"===i.ideal?t=["back","rear"]:"user"!==i.exact&&"user"!==i.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{let a=(n=n.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),pk("chrome: "+JSON.stringify(e)),o(e)}))}e.video=r(e.video)}return pk("chrome: "+JSON.stringify(e)),o(e)},i=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){o(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{r&&r(i(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return o(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(i(e))))))}}}function hk(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function mk(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const o=new Event("track");o.track=n.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)})),t.stream.getTracks().forEach((n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else rk(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function yk(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function vk(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const o=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},i=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const r=function(e){n(i(o(e)))};return t.apply(this,[r,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(i(o(t)))},n])})).then(n,r)}}function bk(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>dk(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),rk(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>dk(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach((n=>{n.track===e&&(t?r=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?r=!0:n=t),t.track===e))),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function gk(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),o.apply(this,arguments)}}function Sk(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return gk(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const o=e.RTCPeerConnection.prototype.removeStream;function i(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const o=this.getSenders().find((e=>e.track===t));if(o)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=i(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>i(this,e)))}};e.RTCPeerConnection.prototype[t]=r[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=s.get.apply(this);return""===e.type?e:i(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function wk(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function kk(e,t){rk(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var Ok=Object.freeze({__proto__:null,fixNegotiationNeeded:kk,shimAddTrackRemoveTrack:Sk,shimAddTrackRemoveTrackWithNative:gk,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))},shimGetSendersWithDtmf:yk,shimGetStats:vk,shimGetUserMedia:fk,shimMediaStream:hk,shimOnTrack:mk,shimPeerConnection:wk,shimSenderReceiverGetStats:bk});function Pk(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){sk("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function Ek(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ck(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,o,i]=arguments;return r.apply(this,[e||null]).then((e=>{if(t.version<53&&!o)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(o,i)}}function Tk(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function xk(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),rk(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Rk(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){sk("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function jk(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Ik(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})}function _k(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function Ak(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function Mk(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var Nk=Object.freeze({__proto__:null,shimAddTransceiver:Ik,shimCreateAnswer:Mk,shimCreateOffer:Ak,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})},shimGetParameters:_k,shimGetUserMedia:Pk,shimOnTrack:Ek,shimPeerConnection:Ck,shimRTCDataChannel:jk,shimReceiverGetStats:xk,shimRemoveStream:Rk,shimSenderGetStats:Tk});function Dk(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function Lk(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function Uk(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,i=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o};let s=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Bk(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Fk(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function Fk(e){return e&&void 0!==e.video?Object.assign({},e,{video:lk(e.video)}):e}function zk(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;nt.generateCertificate})}function Wk(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Zk(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Hk(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var qk=Object.freeze({__proto__:null,shimAudioContext:Hk,shimCallbacksAPI:Uk,shimConstraints:Fk,shimCreateOfferLegacy:Zk,shimGetUserMedia:Bk,shimLocalStreamsAPI:Dk,shimRTCIceServerUrls:zk,shimRemoteStreamsAPI:Lk,shimTrackEventTransceiver:Wk}),$k={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],o=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substring(12),password:o.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" ");n.profile=r[2];for(let o=3;o{n.headerExtensions.push(t.parseExtmap(e))}));const o=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{o.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)}));let o=0;return n.codecs.forEach((e=>{e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),i=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const l=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));l.length>0&&l[0].length>1&&l[0][0]===s&&(c=l[0][1]),r.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),n.push(t),o&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:i?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&s&&n.push({ssrc:s});let u=t.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substring(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=u}))),n},t.parseRtcpParameters=function(e){const n={},r=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const o=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=o.length>0,n.compound=0===o.length;const i=t.matchPrefix(e,"a=rtcp-mux");return n.mux=i.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const r=t.matchPrefix(e,"a=msid:");if(1===r.length)return n=r[0].substring(7).split(" "),{stream:n[0],track:n[1]};const o=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return o.length>0?(n=o[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");let o;r.length>0&&(o=parseInt(r[0].substring(19),10)),isNaN(o)&&(o=65536);const i=t.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substring(12),10),protocol:n.fmt,maxMessageSize:o};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:o}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,r){let o;const i=void 0!==n?n:2;return o=e||t.generateSessionId(),"v=0\r\no="+(r||"thisisadapterortc")+" "+o+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const r=t.splitLines(e);for(let e=0;e(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Yk(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||rk(e,"icecandidate",(e=>{if(e.candidate){const t=Gk.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Qk(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Gk.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Gk.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),n=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(e),r=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const o=Gk.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substring(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],e);let o;o=0===n&&0===r?Number.POSITIVE_INFINITY:0===n||0===r?Math.max(n,r):Math.min(n,r);const i={};Object.defineProperty(i,"maxMessageSize",{get:()=>o}),this._sctp=i}return n.apply(this,arguments)}}function Xk(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},rk(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function eO(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function tO(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function nO(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function rO(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?n.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>n.apply(this,[e])))})}var oO,iO,aO,sO=Object.freeze({__proto__:null,removeExtmapAllowMixed:tO,shimAddIceCandidateNullOrEmpty:nO,shimConnectionState:eO,shimMaxMessageSize:Qk,shimParameterlessSetLocalDescription:rO,shimRTCIceCandidate:Kk,shimRTCIceCandidateRelayProtocol:Yk,shimSendThrowTypeError:Xk});function cO(e){switch(e){case 0:case"PUBLISHER":return oO.PUBLISHER;case 1:case"SUBSCRIBER":return oO.SUBSCRIBER;default:return oO.UNRECOGNIZED}}function lO(e){switch(e){case oO.PUBLISHER:return"PUBLISHER";case oO.SUBSCRIBER:return"SUBSCRIBER";case oO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function uO(e){switch(e){case 0:case"ACTIVE":return iO.ACTIVE;case 1:case"PAUSED":return iO.PAUSED;default:return iO.UNRECOGNIZED}}function dO(e){switch(e){case 0:case"UDP":return aO.UDP;case 1:case"TCP":return aO.TCP;case 2:case"TLS":return aO.TLS;default:return aO.UNRECOGNIZED}}!function(){let{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=ak,r=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=nk(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=nk(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=nk(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),o={browserDetails:r,commonShim:sO,extractVersion:nk,disableLog:ok,disableWarnings:ik,sdp:Jk};switch(r.browser){case"chrome":if(!Ok||!wk||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),o;if(null===r.version)return n("Chrome shim can not determine version, not shimming."),o;n("adapter.js shimming chrome."),o.browserShim=Ok,nO(e,r),rO(e),fk(e,r),hk(e),wk(e,r),mk(e),Sk(e,r),yk(e),vk(e),bk(e),kk(e,r),Kk(e),Yk(e),eO(e),Qk(e,r),Xk(e),tO(e,r);break;case"firefox":if(!Nk||!Ck||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),o;n("adapter.js shimming firefox."),o.browserShim=Nk,nO(e,r),rO(e),Pk(e,r),Ck(e,r),Ek(e),Rk(e),Tk(e),xk(e),jk(e),Ik(e),_k(e),Ak(e),Mk(e),Kk(e),eO(e),Qk(e,r),Xk(e);break;case"safari":if(!qk||!t.shimSafari)return n("Safari shim is not included in this adapter release."),o;n("adapter.js shimming safari."),o.browserShim=qk,nO(e,r),rO(e),zk(e),Zk(e),Uk(e),Dk(e),Lk(e),Wk(e),Bk(e),Hk(e),Kk(e),Yk(e),Qk(e,r),Xk(e),tO(e,r);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window}),function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(oO||(oO={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.PAUSED=1]="PAUSED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(iO||(iO={})),function(e){e[e.UDP=0]="UDP",e[e.TCP=1]="TCP",e[e.TLS=2]="TLS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(aO||(aO={}));const pO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.message)||void 0===n?void 0:n.$case){case"offer":kO.encode(e.message.offer,t.uint32(10).fork()).ldelim();break;case"answer":kO.encode(e.message.answer,t.uint32(18).fork()).ldelim();break;case"trickle":yO.encode(e.message.trickle,t.uint32(26).fork()).ldelim();break;case"addTrack":mO.encode(e.message.addTrack,t.uint32(34).fork()).ldelim();break;case"mute":vO.encode(e.message.mute,t.uint32(42).fork()).ldelim();break;case"subscription":PO.encode(e.message.subscription,t.uint32(50).fork()).ldelim();break;case"trackSetting":EO.encode(e.message.trackSetting,t.uint32(58).fork()).ldelim();break;case"leave":CO.encode(e.message.leave,t.uint32(66).fork()).ldelim();break;case"updateLayers":TO.encode(e.message.updateLayers,t.uint32(82).fork()).ldelim();break;case"subscriptionPermission":FO.encode(e.message.subscriptionPermission,t.uint32(90).fork()).ldelim();break;case"syncState":WO.encode(e.message.syncState,t.uint32(98).fork()).ldelim();break;case"simulate":HO.encode(e.message.simulate,t.uint32(106).fork()).ldelim();break;case"ping":t.uint32(112).int64(e.message.ping);break;case"updateMetadata":xO.encode(e.message.updateMetadata,t.uint32(122).fork()).ldelim();break;case"pingReq":qO.encode(e.message.pingReq,t.uint32(130).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={message:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.message={$case:"offer",offer:kO.decode(n,n.uint32())};continue;case 2:if(18!=e)break;o.message={$case:"answer",answer:kO.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.message={$case:"trickle",trickle:yO.decode(n,n.uint32())};continue;case 4:if(34!=e)break;o.message={$case:"addTrack",addTrack:mO.decode(n,n.uint32())};continue;case 5:if(42!=e)break;o.message={$case:"mute",mute:vO.decode(n,n.uint32())};continue;case 6:if(50!=e)break;o.message={$case:"subscription",subscription:PO.decode(n,n.uint32())};continue;case 7:if(58!=e)break;o.message={$case:"trackSetting",trackSetting:EO.decode(n,n.uint32())};continue;case 8:if(66!=e)break;o.message={$case:"leave",leave:CO.decode(n,n.uint32())};continue;case 10:if(82!=e)break;o.message={$case:"updateLayers",updateLayers:TO.decode(n,n.uint32())};continue;case 11:if(90!=e)break;o.message={$case:"subscriptionPermission",subscriptionPermission:FO.decode(n,n.uint32())};continue;case 12:if(98!=e)break;o.message={$case:"syncState",syncState:WO.decode(n,n.uint32())};continue;case 13:if(106!=e)break;o.message={$case:"simulate",simulate:HO.decode(n,n.uint32())};continue;case 14:if(112!=e)break;o.message={$case:"ping",ping:eP(n.int64())};continue;case 15:if(122!=e)break;o.message={$case:"updateMetadata",updateMetadata:xO.decode(n,n.uint32())};continue;case 16:if(130!=e)break;o.message={$case:"pingReq",pingReq:qO.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({message:tP(e.offer)?{$case:"offer",offer:kO.fromJSON(e.offer)}:tP(e.answer)?{$case:"answer",answer:kO.fromJSON(e.answer)}:tP(e.trickle)?{$case:"trickle",trickle:yO.fromJSON(e.trickle)}:tP(e.addTrack)?{$case:"addTrack",addTrack:mO.fromJSON(e.addTrack)}:tP(e.mute)?{$case:"mute",mute:vO.fromJSON(e.mute)}:tP(e.subscription)?{$case:"subscription",subscription:PO.fromJSON(e.subscription)}:tP(e.trackSetting)?{$case:"trackSetting",trackSetting:EO.fromJSON(e.trackSetting)}:tP(e.leave)?{$case:"leave",leave:CO.fromJSON(e.leave)}:tP(e.updateLayers)?{$case:"updateLayers",updateLayers:TO.fromJSON(e.updateLayers)}:tP(e.subscriptionPermission)?{$case:"subscriptionPermission",subscriptionPermission:FO.fromJSON(e.subscriptionPermission)}:tP(e.syncState)?{$case:"syncState",syncState:WO.fromJSON(e.syncState)}:tP(e.simulate)?{$case:"simulate",simulate:HO.fromJSON(e.simulate)}:tP(e.ping)?{$case:"ping",ping:Number(e.ping)}:tP(e.updateMetadata)?{$case:"updateMetadata",updateMetadata:xO.fromJSON(e.updateMetadata)}:tP(e.pingReq)?{$case:"pingReq",pingReq:qO.fromJSON(e.pingReq)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H;const q={};return"offer"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&(q.offer=(null===(n=e.message)||void 0===n?void 0:n.offer)?kO.toJSON(null===(r=e.message)||void 0===r?void 0:r.offer):void 0),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&(q.answer=(null===(i=e.message)||void 0===i?void 0:i.answer)?kO.toJSON(null===(a=e.message)||void 0===a?void 0:a.answer):void 0),"trickle"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&(q.trickle=(null===(c=e.message)||void 0===c?void 0:c.trickle)?yO.toJSON(null===(l=e.message)||void 0===l?void 0:l.trickle):void 0),"addTrack"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&(q.addTrack=(null===(d=e.message)||void 0===d?void 0:d.addTrack)?mO.toJSON(null===(p=e.message)||void 0===p?void 0:p.addTrack):void 0),"mute"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&(q.mute=(null===(h=e.message)||void 0===h?void 0:h.mute)?vO.toJSON(null===(m=e.message)||void 0===m?void 0:m.mute):void 0),"subscription"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&(q.subscription=(null===(v=e.message)||void 0===v?void 0:v.subscription)?PO.toJSON(null===(b=e.message)||void 0===b?void 0:b.subscription):void 0),"trackSetting"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&(q.trackSetting=(null===(S=e.message)||void 0===S?void 0:S.trackSetting)?EO.toJSON(null===(w=e.message)||void 0===w?void 0:w.trackSetting):void 0),"leave"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&(q.leave=(null===(O=e.message)||void 0===O?void 0:O.leave)?CO.toJSON(null===(P=e.message)||void 0===P?void 0:P.leave):void 0),"updateLayers"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&(q.updateLayers=(null===(C=e.message)||void 0===C?void 0:C.updateLayers)?TO.toJSON(null===(T=e.message)||void 0===T?void 0:T.updateLayers):void 0),"subscriptionPermission"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&(q.subscriptionPermission=(null===(R=e.message)||void 0===R?void 0:R.subscriptionPermission)?FO.toJSON(null===(j=e.message)||void 0===j?void 0:j.subscriptionPermission):void 0),"syncState"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&(q.syncState=(null===(_=e.message)||void 0===_?void 0:_.syncState)?WO.toJSON(null===(A=e.message)||void 0===A?void 0:A.syncState):void 0),"simulate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&(q.simulate=(null===(N=e.message)||void 0===N?void 0:N.simulate)?HO.toJSON(null===(D=e.message)||void 0===D?void 0:D.simulate):void 0),"ping"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&(q.ping=Math.round(null===(U=e.message)||void 0===U?void 0:U.ping)),"updateMetadata"===(null===(B=e.message)||void 0===B?void 0:B.$case)&&(q.updateMetadata=(null===(F=e.message)||void 0===F?void 0:F.updateMetadata)?xO.toJSON(null===(z=e.message)||void 0===z?void 0:z.updateMetadata):void 0),"pingReq"===(null===(W=e.message)||void 0===W?void 0:W.$case)&&(q.pingReq=(null===(Z=e.message)||void 0===Z?void 0:Z.pingReq)?qO.toJSON(null===(H=e.message)||void 0===H?void 0:H.pingReq):void 0),q},create:e=>pO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q;const $={message:void 0};return"offer"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.message)||void 0===n?void 0:n.offer)&&null!==(null===(r=e.message)||void 0===r?void 0:r.offer)&&($.message={$case:"offer",offer:kO.fromPartial(e.message.offer)}),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.message)||void 0===i?void 0:i.answer)&&null!==(null===(a=e.message)||void 0===a?void 0:a.answer)&&($.message={$case:"answer",answer:kO.fromPartial(e.message.answer)}),"trickle"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.message)||void 0===c?void 0:c.trickle)&&null!==(null===(l=e.message)||void 0===l?void 0:l.trickle)&&($.message={$case:"trickle",trickle:yO.fromPartial(e.message.trickle)}),"addTrack"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.message)||void 0===d?void 0:d.addTrack)&&null!==(null===(p=e.message)||void 0===p?void 0:p.addTrack)&&($.message={$case:"addTrack",addTrack:mO.fromPartial(e.message.addTrack)}),"mute"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.message)||void 0===h?void 0:h.mute)&&null!==(null===(m=e.message)||void 0===m?void 0:m.mute)&&($.message={$case:"mute",mute:vO.fromPartial(e.message.mute)}),"subscription"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.message)||void 0===v?void 0:v.subscription)&&null!==(null===(b=e.message)||void 0===b?void 0:b.subscription)&&($.message={$case:"subscription",subscription:PO.fromPartial(e.message.subscription)}),"trackSetting"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&void 0!==(null===(S=e.message)||void 0===S?void 0:S.trackSetting)&&null!==(null===(w=e.message)||void 0===w?void 0:w.trackSetting)&&($.message={$case:"trackSetting",trackSetting:EO.fromPartial(e.message.trackSetting)}),"leave"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&void 0!==(null===(O=e.message)||void 0===O?void 0:O.leave)&&null!==(null===(P=e.message)||void 0===P?void 0:P.leave)&&($.message={$case:"leave",leave:CO.fromPartial(e.message.leave)}),"updateLayers"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&void 0!==(null===(C=e.message)||void 0===C?void 0:C.updateLayers)&&null!==(null===(T=e.message)||void 0===T?void 0:T.updateLayers)&&($.message={$case:"updateLayers",updateLayers:TO.fromPartial(e.message.updateLayers)}),"subscriptionPermission"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&void 0!==(null===(R=e.message)||void 0===R?void 0:R.subscriptionPermission)&&null!==(null===(j=e.message)||void 0===j?void 0:j.subscriptionPermission)&&($.message={$case:"subscriptionPermission",subscriptionPermission:FO.fromPartial(e.message.subscriptionPermission)}),"syncState"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&void 0!==(null===(_=e.message)||void 0===_?void 0:_.syncState)&&null!==(null===(A=e.message)||void 0===A?void 0:A.syncState)&&($.message={$case:"syncState",syncState:WO.fromPartial(e.message.syncState)}),"simulate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&void 0!==(null===(N=e.message)||void 0===N?void 0:N.simulate)&&null!==(null===(D=e.message)||void 0===D?void 0:D.simulate)&&($.message={$case:"simulate",simulate:HO.fromPartial(e.message.simulate)}),"ping"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&void 0!==(null===(U=e.message)||void 0===U?void 0:U.ping)&&null!==(null===(B=e.message)||void 0===B?void 0:B.ping)&&($.message={$case:"ping",ping:e.message.ping}),"updateMetadata"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&void 0!==(null===(z=e.message)||void 0===z?void 0:z.updateMetadata)&&null!==(null===(W=e.message)||void 0===W?void 0:W.updateMetadata)&&($.message={$case:"updateMetadata",updateMetadata:xO.fromPartial(e.message.updateMetadata)}),"pingReq"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&void 0!==(null===(H=e.message)||void 0===H?void 0:H.pingReq)&&null!==(null===(q=e.message)||void 0===q?void 0:q.pingReq)&&($.message={$case:"pingReq",pingReq:qO.fromPartial(e.message.pingReq)}),$}},fO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.message)||void 0===n?void 0:n.$case){case"join":bO.encode(e.message.join,t.uint32(10).fork()).ldelim();break;case"answer":kO.encode(e.message.answer,t.uint32(18).fork()).ldelim();break;case"offer":kO.encode(e.message.offer,t.uint32(26).fork()).ldelim();break;case"trickle":yO.encode(e.message.trickle,t.uint32(34).fork()).ldelim();break;case"update":OO.encode(e.message.update,t.uint32(42).fork()).ldelim();break;case"trackPublished":SO.encode(e.message.trackPublished,t.uint32(50).fork()).ldelim();break;case"leave":CO.encode(e.message.leave,t.uint32(66).fork()).ldelim();break;case"mute":vO.encode(e.message.mute,t.uint32(74).fork()).ldelim();break;case"speakersChanged":jO.encode(e.message.speakersChanged,t.uint32(82).fork()).ldelim();break;case"roomUpdate":IO.encode(e.message.roomUpdate,t.uint32(90).fork()).ldelim();break;case"connectionQuality":AO.encode(e.message.connectionQuality,t.uint32(98).fork()).ldelim();break;case"streamStateUpdate":NO.encode(e.message.streamStateUpdate,t.uint32(106).fork()).ldelim();break;case"subscribedQualityUpdate":UO.encode(e.message.subscribedQualityUpdate,t.uint32(114).fork()).ldelim();break;case"subscriptionPermissionUpdate":zO.encode(e.message.subscriptionPermissionUpdate,t.uint32(122).fork()).ldelim();break;case"refreshToken":t.uint32(130).string(e.message.refreshToken);break;case"trackUnpublished":wO.encode(e.message.trackUnpublished,t.uint32(138).fork()).ldelim();break;case"pong":t.uint32(144).int64(e.message.pong);break;case"reconnect":gO.encode(e.message.reconnect,t.uint32(154).fork()).ldelim();break;case"pongResp":$O.encode(e.message.pongResp,t.uint32(162).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={message:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.message={$case:"join",join:bO.decode(n,n.uint32())};continue;case 2:if(18!=e)break;o.message={$case:"answer",answer:kO.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.message={$case:"offer",offer:kO.decode(n,n.uint32())};continue;case 4:if(34!=e)break;o.message={$case:"trickle",trickle:yO.decode(n,n.uint32())};continue;case 5:if(42!=e)break;o.message={$case:"update",update:OO.decode(n,n.uint32())};continue;case 6:if(50!=e)break;o.message={$case:"trackPublished",trackPublished:SO.decode(n,n.uint32())};continue;case 8:if(66!=e)break;o.message={$case:"leave",leave:CO.decode(n,n.uint32())};continue;case 9:if(74!=e)break;o.message={$case:"mute",mute:vO.decode(n,n.uint32())};continue;case 10:if(82!=e)break;o.message={$case:"speakersChanged",speakersChanged:jO.decode(n,n.uint32())};continue;case 11:if(90!=e)break;o.message={$case:"roomUpdate",roomUpdate:IO.decode(n,n.uint32())};continue;case 12:if(98!=e)break;o.message={$case:"connectionQuality",connectionQuality:AO.decode(n,n.uint32())};continue;case 13:if(106!=e)break;o.message={$case:"streamStateUpdate",streamStateUpdate:NO.decode(n,n.uint32())};continue;case 14:if(114!=e)break;o.message={$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.decode(n,n.uint32())};continue;case 15:if(122!=e)break;o.message={$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.decode(n,n.uint32())};continue;case 16:if(130!=e)break;o.message={$case:"refreshToken",refreshToken:n.string()};continue;case 17:if(138!=e)break;o.message={$case:"trackUnpublished",trackUnpublished:wO.decode(n,n.uint32())};continue;case 18:if(144!=e)break;o.message={$case:"pong",pong:eP(n.int64())};continue;case 19:if(154!=e)break;o.message={$case:"reconnect",reconnect:gO.decode(n,n.uint32())};continue;case 20:if(162!=e)break;o.message={$case:"pongResp",pongResp:$O.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({message:tP(e.join)?{$case:"join",join:bO.fromJSON(e.join)}:tP(e.answer)?{$case:"answer",answer:kO.fromJSON(e.answer)}:tP(e.offer)?{$case:"offer",offer:kO.fromJSON(e.offer)}:tP(e.trickle)?{$case:"trickle",trickle:yO.fromJSON(e.trickle)}:tP(e.update)?{$case:"update",update:OO.fromJSON(e.update)}:tP(e.trackPublished)?{$case:"trackPublished",trackPublished:SO.fromJSON(e.trackPublished)}:tP(e.leave)?{$case:"leave",leave:CO.fromJSON(e.leave)}:tP(e.mute)?{$case:"mute",mute:vO.fromJSON(e.mute)}:tP(e.speakersChanged)?{$case:"speakersChanged",speakersChanged:jO.fromJSON(e.speakersChanged)}:tP(e.roomUpdate)?{$case:"roomUpdate",roomUpdate:IO.fromJSON(e.roomUpdate)}:tP(e.connectionQuality)?{$case:"connectionQuality",connectionQuality:AO.fromJSON(e.connectionQuality)}:tP(e.streamStateUpdate)?{$case:"streamStateUpdate",streamStateUpdate:NO.fromJSON(e.streamStateUpdate)}:tP(e.subscribedQualityUpdate)?{$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.fromJSON(e.subscribedQualityUpdate)}:tP(e.subscriptionPermissionUpdate)?{$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.fromJSON(e.subscriptionPermissionUpdate)}:tP(e.refreshToken)?{$case:"refreshToken",refreshToken:String(e.refreshToken)}:tP(e.trackUnpublished)?{$case:"trackUnpublished",trackUnpublished:wO.fromJSON(e.trackUnpublished)}:tP(e.pong)?{$case:"pong",pong:Number(e.pong)}:tP(e.reconnect)?{$case:"reconnect",reconnect:gO.fromJSON(e.reconnect)}:tP(e.pongResp)?{$case:"pongResp",pongResp:$O.fromJSON(e.pongResp)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q,$,V,G,J,K,Y,Q,X,ee,te;const ne={};return"join"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&(ne.join=(null===(n=e.message)||void 0===n?void 0:n.join)?bO.toJSON(null===(r=e.message)||void 0===r?void 0:r.join):void 0),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&(ne.answer=(null===(i=e.message)||void 0===i?void 0:i.answer)?kO.toJSON(null===(a=e.message)||void 0===a?void 0:a.answer):void 0),"offer"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&(ne.offer=(null===(c=e.message)||void 0===c?void 0:c.offer)?kO.toJSON(null===(l=e.message)||void 0===l?void 0:l.offer):void 0),"trickle"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&(ne.trickle=(null===(d=e.message)||void 0===d?void 0:d.trickle)?yO.toJSON(null===(p=e.message)||void 0===p?void 0:p.trickle):void 0),"update"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&(ne.update=(null===(h=e.message)||void 0===h?void 0:h.update)?OO.toJSON(null===(m=e.message)||void 0===m?void 0:m.update):void 0),"trackPublished"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&(ne.trackPublished=(null===(v=e.message)||void 0===v?void 0:v.trackPublished)?SO.toJSON(null===(b=e.message)||void 0===b?void 0:b.trackPublished):void 0),"leave"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&(ne.leave=(null===(S=e.message)||void 0===S?void 0:S.leave)?CO.toJSON(null===(w=e.message)||void 0===w?void 0:w.leave):void 0),"mute"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&(ne.mute=(null===(O=e.message)||void 0===O?void 0:O.mute)?vO.toJSON(null===(P=e.message)||void 0===P?void 0:P.mute):void 0),"speakersChanged"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&(ne.speakersChanged=(null===(C=e.message)||void 0===C?void 0:C.speakersChanged)?jO.toJSON(null===(T=e.message)||void 0===T?void 0:T.speakersChanged):void 0),"roomUpdate"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&(ne.roomUpdate=(null===(R=e.message)||void 0===R?void 0:R.roomUpdate)?IO.toJSON(null===(j=e.message)||void 0===j?void 0:j.roomUpdate):void 0),"connectionQuality"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&(ne.connectionQuality=(null===(_=e.message)||void 0===_?void 0:_.connectionQuality)?AO.toJSON(null===(A=e.message)||void 0===A?void 0:A.connectionQuality):void 0),"streamStateUpdate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&(ne.streamStateUpdate=(null===(N=e.message)||void 0===N?void 0:N.streamStateUpdate)?NO.toJSON(null===(D=e.message)||void 0===D?void 0:D.streamStateUpdate):void 0),"subscribedQualityUpdate"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&(ne.subscribedQualityUpdate=(null===(U=e.message)||void 0===U?void 0:U.subscribedQualityUpdate)?UO.toJSON(null===(B=e.message)||void 0===B?void 0:B.subscribedQualityUpdate):void 0),"subscriptionPermissionUpdate"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&(ne.subscriptionPermissionUpdate=(null===(z=e.message)||void 0===z?void 0:z.subscriptionPermissionUpdate)?zO.toJSON(null===(W=e.message)||void 0===W?void 0:W.subscriptionPermissionUpdate):void 0),"refreshToken"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&(ne.refreshToken=null===(H=e.message)||void 0===H?void 0:H.refreshToken),"trackUnpublished"===(null===(q=e.message)||void 0===q?void 0:q.$case)&&(ne.trackUnpublished=(null===($=e.message)||void 0===$?void 0:$.trackUnpublished)?wO.toJSON(null===(V=e.message)||void 0===V?void 0:V.trackUnpublished):void 0),"pong"===(null===(G=e.message)||void 0===G?void 0:G.$case)&&(ne.pong=Math.round(null===(J=e.message)||void 0===J?void 0:J.pong)),"reconnect"===(null===(K=e.message)||void 0===K?void 0:K.$case)&&(ne.reconnect=(null===(Y=e.message)||void 0===Y?void 0:Y.reconnect)?gO.toJSON(null===(Q=e.message)||void 0===Q?void 0:Q.reconnect):void 0),"pongResp"===(null===(X=e.message)||void 0===X?void 0:X.$case)&&(ne.pongResp=(null===(ee=e.message)||void 0===ee?void 0:ee.pongResp)?$O.toJSON(null===(te=e.message)||void 0===te?void 0:te.pongResp):void 0),ne},create:e=>fO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q,$,V,G,J,K,Y,Q,X,ee,te,ne,re;const oe={message:void 0};return"join"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.message)||void 0===n?void 0:n.join)&&null!==(null===(r=e.message)||void 0===r?void 0:r.join)&&(oe.message={$case:"join",join:bO.fromPartial(e.message.join)}),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.message)||void 0===i?void 0:i.answer)&&null!==(null===(a=e.message)||void 0===a?void 0:a.answer)&&(oe.message={$case:"answer",answer:kO.fromPartial(e.message.answer)}),"offer"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.message)||void 0===c?void 0:c.offer)&&null!==(null===(l=e.message)||void 0===l?void 0:l.offer)&&(oe.message={$case:"offer",offer:kO.fromPartial(e.message.offer)}),"trickle"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.message)||void 0===d?void 0:d.trickle)&&null!==(null===(p=e.message)||void 0===p?void 0:p.trickle)&&(oe.message={$case:"trickle",trickle:yO.fromPartial(e.message.trickle)}),"update"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.message)||void 0===h?void 0:h.update)&&null!==(null===(m=e.message)||void 0===m?void 0:m.update)&&(oe.message={$case:"update",update:OO.fromPartial(e.message.update)}),"trackPublished"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.message)||void 0===v?void 0:v.trackPublished)&&null!==(null===(b=e.message)||void 0===b?void 0:b.trackPublished)&&(oe.message={$case:"trackPublished",trackPublished:SO.fromPartial(e.message.trackPublished)}),"leave"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&void 0!==(null===(S=e.message)||void 0===S?void 0:S.leave)&&null!==(null===(w=e.message)||void 0===w?void 0:w.leave)&&(oe.message={$case:"leave",leave:CO.fromPartial(e.message.leave)}),"mute"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&void 0!==(null===(O=e.message)||void 0===O?void 0:O.mute)&&null!==(null===(P=e.message)||void 0===P?void 0:P.mute)&&(oe.message={$case:"mute",mute:vO.fromPartial(e.message.mute)}),"speakersChanged"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&void 0!==(null===(C=e.message)||void 0===C?void 0:C.speakersChanged)&&null!==(null===(T=e.message)||void 0===T?void 0:T.speakersChanged)&&(oe.message={$case:"speakersChanged",speakersChanged:jO.fromPartial(e.message.speakersChanged)}),"roomUpdate"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&void 0!==(null===(R=e.message)||void 0===R?void 0:R.roomUpdate)&&null!==(null===(j=e.message)||void 0===j?void 0:j.roomUpdate)&&(oe.message={$case:"roomUpdate",roomUpdate:IO.fromPartial(e.message.roomUpdate)}),"connectionQuality"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&void 0!==(null===(_=e.message)||void 0===_?void 0:_.connectionQuality)&&null!==(null===(A=e.message)||void 0===A?void 0:A.connectionQuality)&&(oe.message={$case:"connectionQuality",connectionQuality:AO.fromPartial(e.message.connectionQuality)}),"streamStateUpdate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&void 0!==(null===(N=e.message)||void 0===N?void 0:N.streamStateUpdate)&&null!==(null===(D=e.message)||void 0===D?void 0:D.streamStateUpdate)&&(oe.message={$case:"streamStateUpdate",streamStateUpdate:NO.fromPartial(e.message.streamStateUpdate)}),"subscribedQualityUpdate"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&void 0!==(null===(U=e.message)||void 0===U?void 0:U.subscribedQualityUpdate)&&null!==(null===(B=e.message)||void 0===B?void 0:B.subscribedQualityUpdate)&&(oe.message={$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.fromPartial(e.message.subscribedQualityUpdate)}),"subscriptionPermissionUpdate"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&void 0!==(null===(z=e.message)||void 0===z?void 0:z.subscriptionPermissionUpdate)&&null!==(null===(W=e.message)||void 0===W?void 0:W.subscriptionPermissionUpdate)&&(oe.message={$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.fromPartial(e.message.subscriptionPermissionUpdate)}),"refreshToken"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&void 0!==(null===(H=e.message)||void 0===H?void 0:H.refreshToken)&&null!==(null===(q=e.message)||void 0===q?void 0:q.refreshToken)&&(oe.message={$case:"refreshToken",refreshToken:e.message.refreshToken}),"trackUnpublished"===(null===($=e.message)||void 0===$?void 0:$.$case)&&void 0!==(null===(V=e.message)||void 0===V?void 0:V.trackUnpublished)&&null!==(null===(G=e.message)||void 0===G?void 0:G.trackUnpublished)&&(oe.message={$case:"trackUnpublished",trackUnpublished:wO.fromPartial(e.message.trackUnpublished)}),"pong"===(null===(J=e.message)||void 0===J?void 0:J.$case)&&void 0!==(null===(K=e.message)||void 0===K?void 0:K.pong)&&null!==(null===(Y=e.message)||void 0===Y?void 0:Y.pong)&&(oe.message={$case:"pong",pong:e.message.pong}),"reconnect"===(null===(Q=e.message)||void 0===Q?void 0:Q.$case)&&void 0!==(null===(X=e.message)||void 0===X?void 0:X.reconnect)&&null!==(null===(ee=e.message)||void 0===ee?void 0:ee.reconnect)&&(oe.message={$case:"reconnect",reconnect:gO.fromPartial(e.message.reconnect)}),"pongResp"===(null===(te=e.message)||void 0===te?void 0:te.$case)&&void 0!==(null===(ne=e.message)||void 0===ne?void 0:ne.pongResp)&&null!==(null===(re=e.message)||void 0===re?void 0:re.pongResp)&&(oe.message={$case:"pongResp",pongResp:$O.fromPartial(e.message.pongResp)}),oe}},hO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.codec&&t.uint32(10).string(e.codec),""!==e.cid&&t.uint32(18).string(e.cid),!0===e.enableSimulcastLayers&&t.uint32(24).bool(e.enableSimulcastLayers),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codec:"",cid:"",enableSimulcastLayers:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.codec=n.string();continue;case 2:if(18!=e)break;o.cid=n.string();continue;case 3:if(24!=e)break;o.enableSimulcastLayers=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codec:tP(e.codec)?String(e.codec):"",cid:tP(e.cid)?String(e.cid):"",enableSimulcastLayers:!!tP(e.enableSimulcastLayers)&&Boolean(e.enableSimulcastLayers)}),toJSON(e){const t={};return void 0!==e.codec&&(t.codec=e.codec),void 0!==e.cid&&(t.cid=e.cid),void 0!==e.enableSimulcastLayers&&(t.enableSimulcastLayers=e.enableSimulcastLayers),t},create:e=>hO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={codec:"",cid:"",enableSimulcastLayers:!1};return o.codec=null!==(t=e.codec)&&void 0!==t?t:"",o.cid=null!==(n=e.cid)&&void 0!==n?n:"",o.enableSimulcastLayers=null!==(r=e.enableSimulcastLayers)&&void 0!==r&&r,o}},mO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.cid&&t.uint32(10).string(e.cid),""!==e.name&&t.uint32(18).string(e.name),0!==e.type&&t.uint32(24).int32(e.type),0!==e.width&&t.uint32(32).uint32(e.width),0!==e.height&&t.uint32(40).uint32(e.height),!0===e.muted&&t.uint32(48).bool(e.muted),!0===e.disableDtx&&t.uint32(56).bool(e.disableDtx),0!==e.source&&t.uint32(64).int32(e.source);for(const n of e.layers)Iw.encode(n,t.uint32(74).fork()).ldelim();for(const n of e.simulcastCodecs)hO.encode(n,t.uint32(82).fork()).ldelim();return""!==e.sid&&t.uint32(90).string(e.sid),!0===e.stereo&&t.uint32(96).bool(e.stereo),!0===e.disableRed&&t.uint32(104).bool(e.disableRed),0!==e.encryption&&t.uint32(112).int32(e.encryption),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={cid:"",name:"",type:0,width:0,height:0,muted:!1,disableDtx:!1,source:0,layers:[],simulcastCodecs:[],sid:"",stereo:!1,disableRed:!1,encryption:0};for(;n.pos>>3){case 1:if(10!=e)break;o.cid=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue;case 3:if(24!=e)break;o.type=n.int32();continue;case 4:if(32!=e)break;o.width=n.uint32();continue;case 5:if(40!=e)break;o.height=n.uint32();continue;case 6:if(48!=e)break;o.muted=n.bool();continue;case 7:if(56!=e)break;o.disableDtx=n.bool();continue;case 8:if(64!=e)break;o.source=n.int32();continue;case 9:if(74!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue;case 10:if(82!=e)break;o.simulcastCodecs.push(hO.decode(n,n.uint32()));continue;case 11:if(90!=e)break;o.sid=n.string();continue;case 12:if(96!=e)break;o.stereo=n.bool();continue;case 13:if(104!=e)break;o.disableRed=n.bool();continue;case 14:if(112!=e)break;o.encryption=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({cid:tP(e.cid)?String(e.cid):"",name:tP(e.name)?String(e.name):"",type:tP(e.type)?lw(e.type):0,width:tP(e.width)?Number(e.width):0,height:tP(e.height)?Number(e.height):0,muted:!!tP(e.muted)&&Boolean(e.muted),disableDtx:!!tP(e.disableDtx)&&Boolean(e.disableDtx),source:tP(e.source)?dw(e.source):0,layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[],simulcastCodecs:Array.isArray(null==e?void 0:e.simulcastCodecs)?e.simulcastCodecs.map((e=>hO.fromJSON(e))):[],sid:tP(e.sid)?String(e.sid):"",stereo:!!tP(e.stereo)&&Boolean(e.stereo),disableRed:!!tP(e.disableRed)&&Boolean(e.disableRed),encryption:tP(e.encryption)?Sw(e.encryption):0}),toJSON(e){const t={};return void 0!==e.cid&&(t.cid=e.cid),void 0!==e.name&&(t.name=e.name),void 0!==e.type&&(t.type=uw(e.type)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.disableDtx&&(t.disableDtx=e.disableDtx),void 0!==e.source&&(t.source=pw(e.source)),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],e.simulcastCodecs?t.simulcastCodecs=e.simulcastCodecs.map((e=>e?hO.toJSON(e):void 0)):t.simulcastCodecs=[],void 0!==e.sid&&(t.sid=e.sid),void 0!==e.stereo&&(t.stereo=e.stereo),void 0!==e.disableRed&&(t.disableRed=e.disableRed),void 0!==e.encryption&&(t.encryption=ww(e.encryption)),t},create:e=>mO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h;const m={cid:"",name:"",type:0,width:0,height:0,muted:!1,disableDtx:!1,source:0,layers:[],simulcastCodecs:[],sid:"",stereo:!1,disableRed:!1,encryption:0};return m.cid=null!==(t=e.cid)&&void 0!==t?t:"",m.name=null!==(n=e.name)&&void 0!==n?n:"",m.type=null!==(r=e.type)&&void 0!==r?r:0,m.width=null!==(o=e.width)&&void 0!==o?o:0,m.height=null!==(i=e.height)&&void 0!==i?i:0,m.muted=null!==(a=e.muted)&&void 0!==a&&a,m.disableDtx=null!==(s=e.disableDtx)&&void 0!==s&&s,m.source=null!==(c=e.source)&&void 0!==c?c:0,m.layers=(null===(l=e.layers)||void 0===l?void 0:l.map((e=>Iw.fromPartial(e))))||[],m.simulcastCodecs=(null===(u=e.simulcastCodecs)||void 0===u?void 0:u.map((e=>hO.fromPartial(e))))||[],m.sid=null!==(d=e.sid)&&void 0!==d?d:"",m.stereo=null!==(p=e.stereo)&&void 0!==p&&p,m.disableRed=null!==(f=e.disableRed)&&void 0!==f&&f,m.encryption=null!==(h=e.encryption)&&void 0!==h?h:0,m}},yO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.candidateInit&&t.uint32(10).string(e.candidateInit),0!==e.target&&t.uint32(16).int32(e.target),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={candidateInit:"",target:0};for(;n.pos>>3){case 1:if(10!=e)break;o.candidateInit=n.string();continue;case 2:if(16!=e)break;o.target=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({candidateInit:tP(e.candidateInit)?String(e.candidateInit):"",target:tP(e.target)?cO(e.target):0}),toJSON(e){const t={};return void 0!==e.candidateInit&&(t.candidateInit=e.candidateInit),void 0!==e.target&&(t.target=lO(e.target)),t},create:e=>yO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={candidateInit:"",target:0};return r.candidateInit=null!==(t=e.candidateInit)&&void 0!==t?t:"",r.target=null!==(n=e.target)&&void 0!==n?n:0,r}},vO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.sid&&t.uint32(10).string(e.sid),!0===e.muted&&t.uint32(16).bool(e.muted),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",muted:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(16!=e)break;o.muted=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:tP(e.sid)?String(e.sid):"",muted:!!tP(e.muted)&&Boolean(e.muted)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.muted&&(t.muted=e.muted),t},create:e=>vO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={sid:"",muted:!1};return r.sid=null!==(t=e.sid)&&void 0!==t?t:"",r.muted=null!==(n=e.muted)&&void 0!==n&&n,r}},bO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();void 0!==e.room&&Ew.encode(e.room,t.uint32(10).fork()).ldelim(),void 0!==e.participant&&xw.encode(e.participant,t.uint32(18).fork()).ldelim();for(const n of e.otherParticipants)xw.encode(n,t.uint32(26).fork()).ldelim();""!==e.serverVersion&&t.uint32(34).string(e.serverVersion);for(const n of e.iceServers)RO.encode(n,t.uint32(42).fork()).ldelim();return!0===e.subscriberPrimary&&t.uint32(48).bool(e.subscriberPrimary),""!==e.alternativeUrl&&t.uint32(58).string(e.alternativeUrl),void 0!==e.clientConfiguration&&Fw.encode(e.clientConfiguration,t.uint32(66).fork()).ldelim(),""!==e.serverRegion&&t.uint32(74).string(e.serverRegion),0!==e.pingTimeout&&t.uint32(80).int32(e.pingTimeout),0!==e.pingInterval&&t.uint32(88).int32(e.pingInterval),void 0!==e.serverInfo&&Uw.encode(e.serverInfo,t.uint32(98).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={room:void 0,participant:void 0,otherParticipants:[],serverVersion:"",iceServers:[],subscriberPrimary:!1,alternativeUrl:"",clientConfiguration:void 0,serverRegion:"",pingTimeout:0,pingInterval:0,serverInfo:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.room=Ew.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.participant=xw.decode(n,n.uint32());continue;case 3:if(26!=e)break;o.otherParticipants.push(xw.decode(n,n.uint32()));continue;case 4:if(34!=e)break;o.serverVersion=n.string();continue;case 5:if(42!=e)break;o.iceServers.push(RO.decode(n,n.uint32()));continue;case 6:if(48!=e)break;o.subscriberPrimary=n.bool();continue;case 7:if(58!=e)break;o.alternativeUrl=n.string();continue;case 8:if(66!=e)break;o.clientConfiguration=Fw.decode(n,n.uint32());continue;case 9:if(74!=e)break;o.serverRegion=n.string();continue;case 10:if(80!=e)break;o.pingTimeout=n.int32();continue;case 11:if(88!=e)break;o.pingInterval=n.int32();continue;case 12:if(98!=e)break;o.serverInfo=Uw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({room:tP(e.room)?Ew.fromJSON(e.room):void 0,participant:tP(e.participant)?xw.fromJSON(e.participant):void 0,otherParticipants:Array.isArray(null==e?void 0:e.otherParticipants)?e.otherParticipants.map((e=>xw.fromJSON(e))):[],serverVersion:tP(e.serverVersion)?String(e.serverVersion):"",iceServers:Array.isArray(null==e?void 0:e.iceServers)?e.iceServers.map((e=>RO.fromJSON(e))):[],subscriberPrimary:!!tP(e.subscriberPrimary)&&Boolean(e.subscriberPrimary),alternativeUrl:tP(e.alternativeUrl)?String(e.alternativeUrl):"",clientConfiguration:tP(e.clientConfiguration)?Fw.fromJSON(e.clientConfiguration):void 0,serverRegion:tP(e.serverRegion)?String(e.serverRegion):"",pingTimeout:tP(e.pingTimeout)?Number(e.pingTimeout):0,pingInterval:tP(e.pingInterval)?Number(e.pingInterval):0,serverInfo:tP(e.serverInfo)?Uw.fromJSON(e.serverInfo):void 0}),toJSON(e){const t={};return void 0!==e.room&&(t.room=e.room?Ew.toJSON(e.room):void 0),void 0!==e.participant&&(t.participant=e.participant?xw.toJSON(e.participant):void 0),e.otherParticipants?t.otherParticipants=e.otherParticipants.map((e=>e?xw.toJSON(e):void 0)):t.otherParticipants=[],void 0!==e.serverVersion&&(t.serverVersion=e.serverVersion),e.iceServers?t.iceServers=e.iceServers.map((e=>e?RO.toJSON(e):void 0)):t.iceServers=[],void 0!==e.subscriberPrimary&&(t.subscriberPrimary=e.subscriberPrimary),void 0!==e.alternativeUrl&&(t.alternativeUrl=e.alternativeUrl),void 0!==e.clientConfiguration&&(t.clientConfiguration=e.clientConfiguration?Fw.toJSON(e.clientConfiguration):void 0),void 0!==e.serverRegion&&(t.serverRegion=e.serverRegion),void 0!==e.pingTimeout&&(t.pingTimeout=Math.round(e.pingTimeout)),void 0!==e.pingInterval&&(t.pingInterval=Math.round(e.pingInterval)),void 0!==e.serverInfo&&(t.serverInfo=e.serverInfo?Uw.toJSON(e.serverInfo):void 0),t},create:e=>bO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c;const l={room:void 0,participant:void 0,otherParticipants:[],serverVersion:"",iceServers:[],subscriberPrimary:!1,alternativeUrl:"",clientConfiguration:void 0,serverRegion:"",pingTimeout:0,pingInterval:0,serverInfo:void 0};return l.room=void 0!==e.room&&null!==e.room?Ew.fromPartial(e.room):void 0,l.participant=void 0!==e.participant&&null!==e.participant?xw.fromPartial(e.participant):void 0,l.otherParticipants=(null===(t=e.otherParticipants)||void 0===t?void 0:t.map((e=>xw.fromPartial(e))))||[],l.serverVersion=null!==(n=e.serverVersion)&&void 0!==n?n:"",l.iceServers=(null===(r=e.iceServers)||void 0===r?void 0:r.map((e=>RO.fromPartial(e))))||[],l.subscriberPrimary=null!==(o=e.subscriberPrimary)&&void 0!==o&&o,l.alternativeUrl=null!==(i=e.alternativeUrl)&&void 0!==i?i:"",l.clientConfiguration=void 0!==e.clientConfiguration&&null!==e.clientConfiguration?Fw.fromPartial(e.clientConfiguration):void 0,l.serverRegion=null!==(a=e.serverRegion)&&void 0!==a?a:"",l.pingTimeout=null!==(s=e.pingTimeout)&&void 0!==s?s:0,l.pingInterval=null!==(c=e.pingInterval)&&void 0!==c?c:0,l.serverInfo=void 0!==e.serverInfo&&null!==e.serverInfo?Uw.fromPartial(e.serverInfo):void 0,l}},gO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.iceServers)RO.encode(n,t.uint32(10).fork()).ldelim();return void 0!==e.clientConfiguration&&Fw.encode(e.clientConfiguration,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={iceServers:[],clientConfiguration:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.iceServers.push(RO.decode(n,n.uint32()));continue;case 2:if(18!=e)break;o.clientConfiguration=Fw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({iceServers:Array.isArray(null==e?void 0:e.iceServers)?e.iceServers.map((e=>RO.fromJSON(e))):[],clientConfiguration:tP(e.clientConfiguration)?Fw.fromJSON(e.clientConfiguration):void 0}),toJSON(e){const t={};return e.iceServers?t.iceServers=e.iceServers.map((e=>e?RO.toJSON(e):void 0)):t.iceServers=[],void 0!==e.clientConfiguration&&(t.clientConfiguration=e.clientConfiguration?Fw.toJSON(e.clientConfiguration):void 0),t},create:e=>gO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={iceServers:[],clientConfiguration:void 0};return n.iceServers=(null===(t=e.iceServers)||void 0===t?void 0:t.map((e=>RO.fromPartial(e))))||[],n.clientConfiguration=void 0!==e.clientConfiguration&&null!==e.clientConfiguration?Fw.fromPartial(e.clientConfiguration):void 0,n}},SO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.cid&&t.uint32(10).string(e.cid),void 0!==e.track&&jw.encode(e.track,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={cid:"",track:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.cid=n.string();continue;case 2:if(18!=e)break;o.track=jw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({cid:tP(e.cid)?String(e.cid):"",track:tP(e.track)?jw.fromJSON(e.track):void 0}),toJSON(e){const t={};return void 0!==e.cid&&(t.cid=e.cid),void 0!==e.track&&(t.track=e.track?jw.toJSON(e.track):void 0),t},create:e=>SO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={cid:"",track:void 0};return n.cid=null!==(t=e.cid)&&void 0!==t?t:"",n.track=void 0!==e.track&&null!==e.track?jw.fromPartial(e.track):void 0,n}},wO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.trackSid&&t.uint32(10).string(e.trackSid),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:""};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):""}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),t},create:e=>wO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={trackSid:""};return n.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",n}},kO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.type&&t.uint32(10).string(e.type),""!==e.sdp&&t.uint32(18).string(e.sdp),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={type:"",sdp:""};for(;n.pos>>3){case 1:if(10!=e)break;o.type=n.string();continue;case 2:if(18!=e)break;o.sdp=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({type:tP(e.type)?String(e.type):"",sdp:tP(e.sdp)?String(e.sdp):""}),toJSON(e){const t={};return void 0!==e.type&&(t.type=e.type),void 0!==e.sdp&&(t.sdp=e.sdp),t},create:e=>kO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={type:"",sdp:""};return r.type=null!==(t=e.type)&&void 0!==t?t:"",r.sdp=null!==(n=e.sdp)&&void 0!==n?n:"",r}},OO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.participants)xw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participants:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.participants.push(xw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participants:Array.isArray(null==e?void 0:e.participants)?e.participants.map((e=>xw.fromJSON(e))):[]}),toJSON(e){const t={};return e.participants?t.participants=e.participants.map((e=>e?xw.toJSON(e):void 0)):t.participants=[],t},create:e=>OO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={participants:[]};return n.participants=(null===(t=e.participants)||void 0===t?void 0:t.map((e=>xw.fromPartial(e))))||[],n}},PO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.trackSids)t.uint32(10).string(n);!0===e.subscribe&&t.uint32(16).bool(e.subscribe);for(const n of e.participantTracks)Lw.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSids:[],subscribe:!1,participantTracks:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSids.push(n.string());continue;case 2:if(16!=e)break;o.subscribe=n.bool();continue;case 3:if(26!=e)break;o.participantTracks.push(Lw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],subscribe:!!tP(e.subscribe)&&Boolean(e.subscribe),participantTracks:Array.isArray(null==e?void 0:e.participantTracks)?e.participantTracks.map((e=>Lw.fromJSON(e))):[]}),toJSON(e){const t={};return e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.subscribe&&(t.subscribe=e.subscribe),e.participantTracks?t.participantTracks=e.participantTracks.map((e=>e?Lw.toJSON(e):void 0)):t.participantTracks=[],t},create:e=>PO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={trackSids:[],subscribe:!1,participantTracks:[]};return o.trackSids=(null===(t=e.trackSids)||void 0===t?void 0:t.map((e=>e)))||[],o.subscribe=null!==(n=e.subscribe)&&void 0!==n&&n,o.participantTracks=(null===(r=e.participantTracks)||void 0===r?void 0:r.map((e=>Lw.fromPartial(e))))||[],o}},EO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.trackSids)t.uint32(10).string(n);return!0===e.disabled&&t.uint32(24).bool(e.disabled),0!==e.quality&&t.uint32(32).int32(e.quality),0!==e.width&&t.uint32(40).uint32(e.width),0!==e.height&&t.uint32(48).uint32(e.height),0!==e.fps&&t.uint32(56).uint32(e.fps),0!==e.priority&&t.uint32(64).uint32(e.priority),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSids:[],disabled:!1,quality:0,width:0,height:0,fps:0,priority:0};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSids.push(n.string());continue;case 3:if(24!=e)break;o.disabled=n.bool();continue;case 4:if(32!=e)break;o.quality=n.int32();continue;case 5:if(40!=e)break;o.width=n.uint32();continue;case 6:if(48!=e)break;o.height=n.uint32();continue;case 7:if(56!=e)break;o.fps=n.uint32();continue;case 8:if(64!=e)break;o.priority=n.uint32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],disabled:!!tP(e.disabled)&&Boolean(e.disabled),quality:tP(e.quality)?fw(e.quality):0,width:tP(e.width)?Number(e.width):0,height:tP(e.height)?Number(e.height):0,fps:tP(e.fps)?Number(e.fps):0,priority:tP(e.priority)?Number(e.priority):0}),toJSON(e){const t={};return e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.disabled&&(t.disabled=e.disabled),void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.fps&&(t.fps=Math.round(e.fps)),void 0!==e.priority&&(t.priority=Math.round(e.priority)),t},create:e=>EO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={trackSids:[],disabled:!1,quality:0,width:0,height:0,fps:0,priority:0};return c.trackSids=(null===(t=e.trackSids)||void 0===t?void 0:t.map((e=>e)))||[],c.disabled=null!==(n=e.disabled)&&void 0!==n&&n,c.quality=null!==(r=e.quality)&&void 0!==r?r:0,c.width=null!==(o=e.width)&&void 0!==o?o:0,c.height=null!==(i=e.height)&&void 0!==i?i:0,c.fps=null!==(a=e.fps)&&void 0!==a?a:0,c.priority=null!==(s=e.priority)&&void 0!==s?s:0,c}},CO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return!0===e.canReconnect&&t.uint32(8).bool(e.canReconnect),0!==e.reason&&t.uint32(16).int32(e.reason),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={canReconnect:!1,reason:0};for(;n.pos>>3){case 1:if(8!=e)break;o.canReconnect=n.bool();continue;case 2:if(16!=e)break;o.reason=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({canReconnect:!!tP(e.canReconnect)&&Boolean(e.canReconnect),reason:tP(e.reason)?bw(e.reason):0}),toJSON(e){const t={};return void 0!==e.canReconnect&&(t.canReconnect=e.canReconnect),void 0!==e.reason&&(t.reason=function(e){switch(e){case ew.UNKNOWN_REASON:return"UNKNOWN_REASON";case ew.CLIENT_INITIATED:return"CLIENT_INITIATED";case ew.DUPLICATE_IDENTITY:return"DUPLICATE_IDENTITY";case ew.SERVER_SHUTDOWN:return"SERVER_SHUTDOWN";case ew.PARTICIPANT_REMOVED:return"PARTICIPANT_REMOVED";case ew.ROOM_DELETED:return"ROOM_DELETED";case ew.STATE_MISMATCH:return"STATE_MISMATCH";case ew.JOIN_FAILURE:return"JOIN_FAILURE";case ew.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.reason)),t},create:e=>CO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={canReconnect:!1,reason:0};return r.canReconnect=null!==(t=e.canReconnect)&&void 0!==t&&t,r.reason=null!==(n=e.reason)&&void 0!==n?n:0,r}},TO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.trackSid&&t.uint32(10).string(e.trackSid);for(const n of e.layers)Iw.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:"",layers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue;case 2:if(18!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):"",layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],t},create:e=>TO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={trackSid:"",layers:[]};return r.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",r.layers=(null===(n=e.layers)||void 0===n?void 0:n.map((e=>Iw.fromPartial(e))))||[],r}},xO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.metadata&&t.uint32(10).string(e.metadata),""!==e.name&&t.uint32(18).string(e.name),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={metadata:"",name:""};for(;n.pos>>3){case 1:if(10!=e)break;o.metadata=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({metadata:tP(e.metadata)?String(e.metadata):"",name:tP(e.name)?String(e.name):""}),toJSON(e){const t={};return void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.name&&(t.name=e.name),t},create:e=>xO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={metadata:"",name:""};return r.metadata=null!==(t=e.metadata)&&void 0!==t?t:"",r.name=null!==(n=e.name)&&void 0!==n?n:"",r}},RO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.urls)t.uint32(10).string(n);return""!==e.username&&t.uint32(18).string(e.username),""!==e.credential&&t.uint32(26).string(e.credential),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={urls:[],username:"",credential:""};for(;n.pos>>3){case 1:if(10!=e)break;o.urls.push(n.string());continue;case 2:if(18!=e)break;o.username=n.string();continue;case 3:if(26!=e)break;o.credential=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({urls:Array.isArray(null==e?void 0:e.urls)?e.urls.map((e=>String(e))):[],username:tP(e.username)?String(e.username):"",credential:tP(e.credential)?String(e.credential):""}),toJSON(e){const t={};return e.urls?t.urls=e.urls.map((e=>e)):t.urls=[],void 0!==e.username&&(t.username=e.username),void 0!==e.credential&&(t.credential=e.credential),t},create:e=>RO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={urls:[],username:"",credential:""};return o.urls=(null===(t=e.urls)||void 0===t?void 0:t.map((e=>e)))||[],o.username=null!==(n=e.username)&&void 0!==n?n:"",o.credential=null!==(r=e.credential)&&void 0!==r?r:"",o}},jO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.speakers)Mw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={speakers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.speakers.push(Mw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({speakers:Array.isArray(null==e?void 0:e.speakers)?e.speakers.map((e=>Mw.fromJSON(e))):[]}),toJSON(e){const t={};return e.speakers?t.speakers=e.speakers.map((e=>e?Mw.toJSON(e):void 0)):t.speakers=[],t},create:e=>jO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={speakers:[]};return n.speakers=(null===(t=e.speakers)||void 0===t?void 0:t.map((e=>Mw.fromPartial(e))))||[],n}},IO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return void 0!==e.room&&Ew.encode(e.room,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={room:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.room=Ew.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({room:tP(e.room)?Ew.fromJSON(e.room):void 0}),toJSON(e){const t={};return void 0!==e.room&&(t.room=e.room?Ew.toJSON(e.room):void 0),t},create:e=>IO.fromPartial(null!=e?e:{}),fromPartial(e){const t={room:void 0};return t.room=void 0!==e.room&&null!==e.room?Ew.fromPartial(e.room):void 0,t}},_O={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),0!==e.quality&&t.uint32(16).int32(e.quality),0!==e.score&&t.uint32(29).float(e.score),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",quality:0,score:0};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(16!=e)break;o.quality=n.int32();continue;case 3:if(29!=e)break;o.score=n.float();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",quality:tP(e.quality)?mw(e.quality):0,score:tP(e.score)?Number(e.score):0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.quality&&(t.quality=function(e){switch(e){case QS.POOR:return"POOR";case QS.GOOD:return"GOOD";case QS.EXCELLENT:return"EXCELLENT";case QS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.quality)),void 0!==e.score&&(t.score=e.score),t},create:e=>_O.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",quality:0,score:0};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.quality=null!==(n=e.quality)&&void 0!==n?n:0,o.score=null!==(r=e.score)&&void 0!==r?r:0,o}},AO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.updates)_O.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={updates:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.updates.push(_O.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({updates:Array.isArray(null==e?void 0:e.updates)?e.updates.map((e=>_O.fromJSON(e))):[]}),toJSON(e){const t={};return e.updates?t.updates=e.updates.map((e=>e?_O.toJSON(e):void 0)):t.updates=[],t},create:e=>AO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={updates:[]};return n.updates=(null===(t=e.updates)||void 0===t?void 0:t.map((e=>_O.fromPartial(e))))||[],n}},MO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),""!==e.trackSid&&t.uint32(18).string(e.trackSid),0!==e.state&&t.uint32(24).int32(e.state),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSid:"",state:0};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSid=n.string();continue;case 3:if(24!=e)break;o.state=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",trackSid:tP(e.trackSid)?String(e.trackSid):"",state:tP(e.state)?uO(e.state):0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.trackSid&&(t.trackSid=e.trackSid),void 0!==e.state&&(t.state=function(e){switch(e){case iO.ACTIVE:return"ACTIVE";case iO.PAUSED:return"PAUSED";case iO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.state)),t},create:e=>MO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",trackSid:"",state:0};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.trackSid=null!==(n=e.trackSid)&&void 0!==n?n:"",o.state=null!==(r=e.state)&&void 0!==r?r:0,o}},NO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.streamStates)MO.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={streamStates:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.streamStates.push(MO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({streamStates:Array.isArray(null==e?void 0:e.streamStates)?e.streamStates.map((e=>MO.fromJSON(e))):[]}),toJSON(e){const t={};return e.streamStates?t.streamStates=e.streamStates.map((e=>e?MO.toJSON(e):void 0)):t.streamStates=[],t},create:e=>NO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={streamStates:[]};return n.streamStates=(null===(t=e.streamStates)||void 0===t?void 0:t.map((e=>MO.fromPartial(e))))||[],n}},DO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.quality&&t.uint32(8).int32(e.quality),!0===e.enabled&&t.uint32(16).bool(e.enabled),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={quality:0,enabled:!1};for(;n.pos>>3){case 1:if(8!=e)break;o.quality=n.int32();continue;case 2:if(16!=e)break;o.enabled=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({quality:tP(e.quality)?fw(e.quality):0,enabled:!!tP(e.enabled)&&Boolean(e.enabled)}),toJSON(e){const t={};return void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.enabled&&(t.enabled=e.enabled),t},create:e=>DO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={quality:0,enabled:!1};return r.quality=null!==(t=e.quality)&&void 0!==t?t:0,r.enabled=null!==(n=e.enabled)&&void 0!==n&&n,r}},LO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.codec&&t.uint32(10).string(e.codec);for(const n of e.qualities)DO.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codec:"",qualities:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.codec=n.string();continue;case 2:if(18!=e)break;o.qualities.push(DO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codec:tP(e.codec)?String(e.codec):"",qualities:Array.isArray(null==e?void 0:e.qualities)?e.qualities.map((e=>DO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.codec&&(t.codec=e.codec),e.qualities?t.qualities=e.qualities.map((e=>e?DO.toJSON(e):void 0)):t.qualities=[],t},create:e=>LO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={codec:"",qualities:[]};return r.codec=null!==(t=e.codec)&&void 0!==t?t:"",r.qualities=(null===(n=e.qualities)||void 0===n?void 0:n.map((e=>DO.fromPartial(e))))||[],r}},UO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.trackSid&&t.uint32(10).string(e.trackSid);for(const n of e.subscribedQualities)DO.encode(n,t.uint32(18).fork()).ldelim();for(const n of e.subscribedCodecs)LO.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:"",subscribedQualities:[],subscribedCodecs:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue;case 2:if(18!=e)break;o.subscribedQualities.push(DO.decode(n,n.uint32()));continue;case 3:if(26!=e)break;o.subscribedCodecs.push(LO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):"",subscribedQualities:Array.isArray(null==e?void 0:e.subscribedQualities)?e.subscribedQualities.map((e=>DO.fromJSON(e))):[],subscribedCodecs:Array.isArray(null==e?void 0:e.subscribedCodecs)?e.subscribedCodecs.map((e=>LO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),e.subscribedQualities?t.subscribedQualities=e.subscribedQualities.map((e=>e?DO.toJSON(e):void 0)):t.subscribedQualities=[],e.subscribedCodecs?t.subscribedCodecs=e.subscribedCodecs.map((e=>e?LO.toJSON(e):void 0)):t.subscribedCodecs=[],t},create:e=>UO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={trackSid:"",subscribedQualities:[],subscribedCodecs:[]};return o.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",o.subscribedQualities=(null===(n=e.subscribedQualities)||void 0===n?void 0:n.map((e=>DO.fromPartial(e))))||[],o.subscribedCodecs=(null===(r=e.subscribedCodecs)||void 0===r?void 0:r.map((e=>LO.fromPartial(e))))||[],o}},BO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid),!0===e.allTracks&&t.uint32(16).bool(e.allTracks);for(const n of e.trackSids)t.uint32(26).string(n);return""!==e.participantIdentity&&t.uint32(34).string(e.participantIdentity),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",allTracks:!1,trackSids:[],participantIdentity:""};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(16!=e)break;o.allTracks=n.bool();continue;case 3:if(26!=e)break;o.trackSids.push(n.string());continue;case 4:if(34!=e)break;o.participantIdentity=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",allTracks:!!tP(e.allTracks)&&Boolean(e.allTracks),trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],participantIdentity:tP(e.participantIdentity)?String(e.participantIdentity):""}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.allTracks&&(t.allTracks=e.allTracks),e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.participantIdentity&&(t.participantIdentity=e.participantIdentity),t},create:e=>BO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i={participantSid:"",allTracks:!1,trackSids:[],participantIdentity:""};return i.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",i.allTracks=null!==(n=e.allTracks)&&void 0!==n&&n,i.trackSids=(null===(r=e.trackSids)||void 0===r?void 0:r.map((e=>e)))||[],i.participantIdentity=null!==(o=e.participantIdentity)&&void 0!==o?o:"",i}},FO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();!0===e.allParticipants&&t.uint32(8).bool(e.allParticipants);for(const n of e.trackPermissions)BO.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={allParticipants:!1,trackPermissions:[]};for(;n.pos>>3){case 1:if(8!=e)break;o.allParticipants=n.bool();continue;case 2:if(18!=e)break;o.trackPermissions.push(BO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({allParticipants:!!tP(e.allParticipants)&&Boolean(e.allParticipants),trackPermissions:Array.isArray(null==e?void 0:e.trackPermissions)?e.trackPermissions.map((e=>BO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.allParticipants&&(t.allParticipants=e.allParticipants),e.trackPermissions?t.trackPermissions=e.trackPermissions.map((e=>e?BO.toJSON(e):void 0)):t.trackPermissions=[],t},create:e=>FO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={allParticipants:!1,trackPermissions:[]};return r.allParticipants=null!==(t=e.allParticipants)&&void 0!==t&&t,r.trackPermissions=(null===(n=e.trackPermissions)||void 0===n?void 0:n.map((e=>BO.fromPartial(e))))||[],r}},zO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),""!==e.trackSid&&t.uint32(18).string(e.trackSid),!0===e.allowed&&t.uint32(24).bool(e.allowed),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSid:"",allowed:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSid=n.string();continue;case 3:if(24!=e)break;o.allowed=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",trackSid:tP(e.trackSid)?String(e.trackSid):"",allowed:!!tP(e.allowed)&&Boolean(e.allowed)}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.trackSid&&(t.trackSid=e.trackSid),void 0!==e.allowed&&(t.allowed=e.allowed),t},create:e=>zO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",trackSid:"",allowed:!1};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.trackSid=null!==(n=e.trackSid)&&void 0!==n?n:"",o.allowed=null!==(r=e.allowed)&&void 0!==r&&r,o}},WO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();void 0!==e.answer&&kO.encode(e.answer,t.uint32(10).fork()).ldelim(),void 0!==e.subscription&&PO.encode(e.subscription,t.uint32(18).fork()).ldelim();for(const n of e.publishTracks)SO.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.dataChannels)ZO.encode(n,t.uint32(34).fork()).ldelim();return void 0!==e.offer&&kO.encode(e.offer,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={answer:void 0,subscription:void 0,publishTracks:[],dataChannels:[],offer:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.answer=kO.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.subscription=PO.decode(n,n.uint32());continue;case 3:if(26!=e)break;o.publishTracks.push(SO.decode(n,n.uint32()));continue;case 4:if(34!=e)break;o.dataChannels.push(ZO.decode(n,n.uint32()));continue;case 5:if(42!=e)break;o.offer=kO.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({answer:tP(e.answer)?kO.fromJSON(e.answer):void 0,subscription:tP(e.subscription)?PO.fromJSON(e.subscription):void 0,publishTracks:Array.isArray(null==e?void 0:e.publishTracks)?e.publishTracks.map((e=>SO.fromJSON(e))):[],dataChannels:Array.isArray(null==e?void 0:e.dataChannels)?e.dataChannels.map((e=>ZO.fromJSON(e))):[],offer:tP(e.offer)?kO.fromJSON(e.offer):void 0}),toJSON(e){const t={};return void 0!==e.answer&&(t.answer=e.answer?kO.toJSON(e.answer):void 0),void 0!==e.subscription&&(t.subscription=e.subscription?PO.toJSON(e.subscription):void 0),e.publishTracks?t.publishTracks=e.publishTracks.map((e=>e?SO.toJSON(e):void 0)):t.publishTracks=[],e.dataChannels?t.dataChannels=e.dataChannels.map((e=>e?ZO.toJSON(e):void 0)):t.dataChannels=[],void 0!==e.offer&&(t.offer=e.offer?kO.toJSON(e.offer):void 0),t},create:e=>WO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={answer:void 0,subscription:void 0,publishTracks:[],dataChannels:[],offer:void 0};return r.answer=void 0!==e.answer&&null!==e.answer?kO.fromPartial(e.answer):void 0,r.subscription=void 0!==e.subscription&&null!==e.subscription?PO.fromPartial(e.subscription):void 0,r.publishTracks=(null===(t=e.publishTracks)||void 0===t?void 0:t.map((e=>SO.fromPartial(e))))||[],r.dataChannels=(null===(n=e.dataChannels)||void 0===n?void 0:n.map((e=>ZO.fromPartial(e))))||[],r.offer=void 0!==e.offer&&null!==e.offer?kO.fromPartial(e.offer):void 0,r}},ZO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.label&&t.uint32(10).string(e.label),0!==e.id&&t.uint32(16).uint32(e.id),0!==e.target&&t.uint32(24).int32(e.target),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={label:"",id:0,target:0};for(;n.pos>>3){case 1:if(10!=e)break;o.label=n.string();continue;case 2:if(16!=e)break;o.id=n.uint32();continue;case 3:if(24!=e)break;o.target=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({label:tP(e.label)?String(e.label):"",id:tP(e.id)?Number(e.id):0,target:tP(e.target)?cO(e.target):0}),toJSON(e){const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.id&&(t.id=Math.round(e.id)),void 0!==e.target&&(t.target=lO(e.target)),t},create:e=>ZO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={label:"",id:0,target:0};return o.label=null!==(t=e.label)&&void 0!==t?t:"",o.id=null!==(n=e.id)&&void 0!==n?n:0,o.target=null!==(r=e.target)&&void 0!==r?r:0,o}},HO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.scenario)||void 0===n?void 0:n.$case){case"speakerUpdate":t.uint32(8).int32(e.scenario.speakerUpdate);break;case"nodeFailure":t.uint32(16).bool(e.scenario.nodeFailure);break;case"migration":t.uint32(24).bool(e.scenario.migration);break;case"serverLeave":t.uint32(32).bool(e.scenario.serverLeave);break;case"switchCandidateProtocol":t.uint32(40).int32(e.scenario.switchCandidateProtocol);break;case"subscriberBandwidth":t.uint32(48).int64(e.scenario.subscriberBandwidth)}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={scenario:void 0};for(;n.pos>>3){case 1:if(8!=e)break;o.scenario={$case:"speakerUpdate",speakerUpdate:n.int32()};continue;case 2:if(16!=e)break;o.scenario={$case:"nodeFailure",nodeFailure:n.bool()};continue;case 3:if(24!=e)break;o.scenario={$case:"migration",migration:n.bool()};continue;case 4:if(32!=e)break;o.scenario={$case:"serverLeave",serverLeave:n.bool()};continue;case 5:if(40!=e)break;o.scenario={$case:"switchCandidateProtocol",switchCandidateProtocol:n.int32()};continue;case 6:if(48!=e)break;o.scenario={$case:"subscriberBandwidth",subscriberBandwidth:eP(n.int64())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({scenario:tP(e.speakerUpdate)?{$case:"speakerUpdate",speakerUpdate:Number(e.speakerUpdate)}:tP(e.nodeFailure)?{$case:"nodeFailure",nodeFailure:Boolean(e.nodeFailure)}:tP(e.migration)?{$case:"migration",migration:Boolean(e.migration)}:tP(e.serverLeave)?{$case:"serverLeave",serverLeave:Boolean(e.serverLeave)}:tP(e.switchCandidateProtocol)?{$case:"switchCandidateProtocol",switchCandidateProtocol:dO(e.switchCandidateProtocol)}:tP(e.subscriberBandwidth)?{$case:"subscriberBandwidth",subscriberBandwidth:Number(e.subscriberBandwidth)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f;const h={};return"speakerUpdate"===(null===(t=e.scenario)||void 0===t?void 0:t.$case)&&(h.speakerUpdate=Math.round(null===(n=e.scenario)||void 0===n?void 0:n.speakerUpdate)),"nodeFailure"===(null===(r=e.scenario)||void 0===r?void 0:r.$case)&&(h.nodeFailure=null===(o=e.scenario)||void 0===o?void 0:o.nodeFailure),"migration"===(null===(i=e.scenario)||void 0===i?void 0:i.$case)&&(h.migration=null===(a=e.scenario)||void 0===a?void 0:a.migration),"serverLeave"===(null===(s=e.scenario)||void 0===s?void 0:s.$case)&&(h.serverLeave=null===(c=e.scenario)||void 0===c?void 0:c.serverLeave),"switchCandidateProtocol"===(null===(l=e.scenario)||void 0===l?void 0:l.$case)&&(h.switchCandidateProtocol=void 0!==(null===(u=e.scenario)||void 0===u?void 0:u.switchCandidateProtocol)?function(e){switch(e){case aO.UDP:return"UDP";case aO.TCP:return"TCP";case aO.TLS:return"TLS";case aO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(null===(d=e.scenario)||void 0===d?void 0:d.switchCandidateProtocol):void 0),"subscriberBandwidth"===(null===(p=e.scenario)||void 0===p?void 0:p.$case)&&(h.subscriberBandwidth=Math.round(null===(f=e.scenario)||void 0===f?void 0:f.subscriberBandwidth)),h},create:e=>HO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b;const g={scenario:void 0};return"speakerUpdate"===(null===(t=e.scenario)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.scenario)||void 0===n?void 0:n.speakerUpdate)&&null!==(null===(r=e.scenario)||void 0===r?void 0:r.speakerUpdate)&&(g.scenario={$case:"speakerUpdate",speakerUpdate:e.scenario.speakerUpdate}),"nodeFailure"===(null===(o=e.scenario)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.scenario)||void 0===i?void 0:i.nodeFailure)&&null!==(null===(a=e.scenario)||void 0===a?void 0:a.nodeFailure)&&(g.scenario={$case:"nodeFailure",nodeFailure:e.scenario.nodeFailure}),"migration"===(null===(s=e.scenario)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.scenario)||void 0===c?void 0:c.migration)&&null!==(null===(l=e.scenario)||void 0===l?void 0:l.migration)&&(g.scenario={$case:"migration",migration:e.scenario.migration}),"serverLeave"===(null===(u=e.scenario)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.scenario)||void 0===d?void 0:d.serverLeave)&&null!==(null===(p=e.scenario)||void 0===p?void 0:p.serverLeave)&&(g.scenario={$case:"serverLeave",serverLeave:e.scenario.serverLeave}),"switchCandidateProtocol"===(null===(f=e.scenario)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.scenario)||void 0===h?void 0:h.switchCandidateProtocol)&&null!==(null===(m=e.scenario)||void 0===m?void 0:m.switchCandidateProtocol)&&(g.scenario={$case:"switchCandidateProtocol",switchCandidateProtocol:e.scenario.switchCandidateProtocol}),"subscriberBandwidth"===(null===(y=e.scenario)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.scenario)||void 0===v?void 0:v.subscriberBandwidth)&&null!==(null===(b=e.scenario)||void 0===b?void 0:b.subscriberBandwidth)&&(g.scenario={$case:"subscriberBandwidth",subscriberBandwidth:e.scenario.subscriberBandwidth}),g}},qO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.timestamp&&t.uint32(8).int64(e.timestamp),0!==e.rtt&&t.uint32(16).int64(e.rtt),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={timestamp:0,rtt:0};for(;n.pos>>3){case 1:if(8!=e)break;o.timestamp=eP(n.int64());continue;case 2:if(16!=e)break;o.rtt=eP(n.int64());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({timestamp:tP(e.timestamp)?Number(e.timestamp):0,rtt:tP(e.rtt)?Number(e.rtt):0}),toJSON(e){const t={};return void 0!==e.timestamp&&(t.timestamp=Math.round(e.timestamp)),void 0!==e.rtt&&(t.rtt=Math.round(e.rtt)),t},create:e=>qO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={timestamp:0,rtt:0};return r.timestamp=null!==(t=e.timestamp)&&void 0!==t?t:0,r.rtt=null!==(n=e.rtt)&&void 0!==n?n:0,r}},$O={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.lastPingTimestamp&&t.uint32(8).int64(e.lastPingTimestamp),0!==e.timestamp&&t.uint32(16).int64(e.timestamp),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={lastPingTimestamp:0,timestamp:0};for(;n.pos>>3){case 1:if(8!=e)break;o.lastPingTimestamp=eP(n.int64());continue;case 2:if(16!=e)break;o.timestamp=eP(n.int64());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({lastPingTimestamp:tP(e.lastPingTimestamp)?Number(e.lastPingTimestamp):0,timestamp:tP(e.timestamp)?Number(e.timestamp):0}),toJSON(e){const t={};return void 0!==e.lastPingTimestamp&&(t.lastPingTimestamp=Math.round(e.lastPingTimestamp)),void 0!==e.timestamp&&(t.timestamp=Math.round(e.timestamp)),t},create:e=>$O.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={lastPingTimestamp:0,timestamp:0};return r.lastPingTimestamp=null!==(t=e.lastPingTimestamp)&&void 0!==t?t:0,r.timestamp=null!==(n=e.timestamp)&&void 0!==n?n:0,r}};var VO,GO,JO,KO,YO,QO,XO=(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function eP(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new XO.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}function tP(e){return null!=e}cw.util.Long!==Xg&&(cw.util.Long=Xg,cw.configure());class nP extends Error{constructor(e,t){super(t||"an error has occured"),this.code=e}}class rP extends nP{constructor(e,t,n){super(1,e),this.status=n,this.reason=t}}class oP extends nP{constructor(e){super(21,null!=e?e:"device is unsupported")}}class iP extends nP{constructor(e){super(20,null!=e?e:"track is invalid")}}class aP extends nP{constructor(e){super(10,null!=e?e:"unsupported server")}}class sP extends nP{constructor(e){super(12,null!=e?e:"unexpected connection state")}}class cP extends nP{constructor(e){super(13,null!=e?e:"unable to negotiate")}}!function(e){e.PermissionDenied="PermissionDenied",e.NotFound="NotFound",e.DeviceInUse="DeviceInUse",e.Other="Other"}(VO||(VO={})),function(e){e.getFailure=function(t){if(t&&"name"in t)return"NotFoundError"===t.name||"DevicesNotFoundError"===t.name?e.NotFound:"NotAllowedError"===t.name||"PermissionDeniedError"===t.name?e.PermissionDenied:"NotReadableError"===t.name||"TrackStartError"===t.name?e.DeviceInUse:e.Other}}(VO||(VO={})),function(e){e.Connected="connected",e.Reconnecting="reconnecting",e.Reconnected="reconnected",e.Disconnected="disconnected",e.ConnectionStateChanged="connectionStateChanged",e.StateChanged="connectionStateChanged",e.MediaDevicesChanged="mediaDevicesChanged",e.ParticipantConnected="participantConnected",e.ParticipantDisconnected="participantDisconnected",e.TrackPublished="trackPublished",e.TrackSubscribed="trackSubscribed",e.TrackSubscriptionFailed="trackSubscriptionFailed",e.TrackUnpublished="trackUnpublished",e.TrackUnsubscribed="trackUnsubscribed",e.TrackMuted="trackMuted",e.TrackUnmuted="trackUnmuted",e.LocalTrackPublished="localTrackPublished",e.LocalTrackUnpublished="localTrackUnpublished",e.LocalAudioSilenceDetected="localAudioSilenceDetected",e.ActiveSpeakersChanged="activeSpeakersChanged",e.ParticipantMetadataChanged="participantMetadataChanged",e.RoomMetadataChanged="roomMetadataChanged",e.DataReceived="dataReceived",e.ConnectionQualityChanged="connectionQualityChanged",e.TrackStreamStateChanged="trackStreamStateChanged",e.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",e.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",e.AudioPlaybackStatusChanged="audioPlaybackChanged",e.MediaDevicesError="mediaDevicesError",e.ParticipantPermissionsChanged="participantPermissionsChanged",e.SignalConnected="signalConnected",e.RecordingStatusChanged="recordingStatusChanged",e.DCBufferStatusChanged="dcBufferStatusChanged"}(GO||(GO={})),function(e){e.TrackPublished="trackPublished",e.TrackSubscribed="trackSubscribed",e.TrackSubscriptionFailed="trackSubscriptionFailed",e.TrackUnpublished="trackUnpublished",e.TrackUnsubscribed="trackUnsubscribed",e.TrackMuted="trackMuted",e.TrackUnmuted="trackUnmuted",e.LocalTrackPublished="localTrackPublished",e.LocalTrackUnpublished="localTrackUnpublished",e.ParticipantMetadataChanged="participantMetadataChanged",e.DataReceived="dataReceived",e.IsSpeakingChanged="isSpeakingChanged",e.ConnectionQualityChanged="connectionQualityChanged",e.TrackStreamStateChanged="trackStreamStateChanged",e.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",e.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",e.MediaDevicesError="mediaDevicesError",e.ParticipantPermissionsChanged="participantPermissionsChanged"}(JO||(JO={})),function(e){e.TransportsCreated="transportsCreated",e.Connected="connected",e.Disconnected="disconnected",e.Resuming="resuming",e.Resumed="resumed",e.Restarting="restarting",e.Restarted="restarted",e.SignalResumed="signalResumed",e.Closing="closing",e.MediaTrackAdded="mediaTrackAdded",e.ActiveSpeakersUpdate="activeSpeakersUpdate",e.DataPacketReceived="dataPacketReceived",e.DCBufferStatusChanged="dcBufferStatusChanged"}(KO||(KO={})),(QO=YO||(YO={})).Message="message",QO.Muted="muted",QO.Unmuted="unmuted",QO.Restarted="restarted",QO.Ended="ended",QO.Subscribed="subscribed",QO.Unsubscribed="unsubscribed",QO.UpdateSettings="updateSettings",QO.UpdateSubscription="updateSubscription",QO.AudioPlaybackStarted="audioPlaybackStarted",QO.AudioPlaybackFailed="audioPlaybackFailed",QO.AudioSilenceDetected="audioSilenceDetected",QO.VisibilityChanged="visibilityChanged",QO.VideoDimensionsChanged="videoDimensionsChanged",QO.ElementAttached="elementAttached",QO.ElementDetached="elementDetached",QO.UpstreamPaused="upstreamPaused",QO.UpstreamResumed="upstreamResumed",QO.SubscriptionPermissionChanged="subscriptionPermissionChanged",QO.SubscriptionStatusChanged="subscriptionStatusChanged";const lP=2e3;function uP(e,t){if(!t)return 0;let n,r;return"bytesReceived"in e?(n=e.bytesReceived,r=t.bytesReceived):"bytesSent"in e&&(n=e.bytesSent,r=t.bytesSent),void 0===n||void 0===r||void 0===e.timestamp||void 0===t.timestamp?0:8*(n-r)*1e3/(e.timestamp-t.timestamp)}var dP={exports:{}};!function(e,t){!function(n,r){var o="function",i="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",f="version",h="architecture",m="console",y="mobile",v="tablet",b="smarttv",g="wearable",S="embedded",w="Amazon",k="Apple",O="ASUS",P="BlackBerry",E="Browser",C="Chrome",T="Firefox",x="Google",R="Huawei",j="LG",I="Microsoft",_="Motorola",A="Opera",M="Samsung",N="Sharp",D="Sony",L="Xiaomi",U="Zebra",B="Facebook",F="Chromium OS",z="Mac OS",W=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==o?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==o||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;d+=2}},V=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o2&&(e[l]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,$.call(e,b,S.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,$.call(e,b,S.os),w&&!e[u]&&g&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===s&&e.length>350?q(e,350):e,this},this.setUA(b),this};K.VERSION="1.0.35",K.BROWSER=W([u,f,c]),K.CPU=W([h]),K.DEVICE=W([l,p,d,m,y,b,v,g,S]),K.ENGINE=K.OS=W([u,f]),e.exports&&(t=e.exports=K),t.UAParser=K;var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new K;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:og)}(dP,dP.exports);var pP=ig(dP.exports);function fP(e,t){return Object.keys(t).forEach((n=>{void 0===e[n]&&(e[n]=t[n])})),e}function hP(e){const t={};if(e.video)if("object"==typeof e.video){const n={},r=n,o=e.video;Object.keys(o).forEach((e=>{"resolution"===e?fP(r,o.resolution):r[e]=o[e]})),t.video=n}else t.video=e.video;else t.video=!1;return e.audio?"object"==typeof e.audio?t.audio=e.audio:t.audio=!0:t.audio=!1,t}function mP(){const e="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(e)return new e({latencyHint:"interactive"})}async function yP(e){return new Promise((t=>setTimeout(t,e)))}function vP(){return"addTransceiver"in RTCPeerConnection.prototype}function bP(){return"addTrack"in RTCPeerConnection.prototype}function gP(e){return!!document&&(e||(e=document.createElement("audio")),"setSinkId"in e)}const SP={Chrome:"100",Chromium:"100",Safari:"15",Firefox:"100",Edge:"100",Brave:"1.40"};function wP(){return!!PP()&&-1!==navigator.userAgent.indexOf("Firefox")}function kP(){return!!PP()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function OP(){return!!PP()&&/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent)}function PP(){return"undefined"!=typeof document}function EP(){return"ReactNative"==navigator.product}function CP(e){return e.hostname.endsWith(".livekit.cloud")}function TP(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function xP(){if(PP())return window.devicePixelRatio;if(EP()){let e=TP();if(e)return e.devicePixelRatio}return 1}function RP(e){for(const t of e)t.target.handleResize(t)}function jP(e){for(const t of e)t.target.handleVisibilityChanged(t)}let IP=null;const _P=()=>(IP||(IP=new ResizeObserver(RP)),IP);let AP=null;const MP=()=>(AP||(AP=new IntersectionObserver(jP,{root:document,rootMargin:"0px"})),AP);let NP,DP;function LP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=document.createElement("canvas");o.width=e,o.height=t;const i=o.getContext("2d");null==i||i.fillRect(0,0,o.width,o.height),r&&i&&(i.beginPath(),i.arc(e/2,t/2,50,0,2*Math.PI,!0),i.closePath(),i.fillStyle="grey",i.fill());const a=o.captureStream(),[s]=a.getTracks();if(!s)throw Error("Could not get empty media stream video track");return s.enabled=n,s}function UP(){if(!DP){const e=new AudioContext,t=e.createOscillator(),n=e.createMediaStreamDestination();if(t.connect(n),t.start(),[DP]=n.stream.getAudioTracks(),!DP)throw Error("Could not get empty media stream audio track");DP.enabled=!1}return DP}class BP{constructor(e,t){this.onFinally=t,this.promise=new Promise((async(t,n)=>{this.resolve=t,this.reject=n,e&&await e(t,n)})).finally((()=>{var e;return null===(e=this.onFinally)||void 0===e?void 0:e.call(this)}))}}class FP{constructor(){this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){let e;this._locks+=1;const t=new Promise((t=>e=()=>{this._locks-=1,t()})),n=this._locking.then((()=>e));return this._locking=this._locking.then((()=>t)),n}}const zP="default";class WP{static getInstance(){return void 0===this.instance&&(this.instance=new WP),this.instance}async getDevices(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n;if((null===(n=WP.userMediaPromiseMap)||void 0===n?void 0:n.size)>0){pg.debug("awaiting getUserMedia promise");try{e?await WP.userMediaPromiseMap.get(e):await Promise.all(WP.userMediaPromiseMap.values())}catch(e){pg.warn("error waiting for media permissons")}}let r=await navigator.mediaDevices.enumerateDevices();if(t&&e&&(!WP.userMediaPromiseMap.get(e)||!kP())&&(0===r.length||r.some((t=>{const n=""===t.label,r=!e||t.kind===e;return n&&r})))){const t={video:"audioinput"!==e&&"audiooutput"!==e,audio:"videoinput"!==e},n=await navigator.mediaDevices.getUserMedia(t);r=await navigator.mediaDevices.enumerateDevices(),n.getTracks().forEach((e=>{e.stop()}))}return e&&(r=r.filter((t=>t.kind===e))),r}async normalizeDeviceId(e,t,n){if(t!==zP)return t;const r=(await this.getDevices(e)).find((e=>e.groupId===n&&e.deviceId!==zP));return null==r?void 0:r.deviceId}}WP.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],WP.userMediaPromiseMap=new Map;var ZP,HP={exports:{}},qP="object"==typeof Reflect?Reflect:null,$P=qP&&"function"==typeof qP.apply?qP.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};ZP=qP&&"function"==typeof qP.ownKeys?qP.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var VP=Number.isNaN||function(e){return e!=e};function GP(){GP.init.call(this)}HP.exports=GP,HP.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}oE(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&oE(e,"error",t,{once:!0})}(e,o)}))},GP.EventEmitter=GP,GP.prototype._events=void 0,GP.prototype._eventsCount=0,GP.prototype._maxListeners=void 0;var JP=10;function KP(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function YP(e){return void 0===e._maxListeners?GP.defaultMaxListeners:e._maxListeners}function QP(e,t,n,r){var o,i,a,s;if(KP(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=YP(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function XP(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function eE(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=XP.bind(r);return o.listener=n,r.wrapFn=o,o}function tE(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)$P(s,this,t);else{var c=s.length,l=rE(s,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},GP.prototype.listeners=function(e){return tE(this,e,!0)},GP.prototype.rawListeners=function(e){return tE(this,e,!1)},GP.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):nE.call(e,t)},GP.prototype.listenerCount=nE,GP.prototype.eventNames=function(){return this._eventsCount>0?ZP(this._events):[]};var iE=HP.exports,aE=ig(iE);const sE=[];class cE extends iE.EventEmitter{constructor(e,t){super(),this.attachedElements=[],this.isMuted=!1,this.streamState=cE.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout((()=>this.handleAppVisibilityChanged()),5e3):this.handleAppVisibilityChanged()},this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=cE.Source.Unknown}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===cE.Kind.Video&&(t="video"),0===this.attachedElements.length&&cE.Kind.Video&&this.addAppVisibilityListener(),e||("audio"===t&&(sE.forEach((t=>{null!==t.parentElement||e||(e=t)})),e&&sE.splice(sE.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),lE(this._mediaStreamTrack,e);const n=e.srcObject.getTracks();return n.some((e=>"audio"===e.kind))&&e.play().then((()=>{this.emit(YO.AudioPlaybackStarted)})).catch((t=>{"NotAllowedError"===t.name?this.emit(YO.AudioPlaybackFailed,t):pg.warn("could not playback audio",t),e&&n.some((e=>"video"===e.kind))&&"NotAllowedError"===t.name&&(e.muted=!0,e.play().catch((()=>{})))})),this.emit(YO.ElementAttached,e),e}detach(e){try{if(e){uE(this._mediaStreamTrack,e);const t=this.attachedElements.indexOf(e);return t>=0&&(this.attachedElements.splice(t,1),this.recycleElement(e),this.emit(YO.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e),t.push(e),this.recycleElement(e),this.emit(YO.ElementDetached,e)})),this.attachedElements=[],t}finally{0===this.attachedElements.length&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),sE.forEach((e=>{e.parentElement||(t=!1)})),t&&sE.push(e)}}async handleAppVisibilityChanged(){this.isInBackground="hidden"===document.visibilityState}addAppVisibilityListener(){PP()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){PP()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function lE(e,t){let n,r;n=t.srcObject instanceof MediaStream?t.srcObject:new MediaStream,r="audio"===e.kind?n.getAudioTracks():n.getVideoTracks(),r.includes(e)||(r.forEach((e=>{n.removeTrack(e)})),n.addTrack(e)),t.autoplay=!0,t.muted=0===n.getAudioTracks().length,t instanceof HTMLVideoElement&&(t.playsInline=!0),t.srcObject!==n&&(t.srcObject=n,(kP()||wP())&&t instanceof HTMLVideoElement&&setTimeout((()=>{t.srcObject=n,t.play().catch((()=>{}))}),0))}function uE(e,t){if(t.srcObject instanceof MediaStream){const n=t.srcObject;n.removeTrack(e),n.getTracks().length>0?t.srcObject=n:t.srcObject=null}}!function(e){let t,n,r;!function(e){e.Audio="audio",e.Video="video",e.Unknown="unknown"}(t=e.Kind||(e.Kind={})),function(e){e.Camera="camera",e.Microphone="microphone",e.ScreenShare="screen_share",e.ScreenShareAudio="screen_share_audio",e.Unknown="unknown"}(n=e.Source||(e.Source={})),function(e){e.Active="active",e.Paused="paused",e.Unknown="unknown"}(r=e.StreamState||(e.StreamState={})),e.kindToProto=function(e){switch(e){case t.Audio:return JS.AUDIO;case t.Video:return JS.VIDEO;default:return JS.UNRECOGNIZED}},e.kindFromProto=function(e){switch(e){case JS.AUDIO:return t.Audio;case JS.VIDEO:return t.Video;default:return t.Unknown}},e.sourceToProto=function(e){switch(e){case n.Camera:return KS.CAMERA;case n.Microphone:return KS.MICROPHONE;case n.ScreenShare:return KS.SCREEN_SHARE;case n.ScreenShareAudio:return KS.SCREEN_SHARE_AUDIO;default:return KS.UNRECOGNIZED}},e.sourceFromProto=function(e){switch(e){case KS.CAMERA:return n.Camera;case KS.MICROPHONE:return n.Microphone;case KS.SCREEN_SHARE:return n.ScreenShare;case KS.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}},e.streamStateFromProto=function(e){switch(e){case iO.ACTIVE:return r.Active;case iO.PAUSED:return r.Paused;default:return r.Unknown}}}(cE||(cE={}));class dE extends cE{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(e,t),this._isUpstreamPaused=!1,this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this.emit(YO.Ended,this)},this._mediaStreamTrack.addEventListener("ended",this.handleEnded),this.constraints=null!=n?n:e.getConstraints(),this.reacquireTrack=!1,this.providedByUser=r,this.muteLock=new FP,this.pauseUpstreamLock=new FP}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==cE.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();return e&&t?{width:e,height:t}:void 0}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}async waitForDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;if(this.kind===cE.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");const t=Date.now();for(;Date.now()-t1&&void 0!==arguments[1])||arguments[1];if(!this.sender)throw new iP("unable to replace an unpublished track");return this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this.providedByUser||this._mediaStreamTrack.stop(),e.addEventListener("ended",this.handleEnded),pg.debug("replace MediaStreamTrack"),this.sender&&await this.sender.replaceTrack(e),this._mediaStreamTrack=e,this._mediaStreamTrack.enabled=!this.isMuted,await this.resumeUpstream(),this.attachedElements.forEach((t=>{lE(e,t)})),this.mediaStream=new MediaStream([e]),this.providedByUser=t,this}async restart(e){e||(e=this.constraints),pg.debug("restarting track with constraints",e);const t={audio:!1,video:!1};this.kind===cE.Kind.Video?t.video=e:t.audio=e,this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const n=await navigator.mediaDevices.getUserMedia(t),r=n.getTracks()[0];return r.addEventListener("ended",this.handleEnded),pg.debug("re-acquired MediaStreamTrack"),this.sender&&await this.sender.replaceTrack(r),this._mediaStreamTrack=r,await this.resumeUpstream(),this.attachedElements.forEach((e=>{lE(r,e)})),this.mediaStream=n,this.constraints=e,this.emit(YO.Restarted,this),this}setTrackMuted(e){pg.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted")),this.isMuted===e&&this._mediaStreamTrack.enabled!==e||(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?YO.Muted:YO.Unmuted,this))}get needsReAcquisition(){return"live"!==this._mediaStreamTrack.readyState||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),OP()&&(pg.debug("visibility changed, is in Background: ".concat(this.isInBackground)),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted||(pg.debug("track needs to be reaquired, restarting ".concat(this.source)),await this.restart(),this.reacquireTrack=!1))}async pauseUpstream(){const e=await this.pauseUpstreamLock.lock();try{if(!0===this._isUpstreamPaused)return;if(!this.sender)return void pg.warn("unable to pause upstream for an unpublished track");this._isUpstreamPaused=!0,this.emit(YO.UpstreamPaused,this);const e=this.kind===cE.Kind.Audio?UP():(NP||(NP=LP()),NP);await this.sender.replaceTrack(e)}finally{e()}}async resumeUpstream(){const e=await this.pauseUpstreamLock.lock();try{if(!1===this._isUpstreamPaused)return;if(!this.sender)return void pg.warn("unable to resume upstream for an unpublished track");this._isUpstreamPaused=!1,this.emit(YO.UpstreamResumed,this),await this.sender.replaceTrack(this._mediaStreamTrack)}finally{e()}}}class pE extends dE{constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,cE.Kind.Audio,t,n),this.stopOnMute=!1,this.monitorSender=async()=>{if(!this.sender)return void(this._currentBitrate=0);let e;try{e=await this.getSenderStats()}catch(e){return void pg.error("could not get audio sender stats",{error:e})}e&&this.prevStats&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.checkForSilence()}async setDeviceId(e){this.constraints.deviceId!==e&&(this.constraints.deviceId=e,this.isMuted||await this.restartTrack())}async mute(){const e=await this.muteLock.lock();try{return this.source===cE.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(pg.debug("stopping mic track"),this._mediaStreamTrack.stop()),await super.mute(),this}finally{e()}}async unmute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Microphone||!this.stopOnMute&&"ended"!==this._mediaStreamTrack.readyState||this.isUserProvided||(pg.debug("reacquiring mic track"),await this.restartTrack()),await super.unmute(),this}finally{e()}}async restartTrack(e){let t;if(e){const n=hP({audio:e});"boolean"!=typeof n.audio&&(t=n.audio)}await this.restart(t)}async restart(e){const t=await super.restart(e);return this.checkForSilence(),t}startMonitor(){PP()&&(this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),lP)))}async getSenderStats(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return;let t;return(await this.sender.getStats()).forEach((e=>{"outbound-rtp"===e.type&&(t={type:"audio",streamId:e.id,packetsSent:e.packetsSent,packetsLost:e.packetsLost,bytesSent:e.bytesSent,timestamp:e.timestamp,roundTripTime:e.roundTripTime,jitter:e.jitter})})),t}async checkForSilence(){const e=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;const n=mP();if(n){const r=n.createAnalyser();r.fftSize=2048;const o=r.frequencyBinCount,i=new Uint8Array(o);n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(r),await yP(t),r.getByteTimeDomainData(i);const a=i.some((e=>128!==e&&0!==e));return n.close(),!a}return!1}(this);return e&&(this.isMuted||pg.warn("silence detected on local audio track"),this.emit(YO.AudioSilenceDetected)),e}}class fE extends dE{constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,cE.Kind.Video,t,n),this.simulcastCodecs=new Map,this.monitorSender=async()=>{if(!this.sender)return void(this._currentBitrate=0);let e;try{e=await this.getSenderStats()}catch(e){return void pg.error("could not get audio sender stats",{error:e})}const t=new Map(e.map((e=>[e.rid,e])));if(this.prevStats){let e=0;t.forEach(((t,n)=>{var r;const o=null===(r=this.prevStats)||void 0===r?void 0:r.get(n);e+=uP(t,o)})),this._currentBitrate=e}this.prevStats=t},this.senderLock=new FP}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!PP())return;const n=null===(t=this.sender)||void 0===t?void 0:t.getParameters();n&&(this.encodings=n.encodings),this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),lP))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach((e=>{e.mediaStreamTrack.stop()})),super.stop()}async mute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Camera||this.isUserProvided||(pg.debug("stopping camera track"),this._mediaStreamTrack.stop()),await super.mute(),this}finally{e()}}async unmute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Camera||this.isUserProvided||(pg.debug("reacquiring camera track"),await this.restartTrack()),await super.unmute(),this}finally{e()}}async getSenderStats(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return[];const t=[],n=await this.sender.getStats();return n.forEach((e=>{var r;if("outbound-rtp"===e.type){const o={type:"video",streamId:e.id,frameHeight:e.frameHeight,frameWidth:e.frameWidth,firCount:e.firCount,pliCount:e.pliCount,nackCount:e.nackCount,packetsSent:e.packetsSent,bytesSent:e.bytesSent,framesSent:e.framesSent,timestamp:e.timestamp,rid:null!==(r=e.rid)&&void 0!==r?r:e.id,retransmittedPacketsSent:e.retransmittedPacketsSent,qualityLimitationReason:e.qualityLimitationReason,qualityLimitationResolutionChanges:e.qualityLimitationResolutionChanges},i=n.get(e.remoteId);i&&(o.jitter=i.jitter,o.packetsLost=i.packetsLost,o.roundTripTime=i.roundTripTime),t.push(o)}})),t}setPublishingQuality(e){const t=[];for(let n=YS.LOW;n<=YS.HIGH;n+=1)t.push({quality:n,enabled:n<=e});pg.debug("setting publishing quality. max quality ".concat(e)),this.setPublishingLayers(t)}async setDeviceId(e){this.constraints.deviceId!==e&&(this.constraints.deviceId=e,this.isMuted||await this.restartTrack())}async restartTrack(e){let t;if(e){const n=hP({video:e});"boolean"!=typeof n.video&&(t=n.video)}await this.restart(t)}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e))throw new Error("".concat(e," already added"));const n={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,n),n}setSimulcastTrackSender(e,t){const n=this.simulcastCodecs.get(e);n&&(n.sender=t,setTimeout((()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)}),5e3))}async setPublishingCodecs(e){if(pg.debug("setting publishing codecs",{codecs:e,currentCodec:this.codec}),!this.codec&&e.length>0)return await this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const t=[];var n,r=!1,o=!1;try{for(var i,a=Jw(e);r=!(i=await a.next()).done;r=!1){const e=i.value;if(this.codec&&this.codec!==e.codec){const n=this.simulcastCodecs.get(e.codec);if(pg.debug("try setPublishingCodec for ".concat(e.codec),n),n&&n.sender)n.encodings&&(pg.debug("try setPublishingLayersForSender ".concat(e.codec)),await hE(n.sender,n.encodings,e.qualities,this.senderLock));else for(const n of e.qualities)if(n.enabled){t.push(e.codec);break}}else await this.setPublishingLayers(e.qualities)}}catch(e){o=!0,n=e}finally{try{r&&null!=a.return&&await a.return()}finally{if(o)throw n}}return t}async setPublishingLayers(e){pg.debug("setting publishing layers",e),this.sender&&this.encodings&&await hE(this.sender,this.encodings,e,this.senderLock)}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),OP()&&this.isInBackground&&this.source===cE.Source.Camera&&(this._mediaStreamTrack.enabled=!1)}}async function hE(e,t,n,r){const o=await r.lock();pg.debug("setPublishingLayersForSender",{sender:e,qualities:n,senderEncodings:t});try{const r=e.getParameters(),{encodings:o}=r;if(!o)return;if(o.length!==t.length)return void pg.warn("cannot set publishing layers, encodings mismatch");let i=!1;o.forEach(((e,r)=>{var o;let a=null!==(o=e.rid)&&void 0!==o?o:"";""===a&&(a="q");const s=mE(a),c=n.find((e=>e.quality===s));c&&e.active!==c.enabled&&(i=!0,e.active=c.enabled,pg.debug("setting layer ".concat(c.quality," to ").concat(e.active?"enabled":"disabled")),wP()&&(c.enabled?(e.scaleResolutionDownBy=t[r].scaleResolutionDownBy,e.maxBitrate=t[r].maxBitrate,e.maxFrameRate=t[r].maxFrameRate):(e.scaleResolutionDownBy=4,e.maxBitrate=10,e.maxFrameRate=2)))})),i&&(r.encodings=o,await e.setParameters(r))}finally{o()}}function mE(e){switch(e){case"f":return YS.HIGH;case"h":return YS.MEDIUM;case"q":return YS.LOW;default:return YS.UNRECOGNIZED}}function yE(e,t,n){return n?n.map((r=>{var o,i,a;const s=null!==(o=r.scaleResolutionDownBy)&&void 0!==o?o:1;let c=mE(null!==(i=r.rid)&&void 0!==i?i:"");return c===YS.UNRECOGNIZED&&1===n.length&&(c=YS.HIGH),{quality:c,width:e/s,height:t/s,bitrate:null!==(a=r.maxBitrate)&&void 0!==a?a:0,ssrc:0}})):[{quality:YS.HIGH,width:e,height:t,bitrate:0,ssrc:0}]}class vE extends cE{constructor(e,t,n,r){super(e,n),this.sid=t,this.receiver=r}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?YO.Muted:YO.Unmuted,this))}setMediaStream(e){this.mediaStream=e,e.onremovetrack=()=>{this.receiver=void 0,this._currentBitrate=0,this.emit(YO.Ended,this)}}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval((()=>this.monitorReceiver()),lP))}}class bE extends vE{constructor(e,t,n,r,o){super(e,t,cE.Kind.Audio,n),this.monitorReceiver=async()=>{if(!this.receiver)return void(this._currentBitrate=0);const e=await this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.audioContext=r,this.webAudioPluginNodes=[],o&&(this.sinkId=o.deviceId)}setVolume(e){var t;for(const n of this.attachedElements)this.audioContext?null===(t=this.gainNode)||void 0===t||t.gain.setTargetAtTime(e,0,.1):n.volume=e;this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;let e=0;return this.attachedElements.forEach((t=>{t.volume>e&&(e=t.volume)})),e}async setSinkId(e){this.sinkId=e,await Promise.all(this.attachedElements.map((t=>{if(gP(t))return t.setSinkId(e)})))}attach(e){const t=0===this.attachedElements.length;return e?super.attach(e):e=super.attach(),this.elementVolume&&(e.volume=this.elementVolume),this.sinkId&&gP(e)&&e.setSinkId(this.sinkId),this.audioContext&&t&&(pg.debug("using audio context mapping"),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let n=this.sourceNode;this.webAudioPluginNodes.forEach((e=>{n.connect(e),n=e})),this.gainNode=e.createGain(),n.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),"running"!==e.state&&e.resume().then((()=>{"running"!==e.state&&this.emit(YO.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))})).catch((e=>{this.emit(YO.AudioPlaybackFailed,e)}))}disconnectWebAudio(){var e,t;null===(e=this.gainNode)||void 0===e||e.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}async getReceiverStats(){if(!this.receiver||!this.receiver.getStats)return;let e;return(await this.receiver.getStats()).forEach((t=>{"inbound-rtp"===t.type&&(e={type:"audio",timestamp:t.timestamp,jitter:t.jitter,bytesReceived:t.bytesReceived,concealedSamples:t.concealedSamples,concealmentEvents:t.concealmentEvents,silentConcealedSamples:t.silentConcealedSamples,silentConcealmentEvents:t.silentConcealmentEvents,totalAudioEnergy:t.totalAudioEnergy,totalSamplesDuration:t.totalSamplesDuration})})),e}}function gE(e,t,n){var r,o,i;void 0===t&&(t=50),void 0===n&&(n={});var a=null!=(r=n.isImmediate)&&r,s=null!=(o=n.callback)&&o,c=n.maxWait,l=Date.now(),u=[];function d(){if(void 0!==c){var e=Date.now()-l;if(e+t>=c)return c-e}return t}var p=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(r,o){var c=a&&void 0===i;if(void 0!==i&&clearTimeout(i),i=setTimeout((function(){if(i=void 0,l=Date.now(),!a){var r=e.apply(n,t);s&&s(r),u.forEach((function(e){return(0,e.resolve)(r)})),u=[]}}),d()),c){var p=e.apply(n,t);return s&&s(p),r(p)}u.push({resolve:r,reject:o})}))};return p.cancel=function(e){void 0!==i&&clearTimeout(i),u.forEach((function(t){return(0,t.reject)(e)})),u=[]},p}class SE{}SE.setTimeout=function(){return setTimeout(...arguments)},SE.setInterval=function(){return setInterval(...arguments)},SE.clearTimeout=function(){return clearTimeout(...arguments)},SE.clearInterval=function(){return clearInterval(...arguments)};class wE extends vE{constructor(e,t,n,r){super(e,t,cE.Kind.Video,n),this.elementInfos=[],this.isObserved=!1,this.monitorReceiver=async()=>{if(!this.receiver)return void(this._currentBitrate=0);const e=await this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.debouncedHandleResize=gE((()=>{this.updateDimensions()}),100),this.adaptiveStreamSettings=r}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}get mediaStreamTrack(){return this.isAdaptiveStream&&!this.isObserved&&pg.warn("When using adaptiveStream, you need to use remoteVideoTrack.attach() to add the track to a HTMLVideoElement, otherwise your video tracks might never start"),this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach((t=>{e?uE(this._mediaStreamTrack,t):lE(this._mediaStreamTrack,t)}))}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t.element===e))){const t=new kE(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t===e))?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility(),this.isObserved=!0):pg.warn("visibility resize observer not triggered")}stopObservingElementInfo(e){if(!this.isAdaptiveStream)return void pg.warn("stopObservingElementInfo ignored");const t=this.elementInfos.filter((t=>t===e));for(const e of t)e.stopObserving();this.elementInfos=this.elementInfos.filter((t=>t!==e)),this.updateVisibility()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const e of t)this.stopObservingElement(e);return t}getDecoderImplementation(){var e;return null===(e=this.prevStats)||void 0===e?void 0:e.decoderImplementation}async getReceiverStats(){if(!this.receiver||!this.receiver.getStats)return;let e;return(await this.receiver.getStats()).forEach((t=>{"inbound-rtp"===t.type&&(e={type:"video",framesDecoded:t.framesDecoded,framesDropped:t.framesDropped,framesReceived:t.framesReceived,packetsReceived:t.packetsReceived,packetsLost:t.packetsLost,frameWidth:t.frameWidth,frameHeight:t.frameHeight,pliCount:t.pliCount,firCount:t.firCount,nackCount:t.nackCount,jitter:t.jitter,timestamp:t.timestamp,bytesReceived:t.bytesReceived,decoderImplementation:t.decoderImplementation})})),e}stopObservingElement(e){const t=this.elementInfos.filter((t=>t.element===e));for(const e of t)e.stopObserving();this.elementInfos=this.elementInfos.filter((t=>t.element!==e))}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),this.isAdaptiveStream&&this.updateVisibility()}updateVisibility(){var e,t;const n=this.elementInfos.reduce(((e,t)=>Math.max(e,t.visibilityChangedAt||0)),0),r=!(null!==(t=null===(e=this.adaptiveStreamSettings)||void 0===e?void 0:e.pauseVideoInBackground)&&void 0!==t&&!t)&&this.isInBackground,o=this.elementInfos.some((e=>e.pictureInPicture)),i=this.elementInfos.some((e=>e.visible))&&!r||o;this.lastVisible!==i&&(!i&&Date.now()-n<100?SE.setTimeout((()=>{this.updateVisibility()}),100):(this.lastVisible=i,this.emit(YO.VisibilityChanged,i,this)))}updateDimensions(){var e,t,n,r;let o=0,i=0;for(const n of this.elementInfos){const r=null!==(t=null===(e=this.adaptiveStreamSettings)||void 0===e?void 0:e.pixelDensity)&&void 0!==t?t:1,a="screen"===r?xP():r,s=n.width()*a,c=n.height()*a;s+c>o+i&&(o=s,i=c)}(null===(n=this.lastDimensions)||void 0===n?void 0:n.width)===o&&(null===(r=this.lastDimensions)||void 0===r?void 0:r.height)===i||(this.lastDimensions={width:o,height:i},this.emit(YO.VideoDimensionsChanged,this.lastDimensions,this))}}class kE{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=e=>{var t;const{target:n,isIntersecting:r}=e;n===this.element&&(this.isIntersecting=r,this.visibilityChangedAt=Date.now(),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this))},this.onEnterPiP=()=>{var e;this.isPiP=!0,null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.onLeavePiP=()=>{var e;this.isPiP=!1,null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.element=e,this.isIntersecting=null!=t?t:OE(e),this.isPiP=PP()&&document.pictureInPictureElement===e,this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){this.isIntersecting=OE(this.element),this.isPiP=document.pictureInPictureElement===this.element,this.element.handleResize=()=>{var e;null===(e=this.handleResize)||void 0===e||e.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,MP().observe(this.element),_P().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP)}stopObserving(){var e,t;null===(e=MP())||void 0===e||e.unobserve(this.element),null===(t=_P())||void 0===t||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP)}}function OE(e){let t=e.offsetTop,n=e.offsetLeft;const r=e.offsetWidth,o=e.offsetHeight,{hidden:i}=e,{opacity:a,display:s}=getComputedStyle(e);for(;e.offsetParent;)t+=(e=e.offsetParent).offsetTop,n+=e.offsetLeft;return twindow.pageYOffset&&n+r>window.pageXOffset&&!i&&(""===a||parseFloat(a)>0)&&"none"!==s}class PE extends iE.EventEmitter{constructor(e,t,n){super(),this.metadataMuted=!1,this.handleMuted=()=>{this.emit(YO.Muted)},this.handleUnmuted=()=>{this.emit(YO.Unmuted)},this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=n,this.source=cE.Source.Unknown}setTrack(e){this.track&&(this.track.off(YO.Muted,this.handleMuted),this.track.off(YO.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(YO.Muted,this.handleMuted),e.on(YO.Unmuted,this.handleUnmuted))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get audioTrack(){if(this.track instanceof pE||this.track instanceof bE)return this.track}get videoTrack(){if(this.track instanceof fE||this.track instanceof wE)return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=cE.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===cE.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.trackInfo=e,pg.trace("update publication info",{info:e})}}!function(e){var t,n;(t=e.SubscriptionStatus||(e.SubscriptionStatus={})).Desired="desired",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",(n=e.PermissionStatus||(e.PermissionStatus={})).Allowed="allowed",n.NotAllowed="not_allowed"}(PE||(PE={}));class EE extends PE{get isUpstreamPaused(){var e;return null===(e=this.track)||void 0===e?void 0:e.isUpstreamPaused}constructor(e,t,n){super(e,t.sid,t.name),this.track=void 0,this.handleTrackEnded=()=>{this.emit(YO.Ended)},this.updateInfo(t),this.setTrack(n)}setTrack(e){this.track&&this.track.off(YO.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(YO.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}async mute(){var e;return null===(e=this.track)||void 0===e?void 0:e.mute()}async unmute(){var e;return null===(e=this.track)||void 0===e?void 0:e.unmute()}async pauseUpstream(){var e;await(null===(e=this.track)||void 0===e?void 0:e.pauseUpstream())}async resumeUpstream(){var e;await(null===(e=this.track)||void 0===e?void 0:e.resumeUpstream())}}class CE{constructor(e,t,n,r){this.width=e,this.height=t,this.encoding={maxBitrate:n,maxFramerate:r}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.width/this.height}}}const TE=["vp8","h264"];function xE(e){return!!TE.find((t=>t===e))}var RE;!function(e){e.telephone={maxBitrate:12e3},e.speech={maxBitrate:2e4},e.music={maxBitrate:32e3},e.musicStereo={maxBitrate:48e3},e.musicHighQuality={maxBitrate:64e3},e.musicHighQualityStereo={maxBitrate:96e3}}(RE||(RE={}));const jE={h90:new CE(160,90,6e4,15),h180:new CE(320,180,12e4,15),h216:new CE(384,216,18e4,15),h360:new CE(640,360,3e5,20),h540:new CE(960,540,6e5,25),h720:new CE(1280,720,17e5,30),h1080:new CE(1920,1080,3e6,30),h1440:new CE(2560,1440,5e6,30),h2160:new CE(3840,2160,8e6,30)},IE={h120:new CE(160,120,8e4,15),h180:new CE(240,180,1e5,15),h240:new CE(320,240,15e4,15),h360:new CE(480,360,225e3,20),h480:new CE(640,480,3e5,20),h540:new CE(720,540,45e4,25),h720:new CE(960,720,15e5,30),h1080:new CE(1440,1080,25e5,30),h1440:new CE(1920,1440,35e5,30)},_E={h360fps3:new CE(640,360,2e5,3),h720fps5:new CE(1280,720,4e5,5),h720fps15:new CE(1280,720,1e6,15),h1080fps15:new CE(1920,1080,15e5,15),h1080fps30:new CE(1920,1080,3e6,30)};var AE;!function(e){e.Excellent="excellent",e.Good="good",e.Poor="poor",e.Unknown="unknown"}(AE||(AE={}));class ME extends iE.EventEmitter{constructor(e,t,n,r){super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=AE.Unknown,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=n,this.metadata=r,this.audioTracks=new Map,this.videoTracks=new Map,this.tracks=new Map}getTracks(){return Array.from(this.tracks.values())}getTrack(e){for(const[,t]of this.tracks)if(t.source===e)return t}getTrackByName(e){for(const[,t]of this.tracks)if(t.trackName===e)return t}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrack(cE.Source.Camera);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isMicrophoneEnabled(){var e;const t=this.getTrack(cE.Source.Microphone);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isScreenShareEnabled(){return!!this.getTrack(cE.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(1e3*this.participantInfo.joinedAt):new Date}updateInfo(e){this.identity=e.identity,this.sid=e.sid,this.name=e.name,this.setMetadata(e.metadata),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,pg.trace("update participant info",{info:e})}setMetadata(e){const t=this.metadata!==e,n=this.metadata;this.metadata=e,t&&this.emit(JO.ParticipantMetadataChanged,n)}setPermissions(e){var t,n,r,o,i;const a=this.permissions,s=e.canPublish!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublish)||e.canSubscribe!==(null===(n=this.permissions)||void 0===n?void 0:n.canSubscribe)||e.canPublishData!==(null===(r=this.permissions)||void 0===r?void 0:r.canPublishData)||e.hidden!==(null===(o=this.permissions)||void 0===o?void 0:o.hidden)||e.recorder!==(null===(i=this.permissions)||void 0===i?void 0:i.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some(((e,t)=>{var n;return e!==(null===(n=this.permissions)||void 0===n?void 0:n.canPublishSources[t])}));return this.permissions=e,s&&this.emit(JO.ParticipantPermissionsChanged,a),s}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(JO.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=function(e){switch(e){case QS.EXCELLENT:return AE.Excellent;case QS.GOOD:return AE.Good;case QS.POOR:return AE.Poor;default:return AE.Unknown}}(e),t!==this._connectionQuality&&this.emit(JO.ConnectionQualityChanged,this._connectionQuality)}addTrackPublication(e){e.on(YO.Muted,(()=>{this.emit(JO.TrackMuted,e)})),e.on(YO.Unmuted,(()=>{this.emit(JO.TrackUnmuted,e)}));const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.tracks.set(e.trackSid,e),e.kind){case cE.Kind.Audio:this.audioTracks.set(e.trackSid,e);break;case cE.Kind.Video:this.videoTracks.set(e.trackSid,e)}}}const NE=Object.values(jE),DE=Object.values(IE),LE=Object.values(_E),UE=[jE.h180,jE.h360],BE=[IE.h180,IE.h360],FE=e=>[{scaleResolutionDownBy:2,fps:3}].map((t=>{var n;return new CE(Math.floor(e.width/t.scaleResolutionDownBy),Math.floor(e.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(e.encoding.maxBitrate/(t.scaleResolutionDownBy**2*((null!==(n=e.encoding.maxFramerate)&&void 0!==n?n:30)/t.fps)))),t.fps)})),zE=["q","h","f"];function WE(e,t,n,r){var o,i;let a=null==r?void 0:r.videoEncoding;e&&(a=null==r?void 0:r.screenShareEncoding);const s=null==r?void 0:r.simulcast,c=null==r?void 0:r.scalabilityMode,l=null==r?void 0:r.videoCodec;if(!a&&!s&&!c||!t||!n)return[{}];a||(a=function(e,t,n,r){const o=function(e,t,n){if(e)return LE;const r=t>n?t/n:n/t;return Math.abs(r-16/9)=a)break}return r&&"av1"===r&&(i.maxBitrate=.7*i.maxBitrate),i}(e,t,n,l),pg.debug("using video encoding",a));const u=new CE(t,n,a.maxBitrate,a.maxFramerate);if(c&&"av1"===l){pg.debug("using svc with scalabilityMode ".concat(c));const e=[];if("L3T3"===c){for(let t=0;t<3;t+=1)e.push({rid:zE[2-t],scaleResolutionDownBy:2**t,maxBitrate:a.maxBitrate/3**t,maxFramerate:u.encoding.maxFramerate,scalabilityMode:"L3T3"});return pg.debug("encodings",e),e}throw new Error("unsupported scalabilityMode: ".concat(c))}if(!s)return[a];let d,p=[];if(p=e?null!==(o=$E(null==r?void 0:r.screenShareSimulcastLayers))&&void 0!==o?o:HE(e,u):null!==(i=$E(null==r?void 0:r.videoSimulcastLayers))&&void 0!==i?i:HE(e,u),p.length>0){const e=p[0];p.length>1&&([,d]=p);const r=Math.max(t,n);if(r>=960&&d)return qE(t,n,[e,d,u]);if(r>=480)return qE(t,n,[e,u])}return qE(t,n,[u])}function ZE(e,t,n){var r,o,i,a;if(!n.backupCodec||n.backupCodec.codec===n.videoCodec)return;t!==n.backupCodec.codec&&pg.warn("requested a different codec than specified as backup",{serverRequested:t,backup:n.backupCodec.codec}),n.videoCodec=t,n.videoEncoding=n.backupCodec.encoding;const s=e.mediaStreamTrack.getSettings(),c=null!==(r=s.width)&&void 0!==r?r:null===(o=e.dimensions)||void 0===o?void 0:o.width,l=null!==(i=s.height)&&void 0!==i?i:null===(a=e.dimensions)||void 0===a?void 0:a.height;return WE(e.source===cE.Source.ScreenShare,c,l,n)}function HE(e,t){if(e)return FE(t);const{width:n,height:r}=t,o=n>r?n/r:r/n;return Math.abs(o-16/9){if(o>=zE.length)return;const i=Math.min(e,t),a=zE[o];r.push({rid:a,scaleResolutionDownBy:Math.max(1,i/Math.min(n.width,n.height)),maxBitrate:n.encoding.maxBitrate,maxFramerate:n.encoding.maxFramerate})})),r}function $E(e){if(e)return e.sort(((e,t)=>{const{encoding:n}=e,{encoding:r}=t;return n.maxBitrate>r.maxBitrate?1:n.maxBitrater.maxFramerate?1:-1:0}))}class VE extends PE{constructor(e,t,n){super(e,t.sid,t.name),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=YS.HIGH,this.handleEnded=e=>{this.setTrack(void 0),this.emit(YO.Ended,e)},this.handleVisibilityChange=e=>{pg.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(e),{trackSid:this.trackSid}),this.disabled=!e,this.emitTrackUpdate()},this.handleVideoDimensionsChange=e=>{pg.debug("adaptivestream video dimensions ".concat(e.width,"x").concat(e.height),{trackSid:this.trackSid}),this.videoDimensions=e,this.emitTrackUpdate()},this.subscribed=n,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const r={trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[{participantSid:"",trackSids:[this.trackSid]}]};this.emit(YO.UpdateSubscription,r),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(n)}get subscriptionStatus(){return!1===this.subscribed?PE.SubscriptionStatus.Unsubscribed:super.isSubscribed?PE.SubscriptionStatus.Subscribed:PE.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?PE.PermissionStatus.Allowed:PE.PermissionStatus.NotAllowed}get isSubscribed(){return!1!==this.subscribed&&super.isSubscribed}get isDesired(){return!1!==this.subscribed}get isEnabled(){return!this.disabled}setEnabled(e){this.isManualOperationAllowed()&&this.disabled!==!e&&(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){this.isManualOperationAllowed()&&this.currentVideoQuality!==e&&(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,n;this.isManualOperationAllowed()&&((null===(t=this.videoDimensions)||void 0===t?void 0:t.width)===e.width&&(null===(n=this.videoDimensions)||void 0===n?void 0:n.height)===e.height||(this.track instanceof wE&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&this.track instanceof wE&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,n=this.permissionStatus,r=this.track;r!==e&&(r&&(r.off(YO.VideoDimensionsChanged,this.handleVideoDimensionsChange),r.off(YO.VisibilityChanged,this.handleVisibilityChange),r.off(YO.Ended,this.handleEnded),r.detach(),r.stopMonitor(),this.emit(YO.Unsubscribed,r)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(YO.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(YO.VisibilityChanged,this.handleVisibilityChange),e.on(YO.Ended,this.handleEnded),this.emit(YO.Subscribed,e)),this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?YO.Muted:YO.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(YO.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(YO.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===cE.Kind.Video&&this.isAdaptiveStream?(pg.warn("adaptive stream is enabled, cannot change video track settings",{trackSid:this.trackSid}),!1):!!this.isDesired||(pg.warn("cannot update track settings when not subscribed",{trackSid:this.trackSid}),!1)}get isAdaptiveStream(){return this.track instanceof wE&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=EO.fromPartial({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=this.videoDimensions.width,e.height=this.videoDimensions.height):void 0!==this.currentVideoQuality?e.quality=this.currentVideoQuality:e.quality=YS.HIGH,this.emit(YO.UpdateSettings,e)}}class GE extends ME{static fromParticipantInfo(e,t){return new GE(e,t.sid,t.identity,t.name,t.metadata)}constructor(e,t,n,r,o){super(t,n||"",r,o),this.signalClient=e,this.tracks=new Map,this.audioTracks=new Map,this.videoTracks=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(YO.UpdateSettings,(e=>{pg.debug("send update settings",e),this.signalClient.sendUpdateTrackSettings(e)})),e.on(YO.UpdateSubscription,(e=>{e.participantTracks.forEach((e=>{e.participantSid=this.sid})),this.signalClient.sendUpdateSubscription(e)})),e.on(YO.SubscriptionPermissionChanged,(t=>{this.emit(JO.TrackSubscriptionPermissionChanged,e,t)})),e.on(YO.SubscriptionStatusChanged,(t=>{this.emit(JO.TrackSubscriptionStatusChanged,e,t)})),e.on(YO.Subscribed,(t=>{this.emit(JO.TrackSubscribed,t,e)})),e.on(YO.Unsubscribed,(t=>{this.emit(JO.TrackUnsubscribed,t,e)}))}getTrack(e){const t=super.getTrack(e);if(t)return t}getTrackByName(e){const t=super.getTrackByName(e);if(t)return t}setVolume(e){this.volume=e;const t=this.getTrack(cE.Source.Microphone);t&&t.track&&t.track.setVolume(e)}getVolume(){const e=this.getTrack(cE.Source.Microphone);return e&&e.track?e.track.getVolume():this.volume}addSubscribedMediaTrack(e,t,n,r,o,i){let a,s=this.getTrackPublication(t);return s||t.startsWith("TR")||this.tracks.forEach((t=>{s||e.kind!==t.kind.toString()||(s=t)})),s?"ended"===e.readyState?(pg.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",{participant:this.sid,trackSid:t}),void this.emit(JO.TrackSubscriptionFailed,t)):(a="video"===e.kind?new wE(e,t,r,o):new bE(e,t,r,this.audioContext,this.audioOutput),a.source=s.source,a.isMuted=s.isMuted,a.setMediaStream(n),a.start(),s.setTrack(a),void 0!==this.volume&&a instanceof bE&&a.source===cE.Source.Microphone&&a.setVolume(this.volume),s):0===i?(pg.error("could not find published track",{participant:this.sid,trackSid:t}),void this.emit(JO.TrackSubscriptionFailed,t)):(void 0===i&&(i=20),void setTimeout((()=>{this.addSubscribedMediaTrack(e,t,n,r,o,i-1)}),150))}get hasMetadata(){return!!this.participantInfo}getTrackPublication(e){return this.tracks.get(e)}updateInfo(e){super.updateInfo(e);const t=new Map,n=new Map;e.tracks.forEach((r=>{var o;let i=this.getTrackPublication(r.sid);if(i)i.updateInfo(r);else{const t=cE.kindFromProto(r.type);if(!t)return;i=new VE(t,r,null===(o=this.signalClient.connectOptions)||void 0===o?void 0:o.autoSubscribe),i.updateInfo(r),n.set(r.sid,i);const a=Array.from(this.tracks.values()).find((e=>e.source===(null==i?void 0:i.source)));a&&i.source!==cE.Source.Unknown&&pg.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(i.source),{oldTrack:a,newTrack:i,participant:this,participantInfo:e}),this.addTrackPublication(i)}t.set(r.sid,i)})),this.tracks.forEach((e=>{t.has(e.trackSid)||(pg.trace("detected removed track on remote participant, unpublishing",{publication:e,participantSid:this.sid}),this.unpublishTrack(e.trackSid,!0))})),n.forEach((e=>{this.emit(JO.TrackPublished,e)}))}unpublishTrack(e,t){const n=this.tracks.get(e);if(!n)return;switch(this.tracks.delete(e),n.kind){case cE.Kind.Audio:this.audioTracks.delete(e);break;case cE.Kind.Video:this.videoTracks.delete(e)}const{track:r}=n;r&&(r.stop(),n.setTrack(void 0)),t&&this.emit(JO.TrackUnpublished,n)}setAudioContext(e){this.audioContext=e,this.audioTracks.forEach((t=>t.track instanceof bE&&t.track.setAudioContext(e)))}async setAudioOutput(e){this.audioOutput=e;const t=[];this.audioTracks.forEach((n=>{var r;n.track instanceof bE&&t.push(n.track.setSinkId(null!==(r=e.deviceId)&&void 0!==r?r:"default"))})),await Promise.all(t)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{this.reconnectFuture||(this.reconnectFuture=new BP)},this.handleReconnected=()=>{var e,t;null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.resolve)||void 0===t||t.call(e),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var e,t;null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.reject)||void 0===t||t.call(e,"Got disconnected during publishing attempt"),this.reconnectFuture=void 0},this.updateTrackSubscriptionPermissions=()=>{pg.debug("updating track subscription permissions",{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions}),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map((e=>function(e){var t,n,r;if(!e.participantSid&&!e.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return{participantIdentity:null!==(t=e.participantIdentity)&&void 0!==t?t:"",participantSid:null!==(n=e.participantSid)&&void 0!==n?n:"",allTracks:null!==(r=e.allowAll)&&void 0!==r&&r,trackSids:e.allowedTrackSids||[]}}(e))))},this.onTrackUnmuted=e=>{this.onTrackMuted(e,e.isUpstreamPaused)},this.onTrackMuted=(e,t)=>{void 0===t&&(t=!0),e.sid?this.engine.updateMuteStatus(e.sid,t):pg.error("could not update mute status for unpublished track",e)},this.onTrackUpstreamPaused=e=>{pg.debug("upstream paused"),this.onTrackMuted(e,!0)},this.onTrackUpstreamResumed=e=>{pg.debug("upstream resumed"),this.onTrackMuted(e,e.isMuted)},this.handleSubscribedQualityUpdate=async e=>{var t,n;if(!(null===(t=this.roomOptions)||void 0===t?void 0:t.dynacast))return;const r=this.videoTracks.get(e.trackSid);if(r)if(e.subscribedCodecs.length>0){if(!r.videoTrack)return;const t=await r.videoTrack.setPublishingCodecs(e.subscribedCodecs);var o,i=!1,a=!1;try{for(var s,c=Jw(t);i=!(s=await c.next()).done;i=!1){const e=s.value;xE(e)&&(pg.debug("publish ".concat(e," for ").concat(r.videoTrack.sid)),await this.publishAdditionalCodecForTrack(r.videoTrack,e,r.options))}}catch(e){a=!0,o=e}finally{try{i&&null!=c.return&&await c.return()}finally{if(a)throw o}}}else e.subscribedQualities.length>0&&await(null===(n=r.videoTrack)||void 0===n?void 0:n.setPublishingLayers(e.subscribedQualities));else pg.warn("received subscribed quality update for unknown track",{method:"handleSubscribedQualityUpdate",sid:e.trackSid})},this.handleLocalTrackUnpublished=e=>{const t=this.tracks.get(e.trackSid);t?this.unpublishTrack(t.track):pg.warn("received unpublished event for unknown track",{method:"handleLocalTrackUnpublished",trackSid:e.trackSid})},this.handleTrackEnded=async e=>{if(e.source===cE.Source.ScreenShare||e.source===cE.Source.ScreenShareAudio)pg.debug("unpublishing local track due to TrackEnded",{track:e.sid}),this.unpublishTrack(e);else if(e.isUserProvided)await e.mute();else if(e instanceof pE||e instanceof fE)try{if(PP())try{const t=await(null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:e.source===cE.Source.Camera?"camera":"microphone"}));if(t&&"denied"===t.state)throw pg.warn("user has revoked access to ".concat(e.source)),t.onchange=()=>{"denied"!==t.state&&(e.isMuted||e.restartTrack(),t.onchange=null)},new Error("GetUserMedia Permission denied")}catch(e){}e.isMuted||(pg.debug("track ended, attempting to use a different device"),await e.restartTrack())}catch(t){pg.warn("could not restart track, muting instead"),await e.mute()}},this.audioTracks=new Map,this.videoTracks=new Map,this.tracks=new Map,this.engine=n,this.roomOptions=r,this.setupEngine(n)}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}getTrack(e){const t=super.getTrack(e);if(t)return t}getTrackByName(e){const t=super.getTrackByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.client.onRemoteMuteChanged=(e,t)=>{const n=this.tracks.get(e);n&&n.track&&(t?n.mute():n.unmute())},this.engine.client.onSubscribedQualityUpdate=this.handleSubscribedQualityUpdate,this.engine.client.onLocalTrackUnpublished=this.handleLocalTrackUnpublished,this.engine.on(KO.Connected,this.handleReconnected).on(KO.Restarted,this.handleReconnected).on(KO.Resumed,this.handleReconnected).on(KO.Restarting,this.handleReconnecting).on(KO.Resuming,this.handleReconnecting).on(KO.Disconnected,this.handleDisconnected)}setCameraEnabled(e,t,n){return this.setTrackEnabled(cE.Source.Camera,e,t,n)}setMicrophoneEnabled(e,t,n){return this.setTrackEnabled(cE.Source.Microphone,e,t,n)}setScreenShareEnabled(e,t,n){return this.setTrackEnabled(cE.Source.ScreenShare,e,t,n)}async setTrackEnabled(e,t,n,r){var o,i;pg.debug("setTrackEnabled",{source:e,enabled:t});let a=this.getTrack(e);if(t)if(a)await a.unmute();else{let t;if(this.pendingPublishing.has(e))return void pg.info("skipping duplicate published source",{source:e});this.pendingPublishing.add(e);try{switch(e){case cE.Source.Camera:t=await this.createTracks({video:null===(o=n)||void 0===o||o});break;case cE.Source.Microphone:t=await this.createTracks({audio:null===(i=n)||void 0===i||i});break;case cE.Source.ScreenShare:t=await this.createScreenTracks(Qw({},n));break;default:throw new iP(e)}const s=[];for(const e of t)pg.info("publishing track",{localTrack:e}),s.push(this.publishTrack(e,r));const c=await Promise.all(s);[a]=c}catch(e){throw e instanceof Error&&!(e instanceof iP)&&this.emit(JO.MediaDevicesError,e),e}finally{this.pendingPublishing.delete(e)}}else if(a&&a.track)if(e===cE.Source.ScreenShare){a=await this.unpublishTrack(a.track);const e=this.getTrack(cE.Source.ScreenShareAudio);e&&e.track&&this.unpublishTrack(e.track)}else await a.mute();return a}async enableCameraAndMicrophone(){if(!this.pendingPublishing.has(cE.Source.Camera)&&!this.pendingPublishing.has(cE.Source.Microphone)){this.pendingPublishing.add(cE.Source.Camera),this.pendingPublishing.add(cE.Source.Microphone);try{const e=await this.createTracks({audio:!0,video:!0});await Promise.all(e.map((e=>this.publishTrack(e))))}finally{this.pendingPublishing.delete(cE.Source.Camera),this.pendingPublishing.delete(cE.Source.Microphone)}}}async createTracks(e){var t,n;const r=hP(function(e,t,n){const r=Qw({},e);return!0===r.audio&&(r.audio={}),!0===r.video&&(r.video={}),r.audio&&fP(r.audio,t),r.video&&fP(r.video,n),r}(e,null===(t=this.roomOptions)||void 0===t?void 0:t.audioCaptureDefaults,null===(n=this.roomOptions)||void 0===n?void 0:n.videoCaptureDefaults));let o;try{o=await navigator.mediaDevices.getUserMedia(r)}catch(e){throw e instanceof Error&&(r.audio&&(this.microphoneError=e),r.video&&(this.cameraError=e)),e}return r.audio&&(this.microphoneError=void 0),r.video&&(this.cameraError=void 0),o.getTracks().map((t=>{const n="audio"===t.kind;let i;n?e.audio:e.video;const a=n?r.audio:r.video;"boolean"!=typeof a&&(i=a);const s=function(e,t){switch(e.kind){case"audio":return new pE(e,t,!1);case"video":return new fE(e,t,!1);default:throw new iP("unsupported track type: ".concat(e.kind))}}(t,i);return s.kind===cE.Kind.Video?s.source=cE.Source.Camera:s.kind===cE.Kind.Audio&&(s.source=cE.Source.Microphone),s.mediaStream=o,s}))}async createScreenTracks(e){var t;void 0===e&&(e={}),void 0===e.resolution&&(e.resolution=_E.h1080fps15.resolution);let n=!0;if(e.resolution&&(n=kP()?{width:{max:e.resolution.width},height:{max:e.resolution.height},frameRate:e.resolution.frameRate}:{width:{ideal:e.resolution.width},height:{ideal:e.resolution.height},frameRate:e.resolution.frameRate}),void 0===navigator.mediaDevices.getDisplayMedia)throw new oP("getDisplayMedia not supported");const r=await navigator.mediaDevices.getDisplayMedia({audio:null!==(t=e.audio)&&void 0!==t&&t,video:n,controller:e.controller,selfBrowserSurface:e.selfBrowserSurface,surfaceSwitching:e.surfaceSwitching,systemAudio:e.systemAudio}),o=r.getVideoTracks();if(0===o.length)throw new iP("no video track found");const i=new fE(o[0],void 0,!1);i.source=cE.Source.ScreenShare;const a=[i];if(r.getAudioTracks().length>0){const e=new pE(r.getAudioTracks()[0],void 0,!1);e.source=cE.Source.ScreenShareAudio,a.push(e)}return a}async publishTrack(e,t){var n,r,o;if(await(null===(n=this.reconnectFuture)||void 0===n?void 0:n.promise),e instanceof dE&&this.pendingPublishPromises.has(e)&&await this.pendingPublishPromises.get(e),e instanceof MediaStreamTrack)switch(e.kind){case"audio":e=new pE(e,void 0,!0);break;case"video":e=new fE(e,void 0,!0);break;default:throw new iP("unsupported MediaStreamTrack kind ".concat(e.kind))}let i;if(this.tracks.forEach((t=>{t.track&&t.track===e&&(i=t)})),i)return pg.warn("track has already been published, skipping"),i;const a=(null==t?void 0:t.forceStereo)||"channelCount"in e.mediaStreamTrack.getSettings()&&2===e.mediaStreamTrack.getSettings().channelCount||2===e.mediaStreamTrack.getConstraints().channelCount;a&&(t||(t={}),void 0===t.dtx&&pg.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work."),void 0===t.red&&pg.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(r=t.dtx)&&void 0!==r||(t.dtx=!1),null!==(o=t.red)&&void 0!==o||(t.red=!1));const s=Qw(Qw({},this.roomOptions.publishDefaults),t);s.source&&(e.source=s.source);const c=this.publish(e,s,t,a);this.pendingPublishPromises.set(e,c);try{return await c}catch(e){throw e}finally{this.pendingPublishPromises.delete(e)}}async publish(e,t,n,r){var o,i,a,s;const c=Array.from(this.tracks.values()).find((t=>e instanceof dE&&t.source===e.source));if(c&&e.source!==cE.Source.Unknown)try{throw Error("publishing a second track with the same source: ".concat(e.source))}catch(t){t instanceof Error&&pg.warn(t.message,{oldTrack:c,newTrack:e,trace:t.stack})}t.stopMicTrackOnMute&&e instanceof pE&&(e.stopOnMute=!0),e.source===cE.Source.ScreenShare&&wP()&&(t.simulcast=!1),"av1"!==t.videoCodec||function(){const e=RTCRtpReceiver.getCapabilities("video");let t=!1,n=!1;if(e){for(const n of e.codecs)if("video/AV1"===n.mimeType){t=!0;break}for(const t of e.headerExtensions)if("https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"===t.uri){n=!0;break}}return t&&n}()||(t.videoCodec=void 0),e.on(YO.Muted,this.onTrackMuted),e.on(YO.Unmuted,this.onTrackUnmuted),e.on(YO.Ended,this.handleTrackEnded),e.on(YO.UpstreamPaused,this.onTrackUpstreamPaused),e.on(YO.UpstreamResumed,this.onTrackUpstreamResumed);const l=mO.fromPartial({cid:e.mediaStreamTrack.id,name:null==n?void 0:n.name,type:cE.kindToProto(e.kind),muted:e.isMuted,source:cE.sourceToProto(e.source),disableDtx:!(null===(o=t.dtx)||void 0===o||o),stereo:r,disableRed:!(null===(i=t.red)||void 0===i||i)});let u,d;if(e.kind===cE.Kind.Video){let n={width:0,height:0};try{n=await e.waitForDimensions()}catch(e){pg.error("could not determine track dimensions")}if(l.width=n.width,l.height=n.height,e instanceof fE&&("av1"===(null==t?void 0:t.videoCodec)&&(t.scalabilityMode=null!==(a=t.scalabilityMode)&&void 0!==a?a:"L3T3"),t.videoCodec&&t.backupCodec&&t.videoCodec!==t.backupCodec.codec)){const n=Qw({},t);n.simulcast=!0,d=ZE(e,t.backupCodec.codec,n),l.simulcastCodecs=[{codec:t.videoCodec,cid:e.mediaStreamTrack.id,enableSimulcastLayers:!0},{codec:t.backupCodec.codec,cid:"",enableSimulcastLayers:!0}]}u=WE(e.source===cE.Source.ScreenShare,n.width,n.height,t),l.layers=yE(l.width,l.height,null!=d?d:u)}else e.kind===cE.Kind.Audio&&t.audioBitrate&&(u=[{maxBitrate:t.audioBitrate}]);if(!this.engine||this.engine.isClosed)throw new sP("cannot publish track when not connected");const p=await this.engine.addTrack(l),f=new EE(e.kind,p,e);if(f.options=t,e.sid=p.sid,!this.engine.publisher)throw new sP("publisher is closed");return pg.debug("publishing ".concat(e.kind," with encodings"),{encodings:u,trackInfo:p}),e.sender=await this.engine.createSender(e,t,u),"av1"===e.codec&&u&&(null===(s=u[0])||void 0===s?void 0:s.maxBitrate)&&this.engine.publisher.setTrackCodecBitrate(l.cid,e.codec,u[0].maxBitrate/1e3),this.engine.negotiate(),e instanceof fE?e.startMonitor(this.engine.client):e instanceof pE&&e.startMonitor(),this.addTrackPublication(f),this.emit(JO.LocalTrackPublished,f),f}get isLocal(){return!0}async publishAdditionalCodecForTrack(e,t,n){var r;let o;if(this.tracks.forEach((t=>{t.track&&t.track===e&&(o=t)})),!o)throw new iP("track is not published");if(!(e instanceof fE))throw new iP("track is not a video track");const i=Qw(Qw({},null===(r=this.roomOptions)||void 0===r?void 0:r.publishDefaults),n),a=ZE(e,t,i);if(!a)return void pg.info("backup codec has been disabled, ignoring request to add additional codec for track");const s=e.addSimulcastTrack(t,a),c=mO.fromPartial({cid:s.mediaStreamTrack.id,type:cE.kindToProto(e.kind),muted:e.isMuted,source:cE.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:i.videoCodec,cid:s.mediaStreamTrack.id,enableSimulcastLayers:i.simulcast}]});if(c.layers=yE(c.width,c.height,a),!this.engine||this.engine.isClosed)throw new sP("cannot publish track when not connected");const l=await this.engine.addTrack(c);await this.engine.createSimulcastSender(e,s,i,a),this.engine.negotiate(),pg.debug("published ".concat(t," for track ").concat(e.sid),{encodings:a,trackInfo:l})}async unpublishTrack(e,t){var n,r;const o=this.getPublicationForTrack(e);if(pg.debug("unpublishing track",{track:e,method:"unpublishTrack"}),!o||!o.track)return void pg.warn("track was not unpublished because no publication was found",{track:e,method:"unpublishTrack"});(e=o.track).off(YO.Muted,this.onTrackMuted),e.off(YO.Unmuted,this.onTrackUnmuted),e.off(YO.Ended,this.handleTrackEnded),e.off(YO.UpstreamPaused,this.onTrackUpstreamPaused),e.off(YO.UpstreamResumed,this.onTrackUpstreamResumed),void 0===t&&(t=null===(r=null===(n=this.roomOptions)||void 0===n?void 0:n.stopLocalTrackOnUnpublish)||void 0===r||r),t&&e.stop();let i=!1;const a=e.sender;if(e.sender=void 0,this.engine.publisher&&"closed"!==this.engine.publisher.pc.connectionState&&a)try{if(this.engine.removeTrack(a)&&(i=!0),e instanceof fE){for(const[,t]of e.simulcastCodecs)t.sender&&(this.engine.removeTrack(t.sender)&&(i=!0),t.sender=void 0);e.simulcastCodecs.clear()}}catch(e){pg.warn("failed to unpublish track",{error:e,method:"unpublishTrack"})}switch(this.tracks.delete(o.trackSid),o.kind){case cE.Kind.Audio:this.audioTracks.delete(o.trackSid);break;case cE.Kind.Video:this.videoTracks.delete(o.trackSid)}return this.emit(JO.LocalTrackUnpublished,o),o.setTrack(void 0),i&&await this.engine.negotiate(),o}async unpublishTracks(e){return(await Promise.all(e.map((e=>this.unpublishTrack(e))))).filter((e=>e instanceof EE))}async republishAllTracks(e){const t=[];this.tracks.forEach((n=>{n.track&&(e&&(n.options=Qw(Qw({},n.options),e)),t.push(n))})),await Promise.all(t.map((async e=>{const t=e.track;await this.unpublishTrack(t,!1),await this.publishTrack(t,e.options)})))}async publishData(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Array.isArray(n)?n:null==n?void 0:n.destination,o=[],i=Array.isArray(n)?void 0:n.topic;void 0!==r&&r.forEach((e=>{e instanceof GE?o.push(e.sid):o.push(e)}));const a={kind:t,value:{$case:"user",user:{participantSid:this.sid,payload:e,destinationSids:o,topic:i}}};await this.engine.sendDataPacket(a,t)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isConnected&&this.updateTrackSubscriptionPermissions()}updateInfo(e){e.sid===this.sid&&(super.updateInfo(e),e.tracks.forEach((e=>{var t,n;const r=this.tracks.get(e.sid);if(r){const o=r.isMuted||null!==(n=null===(t=r.track)||void 0===t?void 0:t.isUpstreamPaused)&&void 0!==n&&n;o!==e.muted&&(pg.debug("updating server mute state after reconcile",{sid:e.sid,muted:o}),this.engine.client.sendMuteTrack(e.sid,o))}})))}getPublicationForTrack(e){let t;return this.tracks.forEach((n=>{const r=n.track;r&&(e instanceof MediaStreamTrack?(r instanceof pE||r instanceof fE)&&r.mediaStreamTrack===e&&(t=n):e===r&&(t=n))})),t}publishedTracksInfo(){const e=[];return this.tracks.forEach((t=>{void 0!==t.track&&e.push({cid:t.track.mediaStreamID,track:t.trackInfo})})),e}dataChannelsInfo(){const e=[],t=(t,n)=>{void 0!==(null==t?void 0:t.id)&&null!==t.id&&e.push({label:t.label,id:t.id,target:n})};return t(this.engine.dataChannelForKind(ow.LOSSY),oO.PUBLISHER),t(this.engine.dataChannelForKind(ow.RELIABLE),oO.PUBLISHER),t(this.engine.dataChannelForKind(ow.LOSSY,!0),oO.SUBSCRIBER),t(this.engine.dataChannelForKind(ow.RELIABLE,!0),oO.SUBSCRIBER),e}}class KE{constructor(e,t){this.maxConcurrent=e||1,this.minCycle=t||0,this.queueRunning=[],this.queueWaiting={},this.lastRun=0}dequeue(e){const t=this.queueRunning,n=t.findIndex((t=>t.hash===e));if(-1==n)throw"queue desync";const r=t[n];return t.splice(n,1),r}getFirstWaiting(){for(let e of Object.keys(this.queueWaiting).sort(((e,t)=>e-t)))if(void 0!==this.queueWaiting[e]&&this.queueWaiting[e].length>0)return this.queueWaiting[e]}end(e){this.dequeue(e).resolve();const t=this.getFirstWaiting();void 0!==t&&t.shift().resolve()}async wait(e,t){const n=void 0===t?0:t;let r={hash:e,priority:n};for(null==this.queueWaiting[n]&&(this.queueWaiting[n]=[]),this.queueRunning.length>=this.maxConcurrent&&(r.promise=new Promise((e=>{r.resolve=e})),this.queueWaiting[n].push(r),await r.promise),this.queueRunning.push(r),r.promise=new Promise((e=>{r.resolve=e}));Date.now()-this.lastRunsetTimeout(e,this.minCycle-Date.now()+this.lastRun)));this.lastRun=Date.now()}run(e,t){const n=void 0===t?0:t,r=Symbol();return this.wait(r,n).then((()=>e())).finally((()=>{this.end(r)}))}stat(){return{running:this.queueRunning.length,waiting:Object.keys(this.queueWaiting).reduce(((e,t)=>e+this.queueWaiting[t].length),0),last:this.lastRun}}async flush(){for(;this.stat().waiting>0;)for(let e of Object.keys(this.queueWaiting).sort(((e,t)=>t-e))){const t=this.queueWaiting[e];void 0!==t&&t.length>0&&await t[t.length-1].promise}for(;this.queueRunning.length>0;)await Promise.allSettled(this.queueRunning.map((e=>e.promise)))}}const YE=["syncState","trickle","offer","answer","simulate","leave"];class QE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.rtt=0,this.isConnected=!1,this.isReconnecting=!1,this.useJSON=e,this.requestQueue=new KE,this.queuedRequests=[],this.closingLock=new FP}async join(e,t,n,r){return this.isConnected=!1,this.options=n,await this.connect(e,t,n,r)}async reconnect(e,t,n,r){if(this.options)return this.isReconnecting=!0,this.clearPingInterval(),await this.connect(e,t,Qw(Qw({},this.options),{},{reconnect:!0,sid:n,reconnectReason:r}));pg.warn("attempted to reconnect without signal options being set, ignoring")}connect(e,t,n,r){this.connectOptions=n,e.startsWith("http")&&(e=e.replace("http","ws")),e=e.replace(/\/$/,""),e+="/rtc";const o=function(e,t,n){var r;const o=new URLSearchParams;return o.set("access_token",e),n.reconnect&&(o.set("reconnect","1"),n.sid&&o.set("sid",n.sid)),o.set("auto_subscribe",n.autoSubscribe?"1":"0"),o.set("sdk",EP()?"reactnative":"js"),o.set("version",t.version),o.set("protocol",t.protocol.toString()),t.deviceModel&&o.set("device_model",t.deviceModel),t.os&&o.set("os",t.os),t.osVersion&&o.set("os_version",t.osVersion),t.browser&&o.set("browser",t.browser),t.browserVersion&&o.set("browser_version",t.browserVersion),void 0!==n.publishOnly&&o.set("publish",n.publishOnly),n.adaptiveStream&&o.set("adaptive_stream","1"),n.reconnectReason&&o.set("reconnect_reason",n.reconnectReason.toString()),(null===(r=navigator.connection)||void 0===r?void 0:r.type)&&o.set("network",navigator.connection.type),"?".concat(o.toString())}(t,function(){var e;const t=Bw.fromPartial({sdk:aw.JS,protocol:9,version:"1.8.0"});return EP()&&(t.os=null!==(e=function(){if(!EP())return;let e=TP();return e?e.platform:void 0}())&&void 0!==e?e:""),t}(),n);return new Promise((async(t,i)=>{const a=async()=>{await this.close(),i(new rP("room connection has been cancelled (signal)"))};(null==r?void 0:r.aborted)&&a(),null==r||r.addEventListener("abort",a),pg.debug("connecting to ".concat(e+o)),this.ws&&await this.close(),this.ws=new WebSocket(e+o),this.ws.binaryType="arraybuffer",this.ws.onerror=async t=>{if(this.isConnected)this.handleWSError(t);else try{const t=await fetch("http".concat(e.substring(2),"/validate").concat(o));if(t.status.toFixed(0).startsWith("4")){const e=await t.text();i(new rP(e,0,t.status))}else i(new rP("Internal error",2,t.status))}catch(e){i(new rP("server was not reachable",1))}},this.ws.onmessage=async e=>{var o,s,c,l;let u;if("string"==typeof e.data){const t=JSON.parse(e.data);u=fO.fromJSON(t)}else{if(!(e.data instanceof ArrayBuffer))return void pg.error("could not decode websocket message: ".concat(typeof e.data));u=fO.decode(new Uint8Array(e.data))}if(!this.isConnected){let e=!1;if("join"===(null===(o=u.message)||void 0===o?void 0:o.$case)?(this.isConnected=!0,null==r||r.removeEventListener("abort",a),this.pingTimeoutDuration=u.message.join.pingTimeout,this.pingIntervalDuration=u.message.join.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(pg.debug("ping config",{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration}),this.startPingInterval()),t(u.message.join)):n.reconnect?(this.isConnected=!0,null==r||r.removeEventListener("abort",a),this.startPingInterval(),"reconnect"===(null===(s=u.message)||void 0===s?void 0:s.$case)?t(null===(c=u.message)||void 0===c?void 0:c.reconnect):(t(),e=!0)):n.reconnect||i(new rP("did not receive join response, got ".concat(null===(l=u.message)||void 0===l?void 0:l.$case," instead"))),!e)return}this.signalLatency&&await yP(this.signalLatency),this.handleSignalResponse(u)},this.ws.onclose=e=>{this.isConnected&&(pg.debug("websocket connection closed: ".concat(e.reason)),this.isConnected=!1,this.onClose&&this.onClose(e.reason),this.ws=void 0)}}))}async close(){const e=await this.closingLock.lock();try{if(this.isConnected=!1,this.ws){this.ws.onclose=null,this.ws.onmessage=null,this.ws.onopen=null;const e=new Promise((e=>{this.ws?this.ws.onclose=e:e(!0)}));this.ws.close(),await Promise.race([e,yP(250)])}this.ws=void 0,this.clearPingInterval()}finally{e()}}sendOffer(e){pg.debug("sending offer",e),this.sendRequest({$case:"offer",offer:eC(e)})}sendAnswer(e){pg.debug("sending answer"),this.sendRequest({$case:"answer",answer:eC(e)})}sendIceCandidate(e,t){pg.trace("sending ice candidate",e),this.sendRequest({$case:"trickle",trickle:{candidateInit:JSON.stringify(e),target:t}})}sendMuteTrack(e,t){this.sendRequest({$case:"mute",mute:{sid:e,muted:t}})}sendAddTrack(e){this.sendRequest({$case:"addTrack",addTrack:mO.fromPartial(e)})}sendUpdateTrackSettings(e){this.sendRequest({$case:"trackSetting",trackSetting:e})}sendUpdateSubscription(e){this.sendRequest({$case:"subscription",subscription:e})}sendSyncState(e){this.sendRequest({$case:"syncState",syncState:e})}sendUpdateVideoLayers(e,t){this.sendRequest({$case:"updateLayers",updateLayers:{trackSid:e,layers:t}})}sendUpdateSubscriptionPermissions(e,t){this.sendRequest({$case:"subscriptionPermission",subscriptionPermission:{allParticipants:e,trackPermissions:t}})}sendSimulateScenario(e){this.sendRequest({$case:"simulate",simulate:e})}sendPing(){this.sendRequest({$case:"ping",ping:Date.now()}),this.sendRequest({$case:"pingReq",pingReq:{timestamp:Date.now(),rtt:this.rtt}})}async sendLeave(){await this.sendRequest({$case:"leave",leave:{canReconnect:!1,reason:ew.CLIENT_INITIATED}})}async sendRequest(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=!t&&!function(e){const t=YE.includes(e.$case);return pg.trace("request allowed to bypass queue:",{canPass:t,req:e}),t}(e);if(n&&this.isReconnecting)return void this.queuedRequests.push((async()=>{await this.sendRequest(e,!0)}));if(t||await this.requestQueue.flush(),this.signalLatency&&await yP(this.signalLatency),!this.ws||this.ws.readyState!==this.ws.OPEN)return void pg.error("cannot send signal request before connected, type: ".concat(null==e?void 0:e.$case));const r={message:e};try{this.useJSON?this.ws.send(JSON.stringify(pO.toJSON(r))):this.ws.send(pO.encode(r).finish())}catch(e){pg.error("error sending signal message",{error:e})}}handleSignalResponse(e){var t,n;const r=e.message;if(null!=r)if("answer"===r.$case){const e=XE(r.answer);this.onAnswer&&this.onAnswer(e)}else if("offer"===r.$case){const e=XE(r.offer);this.onOffer&&this.onOffer(e)}else if("trickle"===r.$case){const e=JSON.parse(r.trickle.candidateInit);this.onTrickle&&this.onTrickle(e,r.trickle.target)}else"update"===r.$case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(t=r.update.participants)&&void 0!==t?t:[]):"trackPublished"===r.$case?this.onLocalTrackPublished&&this.onLocalTrackPublished(r.trackPublished):"speakersChanged"===r.$case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(n=r.speakersChanged.speakers)&&void 0!==n?n:[]):"leave"===r.$case?this.onLeave&&this.onLeave(r.leave):"mute"===r.$case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(r.mute.sid,r.mute.muted):"roomUpdate"===r.$case?this.onRoomUpdate&&r.roomUpdate.room&&this.onRoomUpdate(r.roomUpdate.room):"connectionQuality"===r.$case?this.onConnectionQuality&&this.onConnectionQuality(r.connectionQuality):"streamStateUpdate"===r.$case?this.onStreamStateUpdate&&this.onStreamStateUpdate(r.streamStateUpdate):"subscribedQualityUpdate"===r.$case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(r.subscribedQualityUpdate):"subscriptionPermissionUpdate"===r.$case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(r.subscriptionPermissionUpdate):"refreshToken"===r.$case?this.onTokenRefresh&&this.onTokenRefresh(r.refreshToken):"trackUnpublished"===r.$case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(r.trackUnpublished):"pong"===r.$case?this.resetPingTimeout():"pongResp"===r.$case?(this.rtt=Date.now()-r.pongResp.lastPingTimestamp,this.resetPingTimeout()):pg.debug("unsupported message",r);else pg.debug("received unsupported message")}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}this.isReconnecting=!1}handleWSError(e){pg.error("websocket error",e)}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=SE.setTimeout((()=>{pg.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*this.pingTimeoutDuration).toUTCString())),this.onClose&&this.onClose("ping timeout")}),1e3*this.pingTimeoutDuration):pg.warn("ping timeout duration not set")}clearPingTimeout(){this.pingTimeout&&SE.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(pg.debug("start ping interval"),this.pingInterval=SE.setInterval((()=>{this.sendPing()}),1e3*this.pingIntervalDuration)):pg.warn("ping interval duration not set")}clearPingInterval(){pg.debug("clearing ping interval"),this.clearPingTimeout(),this.pingInterval&&SE.clearInterval(this.pingInterval)}}function XE(e){const t={type:"offer",sdp:e.sdp};switch(e.type){case"answer":case"offer":case"pranswer":case"rollback":t.type=e.type}return t}function eC(e){return{sdp:e.sdp,type:e.type}}const tC={audioBitrate:RE.music.maxBitrate,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:_E.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:"vp8",backupCodec:{codec:"vp8",encoding:jE.h540.encoding}},nC={autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0},rC={resolution:jE.h720.resolution},oC={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(e){this._retryDelays=void 0!==e?[...e]:Gw}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+1e3*Math.random()}},disconnectOnPageLeave:!0,expWebAudioMix:!1},iC={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3};var aC={},sC={exports:{}},cC=sC.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),(t+=null!=e["network-id"]?" network-id %d":"%v")+(null!=e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",(t+=null!=e.rateNumerator?" rate=%s":"")+(null!=e.rateDenominator?"/%s":"")}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(cC).forEach((function(e){cC[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}));var lC=sC.exports;!function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r){var o=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:o&&!n[e.name]&&(n[e.name]={});var i=e.push?{}:o?n[e.name]:n;!function(e,n,r,o){if(o&&!r)n[o]=t(e[1]);else for(var i=0;i1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(i,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(" ").map(t),o=0;o=r)return e;var o=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(o);case"%d":return Number(o);case"%v":return""}}))},fC=function(e,t,n){var r=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var o=0;o{this.emit(bC);try{this.createAndSendOffer()}catch(t){if(!e)throw t;e(t)}}),100),this.pc=new RTCPeerConnection(e)}get isICEConnected(){return"connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState}async addIceCandidate(e){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)}async setRemoteDescription(e){if("offer"===e.type){let{stereoMids:t,nackMids:n}=function(e){var t;const n=[],r=[],o=vC(null!==(t=e.sdp)&&void 0!==t?t:"");let i=0;return o.media.forEach((e=>{var t;"audio"===e.type&&(e.rtp.some((e=>"opus"===e.codec&&(i=e.payload,!0))),(null===(t=e.rtcpFb)||void 0===t?void 0:t.some((e=>e.payload===i&&"nack"===e.type)))&&r.push(e.mid),e.fmtp.some((t=>t.payload===i&&(t.config.includes("sprop-stereo=1")&&n.push(e.mid),!0))))})),{stereoMids:n,nackMids:r}}(e);this.remoteStereoMids=t,this.remoteNackMids=n}await this.pc.setRemoteDescription(e),this.pendingCandidates.forEach((e=>{this.pc.addIceCandidate(e)})),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,this.createAndSendOffer()):"answer"===e.type&&this.emit(gC)}async createAndSendOffer(e){var t;if(void 0===this.onOffer)return;if((null==e?void 0:e.iceRestart)&&(pg.debug("restarting ICE"),this.restartingIce=!0),"have-local-offer"===this.pc.signalingState){const t=this.pc.remoteDescription;if(!(null==e?void 0:e.iceRestart)||!t)return void(this.renegotiate=!0);await this.pc.setRemoteDescription(t)}else if("closed"===this.pc.signalingState)return void pg.warn("could not createOffer with closed peer connection");pg.debug("starting to negotiate");const n=await this.pc.createOffer(e),r=vC(null!==(t=n.sdp)&&void 0!==t?t:"");r.media.forEach((e=>{"audio"===e.type?wC(e,[],[]):"video"===e.type&&this.trackBitrates.some((t=>{if(!e.msid||!e.msid.includes(t.sid))return!1;let n=0;return e.rtp.some((e=>e.codec.toUpperCase()===t.codec.toUpperCase()&&(n=e.payload,!0))),n>0&&(e.fmtp.some((e=>e.payload===n&&(e.config.includes("x-google-max-bitrate")||(e.config+=";x-google-max-bitrate=".concat(t.maxbr)),!0)))||e.fmtp.push({payload:n,config:"x-google-max-bitrate=".concat(t.maxbr)})),!0}))})),this.trackBitrates=[],await this.setMungedLocalDescription(n,yC(r)),this.onOffer(n)}async createAndSetAnswer(){var e;const t=await this.pc.createAnswer(),n=vC(null!==(e=t.sdp)&&void 0!==e?e:"");return n.media.forEach((e=>{"audio"===e.type&&wC(e,this.remoteStereoMids,this.remoteNackMids)})),await this.setMungedLocalDescription(t,yC(n)),t}setTrackCodecBitrate(e,t,n){this.trackBitrates.push({sid:e,codec:t,maxbr:n})}close(){this.pc.onconnectionstatechange=null,this.pc.oniceconnectionstatechange=null,this.pc.close()}async setMungedLocalDescription(e,t){const n=e.sdp;e.sdp=t;try{return pg.debug("setting munged local description"),void await this.pc.setLocalDescription(e)}catch(t){pg.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),{error:t}),e.sdp=n}try{await this.pc.setLocalDescription(e)}catch(e){let t="unknown error";throw e instanceof Error?t=e.message:"string"==typeof e&&(t=e),new cP(t)}}}function wC(e,t,n){let r=0;e.rtp.some((e=>"opus"===e.codec&&(r=e.payload,!0))),r>0&&(e.rtcpFb||(e.rtcpFb=[]),n.includes(e.mid)&&!e.rtcpFb.some((e=>e.payload===r&&"nack"===e.type))&&e.rtcpFb.push({payload:r,type:"nack"}),t.includes(e.mid)&&e.fmtp.some((e=>e.payload===r&&(e.config.includes("stereo=1")||(e.config+=";stereo=1"),!0))))}class kC{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}isCloud(){return CP(this.serverUrl)}async getNextBestRegionUrl(e){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=await this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter((e=>!this.attemptedRegions.find((t=>t.url===e.url))));if(t.length>0){const e=t[0];return this.attemptedRegions.push(e),pg.debug("next region: ".concat(e.region)),e.url}return null}resetAttempts(){this.attemptedRegions=[]}async fetchRegionSettings(e){const t=await fetch("".concat((n=this.serverUrl,"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});var n;if(t.ok){const e=await t.json();return this.lastUpdateAt=Date.now(),e}throw new rP("Could not fetch region settings: ".concat(t.statusText),401===t.status?0:void 0,t.status)}}const OC="_lossy",PC="_reliable",EC="leave-reconnect";var CC,TC,xC;!function(e){e[e.New=0]="New",e[e.Connected=1]="Connected",e[e.Disconnected=2]="Disconnected",e[e.Reconnecting=3]="Reconnecting",e[e.Closed=4]="Closed"}(CC||(CC={}));class RC extends iE.EventEmitter{get isClosed(){return this._isClosed}constructor(e){super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=iC.peerConnectionTimeout,this.subscriberPrimary=!1,this.pcState=CC.New,this._isClosed=!0,this.pendingTrackResolvers={},this.hasPublished=!1,this.reconnectAttempts=0,this.reconnectStart=0,this.fullReconnectOnNext=!1,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.handleDataChannel=async e=>{let{channel:t}=e;if(t){if(t.label===PC)this.reliableDCSub=t;else{if(t.label!==OC)return;this.lossyDCSub=t}pg.debug("on data channel ".concat(t.id,", ").concat(t.label)),t.onmessage=this.handleDataMessage}},this.handleDataMessage=async e=>{var t,n;const r=await this.dataProcessLock.lock();try{let r;if(e.data instanceof ArrayBuffer)r=e.data;else{if(!(e.data instanceof Blob))return void pg.error("unsupported data type",e.data);r=await e.data.arrayBuffer()}const o=_w.decode(new Uint8Array(r));"speaker"===(null===(t=o.value)||void 0===t?void 0:t.$case)?this.emit(KO.ActiveSpeakersUpdate,o.value.speaker.speakers):"user"===(null===(n=o.value)||void 0===n?void 0:n.$case)&&this.emit(KO.DataPacketReceived,o.value.user,o.kind)}finally{r()}},this.handleDataError=e=>{const t=0===e.currentTarget.maxRetransmits?"lossy":"reliable";if(e instanceof ErrorEvent){const{error:n}=e.error;pg.error("DataChannel error on ".concat(t,": ").concat(e.message),n)}else pg.error("Unknown DataChannel Error on ".concat(t),e)},this.handleBufferedAmountLow=e=>{const t=0===e.currentTarget.maxRetransmits?ow.LOSSY:ow.RELIABLE;this.updateAndEmitDCBufferStatus(t)},this.handleDisconnect=(e,t)=>{if(this._isClosed)return;pg.warn("".concat(e," disconnected")),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const n=Date.now()-this.reconnectStart;let r=this.getNextRetryDelay({elapsedMs:n,retryCount:this.reconnectAttempts});null!==r?(e===EC&&(r=0),pg.debug("reconnecting in ".concat(r,"ms")),this.clearReconnectTimeout(),this.url&&this.token&&CP(new URL(this.url))&&(this.regionUrlProvider=new kC(this.url,this.token)),this.reconnectTimeout=SE.setTimeout((()=>this.attemptReconnect(t)),r)):(e=>{pg.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(e,"ms. giving up")),this.emit(KO.Disconnected),this.close()})(n)},this.updateAndEmitDCBufferStatus=e=>{const t=this.isBufferStatusLow(e);void 0!==t&&t!==this.dcBufferStatus.get(e)&&(this.dcBufferStatus.set(e,t),this.emit(KO.DCBufferStatusChanged,t,e))},this.isBufferStatusLow=e=>{const t=this.dataChannelForKind(e);if(t)return t.bufferedAmount<=t.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.isReconnecting&&(this.clearReconnectTimeout(),this.attemptReconnect(tw.RR_SIGNAL_DISCONNECTED))},this.client=new QE,this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new FP,this.dataProcessLock=new FP,this.dcBufferStatus=new Map([[ow.LOSSY,!0],[ow.RELIABLE,!0]])}async join(e,t,n,r){this.url=e,this.token=t,this.signalOpts=n;try{this.joinAttempts+=1;const o=await this.client.join(e,t,n,r);return this._isClosed=!1,this.subscriberPrimary=o.subscriberPrimary,this.publisher||this.configure(o),this.subscriberPrimary||this.negotiate(),this.clientConfiguration=o.clientConfiguration,o}catch(o){if(o instanceof rP&&1===o.reason&&(pg.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts)),this.joinAttempts{var t,n;try{(null===(t=this.publisher)||void 0===t?void 0:t.pc.removeTrack)&&(null===(n=this.publisher)||void 0===n||n.pc.removeTrack(e))}catch(e){pg.warn("could not removeTrack",{error:e})}})),this.publisher.close(),this.publisher=void 0),this.subscriber&&(this.subscriber.close(),this.subscriber=void 0),await this.client.close()}finally{e()}}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new iP("a track with the same ID has already been published");return new Promise(((t,n)=>{const r=setTimeout((()=>{delete this.pendingTrackResolvers[e.cid],n(new rP("publication of local track timed out, no response from server"))}),1e4);this.pendingTrackResolvers[e.cid]={resolve:e=>{clearTimeout(r),t(e)},reject:()=>{clearTimeout(r),n(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)}))}removeTrack(e){var t;if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return null===(t=this.publisher)||void 0===t||t.pc.removeTrack(e),!0}catch(e){pg.warn("failed to remove track",{error:e,method:"removeTrack"})}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return null===(e=this.reliableDCSub)||void 0===e?void 0:e.readyState}async getConnectedServerAddress(){if(void 0!==this.primaryPC)return async function(e){var t;let n="";const r=new Map,o=new Map;if((await e.getStats()).forEach((e=>{switch(e.type){case"transport":n=e.selectedCandidatePairId;break;case"candidate-pair":""===n&&e.selected&&(n=e.id),r.set(e.id,e);break;case"remote-candidate":o.set(e.id,"".concat(e.address,":").concat(e.port))}})),""===n)return;const i=null===(t=r.get(n))||void 0===t?void 0:t.remoteCandidateId;return void 0!==i?o.get(i):void 0}(this.primaryPC)}configure(e){var t;if(this.publisher||this.subscriber)return;this.participantSid=null===(t=e.participant)||void 0===t?void 0:t.sid;const n=this.makeRTCConfiguration(e);this.publisher=new SC(n),this.subscriber=new SC(n),this.emit(KO.TransportsCreated,this.publisher,this.subscriber),this.publisher.pc.onicecandidate=e=>{e.candidate&&(pg.trace("adding ICE candidate for peer",e.candidate),this.client.sendIceCandidate(e.candidate,oO.PUBLISHER))},this.subscriber.pc.onicecandidate=e=>{e.candidate&&this.client.sendIceCandidate(e.candidate,oO.SUBSCRIBER)},this.publisher.onOffer=e=>{this.client.sendOffer(e)};let r=this.publisher.pc,o=this.subscriber.pc,i=e.subscriberPrimary;i&&(r=this.subscriber.pc,o=this.publisher.pc,this.subscriber.pc.ondatachannel=this.handleDataChannel),this.primaryPC=r,r.onconnectionstatechange=async()=>{if(pg.debug("primary PC state changed ".concat(r.connectionState)),"connected"===r.connectionState){const t=this.pcState===CC.New;this.pcState=CC.Connected,t&&this.emit(KO.Connected,e)}else"failed"===r.connectionState&&this.pcState===CC.Connected&&(this.pcState=CC.Disconnected,this.handleDisconnect("primary peerconnection",i?tw.RR_SUBSCRIBER_FAILED:tw.RR_PUBLISHER_FAILED))},o.onconnectionstatechange=async()=>{pg.debug("secondary PC state changed ".concat(o.connectionState)),"failed"===o.connectionState&&this.handleDisconnect("secondary peerconnection",i?tw.RR_PUBLISHER_FAILED:tw.RR_SUBSCRIBER_FAILED)},this.subscriber.pc.ontrack=e=>{this.emit(KO.MediaTrackAdded,e.track,e.streams[0],e.receiver)},this.createDataChannels(),this.client.onAnswer=async e=>{this.publisher&&(pg.debug("received server answer",{RTCSdpType:e.type,signalingState:this.publisher.pc.signalingState}),await this.publisher.setRemoteDescription(e))},this.client.onTrickle=(e,t)=>{this.publisher&&this.subscriber&&(pg.trace("got ICE candidate from peer",{candidate:e,target:t}),t===oO.PUBLISHER?this.publisher.addIceCandidate(e):this.subscriber.addIceCandidate(e))},this.client.onOffer=async e=>{if(!this.subscriber)return;pg.debug("received server offer",{RTCSdpType:e.type,signalingState:this.subscriber.pc.signalingState}),await this.subscriber.setRemoteDescription(e);const t=await this.subscriber.createAndSetAnswer();this.client.sendAnswer(t)},this.client.onLocalTrackPublished=e=>{pg.debug("received trackPublishedResponse",e);const{resolve:t}=this.pendingTrackResolvers[e.cid];t?(delete this.pendingTrackResolvers[e.cid],t(e.track)):pg.error("missing track resolver for ".concat(e.cid))},this.client.onTokenRefresh=e=>{this.token=e},this.client.onClose=()=>{this.handleDisconnect("signal",tw.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{(null==e?void 0:e.canReconnect)?(this.fullReconnectOnNext=!0,this.primaryPC=void 0,this.handleDisconnect(EC)):(this.emit(KO.Disconnected,null==e?void 0:e.reason),this.close()),pg.trace("leave request",{leave:e})}}makeRTCConfiguration(e){const t=Qw({},this.rtcConfig);if(e.iceServers&&!t.iceServers){const n=[];e.iceServers.forEach((e=>{const t={urls:e.urls};e.username&&(t.username=e.username),e.credential&&(t.credential=e.credential),n.push(t)})),t.iceServers=n}return e.clientConfiguration&&e.clientConfiguration.forceRelay===XS.ENABLED&&(t.iceTransportPolicy="relay"),t.sdpSemantics="unified-plan",t.continualGatheringPolicy="gather_continually",t}createDataChannels(){this.publisher&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.publisher.pc.createDataChannel(OC,{ordered:!0,maxRetransmits:0}),this.reliableDC=this.publisher.pc.createDataChannel(PC,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}setPreferredCodec(e,t,n){if(!("getCapabilities"in RTCRtpSender))return;const r=RTCRtpSender.getCapabilities(t);if(!r)return;pg.debug("get capabilities",r);const o=[],i=[],a=[];r.codecs.forEach((e=>{const t=e.mimeType.toLowerCase();"audio/opus"!==t?t==="video/".concat(n)?"h264"!==n||e.sdpFmtpLine&&e.sdpFmtpLine.includes("profile-level-id=42e01f")?o.push(e):i.push(e):a.push(e):o.push(e)})),function(e){if(!PP())return!1;if(!("setCodecPreferences"in e))return!1;const t=pP();if(!t.browser.name||!t.browser.version)return!1;const n=SP[t.browser.name];return!!n&&function(e,t){const n=e.split("."),r=t.split("."),o=Math.min(e.length,t.length);for(let e=0;eo)return 1;if(t=0}(e)&&e.setCodecPreferences(o.concat(i,a))}async createSender(e,t,n){if(vP())return this.createTransceiverRTCRtpSender(e,t,n);if(bP())return pg.debug("using add-track fallback"),this.createRTCRtpSender(e.mediaStreamTrack);throw new sP("Required webRTC APIs not supported on this device")}async createSimulcastSender(e,t,n,r){if(vP())return this.createSimulcastTransceiverSender(e,t,n,r);if(bP())return pg.debug("using add-track fallback"),this.createRTCRtpSender(e.mediaStreamTrack);throw new sP("Cannot stream on this device")}async createTransceiverRTCRtpSender(e,t,n){if(!this.publisher)throw new sP("publisher is closed");const r={direction:"sendonly"};n&&(r.sendEncodings=n);const o=await this.publisher.pc.addTransceiver(e.mediaStreamTrack,r);return e.kind===cE.Kind.Video&&t.videoCodec&&(this.setPreferredCodec(o,e.kind,t.videoCodec),e.codec=t.videoCodec),o.sender}async createSimulcastTransceiverSender(e,t,n,r){if(!this.publisher)throw new sP("publisher is closed");const o={direction:"sendonly"};r&&(o.sendEncodings=r);const i=await this.publisher.pc.addTransceiver(t.mediaStreamTrack,o);if(n.videoCodec)return this.setPreferredCodec(i,e.kind,n.videoCodec),e.setSimulcastTrackSender(n.videoCodec,i.sender),i.sender}async createRTCRtpSender(e){if(!this.publisher)throw new sP("publisher is closed");return this.publisher.pc.addTrack(e)}async attemptReconnect(e){var t,n,r;if(!this._isClosed&&!this.attemptingReconnect){(null===(t=this.clientConfiguration)||void 0===t?void 0:t.resumeConnection)!==XS.DISABLED&&"closed"!==(null!==(r=null===(n=this.primaryPC)||void 0===n?void 0:n.signalingState)&&void 0!==r?r:"closed")||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?await this.restartConnection():await this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(e){this.reconnectAttempts+=1;let t=!0;e instanceof sP?(pg.debug("received unrecoverable error",{error:e}),t=!1):e instanceof jC||(this.fullReconnectOnNext=!0),t?this.handleDisconnect("reconnect",tw.RR_UNKOWN):(pg.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up")),this.emit(KO.Disconnected),this.close())}finally{this.attemptingReconnect=!1}}}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(e){pg.warn("encountered error in reconnect policy",{error:e})}return null}async restartConnection(e){var t,n,r,o,i;try{if(!this.url||!this.token)throw new sP("could not reconnect, url or token not saved");let o;pg.info("reconnecting, attempt: ".concat(this.reconnectAttempts)),this.emit(KO.Restarting),this.client.isConnected&&await this.client.sendLeave(),await this.client.close(),this.primaryPC=void 0,null===(t=this.publisher)||void 0===t||t.close(),this.publisher=void 0,null===(n=this.subscriber)||void 0===n||n.close(),this.subscriber=void 0;try{if(!this.signalOpts)throw pg.warn("attempted connection restart, without signal options present"),new jC;o=await this.join(null!=e?e:this.url,this.token,this.signalOpts)}catch(e){if(e instanceof rP&&0===e.reason)throw new sP("could not reconnect, token might be expired");throw new jC}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");await this.waitForPCReconnected(),this.client.setReconnected(),null===(r=this.regionUrlProvider)||void 0===r||r.resetAttempts(),this.emit(KO.Restarted,o)}catch(e){const t=await(null===(o=this.regionUrlProvider)||void 0===o?void 0:o.getNextBestRegionUrl());if(t)return void await this.restartConnection(t);throw null===(i=this.regionUrlProvider)||void 0===i||i.resetAttempts(),e}}async resumeConnection(e){var t;if(!this.url||!this.token)throw new sP("could not reconnect, url or token not saved");if(!this.publisher||!this.subscriber)throw new sP("publisher and subscriber connections unset");pg.info("resuming signal connection, attempt ".concat(this.reconnectAttempts)),this.emit(KO.Resuming);try{const t=await this.client.reconnect(this.url,this.token,this.participantSid,e);if(t){const e=this.makeRTCConfiguration(t);this.publisher.pc.setConfiguration(e),this.subscriber.pc.setConfiguration(e)}}catch(e){let t="";if(e instanceof Error&&(t=e.message),e instanceof rP&&0===e.reason)throw new sP("could not reconnect, token might be expired");throw new jC(t)}if(this.emit(KO.SignalResumed),this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");this.subscriber.restartingIce=!0,this.hasPublished&&await this.publisher.createAndSendOffer({iceRestart:!0}),await this.waitForPCReconnected(),this.client.setReconnected(),"open"===(null===(t=this.reliableDC)||void 0===t?void 0:t.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),this.emit(KO.Resumed)}async waitForPCInitialConnection(e,t){if(this.pcState!==CC.Connected){if(this.pcState!==CC.New)throw new sP("Expected peer connection to be new on initial connection");return new Promise(((n,r)=>{const o=()=>{pg.warn("closing engine"),SE.clearTimeout(a),r(new rP("room connection has been cancelled",3))};(null==t?void 0:t.signal.aborted)&&o(),null==t||t.signal.addEventListener("abort",o);const i=()=>{SE.clearTimeout(a),null==t||t.signal.removeEventListener("abort",o),n()},a=SE.setTimeout((()=>{this.off(KO.Connected,i),r(new rP("could not establish pc connection"))}),null!=e?e:this.peerConnectionTimeout);this.once(KO.Connected,i)}))}}async waitForPCReconnected(){var e;const t=Date.now();let n=t;for(this.pcState=CC.Reconnecting,pg.debug("waiting for peer connection to reconnect");n-t2e3&&"connected"===(null===(e=this.primaryPC)||void 0===e?void 0:e.connectionState)&&(this.pcState=CC.Connected),this.pcState===CC.Connected)return;await yP(100),n=Date.now()}throw new rP("could not establish PC connection")}async sendDataPacket(e,t){const n=_w.encode(e).finish();await this.ensurePublisherConnected(t);const r=this.dataChannelForKind(t);r&&r.send(n),this.updateAndEmitDCBufferStatus(t)}async ensureDataTransportConnected(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;var n,r,o;const i=t?this.subscriber:this.publisher,a=t?"Subscriber":"Publisher";if(!i)throw new rP("".concat(a," connection not set"));t||(null===(n=this.publisher)||void 0===n?void 0:n.isICEConnected)||"checking"===(null===(r=this.publisher)||void 0===r?void 0:r.pc.iceConnectionState)||this.negotiate();const s=this.dataChannelForKind(e,t);if("open"===(null==s?void 0:s.readyState))return;const c=(new Date).getTime()+this.peerConnectionTimeout;for(;(new Date).getTime(){if(!this.publisher)return void t(new cP("publisher is not defined"));this.hasPublished=!0;const n=()=>{pg.debug("engine disconnected while negotiation was ongoing"),o(),e()};this.on(KO.Closing,n);const r=setTimeout((()=>{t("negotiation timed out"),this.handleDisconnect("negotiation",tw.RR_SIGNAL_DISCONNECTED)}),this.peerConnectionTimeout),o=()=>{clearTimeout(r),this.off(KO.Closing,n)};this.publisher.once(bC,(()=>{var t;null===(t=this.publisher)||void 0===t||t.once(gC,(()=>{o(),e()}))})),this.publisher.negotiate((e=>{o(),t(e),e instanceof cP&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",tw.RR_UNKOWN)}))}))}dataChannelForKind(e,t){if(t){if(e===ow.LOSSY)return this.lossyDCSub;if(e===ow.RELIABLE)return this.reliableDCSub}else{if(e===ow.LOSSY)return this.lossyDC;if(e===ow.RELIABLE)return this.reliableDC}}failNext(){this.shouldFailNext=!0}clearReconnectTimeout(){this.reconnectTimeout&&SE.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){PP()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){PP()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class jC extends Error{}!function(e){e.Disconnected="disconnected",e.Connecting="connecting",e.Connected="connected",e.Reconnecting="reconnecting"}(TC||(TC={}));class IC extends iE.EventEmitter{constructor(e){var t;super(),t=this,this.state=TC.Disconnected,this.activeSpeakers=[],this.sid="",this.name="",this.metadata=void 0,this._isRecording=!1,this.audioEnabled=!0,this.connect=async(e,t,n)=>{const r=await this.disconnectLock.lock();if(this.state===TC.Connected)return pg.info("already connected to room ".concat(this.name)),r(),Promise.resolve();if(this.connectFuture)return r(),this.connectFuture.promise;this.setAndEmitConnectionState(TC.Connecting);const o=new kC(e,t),i=async(a,s,c)=>{var l;this.abortController&&this.abortController.abort(),this.abortController=new AbortController,null==r||r();try{await this.attemptConnection(null!=c?c:e,t,n,this.abortController),this.abortController=void 0,a()}catch(t){if(CP(new URL(e))&&t instanceof rP&&3!==t.reason){let e=null;try{e=await o.getNextBestRegionUrl(null===(l=this.abortController)||void 0===l?void 0:l.signal)}catch(e){if(e instanceof rP&&(401===e.status||3===e.reason))return void s(e)}e?(pg.debug("initial connection failed, retrying with another region"),await i(a,s,e)):s(t)}else s(t)}};return this.connectFuture=new BP(i,(()=>{this.clearConnectionFutures()})),this.connectFuture.promise},this.connectSignal=async(e,t,n,r,o,i)=>{const a=await n.join(e,t,{autoSubscribe:r.autoSubscribe,publishOnly:r.publishOnly,adaptiveStream:"object"==typeof o.adaptiveStream||o.adaptiveStream,maxRetries:r.maxRetries},i.signal);let s=a.serverInfo;if(s||(s={version:a.serverVersion,region:a.serverRegion}),pg.debug("connected to Livekit Server ".concat(Object.entries(s).map((e=>{let[t,n]=e;return"".concat(t,": ").concat(n)})).join(", "))),!a.serverVersion)throw new aP("unknown server version");return"0.15.1"===a.serverVersion&&this.options.dynacast&&(pg.debug("disabling dynacast due to server version"),o.dynacast=!1),a},this.applyJoinResponse=e=>{const t=e.participant;this.localParticipant.sid=t.sid,this.localParticipant.identity=t.identity,this.localParticipant.updateInfo(t),this.setupLocalParticipantEvents(),e.otherParticipants.forEach((e=>{e.sid!==this.localParticipant.sid&&e.identity!==this.localParticipant.identity?this.getOrCreateParticipant(e.sid,e):pg.warn("received info to create local participant as remote participant",{info:e,localParticipant:this.localParticipant})})),this.name=e.room.name,this.sid=e.room.sid,this.metadata=e.room.metadata,this._isRecording!==e.room.activeRecording&&(this._isRecording=e.room.activeRecording,this.emit(GO.RecordingStatusChanged,e.room.activeRecording))},this.attemptConnection=async(e,t,n,r)=>{var o;this.state===TC.Reconnecting?(pg.info("Reconnection attempt replaced by new connection attempt"),this.recreateEngine()):this.maybeCreateEngine(),this.acquireAudioContext(),this.connOptions=Qw(Qw({},iC),n),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const n=await this.connectSignal(e,t,this.engine,this.connOptions,this.options,r);this.applyJoinResponse(n),this.emit(GO.SignalConnected)}catch(e){this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish);const t=new rP("could not establish signal connection");throw e instanceof Error&&(t.message="".concat(t.message,": ").concat(e.message)),e instanceof rP&&(t.reason=e.reason,t.status=e.status),pg.debug("error trying to establish signal connection",{error:e}),t}if(r.signal.aborted)throw this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),new rP("Connection attempt aborted");try{await this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,r)}catch(e){throw this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),e}PP()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave),null===(o=navigator.mediaDevices)||void 0===o||o.addEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Connected)},this.disconnect=async function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var n,r,o,i;const a=await t.disconnectLock.lock();try{if(t.state===TC.Disconnected)return void pg.debug("already disconnected");pg.info("disconnect from room",{identity:t.localParticipant.identity}),t.state!==TC.Connecting&&t.state!==TC.Reconnecting||(pg.warn("abort connection attempt"),null===(n=t.abortController)||void 0===n||n.abort(),null===(o=null===(r=t.connectFuture)||void 0===r?void 0:r.reject)||void 0===o||o.call(r,new rP("Client initiated disconnect")),t.connectFuture=void 0),(null===(i=t.engine)||void 0===i?void 0:i.client.isConnected)&&await t.engine.client.sendLeave(),t.engine&&await t.engine.close(),t.handleDisconnect(e,ew.CLIENT_INITIATED),t.engine=void 0}finally{a()}},this.onPageLeave=async()=>{await this.disconnect()},this.handleRestarting=()=>{for(const e of this.participants.values())this.handleParticipantDisconnected(e.sid,e);this.setAndEmitConnectionState(TC.Reconnecting)&&this.emit(GO.Reconnecting)},this.handleRestarted=async e=>{pg.debug("reconnected to server",{region:e.serverRegion});try{e.participant&&(this.localParticipant.sid=e.participant.sid,this.handleParticipantUpdates([e.participant])),this.handleParticipantUpdates(e.otherParticipants);const t=[];this.localParticipant.tracks.forEach((e=>{e.track&&t.push(e)})),await Promise.all(t.map((async e=>{const t=e.track;this.localParticipant.unpublishTrack(t,!1),t.isMuted||((t instanceof pE||t instanceof fE)&&!t.isUserProvided&&(pg.debug("restarting existing track",{track:e.trackSid}),await t.restartTrack()),pg.debug("publishing new track",{track:e.trackSid}),await this.localParticipant.publishTrack(t,e.options))})))}catch(e){pg.error("error trying to re-publish tracks after reconnection",{error:e})}finally{this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Reconnected)}},this.handleParticipantUpdates=e=>{e.forEach((e=>{if(e.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(e);const t=this.identityToSid.get(e.identity);t&&t!==e.sid&&this.handleParticipantDisconnected(t,this.participants.get(t));let n=this.participants.get(e.sid);const r=!n;e.state===nw.DISCONNECTED?this.handleParticipantDisconnected(e.sid,n):(n=this.getOrCreateParticipant(e.sid,e),r||n.updateInfo(e))}))},this.handleActiveSpeakersUpdate=e=>{const t=[],n={};e.forEach((e=>{if(n[e.sid]=!0,e.sid===this.localParticipant.sid)this.localParticipant.audioLevel=e.level,this.localParticipant.setIsSpeaking(!0),t.push(this.localParticipant);else{const n=this.participants.get(e.sid);n&&(n.audioLevel=e.level,n.setIsSpeaking(!0),t.push(n))}})),n[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.participants.forEach((e=>{n[e.sid]||(e.audioLevel=0,e.setIsSpeaking(!1))})),this.activeSpeakers=t,this.emitWhenConnected(GO.ActiveSpeakersChanged,t)},this.handleSpeakersChanged=e=>{const t=new Map;this.activeSpeakers.forEach((e=>{t.set(e.sid,e)})),e.forEach((e=>{let n=this.participants.get(e.sid);e.sid===this.localParticipant.sid&&(n=this.localParticipant),n&&(n.audioLevel=e.level,n.setIsSpeaking(e.active),e.active?t.set(e.sid,n):t.delete(e.sid))}));const n=Array.from(t.values());n.sort(((e,t)=>t.audioLevel-e.audioLevel)),this.activeSpeakers=n,this.emitWhenConnected(GO.ActiveSpeakersChanged,n)},this.handleStreamStateUpdate=e=>{e.streamStates.forEach((e=>{const t=this.participants.get(e.participantSid);if(!t)return;const n=t.getTrackPublication(e.trackSid);n&&n.track&&(n.track.streamState=cE.streamStateFromProto(e.state),t.emit(JO.TrackStreamStateChanged,n,n.track.streamState),this.emitWhenConnected(GO.TrackStreamStateChanged,n,n.track.streamState,t))}))},this.handleSubscriptionPermissionUpdate=e=>{const t=this.participants.get(e.participantSid);if(!t)return;const n=t.getTrackPublication(e.trackSid);n&&n.setAllowed(e.allowed)},this.handleDataPacket=(e,t)=>{const n=this.participants.get(e.participantSid);this.emit(GO.DataReceived,e.payload,n,t,e.topic),null==n||n.emit(JO.DataReceived,e.payload,t)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(GO.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=e=>{pg.warn("could not playback audio",e),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(GO.AudioPlaybackStatusChanged,!1))},this.handleDeviceChange=async()=>{this.emit(GO.MediaDevicesChanged)},this.handleRoomUpdate=e=>{this._isRecording!==e.activeRecording&&(this._isRecording=e.activeRecording,this.emit(GO.RecordingStatusChanged,e.activeRecording)),this.metadata!==e.metadata&&(this.metadata=e.metadata,this.emitWhenConnected(GO.RoomMetadataChanged,e.metadata))},this.handleConnectionQualityUpdate=e=>{e.updates.forEach((e=>{if(e.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(e.quality);const t=this.participants.get(e.participantSid);t&&t.setConnectionQuality(e.quality)}))},this.onLocalParticipantMetadataChanged=e=>{this.emit(GO.ParticipantMetadataChanged,e,this.localParticipant)},this.onLocalTrackMuted=e=>{this.emit(GO.TrackMuted,e,this.localParticipant)},this.onLocalTrackUnmuted=e=>{this.emit(GO.TrackUnmuted,e,this.localParticipant)},this.onLocalTrackPublished=async e=>{this.emit(GO.LocalTrackPublished,e,this.localParticipant),e.track instanceof pE&&await e.track.checkForSilence()&&this.emit(GO.LocalAudioSilenceDetected,e)},this.onLocalTrackUnpublished=e=>{this.emit(GO.LocalTrackUnpublished,e,this.localParticipant)},this.onLocalConnectionQualityChanged=e=>{this.emit(GO.ConnectionQualityChanged,e,this.localParticipant)},this.onMediaDevicesError=e=>{this.emit(GO.MediaDevicesError,e)},this.onLocalParticipantPermissionsChanged=e=>{this.emit(GO.ParticipantPermissionsChanged,e,this.localParticipant)},this.setMaxListeners(100),this.participants=new Map,this.identityToSid=new Map,this.options=Qw(Qw({},oC),e),this.options.audioCaptureDefaults=Qw(Qw({},nC),null==e?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Qw(Qw({},rC),null==e?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Qw(Qw({},tC),null==e?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new FP,this.localParticipant=new JE("","",this.engine,this.options)}maybeCreateEngine(){this.engine||(this.engine=new RC(this.options),this.engine.client.onParticipantUpdate=this.handleParticipantUpdates,this.engine.client.onRoomUpdate=this.handleRoomUpdate,this.engine.client.onSpeakersChanged=this.handleSpeakersChanged,this.engine.client.onStreamStateUpdate=this.handleStreamStateUpdate,this.engine.client.onSubscriptionPermissionUpdate=this.handleSubscriptionPermissionUpdate,this.engine.client.onConnectionQuality=this.handleConnectionQualityUpdate,this.engine.on(KO.MediaTrackAdded,((e,t,n)=>{this.onTrackAdded(e,t,n)})).on(KO.Disconnected,(e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)})).on(KO.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(KO.DataPacketReceived,this.handleDataPacket).on(KO.Resuming,(()=>{this.setAndEmitConnectionState(TC.Reconnecting)&&this.emit(GO.Reconnecting)})).on(KO.Resumed,(()=>{this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Reconnected),this.updateSubscriptions()})).on(KO.SignalResumed,(()=>{this.state===TC.Reconnecting&&this.sendSyncState()})).on(KO.Restarting,this.handleRestarting).on(KO.Restarted,this.handleRestarted).on(KO.DCBufferStatusChanged,((e,t)=>{this.emit(GO.DCBufferStatusChanged,e,t)})),this.localParticipant&&this.localParticipant.setupEngine(this.engine))}static getLocalDevices(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return WP.getInstance().getDevices(e,t)}async prepareConnection(e){await fetch("http".concat(e.substring(2)),{method:"HEAD"})}getParticipantByIdentity(e){if(this.localParticipant.identity===e)return this.localParticipant;const t=this.identityToSid.get(e);return t?this.participants.get(t):void 0}clearConnectionFutures(){this.connectFuture=void 0}get isRecording(){return this._isRecording}async simulateScenario(e){let t,n=()=>{};switch(e){case"signal-reconnect":await this.engine.client.close(),this.engine.client.onClose&&this.engine.client.onClose("simulate disconnect");break;case"speaker":t=HO.fromPartial({scenario:{$case:"speakerUpdate",speakerUpdate:3}});break;case"node-failure":t=HO.fromPartial({scenario:{$case:"nodeFailure",nodeFailure:!0}});break;case"server-leave":t=HO.fromPartial({scenario:{$case:"serverLeave",serverLeave:!0}});break;case"migration":t=HO.fromPartial({scenario:{$case:"migration",migration:!0}});break;case"resume-reconnect":this.engine.failNext(),await this.engine.client.close(),this.engine.client.onClose&&this.engine.client.onClose("simulate resume-reconnect");break;case"force-tcp":case"force-tls":t=HO.fromPartial({scenario:{$case:"switchCandidateProtocol",switchCandidateProtocol:"force-tls"===e?2:1}}),n=async()=>{const e=this.engine.client.onLeave;e&&e({reason:ew.CLIENT_INITIATED,canReconnect:!0})}}t&&(this.engine.client.sendSimulateScenario(t),n())}async startAudio(){await this.acquireAudioContext();const e=[];this.participants.forEach((t=>{t.audioTracks.forEach((t=>{t.track&&t.track.attachedElements.forEach((t=>{e.push(t)}))}))}));try{await Promise.all(e.map((e=>(e.muted=!1,e.play())))),this.handleAudioPlaybackStarted()}catch(e){throw this.handleAudioPlaybackFailed(e),e}}get canPlaybackAudio(){return this.audioEnabled}getActiveAudioOutputDevice(){var e,t;return null!==(t=null===(e=this.options.audioOutput)||void 0===e?void 0:e.deviceId)&&void 0!==t?t:""}async switchActiveDevice(e,t){var n,r;const o=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?{exact:t}:t;if("audioinput"===e){const e=this.options.audioCaptureDefaults.deviceId;this.options.audioCaptureDefaults.deviceId=o;const t=Array.from(this.localParticipant.audioTracks.values()).filter((e=>e.source===cE.Source.Microphone));try{await Promise.all(t.map((e=>{var t;return null===(t=e.audioTrack)||void 0===t?void 0:t.setDeviceId(o)})))}catch(t){throw this.options.audioCaptureDefaults.deviceId=e,t}}else if("videoinput"===e){const e=this.options.videoCaptureDefaults.deviceId;this.options.videoCaptureDefaults.deviceId=o;const t=Array.from(this.localParticipant.videoTracks.values()).filter((e=>e.source===cE.Source.Camera));try{await Promise.all(t.map((e=>{var t;return null===(t=e.videoTrack)||void 0===t?void 0:t.setDeviceId(o)})))}catch(t){throw this.options.videoCaptureDefaults.deviceId=e,t}}else if("audiooutput"===e){if(!gP())throw new Error("cannot switch audio output, setSinkId not supported");null!==(n=(r=this.options).audioOutput)&&void 0!==n||(r.audioOutput={});const e=this.options.audioOutput.deviceId;this.options.audioOutput.deviceId=t;try{await Promise.all(Array.from(this.participants.values()).map((e=>e.setAudioOutput({deviceId:t}))))}catch(t){throw this.options.audioOutput.deviceId=e,t}}}setupLocalParticipantEvents(){this.localParticipant.on(JO.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(JO.TrackMuted,this.onLocalTrackMuted).on(JO.TrackUnmuted,this.onLocalTrackUnmuted).on(JO.LocalTrackPublished,this.onLocalTrackPublished).on(JO.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(JO.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(JO.MediaDevicesError,this.onMediaDevicesError).on(JO.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;null===(e=this.engine)||void 0===e||e.close(),this.engine=void 0,this.participants.clear(),this.maybeCreateEngine()}onTrackAdded(e,t,n){if(this.state===TC.Connecting||this.state===TC.Reconnecting){const r=()=>{this.onTrackAdded(e,t,n),o()},o=()=>{this.off(GO.Reconnected,r),this.off(GO.Connected,r),this.off(GO.Disconnected,o)};return this.once(GO.Reconnected,r),this.once(GO.Connected,r),void this.once(GO.Disconnected,o)}if(this.state===TC.Disconnected)return void pg.warn("skipping incoming track after Room disconnected");const r=function(e){const t=e.split("|");return t.length>1?[t[0],e.substr(t[0].length+1)]:[e,""]}(t.id),o=r[0];let i=r[1];if(i&&""!==i||(i=e.id),o===this.localParticipant.sid)return void pg.warn("tried to create RemoteParticipant for local participant");const a=this.getOrCreateParticipant(o);let s;this.options.adaptiveStream&&(s="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{}),a.addSubscribedMediaTrack(e,i,t,n,s)}handleDisconnect(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var n;this.state!==TC.Disconnected&&(this.participants.forEach((e=>{e.tracks.forEach((t=>{e.unpublishTrack(t.trackSid)}))})),this.localParticipant.tracks.forEach((t=>{var n,r;t.track&&this.localParticipant.unpublishTrack(t.track,e),e&&(null===(n=t.track)||void 0===n||n.detach(),null===(r=t.track)||void 0===r||r.stop())})),this.localParticipant.off(JO.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(JO.TrackMuted,this.onLocalTrackMuted).off(JO.TrackUnmuted,this.onLocalTrackUnmuted).off(JO.LocalTrackPublished,this.onLocalTrackPublished).off(JO.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(JO.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(JO.MediaDevicesError,this.onMediaDevicesError).off(JO.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.tracks.clear(),this.localParticipant.videoTracks.clear(),this.localParticipant.audioTracks.clear(),this.participants.clear(),this.activeSpeakers=[],this.audioContext&&"boolean"==typeof this.options.expWebAudioMix&&(this.audioContext.close(),this.audioContext=void 0),PP()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),null===(n=navigator.mediaDevices)||void 0===n||n.removeEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(TC.Disconnected),this.emit(GO.Disconnected,t))}handleParticipantDisconnected(e,t){this.participants.delete(e),t&&(this.identityToSid.delete(t.identity),t.tracks.forEach((e=>{t.unpublishTrack(e.trackSid,!0)})),this.emit(GO.ParticipantDisconnected,t))}async acquireAudioContext(){var e,t;"boolean"!=typeof this.options.expWebAudioMix&&this.options.expWebAudioMix.audioContext?(this.audioContext=this.options.expWebAudioMix.audioContext,await this.audioContext.resume()):this.audioContext=null!==(e=mP())&&void 0!==e?e:void 0,this.options.expWebAudioMix&&this.participants.forEach((e=>e.setAudioContext(this.audioContext)));const n="running"===(null===(t=this.audioContext)||void 0===t?void 0:t.state);n!==this.canPlaybackAudio&&(this.audioEnabled=n,this.emit(GO.AudioPlaybackStatusChanged,n))}createParticipant(e,t){let n;return n=t?GE.fromParticipantInfo(this.engine.client,t):new GE(this.engine.client,e,"",void 0,void 0),this.options.expWebAudioMix&&n.setAudioContext(this.audioContext),n}getOrCreateParticipant(e,t){if(this.participants.has(e))return this.participants.get(e);const n=this.createParticipant(e,t);return this.participants.set(e,n),t&&(this.identityToSid.set(t.identity,t.sid),this.emitWhenConnected(GO.ParticipantConnected,n)),n.on(JO.TrackPublished,(e=>{this.emitWhenConnected(GO.TrackPublished,e,n)})).on(JO.TrackSubscribed,((e,t)=>{e.kind===cE.Kind.Audio&&(e.on(YO.AudioPlaybackStarted,this.handleAudioPlaybackStarted),e.on(YO.AudioPlaybackFailed,this.handleAudioPlaybackFailed)),this.emit(GO.TrackSubscribed,e,t,n)})).on(JO.TrackUnpublished,(e=>{this.emit(GO.TrackUnpublished,e,n)})).on(JO.TrackUnsubscribed,((e,t)=>{this.emit(GO.TrackUnsubscribed,e,t,n)})).on(JO.TrackSubscriptionFailed,(e=>{this.emit(GO.TrackSubscriptionFailed,e,n)})).on(JO.TrackMuted,(e=>{this.emitWhenConnected(GO.TrackMuted,e,n)})).on(JO.TrackUnmuted,(e=>{this.emitWhenConnected(GO.TrackUnmuted,e,n)})).on(JO.ParticipantMetadataChanged,(e=>{this.emitWhenConnected(GO.ParticipantMetadataChanged,e,n)})).on(JO.ConnectionQualityChanged,(e=>{this.emitWhenConnected(GO.ConnectionQualityChanged,e,n)})).on(JO.ParticipantPermissionsChanged,(e=>{this.emitWhenConnected(GO.ParticipantPermissionsChanged,e,n)})).on(JO.TrackSubscriptionStatusChanged,((e,t)=>{this.emitWhenConnected(GO.TrackSubscriptionStatusChanged,e,t,n)})).on(JO.TrackSubscriptionPermissionChanged,((e,t)=>{this.emitWhenConnected(GO.TrackSubscriptionPermissionChanged,e,t,n)})),t&&n.updateInfo(t),n}sendSyncState(){var e,t;if(void 0===this.engine.subscriber||null===this.engine.subscriber.pc.localDescription)return;const n=this.engine.subscriber.pc.localDescription,r=this.engine.subscriber.pc.remoteDescription,o=null===(t=null===(e=this.connOptions)||void 0===e?void 0:e.autoSubscribe)||void 0===t||t,i=new Array;this.participants.forEach((e=>{e.tracks.forEach((e=>{e.isDesired!==o&&i.push(e.trackSid)}))})),this.engine.client.sendSyncState({answer:eC({sdp:n.sdp,type:n.type}),offer:r?eC({sdp:r.sdp,type:r.type}):void 0,subscription:{trackSids:i,subscribe:!o,participantTracks:[]},publishTracks:this.localParticipant.publishedTracksInfo(),dataChannels:this.localParticipant.dataChannelsInfo()})}updateSubscriptions(){for(const e of this.participants.values())for(const t of e.videoTracks.values())t.isSubscribed&&t instanceof VE&&t.emitTrackUpdate()}setAndEmitConnectionState(e){return e!==this.state&&(this.state=e,this.emit(GO.ConnectionStateChanged,this.state),!0)}emitWhenConnected(e){if(this.state===TC.Connected){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=DC(l,r,c),p=r,f={},h=0;for(let n=0;ne.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function HC(e){return e.replace(/left|right|bottom|top/g,(e=>ZC[e]))}function qC(e,t,n){void 0===n&&(n=!1);const r=_C(e),o=NC(e),i=AC(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=HC(a)),{main:a,cross:HC(a)}}const $C={start:"end",end:"start"};function VC(e){return e.replace(/start|end/g,(e=>$C[e]))}const GC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...m}=e,y=MC(r),v=MC(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),g=d||(v||!h?[HC(a)]:function(e){const t=HC(e);return[VC(e),t,VC(t)]}(a));d||"none"===f||g.push(...function(e,t,n,r){const o=_C(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(MC(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(VC)))),i}(a,h,f,b));const S=[a,...g],w=await BC(t,m),k=[];let O=(null==(n=o.flip)?void 0:n.overflows)||[];if(l&&k.push(w[y]),u){const{main:e,cross:t}=qC(r,i,b);k.push(w[e],w[t])}if(O=[...O,{placement:r,overflows:k}],!k.every((e=>e<=0))){var P,E;const e=((null==(P=o.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(E=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(p){case"bestFit":{var C;const e=null==(C=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:C[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},JC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=MC(n),s=_C(n),c="x"===NC(n),l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const KC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,l={x:n,y:r},u=await BC(t,c),d=NC(MC(o)),p=function(e){return"x"===e?"y":"x"}(d);let f=l[d],h=l[p];if(i){const e="y"===d?"bottom":"right";f=WC(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===p?"bottom":"right";h=WC(h+u["y"===p?"top":"left"],h,h-u[e])}const m=s.fn({...t,[d]:f,[p]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function YC(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function QC(e){return YC(e).getComputedStyle(e)}function XC(e){return e instanceof YC(e).Node}function eT(e){return XC(e)?(e.nodeName||"").toLowerCase():""}let tT;function nT(){if(tT)return tT;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(tT=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),tT):navigator.userAgent}function rT(e){return e instanceof YC(e).HTMLElement}function oT(e){return e instanceof YC(e).Element}function iT(e){return"undefined"!=typeof ShadowRoot&&(e instanceof YC(e).ShadowRoot||e instanceof ShadowRoot)}function aT(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=QC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function sT(e){return["table","td","th"].includes(eT(e))}function cT(e){const t=/firefox/i.test(nT()),n=QC(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function lT(){return/^((?!chrome|android).)*safari/i.test(nT())}function uT(e){return["html","body","#document"].includes(eT(e))}const dT=Math.min,pT=Math.max,fT=Math.round;function hT(e){const t=QC(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=rT(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=fT(n)!==i||fT(r)!==a;return s&&(n=i,r=a),{width:n,height:r,fallback:s}}function mT(e){return oT(e)?e:e.contextElement}const yT={x:1,y:1};function vT(e){const t=mT(e);if(!rT(t))return yT;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=hT(t);let a=(i?fT(n.width):n.width)/r,s=(i?fT(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function bT(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=mT(e);let c=yT;t&&(r?oT(r)&&(c=vT(r)):c=vT(e));const l=s?YC(s):window,u=lT()&&n;let d=(a.left+(u&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(a.top+(u&&(null==(i=l.visualViewport)?void 0:i.offsetTop)||0))/c.y,f=a.width/c.x,h=a.height/c.y;if(s){const e=YC(s),t=r&&oT(r)?YC(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=vT(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,p*=e.y,f*=e.x,h*=e.y,d+=t.x,p+=t.y,n=YC(n).frameElement}}return UC({width:f,height:h,x:d,y:p})}function gT(e){return((XC(e)?e.ownerDocument:e.document)||window.document).documentElement}function ST(e){return oT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function wT(e){return bT(gT(e)).left+ST(e).scrollLeft}function kT(e){if("html"===eT(e))return e;const t=e.assignedSlot||e.parentNode||iT(e)&&e.host||gT(e);return iT(t)?t.host:t}function OT(e){const t=kT(e);return uT(t)?t.ownerDocument.body:rT(t)&&aT(t)?t:OT(t)}function PT(e,t){var n;void 0===t&&(t=[]);const r=OT(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=YC(r);return o?t.concat(i,i.visualViewport||[],aT(r)?r:[]):t.concat(r,PT(r))}function ET(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=YC(e),r=gT(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=lT();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=gT(e),n=ST(e),r=e.ownerDocument.body,o=pT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+wT(e);const s=-n.scrollTop;return"rtl"===QC(r).direction&&(a+=pT(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(gT(e));else if(oT(t))r=function(e,t){const n=bT(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rT(e)?vT(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n={...t};if(lT()){var o,i;const t=YC(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(i=t.visualViewport)?void 0:i.offsetTop)||0}r=n}return UC(r)}function CT(e,t){return rT(e)&&"fixed"!==QC(e).position?t?t(e):e.offsetParent:null}function TT(e,t){const n=YC(e);if(!rT(e))return n;let r=CT(e,t);for(;r&&sT(r)&&"static"===QC(r).position;)r=CT(r,t);return r&&("html"===eT(r)||"body"===eT(r)&&"static"===QC(r).position&&!cT(r))?n:r||function(e){let t=kT(e);for(;rT(t)&&!uT(t);){if(cT(t))return t;t=kT(t)}return null}(e)||n}function xT(e,t,n){const r=rT(t),o=gT(t),i=bT(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==eT(t)||aT(o))&&(a=ST(t)),rT(t)){const e=bT(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=wT(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}const RT={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=PT(e).filter((e=>oT(e)&&"body"!==eT(e))),o=null;const i="fixed"===QC(e).position;let a=i?kT(e):e;for(;oT(a)&&!uT(a);){const e=QC(a),t=cT(a);"fixed"===e.position&&(o=null),(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==a)),a=kT(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],c=a.reduce(((e,n)=>{const r=ET(t,n,o);return e.top=pT(r.top,e.top),e.right=dT(r.right,e.right),e.bottom=dT(r.bottom,e.bottom),e.left=pT(r.left,e.left),e}),ET(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=rT(n),i=gT(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==eT(n)||aT(i))&&(a=ST(n)),rT(n))){const e=bT(n);s=vT(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+c.x,y:t.y*s.y-a.scrollTop*s.y+c.y}},isElement:oT,getDimensions:function(e){return hT(e)},getOffsetParent:TT,getDocumentElement:gT,getScale:vT,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||TT,i=this.getDimensions;return{reference:xT(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===QC(e).direction};var jT=a(8804);function IT(e){return"function"==typeof e}function _T(e){return function(t){if(function(e){return IT(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var AT=function(e,t){return AT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},AT(e,t)};function MT(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}AT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function NT(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function LT(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function UT(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof BT?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(o[e](t))}catch(e){u(i[0][3],e)}}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}(this,arguments,(function(){var t,n,r;return NT(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,BT(t.read())];case 3:return n=o.sent(),r=n.value,n.done?[4,BT(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,BT(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Ex(e){return IT(null==e?void 0:e.getReader)}function Cx(e){if(e instanceof yx)return e;if(null!=e){if(bx(e))return function(e){return new yx((function(t){var n=e[hx]();if(IT(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}(e);if(px(e))return r=e,new yx((function(e){for(var t=0;t0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?HT:(this.currentObservers=null,i.push(e),new ZT((function(){t.currentObservers=null,WT(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,o=t.isStopped;n?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new yx;return e.source=this,e},t.create=function(e,t){return new zx(e,t)},t}(yx),zx=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return MT(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:HT},t}(Fx),Wx=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return MT(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Fx),Zx=Array.isArray;function Hx(){for(var e=[],t=0;tnew Promise(((r,o)=>{var i=e=>{try{s(n.next(e))}catch(e){o(e)}},a=e=>{try{s(n.throw(e))}catch(e){o(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())})),lR="lk";var uR=[GO.ConnectionStateChanged,GO.RoomMetadataChanged,GO.ActiveSpeakersChanged,GO.ConnectionQualityChanged,GO.ParticipantConnected,GO.ParticipantDisconnected,GO.ParticipantPermissionsChanged,GO.ParticipantMetadataChanged,GO.TrackMuted,GO.TrackUnmuted,GO.TrackPublished,GO.TrackUnpublished,GO.TrackStreamStateChanged,GO.TrackSubscriptionFailed,GO.TrackSubscriptionPermissionChanged,GO.TrackSubscriptionStatusChanged,GO.LocalTrackPublished,GO.LocalTrackUnpublished],dR=(JO.ConnectionQualityChanged,JO.IsSpeakingChanged,JO.ParticipantMetadataChanged,JO.ParticipantPermissionsChanged,JO.TrackMuted,JO.TrackUnmuted,JO.TrackPublished,JO.TrackUnpublished,JO.TrackStreamStateChanged,JO.TrackSubscriptionFailed,JO.TrackSubscriptionPermissionChanged,JO.TrackSubscriptionStatusChanged,JO.LocalTrackPublished,JO.LocalTrackUnpublished,jT.getLogger("lk-components-js"));dR.setDefaultLevel("WARN");var pR=dR,fR=[{columns:1,rows:1,name:"1x1",minTiles:1,maxTiles:1,minWidth:0,minHeight:0},{columns:1,rows:2,name:"1x2",minTiles:2,maxTiles:2,minWidth:0,minHeight:0},{columns:2,rows:1,name:"2x1",minTiles:2,maxTiles:2,minWidth:800,minHeight:0},{columns:2,rows:2,name:"2x2",minTiles:3,maxTiles:4,minWidth:560,minHeight:0},{columns:3,rows:3,name:"3x3",minTiles:5,maxTiles:9,minWidth:700,minHeight:0},{columns:4,rows:4,name:"4x4",minTiles:10,maxTiles:16,minWidth:960,minHeight:0},{columns:5,rows:5,name:"5x5",minTiles:17,maxTiles:25,minWidth:1100,minHeight:0}];function hR(e,t,n,r){let o=0,i=e.find(((e,n,r)=>{o=n;const i=-1!==r.findIndex(((t,r)=>{const o=r>n,i=t.maxTiles===e.maxTiles;return o&&i}));return e.maxTiles>=t&&!i}));if(void 0===i){if(i=e[e.length-1],!i)throw new Error("No layout or fallback layout found.");pR.warn(`No layout found for: participantCount: ${t}, width/height: ${n}/${r} fallback to biggest available layout (${i.name}).`)}if((n0){const t=e[o-1];i=hR(e.slice(0,o),t.maxTiles,n,r)}return i}function mR(e){return"object"==typeof e}function yR(e){return Array.isArray(e)&&e.filter(mR).length>0}function vR(e){return void 0!==e&&(function(e){var t;return!!e&&(e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&e.hasOwnProperty("track")&&void 0!==(null==(t=e.publication)?void 0:t.track))}(e)||function(e){return!!e&&(e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&e.hasOwnProperty("publication")&&void 0!==e.publication)}(e))}function bR(e){return!!e&&e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&void 0===e.publication}function gR(e){return"string"==typeof e||"number"==typeof e?`${e}`:vR(e)?`${e.participant.identity}_${e.publication.source}`:`${e.participant.identity}_${e.source}`}function SR(e,t){var n,r,o,i;return(null!=(r=null==(n=e.joinedAt)?void 0:n.getTime())?r:0)-(null!=(i=null==(o=t.joinedAt)?void 0:o.getTime())?i:0)}function wR(e,t){const n=Math.max(e.length,t.length);return new Array(n).fill([]).map(((n,r)=>[e[r],t[r]]))}function kR(e,t,n){return e.filter((e=>!t.map((e=>n(e))).includes(n(e))))}function OR(e){return e.map((e=>"string"==typeof e||"number"==typeof e?`${e}`:gR(e)))}function PR(e,t){const n=t.findIndex((t=>gR(t)===gR(e)));if(-1===n)throw new Error(`Element not part of the array: ${gR(e)} not in ${OR(t)}`);return n}function ER(e,t){var n;return n=t,e.reduce(((e,t,r)=>r%n==0?[...e,[t]]:[...e.slice(0,-1),[...e.slice(-1)[0],t]]),[])}function CR(e,...t){return new yx((n=>{const r=()=>{n.next(e)};return t.forEach((t=>{e.on(t,r)})),()=>{t.forEach((t=>{e.off(t,r)}))}})).pipe(Ux(e))}function TR(e){return`${lR}-${e}`}function xR(e){if(vR(e))return e.publication;{const{source:t,name:n,participant:r}=e;if(t&&n)return r.getTracks().find((e=>e.source===t&&e.trackName===n));if(n)return r.getTrackByName(n);if(t)return r.getTrack(t);throw new Error("At least one of source and name needs to be defined")}}function RR(e,...t){return new yx((n=>{const r=()=>{n.next(e)};return t.forEach((t=>{e.on(t,r)})),()=>{t.forEach((t=>{e.off(t,r)}))}})).pipe(Ux(e))}function jR(e){const t=RR(e,JO.TrackMuted,JO.TrackUnmuted,JO.ParticipantPermissionsChanged,JO.TrackPublished,JO.TrackUnpublished,JO.TrackSubscribed,JO.TrackUnsubscribed,JO.LocalTrackPublished,JO.LocalTrackUnpublished).pipe(dx((e=>{const{isMicrophoneEnabled:t,isCameraEnabled:n,isScreenShareEnabled:r}=e,o=e.getTrack(cE.Source.Microphone);return{isCameraEnabled:n,isMicrophoneEnabled:t,isScreenShareEnabled:r,cameraTrack:e.getTrack(cE.Source.Camera),microphoneTrack:o,participant:e}})));return t}function IR(e,t){return new yx((n=>{const r=(...e)=>{n.next(e)};return e.on(t,r),()=>{e.off(t,r)}}))}function _R(e,t){var n,r;return RR(e,JO.TrackMuted,JO.TrackUnmuted,JO.TrackSubscribed,JO.TrackUnsubscribed,JO.LocalTrackPublished,JO.LocalTrackUnpublished).pipe(dx((e=>{var n;const r=e.getTrack(t);return null==(n=null==r?void 0:r.isMuted)||n})),Ux(null==(r=null==(n=e.getTrack(t))?void 0:n.isMuted)||r))}function AR(e,t){const n=new Wx(void 0),r=t?jR(t.localParticipant).pipe(dx((t=>{var n,r,o;let i;switch(e){case"videoinput":i=null==(n=t.cameraTrack)?void 0:n.track;break;case"audioinput":i=null==(r=t.microphoneTrack)?void 0:r.track;break;default:i=void 0}return null==(o=null==i?void 0:i.mediaStreamTrack.getSettings())?void 0:o.deviceId})),function(){for(var e=[],t=0;tcR(this,null,(function*(){var o,i,a,s;if(t){pR.debug(`Switching active device of kind "${e}" with id ${r}.`),yield t.switchActiveDevice(e,r);let c=r;"videoinput"===e?c=yield null==(i=null==(o=t.localParticipant.getTrack(cE.Source.Camera))?void 0:o.track)?void 0:i.getDeviceId():"audioinput"===e&&(c=yield null==(s=null==(a=t.localParticipant.getTrack(cE.Source.Microphone))?void 0:a.track)?void 0:s.getDeviceId()),c!==r&&"default"!==r&&pR.warn(`Failed to select the desired device. Desired: ${r}. Actual: ${c}`),n.next("default"===r?r:c)}else pR.debug("Skip the device switch because the room object is not available. "),n.next(r)}))}}function MR(e){return CR(e,GO.AudioPlaybackStatusChanged).pipe(dx((e=>({canPlayAudio:e.canPlaybackAudio}))))}function NR(){return{className:TR("start-audio-button"),roomAudioPlaybackAllowedObservable:MR,handleStartAudioPlayback:e=>cR(this,null,(function*(){pR.info("Start Audio for room: ",e),yield e.startAudio()}))}}function DR(e,t,n=!0){const r=[e.localParticipant,...Array.from(e.participants.values())],o=[];return r.forEach((e=>{t.forEach((t=>{const r=Array.from(e.tracks.values()).filter((e=>e.source===t&&(!n||e.track))).map((t=>({participant:e,publication:t,track:t.track,source:t.source})));o.push(...r)}))})),{trackReferences:o,participants:r}}function LR(e,t=1e3){if(null===e)return qx(!1);const n=Kx(e,"mousemove").pipe(dx((()=>!0))),r=n.pipe(function(e,t){var n=function(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,o=n.each,i=n.with,a=void 0===i?aR:i,s=n.scheduler,c=void 0===s?null!=t?t:oR:s,l=n.meta,u=void 0===l?null:l;if(null==r&&null==o)throw new TypeError("No timeout provided.");return _T((function(e,t){var n,i,s=null,l=0,d=function(e){i=xx(t,c,(function(){try{n.unsubscribe(),Cx(a({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(lx(t,(function(e){null==i||i.unsubscribe(),l++,t.next(s=e),o>0&&d(o)}),void 0,void 0,(function(){(null==i?void 0:i.closed)||null==i||i.unsubscribe(),s=null}))),!l&&d(null!=r?"number"==typeof r?r:+r-c.now():o)}))}({each:t,with:()=>{return Lx(qx(!1),r.pipe((e=n,_T((function(t,n){var r=!1,o=lx(n,(function(){null==o||o.unsubscribe(),r=!0}),KT);Cx(e).subscribe(o),t.subscribe(lx(n,(function(e){return r&&n.next(e)})))})))));var e}}),(void 0===i&&(i=mx),o=null!=o?o:sR,_T((function(e,t){var n,r=!0;e.subscribe(lx(t,(function(e){var a=i(e);!r&&o(n,a)||(r=!1,n=a,t.next(e))})))}))));var o,i;return r}new TextEncoder,new TextDecoder;var UR=pR,BR=Object.defineProperty,FR=Object.defineProperties,zR=Object.getOwnPropertyDescriptors,WR=Object.getOwnPropertySymbols,ZR=Object.prototype.hasOwnProperty,HR=Object.prototype.propertyIsEnumerable,qR=(e,t,n)=>t in e?BR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$R=(e,t)=>{for(var n in t||(t={}))ZR.call(t,n)&&qR(e,n,t[n]);if(WR)for(var n of WR(t))HR.call(t,n)&&qR(e,n,t[n]);return e},VR=(e,t)=>FR(e,zR(t)),GR=(e,t)=>{var n={};for(var r in e)ZR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&WR)for(var r of WR(e))t.indexOf(r)<0&&HR.call(e,r)&&(n[r]=e[r]);return n};function JR(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function KR(...e){const t=$R({},e[0]);for(let n=1;n=65&&e.charCodeAt(2)<=90?t[e]=JR(n,o):t[e]="className"!==e&&"UNSAFE_className"!==e||"string"!=typeof n||"string"!=typeof o?void 0!==o?o:n:(0,Zt.Z)(n,o)}}return t}function YR(e){return void 0!==e}function QR(...e){return KR(...e.filter(YR))}var XR=e.createContext(void 0);function ej(){return e.useContext(XR)}var tj=e.createContext(void 0);var nj=e.createContext(void 0);function rj(){return e.useContext(nj)}function oj(t){var n;const r=rj(),o=e.useContext(tj),i=null!=(n=null!=t?t:r)?n:null==o?void 0:o.participant;if(!i)throw new Error("No participant provided, make sure you are inside a participant context or pass the participant explicitly");return i}var ij=e.createContext(void 0);function aj(){const t=e.useContext(ij);if(!t)throw Error("tried to access room context outside of livekit room component");return t}function sj(){return e.useContext(ij)}function cj(e){const t=sj(),n=null!=e?e:t;if(!n)throw new Error("No room provided, make sure you are inside a Room context or pass the room explicitly");return n}function lj(t,n){const[r,o]=e.useState(n);return e.useEffect((()=>{if("undefined"==typeof window||!t)return;const e=t.subscribe(o);return()=>e.unsubscribe()}),[t]),r}function uj(t){const n=cj(t),r=e.useMemo((()=>function(e){return function(e,t){return new yx((n=>{const r=(...e)=>{n.next(e)};return e.on(t,r),()=>{e.off(t,r)}}))}(e,GO.ConnectionStateChanged).pipe(dx((([e])=>e)),Ux(e.state))}(n)),[n]);return lj(r,n.state)}function dj(t){var n=t,{room:r}=n,o=GR(n,["room"]);const i=uj(r);return e.createElement("div",$R({},o),i)}function pj({props:t}){const{dispatch:n}=function(){const t=e.useContext(XR);if(!t)throw Error("Tried to access LayoutContext context outside a LayoutContextProvider provider.");return t}().widget,{className:r}=e.useMemo((()=>({className:[TR("button"),TR("chat-toggle")].join(" ")})),[]);return{mergedProps:e.useMemo((()=>QR(t,{className:r,onClick:()=>{n&&n({msg:"toggle_chat"})}})),[t,r,n])}}function fj(t){const{mergedProps:n}=pj({props:t});return e.createElement("button",$R({},n),t.children)}function hj(t){const{buttonProps:n}=function(t){const n=aj(),r=uj(n),o=e.useMemo((()=>{const{className:e,disconnect:o}=function(e){return{className:TR("disconnect-button"),disconnect:t=>{e.disconnect(t)}}}(n);return QR(t,{className:e,onClick:()=>{var e;return o(null==(e=t.stopTracks)||e)},disabled:r===TC.Disconnected})}),[n,t,r]);return{buttonProps:o}}(t);return e.createElement("button",$R({},n),t.children)}var mj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708L11 10.293V4.5A1.5 1.5 0 0 0 9.5 3H3.707zM0 4.5a1.5 1.5 0 0 1 .943-1.393l9.532 9.533c-.262.224-.603.36-.975.36h-8A1.5 1.5 0 0 1 0 11.5z"}),e.createElement("path",{d:"m15.2 3.6-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),yj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M0 4.5A1.5 1.5 0 0 1 1.5 3h8A1.5 1.5 0 0 1 11 4.5v7A1.5 1.5 0 0 1 9.5 13h-8A1.5 1.5 0 0 1 0 11.5zM15.2 3.6l-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),vj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 2.75A2.75 2.75 0 0 1 2.75 0h10.5A2.75 2.75 0 0 1 16 2.75v13.594a.75.75 0 0 1-1.234.572l-3.691-3.12a1.25 1.25 0 0 0-.807-.296H2.75A2.75 2.75 0 0 1 0 10.75v-8ZM2.75 1.5c-.69 0-1.25.56-1.25 1.25v8c0 .69.56 1.25 1.25 1.25h7.518c.65 0 1.279.23 1.775.65l2.457 2.077V2.75c0-.69-.56-1.25-1.25-1.25H2.75Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 4.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Z",clipRule:"evenodd"})),bj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M5.293 2.293a1 1 0 0 1 1.414 0l4.823 4.823a1.25 1.25 0 0 1 0 1.768l-4.823 4.823a1 1 0 0 1-1.414-1.414L9.586 8 5.293 3.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})),gj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5},e.createElement("path",{d:"M10 1.75h4.25m0 0V6m0-4.25L9 7M6 14.25H1.75m0 0V10m0 4.25L7 9"}))),Sj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 2.75A2.75 2.75 0 0 1 4.75 0h6.5A2.75 2.75 0 0 1 14 2.75v10.5A2.75 2.75 0 0 1 11.25 16h-6.5A2.75 2.75 0 0 1 2 13.25v-.5a.75.75 0 0 1 1.5 0v.5c0 .69.56 1.25 1.25 1.25h6.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25h-6.5c-.69 0-1.25.56-1.25 1.25v.5a.75.75 0 0 1-1.5 0v-.5Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8.78 7.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06l.97-.97H1.75a.75.75 0 0 1 0-1.5h4.69l-.97-.97a.75.75 0 0 1 1.06-1.06l2.25 2.25Z",clipRule:"evenodd"})),wj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M12.227 11.52a5.477 5.477 0 0 0 1.246-2.97.5.5 0 0 0-.995-.1 4.478 4.478 0 0 1-.962 2.359l-1.07-1.07C10.794 9.247 11 8.647 11 8V3a3 3 0 0 0-6 0v1.293L1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708zM8 12.5c.683 0 1.33-.152 1.911-.425l.743.743c-.649.359-1.378.59-2.154.66V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .995-.098A4.5 4.5 0 0 0 8 12.5z"}),e.createElement("path",{d:"M8.743 10.907 5 7.164V8a3 3 0 0 0 3.743 2.907z"})),kj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{fillRule:"evenodd",d:"M2.975 8.002a.5.5 0 0 1 .547.449 4.5 4.5 0 0 0 8.956 0 .5.5 0 1 1 .995.098A5.502 5.502 0 0 1 8.5 13.478V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .448-.547z",clipRule:"evenodd"}),e.createElement("path",{d:"M5 3a3 3 0 1 1 6 0v5a3 3 0 0 1-6 0z"})),Oj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"})),Pj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}))),Ej=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}))),Cj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4Zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-9Zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V.5Z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4Zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-9Zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V.5Z"}))),Tj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 2.75A2.75 2.75 0 0 1 2.75 0h14.5A2.75 2.75 0 0 1 20 2.75v10.5A2.75 2.75 0 0 1 17.25 16H2.75A2.75 2.75 0 0 1 0 13.25V2.75ZM2.75 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h14.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25H2.75Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.47 4.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v4.69a.75.75 0 0 1-1.5 0V6.56l-.97.97a.75.75 0 0 1-1.06-1.06l2.25-2.25Z",clipRule:"evenodd"})),xj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none"},t),e.createElement("g",{fill:"currentColor"},e.createElement("path",{d:"M7.28 4.22a.75.75 0 0 0-1.06 1.06L8.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L10 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L10 6.94z"}),e.createElement("path",{fillRule:"evenodd",d:"M2.75 0A2.75 2.75 0 0 0 0 2.75v10.5A2.75 2.75 0 0 0 2.75 16h14.5A2.75 2.75 0 0 0 20 13.25V2.75A2.75 2.75 0 0 0 17.25 0zM1.5 2.75c0-.69.56-1.25 1.25-1.25h14.5c.69 0 1.25.56 1.25 1.25v10.5c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25z",clipRule:"evenodd"}))),Rj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5},e.createElement("path",{d:"M13.25 7H9m0 0V2.75M9 7l5.25-5.25M2.75 9H7m0 0v4.25M7 9l-5.25 5.25"})));function jj(t){var n=t,{trackSource:r,participant:o}=n,i=GR(n,["trackSource","participant"]);const{mergedProps:a,inFocus:s}=function({trackSource:t,participant:n,props:r}){const o=oj(n),i=ej(),{className:a}=e.useMemo((()=>({className:[TR("button"),TR("focus-toggle-button")].join(" ")})),[]),s=e.useMemo((()=>{const e=o.getTrack(t);return!(!(null==i?void 0:i.pin.state)||!e)&&(n={participant:o,source:t,publication:e},void 0!==(r=i.pin.state)&&(vR(n)?r.some((e=>e.participant.identity===n.participant.identity&&vR(e)&&e.publication.trackSid===n.publication.trackSid)):!!bR(n)&&r.some((e=>e.participant.identity===n.participant.identity&&bR(e)&&e.source===n.source))));var n,r}),[o,t,i]);return{mergedProps:e.useMemo((()=>QR(r,{className:a,onClick:e=>{var n;null==(n=r.onClick)||n.call(r,e);const a=o.getTrack(t);(null==i?void 0:i.pin.dispatch)&&a&&(s?i.pin.dispatch({msg:"clear_pin"}):i.pin.dispatch({msg:"set_pin",trackReference:{participant:o,publication:a,source:a.source}}))}})),[r,a,o,t,s,i]),inFocus:s}}({trackSource:r,participant:o,props:i});return e.createElement(XR.Consumer,null,(t=>void 0!==t&&e.createElement("button",$R({},a),i.children?i.children:s?e.createElement(Rj,null):e.createElement(gj,null))))}function Ij(t){var n=t,{kind:r,initialSelection:o,onActiveDeviceChange:i,onDeviceListChange:a}=n,s=GR(n,["kind","initialSelection","onActiveDeviceChange","onDeviceListChange"]);const c=sj(),{devices:l,activeDeviceId:u,setActiveMediaDevice:d,className:p}=function({kind:t,room:n}){const r=sj(),o=lj(e.useMemo((()=>function(e,t=!0){var n;const r=()=>cR(this,null,(function*(){const n=yield IC.getLocalDevices(e,t);o.next(n)})),o=new Fx,i=o.pipe((a=()=>{var e;null==(e=null==navigator?void 0:navigator.mediaDevices)||e.removeEventListener("devicechange",r)},_T((function(e,t){try{e.subscribe(t)}finally{t.add(a)}}))));var a;if("undefined"!=typeof window){if(!window.isSecureContext)throw new Error("Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices");null==(n=null==navigator?void 0:navigator.mediaDevices)||n.addEventListener("devicechange",r),r()}return i}(t)),[t]),[]),[i,a]=e.useState(""),{className:s,activeDeviceObservable:c,setActiveMediaDevice:l}=e.useMemo((()=>AR(t,null!=n?n:r)),[t,n,r]);return e.useEffect((()=>{const e=c.subscribe((e=>{e&&a(e)}));return()=>{null==e||e.unsubscribe()}}),[c]),{devices:o,className:s,activeDeviceId:i,setActiveMediaDevice:l}}({kind:r,room:c});e.useEffect((()=>{o&&d(o)})),e.useEffect((()=>{"function"==typeof a&&a(l)}),[a,l]);const f=e=>{return t=this,n=null,r=function*(){d(e),null==i||i(e)},new Promise(((e,o)=>{var i=e=>{try{s(r.next(e))}catch(e){o(e)}},a=e=>{try{s(r.throw(e))}catch(e){o(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,n)).next())}));var t,n,r},h=e.useMemo((()=>QR(s,{className:p},{className:"lk-list"})),[p,s]);return e.createElement("ul",$R({},h),l.map((t=>e.createElement("li",{key:t.deviceId,id:t.deviceId,"data-lk-active":t.deviceId===u,"aria-selected":t.deviceId===u,role:"option"},e.createElement("button",{className:"lk-button",onClick:()=>f(t.deviceId)},t.label)))))}function _j(t){var n=t,{label:r="Allow Audio"}=n,o=GR(n,["label"]);const i=aj(),{mergedProps:a}=function({room:t,props:n}){const{className:r,roomAudioPlaybackAllowedObservable:o,handleStartAudioPlayback:i}=e.useMemo((()=>NR()),[]),a=e.useMemo((()=>o(t)),[t,o]),{canPlayAudio:s}=lj(a,{canPlayAudio:!1});return{mergedProps:e.useMemo((()=>QR(n,{className:r,onClick:()=>{i(t)},style:{display:s?"none":"block"}})),[n,r,s,i,t]),canPlayAudio:s}}({room:i,props:o});return e.createElement("button",$R({},a),r)}function Aj(t,n){switch(t){case cE.Source.Microphone:return n?e.createElement(kj,null):e.createElement(wj,null);case cE.Source.Camera:return n?e.createElement(yj,null):e.createElement(mj,null);case cE.Source.ScreenShare:return n?e.createElement(xj,null):e.createElement(Tj,null);default:return}}function Mj(t){var n=t,{showIcon:r}=n,o=GR(n,["showIcon"]);const{buttonProps:i,enabled:a}=function(t){var n,r=t,{source:o,onChange:i,initialState:a,captureOptions:s}=r,c=GR(r,["source","onChange","initialState","captureOptions"]);const l=sj(),u=null==(n=null==l?void 0:l.localParticipant)?void 0:n.getTrack(o),{toggle:d,className:p,pendingObserver:f,enabledObserver:h}=e.useMemo((()=>l?function(e,t,n){const{localParticipant:r}=t,o=(e,t)=>{let n=!1;switch(e){case cE.Source.Camera:n=t.isCameraEnabled;break;case cE.Source.Microphone:n=t.isMicrophoneEnabled;break;case cE.Source.ScreenShare:n=t.isScreenShareEnabled}return n},i=jR(r).pipe(dx((t=>o(e,t.participant))),Ux(o(e,r))),a=new Fx;return{className:TR("button"),toggle:(t,o)=>cR(this,null,(function*(){try{switch(null!=o||(o=n),a.next(!0),e){case cE.Source.Camera:yield r.setCameraEnabled(null!=t?t:!r.isCameraEnabled,o);break;case cE.Source.Microphone:yield r.setMicrophoneEnabled(null!=t?t:!r.isMicrophoneEnabled,o);break;case cE.Source.ScreenShare:yield r.setScreenShareEnabled(null!=t?t:!r.isScreenShareEnabled,o)}}finally{a.next(!1)}})),enabledObserver:i,pendingObserver:a.asObservable()}}(o,l,s):function(){let e=!1;const t=new Fx,n=new Fx;return{className:TR("button"),toggle:r=>{n.next(!0),e=null!=r?r:!e,t.next(e),n.next(!1)},enabledObserver:t.asObservable(),pendingObserver:n.asObservable()}}()),[l,o,JSON.stringify(s)]),m=lj(f,!1),y=lj(h,null!=a?a:!!(null==u?void 0:u.isEnabled));e.useEffect((()=>{null==i||i(y)}),[y,i]),e.useEffect((()=>{void 0!==a&&(UR.debug("forcing initial toggle state",o,a),d(a))}),[]);const v=e.useMemo((()=>KR(c,{className:p})),[c,p]),b=e.useCallback((e=>{var t;d(),null==(t=c.onClick)||t.call(c,e)}),[c,d]);return{toggle:d,enabled:y,pending:m,track:u,buttonProps:VR($R({},v),{"aria-pressed":y,"data-lk-source":o,"data-lk-enabled":y,disabled:m,onClick:b})}}(o);return e.createElement("button",$R({},i),(null==r||r)&&Aj(o.source,a),o.children)}function Nj(t){var n;const{className:r,quality:o}=function(t={}){const n=oj(t.participant),{className:r,connectionQualityObserver:o}=e.useMemo((()=>function(e){const t=TR("connection-quality"),n=function(e){return IR(e,JO.ConnectionQualityChanged).pipe(dx((([e])=>e)),Ux(e.connectionQuality))}(e);return{className:t,connectionQualityObserver:n}}(n)),[n]);return{className:r,quality:lj(o,AE.Unknown)}}(t),i=e.useMemo((()=>VR($R({},QR(t,{className:r})),{"data-lk-quality":o})),[o,t,r]);return e.createElement("div",$R({},i),null!=(n=t.children)?n:function(t){switch(t){case AE.Excellent:return e.createElement(Oj,null);case AE.Good:return e.createElement(Pj,null);case AE.Poor:return e.createElement(Ej,null);default:return e.createElement(Cj,null)}}(o))}function Dj(t){var n=t,{participant:r}=n,o=GR(n,["participant"]);const i=oj(r),{className:a,infoObserver:s}=e.useMemo((()=>function(e){const t=function(e){const t=RR(e,JO.ParticipantMetadataChanged).pipe(dx((({name:e,identity:t,metadata:n})=>({name:e,identity:t,metadata:n}))),Ux({name:e.name,identity:e.identity,metadata:e.metadata}));return t}(e);return{className:"lk-participant-name",infoObserver:t}}(i)),[i]),{identity:c,name:l}=lj(s,{name:i.name,identity:i.identity,metadata:i.metadata}),u=e.useMemo((()=>QR(o,{className:a,"data-lk-participant-name":l})),[o,a,l]);return e.createElement("span",$R({},u),""!==l?l:c,o.children)}var Lj,Uj=t=>{var n,r=t,{source:o,participant:i,show:a="always"}=r,s=GR(r,["source","participant","show"]);const{className:c,isMuted:l}=((t,n={})=>{var r;const o=oj(n.participant),{className:i,mediaMutedObserver:a}=e.useMemo((()=>function(e,t){let n="track-muted-indicator-camera";switch(t){case cE.Source.Camera:n="track-muted-indicator-camera";break;case cE.Source.Microphone:n="track-muted-indicator-microphone"}return{className:TR(n),mediaMutedObserver:_R(e,t)}}(o,t)),[o,t]);return{isMuted:lj(a,!!(null==(r=o.getTrack(t))?void 0:r.isMuted)),className:i}})(o,{participant:i}),u="always"===a||"muted"===a&&l||"unmuted"===a&&!l,d=e.useMemo((()=>QR(s,{className:c})),[c,s]);return u?e.createElement("div",VR($R({},d),{"data-lk-muted":l}),null!=(n=s.children)?n:Aj(o,!l)):null},Bj=t=>{const[n,r]=e.useState({width:0,height:0});e.useLayoutEffect((()=>{if(t.current){const{width:e,height:n}=t.current.getBoundingClientRect();r({width:e,height:n})}}),[t.current]);const o=e.useCallback((e=>r(e.contentRect)),[]);return function(t,n){const r=Lj||(Lj=function(){let e=!1,t=[];const n=new Map;if("undefined"==typeof window)return;const r=new ResizeObserver(((r,o)=>{t=t.concat(r),e||window.requestAnimationFrame((()=>{const r=new Set;for(let e=0;en(t[e],o)))}t=[],e=!1})),e=!0}));return{observer:r,subscribe(e,t){var o;r.observe(e);const i=null!=(o=n.get(e))?o:[];i.push(t),n.set(e,i)},unsubscribe(e,t){var o;const i=null!=(o=n.get(e))?o:[];if(1===i.length)return r.unobserve(e),void n.delete(e);const a=i.indexOf(t);-1!==a&&i.splice(a,1),n.set(e,i)}}}()),o=gi(n);e.useLayoutEffect((()=>{let e=!1;const n=t.current;if(n)return null==r||r.subscribe(n,i),()=>{e=!0,null==r||r.unsubscribe(n,i)};function i(t,n){e||o.current(t,n)}}),[t.current,r,o]),null==r||r.observer}(t,o),n};function Fj(t,n){const{width:r,height:o}=Bj(t),i=r>0&&o>0?hR(fR,n,r,o):fR[0];return e.useEffect((()=>{t.current&&i&&(t.current.style.setProperty("--lk-col-count",null==i?void 0:i.columns.toString()),t.current.style.setProperty("--lk-row-count",null==i?void 0:i.rows.toString()))}),[t,i]),{layout:i}}function zj(t,n={}){var r;const o=oj(n.participant),[i,a]=e.useState(!!(null==(r=o.getTrack(t))?void 0:r.isMuted));return e.useEffect((()=>{const e=_R(o,t).subscribe(a);return()=>e.unsubscribe()}),[o,t]),i}function Wj(t,n={}){const[r,o]=e.useState(xR(t)),[i,a]=e.useState(null==r?void 0:r.isMuted),[s,c]=e.useState(null==r?void 0:r.isSubscribed),[l,u]=e.useState(null==r?void 0:r.track),[d,p]=e.useState("landscape"),f=e.useRef(),{className:h,trackObserver:m}=e.useMemo((()=>function(e){const t=xR(e),n=jR(e.participant).pipe(dx((()=>xR(e))),Ux(t));return{className:TR(e.source===cE.Source.Camera||e.source===cE.Source.ScreenShare?"participant-media-video":"participant-media-audio"),trackObserver:n}}(t)),[t.participant.identity,t.source,vR(t)&&t.publication.trackSid]);return e.useEffect((()=>{const e=m.subscribe((e=>{UR.debug("update track",e),o(e),a(null==e?void 0:e.isMuted),c(null==e?void 0:e.isSubscribed),u(null==e?void 0:e.track)}));return()=>null==e?void 0:e.unsubscribe()}),[m]),e.useEffect((()=>{var e,r;return l&&(f.current&&l.detach(f.current),!(null==(e=n.element)?void 0:e.current)||function(e){return e instanceof JE}(t.participant)&&"audio"===(null==l?void 0:l.kind)||l.attach(n.element.current)),f.current=null==(r=n.element)?void 0:r.current,()=>{f.current&&(null==l||l.detach(f.current))}}),[l,n.element]),e.useEffect((()=>{var e,t;if("number"==typeof(null==(e=null==r?void 0:r.dimensions)?void 0:e.width)&&"number"==typeof(null==(t=null==r?void 0:r.dimensions)?void 0:t.height)){const e=r.dimensions.width>r.dimensions.height?"landscape":"portrait";p(e)}}),[r]),{publication:r,isMuted:i,isSubscribed:s,track:l,elementProps:QR(n.props,$R({className:h,"data-lk-local-participant":t.participant.isLocal,"data-lk-source":null==r?void 0:r.source},(null==r?void 0:r.source)===cE.Source.Camera||(null==r?void 0:r.source)===cE.Source.ScreenShare?{"data-lk-orientation":d}:{}))}}function Zj(t,n,r={}){const o=e.useRef([]),i=e.useRef(-1),a=n!==i.current,s="function"==typeof r.customSortFunction?r.customSortFunction(t):function(e){const t=[],n=[],r=[],o=[];e.forEach((e=>{e.participant.isLocal&&e.source===cE.Source.Camera?t.push(e):e.source===cE.Source.ScreenShare?n.push(e):e.source===cE.Source.Camera?r.push(e):o.push(e)}));const i=function(e){const t=[],n=[];return e.forEach((e=>{e.participant.isLocal?t.push(e):n.push(e)})),t.sort(((e,t)=>SR(e.participant,t.participant))),n.sort(((e,t)=>SR(e.participant,t.participant))),[...n,...t]}(n),a=function(e){const t=[],n=[];return e.forEach((e=>{e.participant.isLocal?t.push(e):n.push(e)})),n.sort(((e,t)=>e.participant.isSpeaking&&t.participant.isSpeaking?function(e,t){return t.audioLevel-e.audioLevel}(e.participant,t.participant):e.participant.isSpeaking!==t.participant.isSpeaking?function(e,t){return e.isSpeaking===t.isSpeaking?0:e.isSpeaking?-1:1}(e.participant,t.participant):e.participant.lastSpokeAt!==t.participant.lastSpokeAt?function(e,t){var n,r,o,i;return void 0!==e.lastSpokeAt||void 0!==t.lastSpokeAt?(null!=(r=null==(n=t.lastSpokeAt)?void 0:n.getTime())?r:0)-(null!=(i=null==(o=e.lastSpokeAt)?void 0:o.getTime())?i:0):0}(e.participant,t.participant):vR(e)!==vR(t)?function(e,t){return vR(e)?vR(t)?0:-1:vR(t)?1:0}(e,t):e.participant.isCameraEnabled!==t.participant.isCameraEnabled?function(e,t){const n=e.participant.isCameraEnabled;return n!==t.participant.isCameraEnabled?n?-1:1:0}(e,t):SR(e.participant,t.participant))),[...t,...n]}(r);return[...t,...i,...a,...o]}(t);let c=[...s];if(!1===a)try{c=function(e,t,n){let r=[...e];if(e.length{if(e&&t){const s={dropped:kR(i=ER(r,n)[o],a=t,gR),added:kR(a,i,gR)};(function(e){return 0!==e.added.length||0!==e.dropped.length})(s)&&(pR.debug(`Detected visual changes on page: ${o}, current: ${OR(e)}, next: ${OR(t)}`,{changes:s}),s.added.length===s.dropped.length&&wR(s.added,s.dropped).forEach((([e,t])=>{if(!e||!t)throw new Error(`For a swap action we need a addition and a removal one is missing: ${e}, ${t}`);r=function(e,t,n){const r=PR(e,n),o=PR(t,n);return n.splice(r,1,t),n.splice(o,1,e),n}(e,t,r)})),0===s.added.length&&s.dropped.length>0&&s.dropped.forEach((e=>{r=function(e,t){const n=PR(e,t);return t.splice(n,1),t}(e,r)})),s.added.length>0&&0===s.dropped.length&&s.added.forEach((e=>{var t,n;t=e,n=r,r=[...n,t]})))}var i,a})),r.length>t.length){const n=kR(e,t,gR);r=r.filter((e=>!n.map(gR).includes(gR(e))))}return r}(o.current,s,n)}catch(e){UR.error("Error while running updatePages(): ",e)}return o.current=a?s:c,i.current=n,c}function Hj(t=[cE.Source.Camera,cE.Source.Microphone,cE.Source.ScreenShare,cE.Source.ScreenShareAudio,cE.Source.Unknown],n={}){const r=cj(n.room),[o,i]=e.useState([]),[a,s]=e.useState([]),c=e.useMemo((()=>t.map((e=>mR(e)?e.source:e))),[JSON.stringify(t)]);e.useEffect((()=>{const e=function(e,t,n){var r,o;const i=null!=(r=n.additionalRoomEvents)?r:uR,a=null==(o=n.onlySubscribed)||o;return CR(e,...Array.from(new Set([GO.ParticipantConnected,GO.ConnectionStateChanged,GO.LocalTrackPublished,GO.LocalTrackUnpublished,GO.TrackPublished,GO.TrackUnpublished,GO.TrackSubscriptionStatusChanged,...i]).values())).pipe(dx((e=>{const n=DR(e,t,a);return pR.debug(`TrackReference[] was updated. (length ${n.trackReferences.length})`,n),n})),Ux(DR(e,t,a)))}(r,c,{additionalRoomEvents:n.updateOnlyOn,onlySubscribed:n.onlySubscribed}).subscribe((({trackReferences:e,participants:t})=>{UR.debug("setting track bundles",e,t),i(e),s(t)}));return()=>e.unsubscribe()}),[r,JSON.stringify(n.updateOnlyOn),JSON.stringify(t)]);const l=e.useMemo((()=>{if(yR(t)){const e=function(e,t){const n=new Map;if(yR(e)){const r=e.filter((e=>e.withPlaceholder)).map((e=>e.source));t.forEach((e=>{const t=e.getTracks().map((e=>{var t;return null==(t=e.track)?void 0:t.source})).filter((e=>void 0!==e)),o=Array.from(function(e,t){const n=new Set(e);for(const e of t)n.delete(e);return n}(new Set(r),new Set(t)));o.length>0&&n.set(e.identity,o)}))}return n}(t,a),n=Array.from(o);return a.forEach((t=>{var r;e.has(t.identity)&&(null!=(r=e.get(t.identity))?r:[]).forEach((e=>{if(o.find((({participant:n,publication:r})=>t.identity===n.identity&&r.source===e)))return;UR.debug(`Add ${e} placeholder for participant ${t.identity}.`);const r={participant:t,source:e};n.push(r)}))})),n}return o}),[o,a,t]);return l}var qj=t=>e.createElement("svg",$R({width:320,height:320,viewBox:"0 0 320 320",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M160 180C204.182 180 240 144.183 240 100C240 55.8172 204.182 20 160 20C115.817 20 79.9997 55.8172 79.9997 100C79.9997 144.183 115.817 180 160 180Z",fill:"white",fillOpacity:.25}),e.createElement("path",{d:"M97.6542 194.614C103.267 191.818 109.841 192.481 115.519 195.141C129.025 201.466 144.1 205 159.999 205C175.899 205 190.973 201.466 204.48 195.141C210.158 192.481 216.732 191.818 222.345 194.614C262.703 214.719 291.985 253.736 298.591 300.062C300.15 310.997 291.045 320 280 320H39.9997C28.954 320 19.8495 310.997 21.4087 300.062C28.014 253.736 57.2966 214.72 97.6542 194.614Z",fill:"white",fillOpacity:.25}));function $j(t){var n=t,{onTrackClick:r,onClick:o,onSubscriptionStatusChanged:i,name:a,publication:s,source:c}=n,l=GR(n,["onTrackClick","onClick","onSubscriptionStatusChanged","name","publication","source"]);const u=e.useRef(null),d=oj(l.participant),{elementProps:p,publication:f,isSubscribed:h}=Wj({participant:d,name:a,source:c,publication:s},{element:u,props:l});return e.useEffect((()=>{null==i||i(!!h)}),[h,i]),e.createElement("video",VR($R({ref:u},p),{muted:!0,onClick:e=>{null==o||o(e),null==r||r({participant:d,track:f})}}))}function Vj(t){var n=t,{onSubscriptionStatusChanged:r,volume:o}=n,i=GR(n,["onSubscriptionStatusChanged","volume"]);const{source:a,name:s,publication:c}=i,l=e.useRef(null),u=oj(i.participant),{elementProps:d,isSubscribed:p,track:f}=Wj({source:a,name:s,participant:u,publication:c},{element:l,props:i});return e.useEffect((()=>{null==r||r(!!p)}),[p,r]),e.useEffect((()=>{o&&f instanceof bE?f.setVolume(o):UR.warn("volume can only be set on remote audio tracks")}),[o,f]),e.createElement("audio",$R({ref:l},d))}function Gj({participant:t,source:n,publication:r,onParticipantClick:o,disableSpeakingIndicator:i,htmlProps:a}){const s=oj(t),c=e.useMemo((()=>{const{className:e}={className:TR("participant-tile")};return QR(a,{className:e,onClick:e=>{var t;if(null==(t=a.onClick)||t.call(a,e),"function"==typeof o){const e=null!=r?r:s.getTrack(n);o({participant:s,track:e})}}})}),[a,n,o,s,r]),l=zj(cE.Source.Camera,{participant:t}),u=zj(cE.Source.Microphone,{participant:t}),d=function(t){const n=oj(t),r=e.useMemo((()=>function(e){return IR(e,JO.IsSpeakingChanged).pipe(dx((([e])=>e)))}(n)),[n]);return lj(r,n.isSpeaking)}(t);return{elementProps:$R({"data-lk-audio-muted":u,"data-lk-video-muted":l,"data-lk-speaking":!0!==i&&d,"data-lk-local-participant":t.isLocal,"data-lk-source":n},c)}}function Jj(t){const n=!!rj();return t.participant&&!n?e.createElement(nj.Provider,{value:t.participant},t.children):e.createElement(e.Fragment,null,t.children)}var Kj=t=>{var n=t,{participant:r,children:o,source:i=cE.Source.Camera,onParticipantClick:a,publication:s,disableSpeakingIndicator:c}=n,l=GR(n,["participant","children","source","onParticipantClick","publication","disableSpeakingIndicator"]);const u=oj(r),{elementProps:d}=Gj({participant:u,htmlProps:l,source:i,publication:s,disableSpeakingIndicator:c,onParticipantClick:a}),p=ej(),f=e.useCallback((e=>{i&&!e&&p&&p.pin.dispatch&&function(e,t,n){return void 0!==n&&n.some((({source:n,participant:r})=>n===t&&r.identity===e.identity))}(u,i,p.pin.state)&&p.pin.dispatch({msg:"clear_pin"})}),[u,p,i]);return e.createElement("div",$R({style:{position:"relative"}},d),e.createElement(Jj,{participant:u},null!=o?o:e.createElement(e.Fragment,null,"video"===(null==s?void 0:s.kind)||i===cE.Source.Camera||i===cE.Source.ScreenShare?e.createElement($j,{participant:u,source:i,publication:s,onSubscriptionStatusChanged:f}):e.createElement(Vj,{participant:u,source:i,publication:s,onSubscriptionStatusChanged:f}),e.createElement("div",{className:"lk-participant-placeholder"},e.createElement(qj,null)),e.createElement("div",{className:"lk-participant-metadata"},e.createElement("div",{className:"lk-participant-metadata-item"},i===cE.Source.Camera?e.createElement(e.Fragment,null,e.createElement(Uj,{source:cE.Source.Microphone,show:"muted"}),e.createElement(Dj,null)):e.createElement(e.Fragment,null,e.createElement(Tj,{style:{marginRight:"0.25rem"}}),e.createElement(Dj,null,"'s screen"))),e.createElement(Nj,{className:"lk-participant-metadata-item"}))),e.createElement(jj,{trackSource:i})))},Yj=t=>{var n=t,{tracks:r}=n,o=GR(n,["tracks"]);return e.createElement(e.Fragment,null,r.map((t=>{const n=vR(t)?t.publication.source:t.source;return e.createElement(tj.Provider,{value:t,key:`${t.participant.identity}_${n}`},function(t,n,r){return e.Children.map(t,(o=>e.isValidElement(o)&&e.Children.only(t)?e.cloneElement(o,VR($R({},n),{key:r})):o))}(o.children))})))};function Qj({totalPageCount:t,nextPage:n,prevPage:r,currentPage:o,pagesContainer:i}){const[a,s]=e.useState(!1);return e.useEffect((()=>{let e;return i&&(e=LR(i.current,2e3).subscribe(s)),()=>{e&&e.unsubscribe()}}),[i]),e.createElement("div",{className:"lk-pagination-control","data-lk-user-interaction":a},e.createElement("button",{className:"lk-button",onClick:r},e.createElement(bj,null)),e.createElement("span",{className:"lk-pagination-count"},`${o} of ${t}`),e.createElement("button",{className:"lk-button",onClick:n},e.createElement(bj,null)))}function Xj({totalPageCount:t,currentPage:n}){const r=new Array(t).fill("").map(((t,r)=>r+1===n?e.createElement("span",{"data-lk-active":!0,key:r}):e.createElement("span",{key:r})));return e.createElement("div",{className:"lk-pagination-indicator"},r)}function eI(t){var n=t,{tracks:r}=n,o=GR(n,["tracks"]);const i=e.createRef(),a=e.useMemo((()=>QR(o,{className:"lk-grid-layout"})),[o]),{layout:s}=Fj(i,r.length),c=function(t,n){const[r,o]=e.useState(1),i=Math.max(Math.ceil(n.length/t),1);r>i&&o(i);const a=r*t,s=a-t,c=e=>{o((t=>"next"===e?t===i?t:t+1:1===t?t:t-1))},l=Zj(n,t);return{totalPageCount:i,nextPage:()=>c("next"),prevPage:()=>c("previous"),setPage:e=>{o(e>i?i:e<1?1:e)},firstItemIndex:s,lastItemIndex:a,tracks:l.slice(s,a),currentPage:r}}(s.maxTiles,r);return function(t,n={}){var r;const o=e.useRef(null),i=e.useRef(null),a=null!=(r=n.minSwipeDistance)?r:50,s=e=>{i.current=null,o.current=e.targetTouches[0].clientX},c=e=>{i.current=e.targetTouches[0].clientX},l=e.useCallback((()=>{if(!o.current||!i.current)return;const e=o.current-i.current,t=e<-a;e>a&&n.onLeftSwipe&&n.onLeftSwipe(),t&&n.onRightSwipe&&n.onRightSwipe()}),[a,n]);e.useEffect((()=>{const e=t.current;return e&&(e.addEventListener("touchstart",s),e.addEventListener("touchmove",c),e.addEventListener("touchend",l)),()=>{e&&(e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",c),e.removeEventListener("touchend",l))}}),[t,l])}(i,{onLeftSwipe:c.nextPage,onRightSwipe:c.prevPage}),e.createElement("div",$R({ref:i,"data-lk-pagination":c.totalPageCount>1},a),e.createElement(Yj,{tracks:c.tracks},o.children),r.length>s.maxTiles&&e.createElement(e.Fragment,null,e.createElement(Xj,{totalPageCount:c.totalPageCount,currentPage:c.currentPage}),e.createElement(Qj,$R({pagesContainer:i},c))))}var tI={connect:!0,audio:!1,video:!1};function nI(t){const{room:n,htmlProps:r}=function(t){const n=$R($R({},tI),t),{token:r,serverUrl:o,options:i,room:a,connectOptions:s,connect:c,audio:l,video:u,screen:d,onConnected:p,onDisconnected:f,onError:h,onMediaDeviceFailure:m,simulateParticipants:y}=n,v=GR(n,["token","serverUrl","options","room","connectOptions","connect","audio","video","screen","onConnected","onDisconnected","onError","onMediaDeviceFailure","simulateParticipants"]);i&&a&&UR.warn("when using a manually created room, the options object will be ignored. set the desired options directly when creating the room instead.");const[b,g]=e.useState();e.useEffect((()=>{g(null!=a?a:new IC(i))}),[i,a]);const S=e.useMemo((()=>QR(v,{className:"lk-room-container"})),[v]);return e.useEffect((()=>{if(!b)return;const e=()=>{const e=b.localParticipant;try{UR.debug("trying to publish local tracks"),e.setMicrophoneEnabled(!!l,"boolean"!=typeof l?l:void 0),e.setCameraEnabled(!!u,"boolean"!=typeof u?u:void 0),e.setScreenShareEnabled(!!d,"boolean"!=typeof d?d:void 0)}catch(e){UR.warn(e),null==h||h(e)}},t=e=>{const t=VO.getFailure(e);null==m||m(t)};return b.on(GO.SignalConnected,e),b.on(GO.MediaDevicesError,t),()=>{b.off(GO.SignalConnected,e),b.off(GO.MediaDevicesError,t)}}),[b,l,u,d,h]),e.useEffect((()=>{if(b)if(y)b.simulateParticipants({participants:{count:y},publish:{audio:!0,useRealTracks:!0}});else{if(r)return o?void(c?(UR.debug("connecting"),b.connect(o,r,s).catch((e=>{UR.warn(e),null==h||h(e)}))):(UR.debug("disconnecting because connect is false"),b.disconnect())):(UR.warn("no livekit url provided"),void(null==h||h(Error("no livekit url provided"))));UR.debug("no token yet")}}),[c,r,s,b,h,o,y]),e.useEffect((()=>{if(!b)return;const e=e=>{switch(e){case TC.Disconnected:f&&f();break;case TC.Connected:p&&p()}};return b.on(GO.ConnectionStateChanged,e),()=>{b.off(GO.ConnectionStateChanged,e)}}),[r,p,f,b]),e.useEffect((()=>{if(b)return()=>{UR.info("disconnecting on onmount"),b.disconnect()}}),[b]),{room:b,htmlProps:S}}(t);return e.createElement("div",$R({},r),n&&e.createElement(ij.Provider,{value:n},t.children))}var rI=t=>{var n=t,{childrenPosition:r="before",children:o}=n,i=GR(n,["childrenPosition","children"]);const{name:a}=function(t={}){const n=cj(t.room),r=e.useMemo((()=>function(e){const t=CR(e,GO.RoomMetadataChanged,GO.ConnectionStateChanged).pipe(dx((e=>({name:e.name,metadata:e.metadata}))));return t}(n)),[n]),{name:o,metadata:i}=lj(r,{name:n.name,metadata:n.metadata});return{name:o,metadata:i}}();return e.createElement("span",$R({},i),"before"===r&&o,a,"after"===r&&o)},oI=t=>{var n=t,{kind:r,initialSelection:o,onActiveDeviceChange:i}=n,a=GR(n,["kind","initialSelection","onActiveDeviceChange"]);const[s,c]=e.useState(!1),[l,u]=e.useState([]),[d,p]=e.useState(!0),f=(e,t)=>{UR.debug("handle device change"),c(!1),null==i||i(e,t)},h=e.useRef(null),m=e.useRef(null);e.useLayoutEffect((()=>{h.current&&m.current&&(l||d)&&function(e,t){return cR(this,null,(function*(){const{x:n,y:r}=yield((e,t,n)=>{const r=new Map,o={platform:RT,...n},i={...o.platform,_c:r};return LC(e,t,{...o,platform:i})})(e,t,{placement:"top",middleware:[JC(6),GC(),KC({padding:5})]});return{x:n,y:r}}))}(h.current,m.current).then((({x:e,y:t})=>{m.current&&Object.assign(m.current.style,{left:`${e}px`,top:`${t}px`})})),p(!1)}),[h,m,l,d]);const y=e.useCallback((e=>{m.current&&e.target!==h.current&&s&&function(e,t){return!e.contains(t.target)}(m.current,e)&&c(!1)}),[s,m,h]);return e.useEffect((()=>(document.addEventListener("click",y),window.addEventListener("resize",(()=>p(!0))),()=>{document.removeEventListener("click",y),window.removeEventListener("resize",(()=>p(!0)))})),[y,p]),e.createElement(e.Fragment,null,e.createElement("button",VR($R({className:"lk-button lk-button-menu","aria-pressed":s},a),{onClick:()=>c(!s),ref:h}),a.children),e.createElement("div",{className:"lk-device-menu",ref:m,style:{visibility:s?"visible":"hidden"}},r?e.createElement(Ij,{initialSelection:o,onActiveDeviceChange:e=>f(r,e),onDeviceListChange:u,kind:r}):e.createElement(e.Fragment,null,e.createElement("div",{className:"lk-device-menu-heading"},"Audio inputs"),e.createElement(Ij,{kind:"audioinput",onActiveDeviceChange:e=>f("audioinput",e),onDeviceListChange:u}),e.createElement("div",{className:"lk-device-menu-heading"},"Video inputs"),e.createElement(Ij,{kind:"videoinput",onActiveDeviceChange:e=>f("videoinput",e),onDeviceListChange:u}))))};function iI(t){var n,r=t,{variation:o,controls:i}=r,a=GR(r,["variation","controls"]);const[s,c]=e.useState(!1),l=ej();e.useEffect((()=>{var e,t;void 0!==(null==(e=null==l?void 0:l.widget.state)?void 0:e.showChat)&&c(null==(t=null==l?void 0:l.widget.state)?void 0:t.showChat)}),[null==(n=null==l?void 0:l.widget.state)?void 0:n.showChat]);const u=function(t){const n=e=>"undefined"!=typeof window&&window.matchMedia(e).matches,[r,o]=e.useState(n(t));function i(){o(n(t))}return e.useEffect((()=>{const e=window.matchMedia(t);return i(),e.addListener?e.addListener(i):e.addEventListener("change",i),()=>{e.removeListener?e.removeListener(i):e.removeEventListener("change",i)}}),[t]),r}(`(max-width: ${s?1e3:760}px)`);null!=o||(o=u?"minimal":"verbose");const d=$R({leave:!0},i),p=function(){const t=aj();return lj(e.useMemo((()=>{return IR(e=t.localParticipant,JO.ParticipantPermissionsChanged).pipe(dx((()=>e.permissions)),Ux(e.permissions));var e}),[t]),t.localParticipant.permissions)}();p?(null!=d.camera||(d.camera=p.canPublish),null!=d.microphone||(d.microphone=p.canPublish),null!=d.screenShare||(d.screenShare=p.canPublish),null!=d.chat||(d.chat=p.canPublishData&&(null==i?void 0:i.chat))):(d.camera=!1,d.chat=!1,d.microphone=!1,d.screenShare=!1);const f=e.useMemo((()=>"minimal"===o||"verbose"===o),[o]),h=e.useMemo((()=>"textOnly"===o||"verbose"===o),[o]),m=e.useMemo((()=>"undefined"!=typeof document&&/Mobi/i.test(window.navigator.userAgent)),[]),[y,v]=e.useState(!1);return e.createElement("div",$R({className:"lk-control-bar"},a),d.microphone&&e.createElement("div",{className:"lk-button-group"},e.createElement(Mj,{source:cE.Source.Microphone,showIcon:f},h&&"Microphone"),e.createElement("div",{className:"lk-button-group-menu"},e.createElement(oI,{kind:"audioinput"}))),d.camera&&e.createElement("div",{className:"lk-button-group"},e.createElement(Mj,{source:cE.Source.Camera,showIcon:f},h&&"Camera"),e.createElement("div",{className:"lk-button-group-menu"},e.createElement(oI,{kind:"videoinput"}))),d.screenShare&&!m&&e.createElement(Mj,{source:cE.Source.ScreenShare,captureOptions:{audio:!0,selfBrowserSurface:"include"},showIcon:f,onChange:e=>{v(e)}},h&&(y?"Stop screen share":"Share screen")),d.chat&&e.createElement(fj,null,f&&e.createElement(vj,null),h&&"Chat"),d.leave&&e.createElement(hj,null,f&&e.createElement(Sj,null),h&&"Leave"),e.createElement(_j,{label:"Start Audio"}))}function aI(e){return aI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aI(e)}function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cI(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?parseFloat(t.messages[t.messages.length-1].Timestamp):0;(this.state.messages.length>0?parseFloat(this.state.messages[this.state.messages.length-1].Timestamp):0)>n&&this.commentPane.current&&(this.commentPane.current.scrollTop=1e5)}}},{key:"componentWillReceiveProps",value:function(e){var t=e.roomType,n=e.roomObjectId;t===this.props.roomType&&n===this.props.roomObjectId||(this.client&&this.client.leaveRoom(this.props.roomType,this.props.roomObjectId,this._newMessageListener),this.setState({messages:[],room:null,value:""}),t&&n&&this.join(t,n))}},{key:"onRoomMessage",value:function(e){if(!this.state.firstUpdateReceived){var t=this.props,n=t.roomType,r=t.roomObjectId;this.client.loadHistory(n,r,0,40),this.setState({firstUpdateReceived:!0})}e&&this.setState({room:e.Room})}},{key:"onNewMessage",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){if(this.setState({firstUpdateReceived:!0}),"VIDEO_CALL"===e["@type"])return console.log("Video Enabled!",e),void this.setState({videoData:e});if(n)this.setState({messages:this.state.messages.filter((function(t){return t.Uuid!==e.Uuid}))});else{if(0===e.Message.indexOf("TOKENS:")){var r,o=function(e){if(Array.isArray(e))return e}(t=e.Message.split(":"))||jI(t)||xI(t)||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.")}(),i=(o[0],o[1]),a=o[2],s=o.slice(3),c=this.state.messages.find((function(e){return e.TokenId===i}));if("FINAL"===a)return r=TI(this.state.messages),c&&(r=r.filter((function(e){return e!==c}))),r.push(EI(EI({},e),{},{Message:s.join(":")})),r.sort((function(e,t){return e.Timestamp-t.Timestamp})),void this.setState({messages:r});var l={position:parseInt(a),token:s.join(":")};return c?(c.Tokens.push(l),c.Tokens.sort((function(e,t){return e.position-t.position})),0===c.Tokens[0].position&&(c.Message=c.Tokens.map((function(e){return e.token})).join("")),r=this.state.messages.filter((function(e){return e!==c})),r.push(EI({},c))):(e=EI(EI({},e),{},{Message:"",Tokens:[l],TokenId:i}),0===l.position&&(e.Message=l.token),r=[].concat(TI(this.state.messages),[e])),void this.setState({messages:r})}var u=[].concat(TI(this.state.messages.filter((function(t){return t.Uuid!==e.Uuid}))),[e]).filter((function(e){return!!e.Message}));u.sort((function(e,t){return e.Timestamp-t.Timestamp})),this.setState({messages:u})}}}},{key:"join",value:function(e,t){var n=this;if(t){var r=this.props.pydio;this.client=Fb.getInstance(r),this.setState({firstUpdateReceived:!1},(function(){var r=n.client.joinRoom(e,t,n._newMessageListener,n.onRoomMessage.bind(n));null!==r&&n.setState({room:r})})),this.client.loadHistory(e,t,0,40)}}},{key:"more",value:function(){var e=this.props,t=e.roomType,n=e.roomObjectId,r=this.state.messages;this.client&&this.client.loadHistory(t,n,r.length-1,40)}},{key:"stop",value:function(){var e=this.props,t=e.roomType,n=e.roomObjectId;this.client&&this.client.leaveRoom(t,n,this._newMessageListener)}},{key:"postMessage",value:function(){if(this.state.value){var e=this.state.room;if(e&&e.Uuid){var t={"@type":"POST",Message:{RoomUuid:e.Uuid,Message:this.state.value}};this.client.send(JSON.stringify(t)),this.setState({value:""})}else console.error("Cannot find cell info")}}},{key:"deleteMessage",value:function(e){var t=this.state.room;if(t&&t.Uuid){var n={"@type":"DELETE_MSG",Message:e};this.client.send(JSON.stringify(n))}else console.error("Cannot find cell info")}},{key:"keyDown",value:function(e){var t=this.state.value;if("Enter"===e.key)if(e.metaKey||e.ctrlKey){var n,r,o=e.currentTarget;o.selectionEnd=40;O.forEach((function(r){var o=UI(1e3*parseFloat(r.Timestamp)).fromNow(),i=e&&e===o,s=n&&n===r.Author&&i;T.push(t().createElement(ng,{key:r.Uuid,message:r,hideDate:i,sameAuthor:s,onDeleteMessage:function(){a.deleteMessage(r)},moreLoader:x?function(){a.more()}:null,muiTheme:S})),x=!1,e=o,n=r.Author})),y&&(r={display:"flex",flexDirection:"column"},T&&T.length&&(o=t().createElement("span",{style:{flex:1}}))),!h||T&&T.length||(i=t().createElement(po,OI({pydio:m},h)));var R=!P,j={color:Q()(S.palette.mui3["on-surface-variant"]).fade(.5).toString(),whiteSpace:"nowrap"};f&&f.hintStyle&&(j=EI(EI({},j),f.hintStyle)),R&&(j=EI(EI({},j),{},{fontStyle:"italic"}));var I=EI({backgroundColor:S.palette.mui3[w?"surface-variant":"surface"]||"white",position:"relative",paddingLeft:16,paddingRight:16},d);return t().createElement("div",{style:EI({padding:0},c)},void 0!==v&&t().createElement("div",{style:u},t().createElement(pv,{acls:v,max:12,onlines:P?P.Users:[]})),t().createElement("div",{ref:this.commentPane,className:"comments_feed",style:EI(EI({maxHeight:300,overflowY:"auto"},r),l)},o,T,i),t().createElement("div",{style:I},t().createElement(g.TextField,OI({hintText:R?m.MessageHash[466]:p,value:this.state.value,onChange:function(e,t){a.setState({value:t})},multiLine:!0,onKeyDown:this.keyDown.bind(this),fullWidth:!0,underlineShow:!1,disabled:b||R},f,{hintStyle:j})),E&&t().createElement("div",{style:{position:"absolute",top:0,right:0}},t().createElement(g.IconButton,{iconStyle:{color:C?"#F44336":"#4CAF4F"},iconClassName:"mdi mdi-video"+(C?"-off":""),onClick:function(){return a.setState({joinVideo:!C})}}))),E&&C&&t().createElement(wI,{url:E.Url,token:E.Token}),t().createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n.chat-message-md *, .comments_feed .user-label, .comments_feed .date-from{\n user-select: text;\n}\n.chat-message-md p{\n padding-top: 0; \n margin-bottom: 0;\n}\n.chat-message-md strong {\n font-weight: 500;\n}\n.chat-message-md a {\n text-decoration: underline;\n color:#2196f3;\n}\n.chat-message-md ul {\n padding-left: 20px;\n}\n"}}))}}],o&&II(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);function FI(e){return FI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FI(e)}function zI(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1]?this.setState({newMessages:Math.max(0,this.state.newMessages-1)}):this.setState({newMessages:this.state.newMessages+1})}},{key:"listenToRoom",value:function(e,t){Fb.getInstance(this.props.pydio).joinRoom(e,t,this._messageListener,null)}},{key:"leaveRoom",value:function(e,t){Fb.getInstance(this.props.pydio).leaveRoom(e,t,this._messageListener)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.roomType,n=e.objectId;this.listenToRoom(t,n)}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.roomType,n=e.objectId;this.leaveRoom(t,n)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.roomType,o=n.objectId;e.roomType===r&&e.objectId===o||(this.leaveRoom(r,o),this.setState({newMessages:0},(function(){t.listenToRoom(e.roomType,e.objectId)})))}},{key:"onClick",value:function(){this.props.pydio.Controller.fireAction("toggle_chat_panel"),this.setState({newMessages:0})}},{key:"render",value:function(){var e=this.state.newMessages;if(0===e)return null;return t().createElement("span",{onClick:this.onClick.bind(this),className:"mdi mdi-comment",style:{display:"inline-block",padding:"0 5px",fontSize:15,textAlign:"center",color:"#8BC34A",fontWeight:500,position:"relative"}},t().createElement("span",{style:{fontSize:13,display:"inline-block",position:"absolute",top:-1,marginLeft:2}},e))}}],r&&zI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function VI(e){return VI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VI(e)}function GI(){return GI=Object.assign?Object.assign.bind():function(e){for(var t=1;t70&&(r=t().createElement("span",{title:r},r.substr(0,70)+"..."));var o=t().createElement(t().Fragment,null,n.tag&&t().createElement("div",{className:"stepper-tag"},n.tag),n.onDelete&&t().createElement("div",e.stProps("action","deleteButton"),t().createElement(g.IconButton,GI({iconClassName:"mdi mdi-close",tooltip:"Remove",onClick:function(e){e.stopPropagation(),n.onDelete()}},r_.deleteIconProps))),t().createElement("div",e.stProps("action","icon"),t().createElement(g.FontIcon,{color:n.tint||"#03A9F4",className:n.icon})),t().createElement("div",e.stProps("action","title"),n.title),t().createElement("div",e.stProps("action","description"),r));return n.dropProps?t().createElement(n_,GI({},e.stProps("action","container"),n.dropProps),o):t().createElement(g.Paper,GI({zDepth:0},e.stProps("action","container"),{onClick:function(){i(n.value)}}),o)}))))})),t().createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n.react-mui-context .bbpanel .stepper-section-actions {\n display: flex;\n flex-wrap: wrap;\n}\n\n.react-mui-context .bbpanel .stepper-section-container {\n margin-bottom: 30px;\n}\n\n.react-mui-context .bbpanel .stepper-section-title {\n font-size: 13px;\n font-weight: 500;\n color: #455a64;\n padding-bottom: 20px; \n}\n\n.react-mui-context .bbpanel .stepper-action-container {\n margin: 10px;\n width: 230px;\n height: 210px;\n display: flex;\n flex-direction: column;\n font-size: 15px;\n padding: 10px 20px;\n border-radius: 6px !important;\n box-shadow: 1px 10px 20px 0 rgba(40,60,75,.15);\n cursor: pointer;\n position:relative;\n}\n\n.react-mui-context .bbpanel .stepper-action-container:hover {\n box-shadow: 1px 10px 20px 0 rgba(40,60,75,.3)\n}\n\n.react-mui-context .bbpanel .stepper-action-icon {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.react-mui-context .bbpanel .stepper-tag {\n position: absolute;\n top: 15px;\n left: 16px;\n background-color: #B0BEC5;\n color: white;\n padding: 1px 5px;\n font-size: 12px;\n height: 19px;\n line-height: 16px;\n border-radius: 4px;\n font-weight: 500;\n}\n\n.react-mui-context .bbpanel .stepper-action-icon > span {\n font-size: 50px !important;\n}\n\n.react-mui-context .bbpanel .stepper-action-title {\n padding-bottom: 20px;\n font-weight: 500;\n text-align: center;\n font-size: 16px;\n}\n\n.react-mui-context .bbpanel .stepper-action-description {\n text-align: center;\n font-weight: 300;\n font-size: 13px;\n padding-bottom: 10px; \n}\n"}}))}}],r&&QI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);const i_=o_;function a_(e){return a_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a_(e)}function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c_(e){for(var t=1;t div{border-radius: 6px !important;}"}}))}}],r&&u_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component),y_={SortableList:L,SimpleList:Mo,NodeListCustomProvider:Wo,ListEntry:de,ListPaginator:Sr,MaterialTable:oi,Masonry:za,Timeline:Xa,TreeView:Ss,DNDTreeView:gs,FoldersTree:ws,ClipboardTextField:Gs,LabelWithTip:js,EmptyStateView:po,SimpleFigureBadge:Us,ModalAppBar:function(e){var n=e.style,r=e.titleStyle,o=e.iconStyleRight,i=e.iconStyleLeft,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,kc),s={style:Ec({flexShrink:0},n),titleStyle:Ec({lineHeight:"56px",height:56,marginLeft:-8},r),iconStyleRight:Ec({marginTop:4},o),iconStyleLeft:Ec({marginTop:4},i)};return t().createElement(g.AppBar,Oc({},a,s))},GenericCard:hc,GenericLine:fc,Mui3CardLine:pc,QuotaUsageLine:Sc,ReactEditorOpener:Mc,DynamicGrid:bl,DynamicGridItemMixin:Ol,asGridItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{gridWidth:4,gridHeight:12},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=e.displayName||e.name;e=Nl()(e);var i=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jl(e,t)}(s,t);var n,r,o,i,a=(o=s,i=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}}(),function(){var e,t=Il(o);if(i){var n=Il(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,e,t)).state={focus:!1,showCloseAction:!1},n}return n=s,r=[{key:"focusItem",value:function(){this.setState({focus:!0})}},{key:"blurItem",value:function(){this.setState({focus:!1})}},{key:"mergeStyleWithFocus",value:function(){return Cl(Cl({},this.props.style),{},{zIndex:this.state.focus?1:null})}},{key:"toggleEditMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e?this.setState({showCloseAction:!(this.state&&this.state.showCloseAction)}):this.setState({showCloseAction:e})}},{key:"getCloseButton",value:function(){var e=function(){};return this.props.onCloseAction&&(e=this.props.onCloseAction),React.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(0,0,0,0.53)",zIndex:10,top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center"}},React.createElement(Ml,{label:this.props.pydio.MessageHash["ajxp_admin.home.48"],className:"card-close-button",onClick:e,style:{color:"white"}}))}},{key:"render",value:function(){var t=Cl(Cl({},this.props),{},{style:this.mergeStyleWithFocus(),closeButton:this.state.showCloseAction?this.getCloseButton():null,onFocusItem:this.focusItem.bind(this),onBlurItem:this.blurItem.bind(this)});return React.createElement(e,t)}}],r&&xl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(Al);return i.propTypes={onCloseAction:_l.func},i.displayName=o,i.builderDisplayName=t,i.getGridLayout=function(e,t){return{x:e||0,y:t||0,w:n.gridWidth||4,h:n.gridHeight||12,isResizable:!1}},i.hasBuilderFields=function(){return void 0!==r},i.getBuilderFields=function(){return r},i},DynamicGridStore:Hc,DND:{Types:p,collect:f,collectDrop:h,nodeDragSource:v,nodeDropTarget:b,DNDActionParameter:m},DNDActionParameter:m,UserAvatar:Hd,SharedAvatar:sv,UsersCompleter:tv,TeamCreationForm:Kf,AddressBook:zy,DirectoryLayout:Py,ListStylesCompact:mu,SharedUsersStack:pv,ContextMenu:Jv,Toolbar:xb,ButtonMenu:Ev,IconButtonMenu:ir,MenuItemsConsumer:Gn,MenuUtils:Un,Chat:BI,ChatIcon:$I,ChatClient:Fb,ResourcePoliciesPanel:cp,CellActionsRenderer:hu,Stepper:{PanelBigButtons:i_,Dialog:m_}}})(),window.PydioComponents=s})(); \ No newline at end of file +(()=>{var e,t,n,r,o={5998:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(3997),o=n(7e3),i=n(5586),a=n(2471),s=n(2137),c=n(6194),l=n(5614),u=function(e,t,n){for(var r=0,i=0;r=i,i=(0,o.fj)(),38===r&&12===i&&(t[n]=1),!(0,o.r)(i);)(0,o.lp)();return(0,o.tP)(e,o.FK)},d=new WeakMap,p=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||d.get(n))&&!r){d.set(e,!0);for(var a=[],s=function(e,t){return(0,o.cE)(function(e,t){var n=-1,r=44;do{switch((0,o.r)(r)){case 0:38===r&&12===(0,o.fj)()&&(t[n]=1),e[n]+=u(o.FK-1,t,n);break;case 2:e[n]+=(0,o.iF)(r);break;case 4:if(44===r){e[++n]=58===(0,o.fj)()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=(0,i.Dp)(r)}}while(r=(0,o.lp)());return e}((0,o.un)(e),t))}(t,a),c=n.props,l=0,p=0;l6)switch((0,i.uO)(e,t+1)){case 109:if(45!==(0,i.uO)(e,t+4))break;case 102:return(0,i.gx)(e,/(.+:)(.+)-([^]+)/,"$1"+a.G$+"$2-$3$1"+a.uj+(108==(0,i.uO)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,i.Cw)(e,"stretch")?h((0,i.gx)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,i.uO)(e,t+1))break;case 6444:switch((0,i.uO)(e,(0,i.to)(e)-3-(~(0,i.Cw)(e,"!important")&&10))){case 107:return(0,i.gx)(e,":",":"+a.G$)+e;case 101:return(0,i.gx)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a.G$+(45===(0,i.uO)(e,14)?"inline-":"")+"box$3$1"+a.G$+"$2$3$1"+a.MS+"$2box$3")+e}break;case 5936:switch((0,i.uO)(e,t+11)){case 114:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return a.G$+e+a.MS+(0,i.gx)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return a.G$+e+a.MS+e+e}return e}var m=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case a.h5:e.return=h(e.value,e.length);break;case a.lK:return(0,s.q)([(0,o.JG)(e,{value:(0,i.gx)(e.value,"@","@"+a.G$)})],r);case a.Fr:if(e.length)return(0,i.$e)(e.props,(function(t){switch((0,i.EQ)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,s.q)([(0,o.JG)(e,{props:[(0,i.gx)(t,/:(read-\w+)/,":"+a.uj+"$1")]})],r);case"::placeholder":return(0,s.q)([(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,":"+a.G$+"input-$1")]}),(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,":"+a.uj+"$1")]}),(0,o.JG)(e,{props:[(0,i.gx)(t,/:(plac\w+)/,a.MS+"input-$1")]})],r)}return""}))}}];const y=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,i,a=e.stylisPlugins||m,u={},d=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n{"use strict";n.d(t,{Z:()=>r});const r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}},7611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7702),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const i=(0,r.Z)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},7702:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},5017:(e,t,n)=>{"use strict";n.d(t,{T:()=>s,w:()=>a});var r=n(6689),o=n(5998);n(1372),n(5335);var i=(0,r.createContext)("undefined"!=typeof HTMLElement?(0,o.Z)({key:"css"}):null);i.Provider;var a=function(e){return(0,r.forwardRef)((function(t,n){var o=(0,r.useContext)(i);return e(t,o,n)}))},s=(0,r.createContext)({})},1372:(e,t,n)=>{"use strict";n.d(t,{O:()=>y});var r=n(9783),o=n(6053),i=n(7702);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},d=(0,i.Z)((function(e){return l(e)?e:e.replace(s,"-$&").toLowerCase()})),p=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(c,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===o.Z[e]||l(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(a(n)){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o{"use strict";n.d(t,{m:()=>r});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t{"use strict";n.d(t,{Z:()=>m});var r=n(212),o=n(6689),i=n(7611),a=n(5017),s=n(5394),c=n(1372),l=n(5335),u=i.Z,d=function(e){return"theme"!==e},p=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?u:d},f=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},h=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,s.hC)(t,n,r),(0,l.L)((function(){return(0,s.My)(t,n,r)})),null};const m=function e(t,n){var i,l,u=t.__emotion_real===t,d=u&&t.__emotion_base||t;void 0!==n&&(i=n.label,l=n.target);var m=f(t,n,u),y=m||p(d),v=!y("as");return function(){var b=arguments,g=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&g.push("label:"+i+";"),null==b[0]||void 0===b[0].raw)g.push.apply(g,b);else{g.push(b[0][0]);for(var S=b.length,w=1;w{"use strict";n.d(t,{Z:()=>i}),n(6689);var r=n(9513),o=(n(1372),n(5335),r.Z.bind());["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){o[e]=o(e)}));const i=o},6053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},5335:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(6689),o=!!r.useInsertionEffect&&r.useInsertionEffect||function(e){return e()}},5394:(e,t,n)=>{"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n.d(t,{My:()=>i,fp:()=>r,hC:()=>o});var o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},i=function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},416:(e,t,n)=>{"use strict";var r=n(7920);t.Z=void 0;var o=r(n(531)),i=n(1827),a=(0,o.default)((0,i.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");t.Z=a},7026:(e,t,n)=>{"use strict";var r=n(7920);t.Z=void 0;var o=r(n(531)),i=n(1827),a=(0,o.default)((0,i.jsx)("path",{d:"m10 17 5-5-5-5v10z"}),"ArrowRight");t.Z=a},531:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(942)},464:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"}},4956:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={black:"#000",white:"#fff"}},1268:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"}},4301:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"}},4512:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"}},3449:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"}},9293:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"}},7436:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"}},7444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(212);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n;return(0,r.Z)({toolbar:(n={minHeight:56},i(n,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),i(n,e.up("sm"),{minHeight:64}),n)},t)}},5202:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>S});var r=n(212),o=n(305),i=n(4070),a=n(4359),s=n(4951),c=n(4956),l=n(4301),u=n(9293),d=n(7436),p=n(3449),f=n(464),h=n(4512),m=n(1268),y=["mode","contrastThreshold","tonalOffset"],v={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:c.Z.white,default:c.Z.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},b={text:{primary:c.Z.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:c.Z.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function g(e,t,n,r){var o=r.light||r,i=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,s.$n)(e.main,o):"dark"===t&&(e.dark=(0,s._j)(e.main,i)))}function S(e){var t=e.mode,n=void 0===t?"light":t,S=e.contrastThreshold,w=void 0===S?3:S,k=e.tonalOffset,O=void 0===k?.2:k,P=(0,o.Z)(e,y),E=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:f.Z[200],light:f.Z[50],dark:f.Z[400]}:{main:f.Z[700],light:f.Z[400],dark:f.Z[800]}}(n),C=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:u.Z[200],light:u.Z[50],dark:u.Z[400]}:{main:u.Z[500],light:u.Z[300],dark:u.Z[700]}}(n),T=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:d.Z[500],light:d.Z[300],dark:d.Z[700]}:{main:d.Z[700],light:d.Z[400],dark:d.Z[800]}}(n),x=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h.Z[400],light:h.Z[300],dark:h.Z[700]}:{main:h.Z[700],light:h.Z[500],dark:h.Z[900]}}(n),R=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m.Z[400],light:m.Z[300],dark:m.Z[700]}:{main:m.Z[800],light:m.Z[500],dark:m.Z[900]}}(n),j=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p.Z[400],light:p.Z[300],dark:p.Z[700]}:{main:"#ed6c02",light:p.Z[500],dark:p.Z[900]}}(n);function I(e){return(0,s.mi)(e,b.text.primary)>=w?b.text.primary:v.text.primary}var _=function(e){var t=e.color,n=e.name,o=e.mainShade,a=void 0===o?500:o,s=e.lightShade,c=void 0===s?300:s,l=e.darkShade,u=void 0===l?700:l;if(!(t=(0,r.Z)({},t)).main&&t[a]&&(t.main=t[a]),!t.hasOwnProperty("main"))throw new Error((0,i.Z)(11,n?" (".concat(n,")"):"",a));if("string"!=typeof t.main)throw new Error((0,i.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return g(t,"light",c,O),g(t,"dark",u,O),t.contrastText||(t.contrastText=I(t.main)),t},A={dark:b,light:v};return(0,a.Z)((0,r.Z)({common:(0,r.Z)({},c.Z),mode:n,primary:_({color:E,name:"primary"}),secondary:_({color:C,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:_({color:T,name:"error"}),warning:_({color:j,name:"warning"}),info:_({color:x,name:"info"}),success:_({color:R,name:"success"}),grey:l.Z,contrastThreshold:w,getContrastText:I,augmentColor:_,tonalOffset:O},A[n]),P)}},8662:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var r=n(212),o=n(305),i=n(4070),a=n(4359),s=n(5156),c=n(1426),l=n(6713),u=n(7444),d=n(5202),p=n(9794),f=n(5891),h=n(4681),m=n(7308),y=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];const v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,v=e.palette,b=void 0===v?{}:v,g=e.transitions,S=void 0===g?{}:g,w=e.typography,k=void 0===w?{}:w,O=(0,o.Z)(e,y);if(e.vars)throw new Error((0,i.Z)(18));var P=(0,d.ZP)(b),E=(0,s.Z)(e),C=(0,a.Z)(E,{mixins:(0,u.Z)(E.breakpoints,n),palette:P,shadows:f.Z.slice(),typography:(0,p.Z)(P,k),transitions:(0,h.ZP)(S),zIndex:(0,r.Z)({},m.Z)});C=(0,a.Z)(C,O);for(var T=arguments.length,x=new Array(T>1?T-1:0),R=1;R{"use strict";n.d(t,{ZP:()=>u,x9:()=>s});var r=n(305),o=n(212),i=["duration","easing","delay"],a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},s={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function c(e){return"".concat(Math.round(e),"ms")}function l(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function u(e){var t=(0,o.Z)({},a,e.easing),n=(0,o.Z)({},s,e.duration);return(0,o.Z)({getAutoHeightDuration:l,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.duration,s=void 0===a?n.standard:a,l=o.easing,u=void 0===l?t.easeInOut:l,d=o.delay,p=void 0===d?0:d;return(0,r.Z)(o,i),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof s?s:c(s)," ").concat(u," ").concat("string"==typeof p?p:c(p))})).join(",")}},e,{easing:t,duration:n})}},9794:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(212),o=n(305),i=n(4359),a=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"],s={textTransform:"uppercase"},c='"Roboto", "Helvetica", "Arial", sans-serif';function l(e,t){var n="function"==typeof t?t(e):t,l=n.fontFamily,u=void 0===l?c:l,d=n.fontSize,p=void 0===d?14:d,f=n.fontWeightLight,h=void 0===f?300:f,m=n.fontWeightRegular,y=void 0===m?400:m,v=n.fontWeightMedium,b=void 0===v?500:v,g=n.fontWeightBold,S=void 0===g?700:g,w=n.htmlFontSize,k=void 0===w?16:w,O=n.allVariants,P=n.pxToRem,E=(0,o.Z)(n,a),C=p/14,T=P||function(e){return"".concat(e/k*C,"rem")},x=function(e,t,n,o,i){return(0,r.Z)({fontFamily:u,fontWeight:e,fontSize:T(t),lineHeight:n},u===c?{letterSpacing:"".concat((a=o/t,Math.round(1e5*a)/1e5),"em")}:{},i,O);var a},R={h1:x(h,96,1.167,-1.5),h2:x(h,60,1.2,-.5),h3:x(y,48,1.167,0),h4:x(y,34,1.235,.25),h5:x(y,24,1.334,0),h6:x(b,20,1.6,.15),subtitle1:x(y,16,1.75,.15),subtitle2:x(b,14,1.57,.1),body1:x(y,16,1.5,.15),body2:x(y,14,1.43,.15),button:x(b,14,1.75,.4,s),caption:x(y,12,1.66,.4),overline:x(y,12,2.66,1,s)};return(0,i.Z)((0,r.Z)({htmlFontSize:k,pxToRem:T,fontFamily:u,fontSize:p,fontWeightLight:h,fontWeightRegular:y,fontWeightMedium:b,fontWeightBold:S},R),E,{clone:!1})}},6651:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(0,n(8662).Z)()},5891:(e,t,n)=>{"use strict";function r(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}n.d(t,{Z:()=>o});const o=["none",r(0,2,1,-1,0,1,1,0,0,1,3,0),r(0,3,1,-2,0,2,2,0,0,1,5,0),r(0,3,3,-2,0,3,4,0,0,1,8,0),r(0,2,4,-1,0,4,5,0,0,1,10,0),r(0,3,5,-1,0,5,8,0,0,1,14,0),r(0,3,5,-1,0,6,10,0,0,1,18,0),r(0,4,5,-2,0,7,10,1,0,2,16,1),r(0,5,5,-3,0,8,10,1,0,3,14,2),r(0,5,6,-3,0,9,12,1,0,3,16,2),r(0,6,6,-3,0,10,14,1,0,4,18,3),r(0,6,7,-4,0,11,15,1,0,4,20,3),r(0,7,8,-4,0,12,17,2,0,5,22,4),r(0,7,8,-4,0,13,19,2,0,5,24,4),r(0,7,9,-4,0,14,21,2,0,5,26,4),r(0,8,9,-5,0,15,22,2,0,6,28,5),r(0,8,10,-5,0,16,24,2,0,6,30,5),r(0,8,11,-5,0,17,26,2,0,6,32,5),r(0,9,11,-5,0,18,28,2,0,7,34,6),r(0,9,12,-6,0,19,29,2,0,7,36,6),r(0,10,13,-6,0,20,31,3,0,8,38,7),r(0,10,13,-6,0,21,33,3,0,8,40,7),r(0,10,14,-6,0,22,35,3,0,8,42,7),r(0,11,14,-7,0,23,36,3,0,9,44,8),r(0,11,15,-7,0,24,38,3,0,9,46,8)]},9812:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>i});var r=n(8045),o=n(6651);const i=(0,r.ZP)({defaultTheme:o.Z,rootShouldForwardProp:function(e){return(0,r.x9)(e)&&"classes"!==e}})},5670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9420),o=n(6651);function i(e){var t=e.props,n=e.name;return(0,r.Z)({props:t,name:n,defaultTheme:o.Z})}},7308:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},942:(e,t,n)=>{"use strict";n.r(t),n.d(t,{capitalize:()=>o,createChainedFunction:()=>i,createSvgIcon:()=>w,debounce:()=>k,deprecatedPropType:()=>O,isMuiElement:()=>P,ownerDocument:()=>E.Z,ownerWindow:()=>T,requirePropFactory:()=>x,setRef:()=>R,unstable_ClassNameGenerator:()=>q,unstable_useEnhancedEffect:()=>j.Z,unstable_useId:()=>I.Z,unsupportedProp:()=>_,useControlled:()=>A.Z,useEventCallback:()=>N,useForkRef:()=>L.Z,useIsFocusVisible:()=>H});var r=n(611);const o=n(994).Z,i=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=this,o=arguments.length,i=new Array(o),a=0;a{"use strict";n.d(t,{Z:()=>r});const r=n(1788).Z},7181:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(9767).Z},4017:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(7116).Z},8241:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(127).Z},9813:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(1822).Z},7809:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(6689).createContext(null)},2292:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689),o=n(7809);function i(){return r.useContext(o.Z)}},254:(e,t,n)=>{"use strict";n.d(t,{Co:()=>i,ZP:()=>o});var r=n(5040);function o(e,t){return(0,r.Z)(e,t)}var i=function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},2455:(e,t,n)=>{"use strict";n.d(t,{E0:()=>b,NL:()=>s});var r=n(5770),o=n(5115),i=n(7654),a=n(1250);function s(e){return"number"!=typeof e?e:"".concat(e,"px solid")}var c=(0,r.ZP)({prop:"border",themeKey:"borders",transform:s}),l=(0,r.ZP)({prop:"borderTop",themeKey:"borders",transform:s}),u=(0,r.ZP)({prop:"borderRight",themeKey:"borders",transform:s}),d=(0,r.ZP)({prop:"borderBottom",themeKey:"borders",transform:s}),p=(0,r.ZP)({prop:"borderLeft",themeKey:"borders",transform:s}),f=(0,r.ZP)({prop:"borderColor",themeKey:"palette"}),h=(0,r.ZP)({prop:"borderTopColor",themeKey:"palette"}),m=(0,r.ZP)({prop:"borderRightColor",themeKey:"palette"}),y=(0,r.ZP)({prop:"borderBottomColor",themeKey:"palette"}),v=(0,r.ZP)({prop:"borderLeftColor",themeKey:"palette"}),b=function(e){if(void 0!==e.borderRadius&&null!==e.borderRadius){var t=(0,i.eI)(e.theme,"shape.borderRadius",4,"borderRadius");return(0,a.k9)(e,e.borderRadius,(function(e){return{borderRadius:(0,i.NA)(t,e)}}))}return null};b.propTypes={},b.filterProps=["borderRadius"],(0,o.Z)(c,l,u,d,p,f,h,m,y,v,b)},1250:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{L7:()=>c,VO:()=>o,W8:()=>s,k9:()=>a}),n(580);var o={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(o[e],"px)")}};function a(e,t,n){var a=e.theme||{};if(Array.isArray(t)){var s=a.breakpoints||i;return t.reduce((function(e,r,o){return e[s.up(s.keys[o])]=n(t[o]),e}),{})}if("object"===r(t)){var c=a.breakpoints||i;return Object.keys(t).reduce((function(e,r){if(-1!==Object.keys(c.values||o).indexOf(r))e[c.up(r)]=n(t[r],r);else{var i=r;e[i]=t[i]}return e}),{})}return n(t)}function s(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{}))||{}}function c(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}},4951:(e,t,n)=>{"use strict";n.d(t,{$n:()=>d,Fq:()=>l,_j:()=>u,mi:()=>c});var r=n(4070);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));var o,a=e.substring(t+1,e.length-1);if("color"===n){if(o=(a=a.split(" ")).shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o))throw new Error((0,r.Z)(10,o))}else a=a.split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)})),colorSpace:o}}function a(e){var t=e.type,n=e.colorSpace,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function s(e){var t="hsl"===(e=i(e)).type||"hsla"===e.type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,s=r*Math.min(o,1-o),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-s*Math.max(Math.min(t-3,9-t,1),-1)},l="rgb",u=[Math.round(255*c(0)),Math.round(255*c(8)),Math.round(255*c(4))];return"hsla"===e.type&&(l+="a",u.push(t[3])),a({type:l,values:u})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){var n=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e,t){return e=i(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,a(e)}function u(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function d(e,t){if(e=i(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return a(e)}},5115:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(1403);const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{ZP:()=>w,x9:()=>g});var r=n(9807),o=n(633),i=n(254),a=n(5156),s=n(1195),c=n(6713);function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=void 0===t?S:t,a=e.rootShouldForwardProp,s=void 0===a?g:a,d=e.slotShouldForwardProp,w=void 0===d?g:d,k=function(e){var t=m(e.theme)?n:e.theme;return(0,c.Z)((0,o.Z)({},e,{theme:t}))};return k.__mui_systemSx=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Co)(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var a=t.name,c=t.slot,d=t.skipVariantsResolver,S=t.skipSx,O=t.overridesResolver,P=(0,r.Z)(t,p),E=void 0!==d?d:c&&"Root"!==c||!1,C=S||!1,T=g;"Root"===c?T=s:c?T=w:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(T=void 0);var x=(0,i.ZP)(e,(0,o.Z)({shouldForwardProp:T,label:void 0},P)),R=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s0){var g=new Array(p).fill("");(d=[].concat(l(e),l(g))).raw=[].concat(l(e.raw),l(g))}else"function"==typeof e&&e.__emotion_real!==e&&(d=function(t){var i=t.theme,a=(0,r.Z)(t,h);return e((0,o.Z)({theme:m(i)?n:i},a))});return x.apply(void 0,[d].concat(l(c)))};return x.withConfig&&(R.withConfig=x.withConfig),R}}},6828:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(9807),o=n(633);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=["values","unit","step"],s=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,o.Z)({},e,function(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t.key,t.val))}),{})};function c(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,i=e.unit,c=void 0===i?"px":i,l=e.step,u=void 0===l?5:l,d=(0,r.Z)(e,a),p=s(n),f=Object.keys(p);function h(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(c,")")}function m(e){var t="number"==typeof n[e]?n[e]:e;return"@media (max-width:".concat(t-u/100).concat(c,")")}function y(e,t){var r=f.indexOf(t);return"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(c,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[f[r]]?n[f[r]]:t)-u/100).concat(c,")")}return(0,o.Z)({keys:f,values:p,up:h,down:m,between:y,only:function(e){return f.indexOf(e)+1{"use strict";n.d(t,{Z:()=>o});var r=n(7654);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,r.hB)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r{"use strict";n.d(t,{Z:()=>p});var r=n(633),o=n(9807),i=n(4359),a=n(6828),s=n(1202),c=n(2500),l=n(6713),u=n(1426),d=["breakpoints","palette","spacing","shape"];const p=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,p=e.palette,f=void 0===p?{}:p,h=e.spacing,m=e.shape,y=void 0===m?{}:m,v=(0,o.Z)(e,d),b=(0,a.Z)(n),g=(0,c.Z)(h),S=(0,i.Z)({breakpoints:b,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},f),spacing:g,shape:(0,r.Z)({},s.Z,y)},v),w=arguments.length,k=new Array(w>1?w-1:0),O=1;O{"use strict";n.d(t,{Z:()=>r});const r={borderRadius:4}},5607:(e,t,n)=>{"use strict";n.d(t,{SG:()=>s,e$:()=>c,s2:()=>l});var r=n(5770),o=n(5115),i=n(7654),a=n(1250),s=function(e){if(void 0!==e.gap&&null!==e.gap){var t=(0,i.eI)(e.theme,"spacing",8,"gap");return(0,a.k9)(e,e.gap,(function(e){return{gap:(0,i.NA)(t,e)}}))}return null};s.propTypes={},s.filterProps=["gap"];var c=function(e){if(void 0!==e.columnGap&&null!==e.columnGap){var t=(0,i.eI)(e.theme,"spacing",8,"columnGap");return(0,a.k9)(e,e.columnGap,(function(e){return{columnGap:(0,i.NA)(t,e)}}))}return null};c.propTypes={},c.filterProps=["columnGap"];var l=function(e){if(void 0!==e.rowGap&&null!==e.rowGap){var t=(0,i.eI)(e.theme,"spacing",8,"rowGap");return(0,a.k9)(e,e.rowGap,(function(e){return{rowGap:(0,i.NA)(t,e)}}))}return null};l.propTypes={},l.filterProps=["rowGap"];var u=(0,r.ZP)({prop:"gridColumn"}),d=(0,r.ZP)({prop:"gridRow"}),p=(0,r.ZP)({prop:"gridAutoFlow"}),f=(0,r.ZP)({prop:"gridAutoColumns"}),h=(0,r.ZP)({prop:"gridAutoRows"}),m=(0,r.ZP)({prop:"gridTemplateColumns"}),y=(0,r.ZP)({prop:"gridTemplateRows"}),v=(0,r.ZP)({prop:"gridTemplateAreas"}),b=(0,r.ZP)({prop:"gridArea"});(0,o.Z)(s,c,l,u,d,p,f,h,m,y,v,b)},8838:(e,t,n)=>{"use strict";function r(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{Z:()=>r})},1403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4359);const o=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},9598:(e,t,n)=>{"use strict";n.d(t,{Sh:()=>i});var r=n(5770),o=n(5115);function i(e,t){return"grey"===t?t:e}var a=(0,r.ZP)({prop:"color",themeKey:"palette",transform:i}),s=(0,r.ZP)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:i}),c=(0,r.ZP)({prop:"backgroundColor",themeKey:"palette",transform:i});(0,o.Z)(a,s,c)},1195:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9807),o=n(994),i=["variant"];function a(e){return 0===e.length}function s(e){var t=e.variant,n=(0,r.Z)(e,i),s=t||"";return Object.keys(n).sort().forEach((function(t){s+="color"===t?a(s)?e[t]:(0,o.Z)(e[t]):"".concat(a(s)?t:(0,o.Z)(t)).concat((0,o.Z)(e[t].toString()))})),s}},1384:(e,t,n)=>{"use strict";n.d(t,{EB:()=>a,kk:()=>c});var r=n(5770),o=n(5115),i=n(1250);function a(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}var s=(0,r.ZP)({prop:"width",transform:a}),c=function(e){return void 0!==e.maxWidth&&null!==e.maxWidth?(0,i.k9)(e,e.maxWidth,(function(t){var n,r,o;return{maxWidth:(null==(n=e.theme)||null==(r=n.breakpoints)||null==(o=r.values)?void 0:o[t])||i.VO[t]||a(t)}})):null};c.filterProps=["maxWidth"];var l=(0,r.ZP)({prop:"minWidth",transform:a}),u=(0,r.ZP)({prop:"height",transform:a}),d=(0,r.ZP)({prop:"maxHeight",transform:a}),p=(0,r.ZP)({prop:"minHeight",transform:a}),f=((0,r.ZP)({prop:"size",cssProperty:"width",transform:a}),(0,r.ZP)({prop:"size",cssProperty:"height",transform:a}),(0,r.ZP)({prop:"boxSizing"}));(0,o.Z)(s,c,l,u,d,p,f)},7654:(e,t,n)=>{"use strict";n.d(t,{NA:()=>v,e6:()=>g,eI:()=>m,hB:()=>y,o3:()=>S});var r=n(1250),o=n(5770),i=n(1403),a=n(8838);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2){if(!u[e])return[e];e=u[e]}var t,n,r=(t=e.split(""),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(t,n)||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.")}()),o=r[0],i=r[1],a=c[o],d=l[i]||"";return Array.isArray(d)?d.map((function(e){return a+e})):[a+d]})),p=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],f=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[].concat(p,f);function m(e,t,n,r){var i,a=null!=(i=(0,o.DW)(e,t,!1))?i:n;return"number"==typeof a?function(e){return"string"==typeof e?e:a*e}:Array.isArray(a)?function(e){return"string"==typeof e?e:a[e]}:"function"==typeof a?a:function(){}}function y(e){return m(e,"spacing",8)}function v(e,t){if("string"==typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}function b(e,t){var n=y(e.theme);return Object.keys(e).map((function(o){return function(e,t,n,o){if(-1===t.indexOf(n))return null;var i=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=v(t,n),e}),{})}}(d(n),o),a=e[n];return(0,r.k9)(e,a,i)}(e,t,o,n)})).reduce(i.Z,{})}function g(e){return b(e,p)}function S(e){return b(e,f)}function w(e){return b(e,h)}g.propTypes={},g.filterProps=p,S.propTypes={},S.filterProps=f,w.propTypes={},w.filterProps=h},5770:(e,t,n)=>{"use strict";n.d(t,{DW:()=>a,Jq:()=>s,ZP:()=>c});var r=n(994),o=n(1250);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){var r="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=r)return r}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function s(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"==typeof e?e(n):Array.isArray(e)?e[n]||o:a(e,n)||o,t&&(r=t(r,o,e)),r}const c=function(e){var t=e.prop,n=e.cssProperty,c=void 0===n?e.prop:n,l=e.themeKey,u=e.transform,d=function(e){if(null==e[t])return null;var n=e[t],d=a(e.theme,l)||{};return(0,o.k9)(e,n,(function(e){var n=s(d,u,e);return e===n&&"string"==typeof e&&(n=s(d,u,"".concat(t).concat("default"===e?"":(0,r.Z)(e)),e)),!1===c?n:function(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},c,n)}))};return d.propTypes={},d.filterProps=[t],d}},1426:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7654),o=n(2455),i=n(5607),a=n(9598),s=n(1384);const c={border:{themeKey:"borders",transform:o.NL},borderTop:{themeKey:"borders",transform:o.NL},borderRight:{themeKey:"borders",transform:o.NL},borderBottom:{themeKey:"borders",transform:o.NL},borderLeft:{themeKey:"borders",transform:o.NL},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:o.E0},color:{themeKey:"palette",transform:a.Sh},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:a.Sh},backgroundColor:{themeKey:"palette",transform:a.Sh},p:{style:r.o3},pt:{style:r.o3},pr:{style:r.o3},pb:{style:r.o3},pl:{style:r.o3},px:{style:r.o3},py:{style:r.o3},padding:{style:r.o3},paddingTop:{style:r.o3},paddingRight:{style:r.o3},paddingBottom:{style:r.o3},paddingLeft:{style:r.o3},paddingX:{style:r.o3},paddingY:{style:r.o3},paddingInline:{style:r.o3},paddingInlineStart:{style:r.o3},paddingInlineEnd:{style:r.o3},paddingBlock:{style:r.o3},paddingBlockStart:{style:r.o3},paddingBlockEnd:{style:r.o3},m:{style:r.e6},mt:{style:r.e6},mr:{style:r.e6},mb:{style:r.e6},ml:{style:r.e6},mx:{style:r.e6},my:{style:r.e6},margin:{style:r.e6},marginTop:{style:r.e6},marginRight:{style:r.e6},marginBottom:{style:r.e6},marginLeft:{style:r.e6},marginX:{style:r.e6},marginY:{style:r.e6},marginInline:{style:r.e6},marginInlineStart:{style:r.e6},marginInlineEnd:{style:r.e6},marginBlock:{style:r.e6},marginBlockStart:{style:r.e6},marginBlockEnd:{style:r.e6},displayPrint:{cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:i.SG},rowGap:{style:i.s2},columnGap:{style:i.e$},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:s.EB},maxWidth:{style:s.kk},minWidth:{transform:s.EB},height:{transform:s.EB},maxHeight:{transform:s.EB},minHeight:{transform:s.EB},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}},6713:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(994),o=n(1403),i=n(5770),a=n(1250),s=n(1426);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(){function e(e,t,n,o){var s,c=(l(s={},e,t),l(s,"theme",n),s),u=o[e];if(!u)return l({},e,t);var d=u.cssProperty,p=void 0===d?e:d,f=u.themeKey,h=u.transform,m=u.style;if(null==t)return null;var y=(0,i.DW)(n,f)||{};return m?m(c):(0,a.k9)(c,t,(function(t){var n=(0,i.Jq)(y,h,t);return t===n&&"string"==typeof t&&(n=(0,i.Jq)(y,h,"".concat(e).concat("default"===t?"":(0,r.Z)(t)),t)),!1===p?n:l({},p,n)}))}return function t(n){var r,i=n||{},u=i.sx,d=i.theme,p=void 0===d?{}:d;if(!u)return null;var f=null!=(r=p.unstable_sxConfig)?r:s.Z;function h(n){var r=n;if("function"==typeof n)r=n(p);else if("object"!==c(n))return n;if(!r)return null;var i=(0,a.W8)(p.breakpoints),s=Object.keys(i),u=i;return Object.keys(r).forEach((function(n){var i,s="function"==typeof(i=r[n])?i(p):i;if(null!=s)if("object"===c(s))if(f[n])u=(0,o.Z)(u,e(n,s,p,f));else{var d=(0,a.k9)({theme:p},s,(function(e){return l({},n,e)}));!function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{Z:()=>a});var r=n(5156),o=n(4313),i=(0,r.Z)();const a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,o.Z)(e)}},3002:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(848);function o(e){var t=e.theme,n=e.name,o=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,o):o}},9420:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(3002),o=n(2957);function i(e){var t=e.props,n=e.name,i=e.defaultTheme,a=(0,o.Z)(i);return(0,r.Z)({theme:a,name:n,props:t})}},4313:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(2292);const o=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=(0,r.Z)();return n&&(e=n,0!==Object.keys(e).length)?n:t}},611:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r,o=function(e){return e};const i=(r=o,{configure:function(e){r=e},generate:function(e){return r(e)},reset:function(){r=o}})},994:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4070);function o(e){if("string"!=typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},7283:(e,t,n)=>{"use strict";function r(e,t,n){var r={};return Object.keys(e).forEach((function(o){r[o]=e[o].reduce((function(e,r){return r&&(e.push(t(r)),n&&n[r]&&e.push(n[r])),e}),[]).join(" ")})),r}n.d(t,{Z:()=>r})},4359:(e,t,n)=>{"use strict";n.d(t,{P:()=>i,Z:()=>s});var r=n(633);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e){return null!==e&&"object"===o(e)&&e.constructor===Object}function a(e){if(!i(e))return e;var t={};return Object.keys(e).forEach((function(n){t[n]=a(e[n])})),t}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},o=n.clone?(0,r.Z)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e&&i(e[r])?o[r]=s(e[r],t[r],n):n.clone?o[r]=i(t[r])?a(t[r]):t[r]:o[r]=t[r])})),o}},4070:(e,t,n)=>{"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;nr})},9691:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(611),o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",i=o[t];return i?"".concat(n,"-").concat(i):"".concat(r.Z.generate(e),"-").concat(t)}},4177:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9691);function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",o={};return t.forEach((function(t){o[t]=(0,r.Z)(e,t,n)})),o}},1788:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:()=>r})},848:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(633);function o(e,t){var n=(0,r.Z)({},t);return Object.keys(e).forEach((function(i){if(i.toString().match(/^(components|slots)$/))n[i]=(0,r.Z)({},e[i],n[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){var a=e[i]||{},s=t[i];n[i]={},s&&Object.keys(s)?a&&Object.keys(a)?(n[i]=(0,r.Z)({},s),Object.keys(a).forEach((function(e){n[i][e]=o(a[e],s[e])}))):n[i]=s:n[i]=a}else void 0===n[i]&&(n[i]=e[i])})),n}},7630:(e,t,n)=>{"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:()=>r})},9767:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";n.d(t,{Z:()=>o});var r=n(6689);const o="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},127:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6689),o=n(7630);function i(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{Z:()=>s});var r=n(6689);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";var r=n(8754),o=n(3700),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},3700:(e,t,n)=>{"use strict";var r=n(298),o=n(8754),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,a,arguments);return c&&l&&c(t,"length").configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},2053:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==r(e))if(Array.isArray(e))for(t=0;ti});const i=function(){for(var e,t,n=0,r="";n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(6205),i=n(8317),a=n(6232),s=n(5142),c=n(1881),l=n(9318),u=n(9490),d=n(2228),p=n(8754),f=n(5554),h=n(2567),m=n(3634),y=n(9238),v=n(5056),b=n(4545),g=f("Date.prototype.getTime"),S=Object.getPrototypeOf,w=f("Object.prototype.toString"),k=p("%Set%",!0),O=f("Map.prototype.has",!0),P=f("Map.prototype.get",!0),E=f("Map.prototype.size",!0),C=f("Set.prototype.add",!0),T=f("Set.prototype.delete",!0),x=f("Set.prototype.has",!0),R=f("Set.prototype.size",!0);function j(e,t,n,r){for(var o,i=m(e);(o=i.next())&&!o.done;)if(N(t,o.value,n,r))return T(e,o.value),!0;return!1}function I(e){return void 0===e?null:"object"!==r(e)?"symbol"!==r(e)&&("string"!=typeof e&&"number"!=typeof e||+e==+e):void 0}function _(e,t,n,r,o,i){var a=I(n);if(null!=a)return a;var s=P(t,a),c=b({},o,{strict:!1});return!(void 0===s&&!O(t,a)||!N(r,s,c,i))&&!O(e,a)&&N(r,s,c,i)}function A(e,t,n){var r=I(n);return null!=r?r:x(t,r)&&!x(e,r)}function M(e,t,n,r,o,i){for(var a,s,c=m(e);(a=c.next())&&!a.done;)if(N(n,s=a.value,o,i)&&N(r,P(t,s),o,i))return T(e,s),!0;return!1}function N(e,t,n,p){var f=n||{};if(f.strict?a(e,t):e===t)return!0;if(d(e)!==d(t))return!1;if(!e||!t||"object"!==r(e)&&"object"!==r(t))return f.strict?a(e,t):e==t;var y,T=p.has(e),I=p.has(t);if(T&&I){if(p.get(e)===p.get(t))return!0}else y={};return T||p.set(e,y),I||p.set(t,y),function(e,t,n,a){var d,p;if(r(e)!==r(t))return!1;if(null==e||null==t)return!1;if(w(e)!==w(t))return!1;if(i(e)!==i(t))return!1;if(l(e)!==l(t))return!1;var f=e instanceof Error,y=t instanceof Error;if(f!==y)return!1;if((f||y)&&(e.name!==t.name||e.message!==t.message))return!1;var T=s(e),I=s(t);if(T!==I)return!1;if((T||I)&&(e.source!==t.source||c(e)!==c(t)))return!1;var L=u(e),U=u(t);if(L!==U)return!1;if((L||U)&&g(e)!==g(t))return!1;if(n.strict&&S&&S(e)!==S(t))return!1;if(v(e)!==v(t))return!1;var B=D(e),F=D(t);if(B!==F)return!1;if(B||F){if(e.length!==t.length)return!1;for(d=0;d=0;d--)if(z[d]!=W[d])return!1;for(d=z.length-1;d>=0;d--)if(!N(e[p=z[d]],t[p],n,a))return!1;var Z=h(e),H=h(t);return Z===H&&("Set"===Z||"Set"===H?function(e,t,n,o){if(R(e)!==R(t))return!1;for(var i,a,s,c=m(e),l=m(t);(i=c.next())&&!i.done;)if(i.value&&"object"===r(i.value))s||(s=new k),C(s,i.value);else if(!x(t,i.value)){if(n.strict)return!1;if(!A(e,t,i.value))return!1;s||(s=new k),C(s,i.value)}if(s){for(;(a=l.next())&&!a.done;)if(a.value&&"object"===r(a.value)){if(!j(s,a.value,n.strict,o))return!1}else if(!n.strict&&!x(e,a.value)&&!j(s,a.value,n.strict,o))return!1;return 0===R(s)}return!0}(e,t,n,a):"Map"!==Z||function(e,t,n,o){if(E(e)!==E(t))return!1;for(var i,a,s,c,l,u,d=m(e),p=m(t);(i=d.next())&&!i.done;)if(c=i.value[0],l=i.value[1],c&&"object"===r(c))s||(s=new k),C(s,c);else if(void 0===(u=P(t,c))&&!O(t,c)||!N(l,u,n,o)){if(n.strict)return!1;if(!_(e,t,c,l,n,o))return!1;s||(s=new k),C(s,c)}if(s){for(;(a=p.next())&&!a.done;)if(c=a.value[0],u=a.value[1],c&&"object"===r(c)){if(!M(s,e,c,u,n,o))return!1}else if(!(n.strict||e.has(c)&&N(P(e,c),u,n,o)||M(s,e,c,u,b({},n,{strict:!1}),o)))return!1;return 0===R(s)}return!0}(e,t,n,a))}(e,t,f,p)}function D(e){return!(!e||"object"!==r(e)||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0]||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))}e.exports=function(e,t,n){return N(e,t,n,y())}},3510:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(6205),i="function"==typeof Symbol&&"symbol"===r(Symbol("foo")),a=Object.prototype.toString,s=Array.prototype.concat,c=Object.defineProperty,l=c&&function(){var e={};try{for(var t in c(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(l?c(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},d=function(e,t){var n=arguments.length>2?arguments[2]:{},r=o(t);i&&(r=s.call(r,Object.getOwnPropertySymbols(t)));for(var a=0;a{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;e.exports=function(e,r,o){if("[object Function]"!==n.call(r))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a{"use strict";var t=Array.prototype.slice,n=Object.prototype.toString;e.exports=function(e){var r=this;if("function"!=typeof r||"[object Function]"!==n.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var o,i=t.call(arguments,1),a=Math.max(0,r.length-i.length),s=[],c=0;c{"use strict";var r=n(2859);e.exports=Function.prototype.bind||r},9045:e=>{"use strict";var t=function(){return"string"==typeof function(){}.name},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch(e){n=null}t.functionsHaveConfigurableNames=function(){return t()&&n&&!!n((function(){}),"name").configurable};var r=Function.prototype.bind;t.boundFunctionsHaveNames=function(){return t()&&"function"==typeof r&&""!==function(){}.bind().name},e.exports=t},8754:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o,i=SyntaxError,a=Function,s=TypeError,c=function(e){try{return a('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var u=function(){throw new s},d=l?function(){try{return u}catch(e){try{return l(arguments,"callee").get}catch(e){return u}}}():u,p=n(8921)(),f=Object.getPrototypeOf||function(e){return e.__proto__},h={},m="undefined"==typeof Uint8Array?o:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):o,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":r(JSON))?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):o,"%Symbol%":p?Symbol:o,"%SyntaxError%":i,"%ThrowTypeError%":d,"%TypedArray%":m,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},v=function e(t){var n;if("%AsyncFunction%"===t)n=c("async function () {}");else if("%GeneratorFunction%"===t)n=c("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=c("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=f(o.prototype))}return y[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=n(298),S=n(6841),w=g.call(Function.call,Array.prototype.concat),k=g.call(Function.apply,Array.prototype.splice),O=g.call(Function.call,String.prototype.replace),P=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,T=function(e,t){var n,r=e;if(S(b,r)&&(r="%"+(n=b[r])[0]+"%"),S(y,r)){var o=y[r];if(o===h&&(o=v(r)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var n=function(e){var t=P(e,0,1),n=P(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return O(e,E,(function(e,t,n,o){r[r.length]=n?O(o,C,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=T("%"+r+"%",t),a=o.name,c=o.value,u=!1,d=o.alias;d&&(r=d[0],k(n,w([0,1],d)));for(var p=1,f=!0;p=n.length){var b=l(c,h);c=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[h]}else f=S(c,h),c=c[h];f&&!u&&(y[a]=c)}}return c}},4521:(e,t)=>{},8921:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="undefined"!=typeof Symbol&&Symbol,i=n(17);e.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"===r(o("foo"))&&"symbol"===r(Symbol("bar"))&&i()}},17:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===t(Symbol.iterator))return!0;var e={},n=Symbol("test"),r=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(n in e[n]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,n);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6841:(e,t,n)=>{"use strict";var r=n(298);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},8317:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="function"==typeof Symbol&&"symbol"===r(Symbol.toStringTag),i=n(5554)("Object.prototype.toString"),a=function(e){return!(o&&e&&"object"===r(e)&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!a(e)||null!==e&&"object"===r(e)&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},c=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=c?a:s},999:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}if("function"==typeof BigInt){var n=BigInt.prototype.valueOf;e.exports=function(e){return null!=e&&"boolean"!=typeof e&&"string"!=typeof e&&"number"!=typeof e&&"symbol"!==t(e)&&"function"!=typeof e&&("bigint"==typeof e||function(e){try{return n.call(e),!0}catch(e){}return!1}(e))}}else e.exports=function(e){return!1}},5217:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(5554),i=o("Boolean.prototype.toString"),a=o("Object.prototype.toString"),s="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"boolean"==typeof e||null!==e&&"object"===r(e)&&(s&&Symbol.toStringTag in e?function(e){try{return i(e),!0}catch(e){return!1}}(e):"[object Boolean]"===a(e))}},9490:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Date.prototype.getDay,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"object"===t(e)&&null!==e&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===r.call(e))}},7233:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;r||(n=function(e){return!1});var i=r?Map.prototype.has:null,a=o?Set.prototype.has:null;n||i||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(i.call(e),a)try{a.call(e)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},2869:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Number.prototype.toString,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"number"==typeof e||"object"===t(e)&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Number]"===r.call(e))}},5142:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o,i,a,s,c=n(5554),l=n(17)()&&!!Symbol.toStringTag;if(l){o=c("Object.prototype.hasOwnProperty"),i=c("RegExp.prototype.exec"),a={};var u=function(){throw a};s={toString:u,valueOf:u},"symbol"===r(Symbol.toPrimitive)&&(s[Symbol.toPrimitive]=u)}var d=c("Object.prototype.toString"),p=Object.getOwnPropertyDescriptor;e.exports=l?function(e){if(!e||"object"!==r(e))return!1;var t=p(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{i(e,s)}catch(e){return e===a}}:function(e){return!(!e||"object"!==r(e)&&"function"!=typeof e)&&"[object RegExp]"===d(e)}},1189:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof Map&&Map.prototype?Map:null,o="function"==typeof Set&&Set.prototype?Set:null;o||(n=function(e){return!1});var i=r?Map.prototype.has:null,a=o?Set.prototype.has:null;n||a||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(a.call(e),i)try{i.call(e)}catch(e){return!0}return e instanceof o}catch(e){}return!1}},373:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=String.prototype.valueOf,r=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"===t(e)&&(o?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===r.call(e))}},5490:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=Object.prototype.toString;if(n(8921)()){var i=Symbol.prototype.toString,a=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"===r(e))return!0;if("[object Symbol]"!==o.call(e))return!1;try{return function(e){return"symbol"===r(e.valueOf())&&a.test(i.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},5924:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(1203),i=n(5696),a=n(5554),s=a("Object.prototype.toString"),c=n(8921)()&&"symbol"===r(Symbol.toStringTag),l=i(),u=a("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1}return!!f&&function(e){var t=!1;return o(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(e){}})),t}(e)}},6494:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="function"==typeof WeakMap&&WeakMap.prototype?WeakMap:null,o="function"==typeof WeakSet&&WeakSet.prototype?WeakSet:null;r||(n=function(e){return!1});var i=r?r.prototype.has:null,a=o?o.prototype.has:null;n||i||(n=function(e){return!1}),e.exports=n||function(e){if(!e||"object"!==t(e))return!1;try{if(i.call(e,i),a)try{a.call(e,a)}catch(e){return!0}return e instanceof r}catch(e){}return!1}},5478:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(8754),i=n(5554),a=o("%WeakSet%",!0),s=i("WeakSet.prototype.has",!0);if(s){var c=i("WeakMap.prototype.has",!0);e.exports=function(e){if(!e||"object"!==r(e))return!1;try{if(s(e,s),c)try{c(e,c)}catch(e){return!0}return e instanceof a}catch(e){}return!1}}else e.exports=function(e){return!1}},9318:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},8804:function(e,t,n){var r,o;function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}!function(a,s){"use strict";r=function(){var e=function(){},t="undefined",n=("undefined"==typeof window?"undefined":i(window))!==t&&i(window.navigator)!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(t,n){for(var o=0;o=0&&n<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==o&&function(e){var n=(r[e]||"silent").toUpperCase();if(("undefined"==typeof window?"undefined":i(window))!==t&&u){try{return void(window.localStorage[u]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(u)+"="+n+";"}catch(e){}}}(n),s.call(c,n,e),("undefined"==typeof console?"undefined":i(console))===t&&n{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=o&&i&&"function"==typeof i.get?i.get:null,s=o&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=c&&l&&"function"==typeof l.get?l.get:null,d=c&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,y=Object.prototype.toString,v=Function.prototype.toString,b=String.prototype.match,g="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,w="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"===r(Symbol.iterator),O=Object.prototype.propertyIsEnumerable,P=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),E=n(5863).custom,C=E&&I(E)?E:null,T="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function x(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function R(e){return String(e).replace(/"/g,""")}function j(e){return!("[object Array]"!==M(e)||T&&"object"===r(e)&&T in e)}function I(e){if(k)return e&&"object"===r(e)&&e instanceof Symbol;if("symbol"===r(e))return!0;if(!e||"object"!==r(e)||!w)return!1;try{return w.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,i){var c=n||{};if(A(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(A(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!A(c,"customInspect")||c.customInspect;if("boolean"!=typeof l&&"symbol"!==l)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(A(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return D(t,c);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var y=void 0===c.depth?5:c.depth;if(void 0===o&&(o=0),o>=y&&y>0&&"object"===r(t))return j(t)?"[Array]":"[Object]";var S,O=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Array(e.indent+1).join(" ")}return{base:n,prev:Array(t+1).join(n)}}(c,o);if(void 0===i)i=[];else if(N(i,t)>=0)return"[Circular]";function E(t,n,r){if(n&&(i=i.slice()).push(n),r){var a={depth:c.depth};return A(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),e(t,a,o+1,i)}return e(t,c,o+1,i)}if("function"==typeof t){var _=function(e){if(e.name)return e.name;var t=b.call(v.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),L=W(t,E);return"[Function"+(_?": "+_:" (anonymous)")+"]"+(L.length>0?" { "+L.join(", ")+" }":"")}if(I(t)){var Z=k?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):w.call(t);return"object"!==r(t)||k?Z:U(Z)}if((S=t)&&"object"===r(S)&&("undefined"!=typeof HTMLElement&&S instanceof HTMLElement||"string"==typeof S.nodeName&&"function"==typeof S.getAttribute)){for(var H="<"+String(t.nodeName).toLowerCase(),q=t.attributes||[],$=0;$"}if(j(t)){if(0===t.length)return"[]";var V=W(t,E);return O&&!function(e){for(var t=0;t=0)return!1;return!0}(V)?"["+z(V,O)+"]":"[ "+V.join(", ")+" ]"}if(function(e){return!("[object Error]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)){var G=W(t,E);return 0===G.length?"["+String(t)+"]":"{ ["+String(t)+"] "+G.join(", ")+" }"}if("object"===r(t)&&l){if(C&&"function"==typeof t[C])return t[C]();if("symbol"!==l&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==r(e))return!1;try{a.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var J=[];return s.call(t,(function(e,n){J.push(E(n,t,!0)+" => "+E(e,t))})),F("Map",a.call(t),J,O)}if(function(e){if(!u||!e||"object"!==r(e))return!1;try{u.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var K=[];return d.call(t,(function(e){K.push(E(e,t))})),F("Set",u.call(t),K,O)}if(function(e){if(!p||!e||"object"!==r(e))return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return B("WeakMap");if(function(e){if(!f||!e||"object"!==r(e))return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return B("WeakSet");if(function(e){if(!h||!e||"object"!==r(e))return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return B("WeakRef");if(function(e){return!("[object Number]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(E(Number(t)));if(function(e){if(!e||"object"!==r(e)||!g)return!1;try{return g.call(e),!0}catch(e){}return!1}(t))return U(E(g.call(t)));if(function(e){return!("[object Boolean]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(m.call(t));if(function(e){return!("[object String]"!==M(e)||T&&"object"===r(e)&&T in e)}(t))return U(E(String(t)));if(!function(e){return!("[object Date]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)&&!function(e){return!("[object RegExp]"!==M(e)||T&&"object"===r(e)&&T in e)}(t)){var Y=W(t,E),Q=P?P(t)===Object.prototype:t instanceof Object||t.constructor===Object,X=t instanceof Object?"":"null prototype",ee=!Q&&T&&Object(t)===t&&T in t?M(t).slice(8,-1):X?"Object":"",te=(Q||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ee||X?"["+[].concat(ee||[],X||[]).join(": ")+"] ":"");return 0===Y.length?te+"{}":O?te+"{"+z(Y,O)+"}":te+"{ "+Y.join(", ")+" }"}return String(t)};var _=Object.prototype.hasOwnProperty||function(e){return e in this};function A(e,t){return _.call(e,t)}function M(e){return y.call(e)}function N(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return D(e.slice(0,t.maxStringLength),t)+r}return x(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,L),"single",t)}function L(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function U(e){return"Object("+e+")"}function B(e){return e+" { ? }"}function F(e,t,n,r){return e+" ("+t+") {"+(r?z(n,r):n.join(", "))+"}"}function z(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+e.join(","+n)+"\n"+t.prev}function W(e,t){var n=j(e),r=[];if(n){r.length=e.length;for(var o=0;o{"use strict";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},6232:(e,t,n)=>{"use strict";var r=n(3510),o=n(3700),i=n(2679),a=n(79),s=n(3025),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},79:(e,t,n)=>{"use strict";var r=n(2679);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},3025:(e,t,n)=>{"use strict";var r=n(79),o=n(3510);e.exports=function(){var e=r();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6016:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=n(2762),c=Object.prototype.propertyIsEnumerable,l=!c.call({toString:null},"toString"),u=c.call((function(){}),"prototype"),d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===r(window[e]))try{p(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();o=function(e){var t=null!==e&&"object"===r(e),n="[object Function]"===a.call(e),o=s(e),c=t&&"[object String]"===a.call(e),f=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var m=u&&n;if(c&&e.length>0&&!i.call(e,0))for(var y=0;y0)for(var v=0;v{"use strict";var r=Array.prototype.slice,o=n(2762),i=Object.keys,a=i?function(e){return i(e)}:n(6016),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(r.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},2762:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n=Object.prototype.toString;e.exports=function(e){var r=n.call(e),o="[object Arguments]"===r;return o||(o="[object Array]"!==r&&null!==e&&"object"===t(e)&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),o}},4609:(e,t,n)=>{"use strict";var r=n(6205),o=n(17)(),i=n(5554),a=Object,s=i("Array.prototype.push"),c=i("Object.prototype.propertyIsEnumerable"),l=o?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var n,i,u,d,p,f,h,m=a(e);for(n=1;n{"use strict";var r=n(3510),o=n(3700),i=n(4609),a=n(1785),s=n(8507),c=o.apply(a()),l=function(e,t){return c(Object,arguments)};r(l,{getPolyfill:a,implementation:i,shim:s}),e.exports=l},1785:(e,t,n)=>{"use strict";var r=n(4609);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{"use strict";var r=n(3510),o=n(1785);e.exports=function(){var e=o();return r(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}},7108:function(e,t,n){var r,o,i,a;function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}e=n.nmd(e),a=function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(31);var r=function(e){return e&&e.__esModule?e:{default:e}}(n(13));t.default=r.default},function(t,n){t.exports=e},function(e,t,n){e.exports=n(19)()},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t},e.exports=t.default},function(e,t,n){(function(t){(function(){var n,r,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-o)/1e6},r=t.hrtime,n=function(){var e;return 1e9*(e=r())[0]+e[1]},o=n()):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(10))},function(e,t,n){(function(t){for(var r=n(23),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],c=o["cancel"+a]||o["cancelRequest"+a],l=0;!s&&l child into a function."))},t.warnAboutElementChild=function(){!a&&i&&(a=!0,console.error("With React 0.13, you need to wrap child into a function."))},t.positiveOrZero=function(e){return e<0?0:e},t.modifyObjValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n},t.isReact13=r;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=r(o.default),a=!1},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(){h&&p&&(h=!1,p.length?f=p.concat(f):m=-1,f.length&&a())}function a(){if(!h){var e=o(i);h=!0;for(var t=f.length;t;){for(p=f,f=[];++m1)for(var n=1;nt.realHeight-t.containerHeight&&(e=t.realHeight-t.containerHeight),e<0&&(e=0),e}},{key:"normalizeLeftPosition",value:function(e,t){return e>t.realWidth-t.containerWidth?e=t.realWidth-t.containerWidth:e<0&&(e=0),e}},{key:"computeSizes",value:function(){return{realHeight:this.content.offsetHeight,containerHeight:this.wrapper.offsetHeight,realWidth:this.content.offsetWidth,containerWidth:this.wrapper.offsetWidth}}},{key:"setSizesToState",value:function(){var e=this.computeSizes();e.realHeight===this.state.realHeight&&e.realWidth===this.state.realWidth||this.setStateFromEvent(this.getModifiedPositionsIfNeeded(e))}},{key:"scrollTop",value:function(){this.scrollYTo(0)}},{key:"scrollBottom",value:function(){this.scrollYTo(this.state.realHeight-this.state.containerHeight)}},{key:"scrollLeft",value:function(){this.scrollXTo(0)}},{key:"scrollRight",value:function(){this.scrollXTo(this.state.realWidth-this.state.containerWidth)}},{key:"scrollYTo",value:function(e){if(this.canScrollY()){var t=this.normalizeTopPosition(e,this.computeSizes());this.setStateFromEvent({topPosition:t},m)}}},{key:"scrollXTo",value:function(e){if(this.canScrollX()){var t=this.normalizeLeftPosition(e,this.computeSizes());this.setStateFromEvent({leftPosition:t},m)}}},{key:"canScrollY",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return e.realHeight>e.containerHeight&&this.props.vertical}},{key:"canScrollX",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return e.realWidth>e.containerWidth&&this.props.horizontal}},{key:"canScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return this.canScrollY(e)||this.canScrollX(e)}},{key:"getModifiedPositionsIfNeeded",value:function(e){var t=e.realHeight-e.containerHeight;this.state.topPosition>=t&&(e.topPosition=this.canScrollY(e)?(0,p.positiveOrZero)(t):0);var n=e.realWidth-e.containerWidth;return this.state.leftPosition>=n&&(e.leftPosition=this.canScrollX(e)?(0,p.positiveOrZero)(n):0),e}},{key:"focusContent",value:function(){this.content&&(0,p.findDOMNode)(this.content).focus()}}]),t}(c.default.Component);t.default=b,b.childContextTypes={scrollArea:l.default.object},b.propTypes={className:l.default.string,style:l.default.object,speed:l.default.number,contentClassName:l.default.string,contentStyle:l.default.object,vertical:l.default.bool,verticalContainerStyle:l.default.object,verticalScrollbarStyle:l.default.object,horizontal:l.default.bool,horizontalContainerStyle:l.default.object,horizontalScrollbarStyle:l.default.object,onScroll:l.default.func,contentWindow:l.default.any,ownerDocument:l.default.any,smoothScrolling:l.default.bool,minScrollSize:l.default.number,swapWheelAxes:l.default.bool,stopScrollPropagation:l.default.bool,focusableTabIndex:l.default.number},b.defaultProps={speed:1,vertical:!0,horizontal:!0,smoothScrolling:!1,swapWheelAxes:!1,contentWindow:"object"===("undefined"==typeof window?"undefined":o(window))?window:void 0,ownerDocument:"object"===("undefined"==typeof document?"undefined":o(document))?document:void 0,focusableTabIndex:1}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t10*m&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();var i=(r.accumulatedTime-Math.floor(r.accumulatedTime/m)*m)/m,a=Math.floor(r.accumulatedTime/m),s={},c={},d={},f={};for(var h in t)if(Object.prototype.hasOwnProperty.call(t,h)){var y=t[h];if("number"==typeof y)d[h]=y,f[h]=0,s[h]=y,c[h]=0;else{for(var v=r.state.lastIdealStyle[h],b=r.state.lastIdealVelocity[h],g=0;g10*y&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var a=(r.accumulatedTime-Math.floor(r.accumulatedTime/y)*y)/y,s=Math.floor(r.accumulatedTime/y),c=[],l=[],p=[],f=[],h=0;h10*g&&(r.accumulatedTime=0),0===r.accumulatedTime)return r.animationID=null,void r.startAnimationIfNecessary();for(var l=(r.accumulatedTime-Math.floor(r.accumulatedTime/g)*g)/g,u=Math.floor(r.accumulatedTime/g),d=a(r.props.willEnter,r.props.willLeave,r.props.didLeave,r.state.mergedPropsStyles,n,r.state.currentStyles,r.state.currentVelocities,r.state.lastIdealStyles,r.state.lastIdealVelocities),f=d[0],m=d[1],y=d[2],v=d[3],b=d[4],S=0;Sr[u])return-1;if(o>i[u]&&cr[u])return 1;if(a>i[u]&&s=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function c(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,r,o;if(t.singleton){var i=b++;n=v||(v=s(t)),r=u.bind(null,n,i,!1),o=u.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=c(t),r=p.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function u(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=S(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var f={},h=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},m=h((function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())})),y=h((function(){return document.head||document.getElementsByTagName("head")[0]})),v=null,b=0,g=[];e.exports=function(e,t){void 0===(t=t||{}).singleton&&(t.singleton=m()),void 0===t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a{"use strict";var r=n(6689),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,i={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:l,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},1827:(e,t,n)=>{"use strict";e.exports=n(2451)},1223:e=>{"use strict";var t=function(e){return e&&2===e.CLOSING},n=function(e,t,n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})},r=function(e){return e.minReconnectionDelay+Math.random()*e.minReconnectionDelay},o=["onopen","onclose","onmessage","onerror"];e.exports=function e(i,a,s){var c,l,u=this;void 0===s&&(s={});var d=0,p=0,f=!0,h=null,m={};if(!(this instanceof e))throw new TypeError("Failed to construct 'ReconnectingWebSocket': Please use the 'new' operator");var y={constructor:"undefined"!=typeof WebSocket&&t(WebSocket)?WebSocket:null,maxReconnectionDelay:1e4,minReconnectionDelay:1500,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,debug:!1};if(Object.keys(y).filter((function(e){return s.hasOwnProperty(e)})).forEach((function(e){return y[e]=s[e]})),!t(y.constructor))throw new TypeError("Invalid WebSocket constructor. Set `options.constructor`");var v=y.debug?function(){for(var e=[],t=0;ty.maxRetries?b("EHOSTDOWN","Too many failed connection attempts"):(d=d?function(e,t){var n=t*e.reconnectionDelayGrowFactor;return n>e.maxReconnectionDelay?e.maxReconnectionDelay:n}(y,d):r(y),v("handleClose - reconnectDelay:",d),f&&setTimeout(S,d))},S=function(){if(f){v("connect");var e=c,t="function"==typeof i?i():i;for(var s in c=new y.constructor(t,a),l=setTimeout((function(){v("timeout"),c.close(),b("ETIMEDOUT","Connection timeout")}),y.connectionTimeout),v("bypass properties"),c)["addEventListener","removeEventListener","close","send"].indexOf(s)<0&&n(c,u,s);c.addEventListener("open",(function(){clearTimeout(l),v("open"),d=r(y),v("reconnectDelay:",d),p=0})),c.addEventListener("close",g),function(e,t,n){Object.keys(n).forEach((function(t){n[t].forEach((function(n){var r=n[0],o=n[1];e.addEventListener(t,r,o)}))})),t&&o.forEach((function(n){e[n]=t[n]}))}(c,e,m),c.onclose=c.onclose||h,h=null}};v("init"),S(),this.close=function(e,t,n){void 0===e&&(e=1e3),void 0===t&&(t="");var r=void 0===n?{}:n,o=r.keepClosed,i=void 0!==o&&o,a=r.fastClose,s=void 0===a||a,l=r.delay,u=void 0===l?0:l;if(v("close - params:",{reason:t,keepClosed:i,fastClose:s,delay:u,retriesCount:p,maxRetries:y.maxRetries}),f=!i&&p<=y.maxRetries,u&&(d=u),c.close(e,t),s){var b={code:e,reason:t,wasClean:!0};g(),c.removeEventListener("close",g),Array.isArray(m.close)&&m.close.forEach((function(e){var t=e[0],n=e[1];t(b),c.removeEventListener("close",t,n)})),c.onclose&&(h=c.onclose,c.onclose(b),c.onclose=null)}},this.send=function(e){c.send(e)},this.addEventListener=function(e,t,n){Array.isArray(m[e])?m[e].some((function(e){return e[0]===t}))||m[e].push([t,n]):m[e]=[[t,n]],c.addEventListener(e,t,n)},this.removeEventListener=function(e,t,n){Array.isArray(m[e])&&(m[e]=m[e].filter((function(e){return e[0]!==t}))),c.removeEventListener(e,t,n)}}},4363:(e,t,n)=>{"use strict";var r=n(9045).functionsHaveConfigurableNames(),o=Object,i=TypeError;e.exports=function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e},r&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})},1881:(e,t,n)=>{"use strict";var r=n(3510),o=n(3700),i=n(4363),a=n(6598),s=n(3262),c=o(a());r(c,{getPolyfill:a,implementation:i,shim:s}),e.exports=c},6598:(e,t,n)=>{"use strict";var r=n(4363),o=n(3510).supportsDescriptors,i=Object.getOwnPropertyDescriptor;e.exports=function(){if(o&&"gim"===/a/gim.flags){var e=i(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(n,"sticky",{get:function(){t+="y"}}),"dy"===t)return e.get}}return r}},3262:(e,t,n)=>{"use strict";var r=n(3510).supportsDescriptors,o=n(6598),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,c=Object.getPrototypeOf,l=/a/;e.exports=function(){if(!r||!c)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=o(),t=c(l),n=i(t,"flags");return n&&n.get===e||a(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},9238:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(8754),i=n(5554),a=n(3055),s=o("%TypeError%"),c=o("%WeakMap%",!0),l=o("%Map%",!0),u=i("WeakMap.prototype.get",!0),d=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),f=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),m=i("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,o={assert:function(e){if(!o.has(e))throw new s("Side channel does not contain "+a(e))},get:function(o){if(c&&o&&("object"===r(o)||"function"==typeof o)){if(e)return u(e,o)}else if(l){if(t)return f(t,o)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,o)},has:function(o){if(c&&o&&("object"===r(o)||"function"==typeof o)){if(e)return p(e,o)}else if(l){if(t)return m(t,o)}else if(n)return function(e,t){return!!y(e,t)}(n,o);return!1},set:function(o,i){c&&o&&("object"===r(o)||"function"==typeof o)?(e||(e=new c),d(e,o,i)):l?(t||(t=new l),h(t,o,i)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,o,i))}};return o}},2228:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(373),i=n(2869),a=n(5217),s=n(5490),c=n(999);e.exports=function(e){return null==e||"object"!==r(e)&&"function"!=typeof e?null:o(e)?"String":i(e)?"Number":a(e)?"Boolean":s(e)?"Symbol":c(e)?"BigInt":void 0}},5056:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(1203),i=n(5696),a=n(5554),s=a("Object.prototype.toString"),c=n(8921)()&&"symbol"===r(Symbol.toStringTag),l=i(),u=a("String.prototype.slice"),d={},p=n(8114),f=Object.getPrototypeOf;c&&p&&f&&o(l,(function(e){if("function"==typeof n.g[e]){var t=new n.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var r=f(t),o=p(r,Symbol.toStringTag);if(!o){var i=f(r);o=p(i,Symbol.toStringTag)}d[e]=o.get}}));var h=n(5924);e.exports=function(e){return!!h(e)&&(c?function(e){var t=!1;return o(d,(function(n,r){if(!t)try{var o=n.call(e);o===r&&(t=o)}catch(e){}})),t}(e):u(s(e),8,-1))}},9003:e=>{"use strict";e.exports=require("classnames")},9105:e=>{"use strict";e.exports=require("color")},4305:e=>{"use strict";e.exports=require("lodash.debounce")},9455:e=>{"use strict";e.exports=require("material-ui")},3173:e=>{"use strict";e.exports=require("material-ui/styles")},580:e=>{"use strict";e.exports=require("prop-types")},757:e=>{"use strict";e.exports=require("pydio")},6880:e=>{"use strict";e.exports=require("pydio/http/api")},5829:e=>{"use strict";e.exports=require("pydio/http/meta-cache-service")},2610:e=>{"use strict";e.exports=require("pydio/http/resources-manager")},2702:e=>{"use strict";e.exports=require("pydio/http/users-api")},2282:e=>{"use strict";e.exports=require("pydio/model/controller")},4603:e=>{"use strict";e.exports=require("pydio/model/data-model")},7180:e=>{"use strict";e.exports=require("pydio/util/func")},4021:e=>{"use strict";e.exports=require("pydio/util/periodical-executer")},6689:e=>{"use strict";e.exports=require("react")},6405:e=>{"use strict";e.exports=require("react-dom")},192:e=>{"use strict";e.exports=require("react-draggable")},5863:()=>{},7920:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},5696:(e,t,n)=>{"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];e.exports=function(){for(var e=[],t=0;t{"use strict";var r=n(8754)("%Object.getOwnPropertyDescriptor%");if(r)try{r([],"length")}catch(e){r=null}e.exports=r},3634:(e,t,n)=>{"use strict";var r=n(8317);if(n(8921)()||n(17)()){var o=Symbol.iterator;e.exports=function(e){return null!=e&&void 0!==e[o]?e[o]():r(e)?Array.prototype[o].call(e):void 0}}else{var i=n(9318),a=n(373),s=n(8754),c=s("%Map%",!0),l=s("%Set%",!0),u=n(5554),d=u("Array.prototype.push"),p=u("String.prototype.charCodeAt"),f=u("String.prototype.slice"),h=function(e){var t=0;return{next:function(){var n,r=t>=e.length;return r||(n=e[t],t+=1),{done:r,value:n}}}},m=function(e,t){if(i(e)||r(e))return h(e);if(a(e)){var n=0;return{next:function(){var t=function(e,t){if(t+1>=e.length)return t+1;var n=p(e,t);if(n<55296||n>56319)return t+1;var r=p(e,t+1);return r<56320||r>57343?t+1:t+2}(e,n),r=f(e,n,t);return n=t,{done:t>e.length,value:r}}}}return t&&void 0!==e["_es6-shim iterator_"]?e["_es6-shim iterator_"]():void 0};if(c||l){var y=n(7233),v=n(1189),b=u("Map.prototype.forEach",!0),g=u("Set.prototype.forEach",!0);if("undefined"==typeof process||!process.versions||!process.versions.node)var S=u("Map.prototype.iterator",!0),w=u("Set.prototype.iterator",!0),k=function(e){var t=!1;return{next:function(){try{return{done:t,value:t?void 0:e.next()}}catch(e){return t=!0,{done:!0,value:void 0}}}}};var O=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),P=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0);e.exports=function(e){return function(e){if(y(e)){if(S)return k(S(e));if(O)return O(e);if(b){var t=[];return b(e,(function(e,n){d(t,[n,e])})),h(t)}}if(v(e)){if(w)return k(w(e));if(P)return P(e);if(g){var n=[];return g(e,(function(e){d(n,e)})),h(n)}}}(e)||m(e)}}else e.exports=function(e){if(null!=e)return m(e,!0)}}},2567:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=n(7233),i=n(1189),a=n(6494),s=n(5478);e.exports=function(e){if(e&&"object"===r(e)){if(o(e))return"Map";if(i(e))return"Set";if(a(e))return"WeakMap";if(s(e))return"WeakSet"}return!1}},212:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},305:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,{Z:()=>r})},633:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;tr})},9807:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,{Z:()=>r})},2471:(e,t,n)=>{"use strict";n.d(t,{Ab:()=>a,Fr:()=>s,G$:()=>i,K$:()=>l,MS:()=>r,h5:()=>c,lK:()=>u,uj:()=>o});var r="-ms-",o="-moz-",i="-webkit-",a="comm",s="rule",c="decl",l="@import",u="@keyframes"},6194:(e,t,n)=>{"use strict";n.d(t,{cD:()=>i,qR:()=>o});var r=n(5586);function o(e){var t=(0,r.Ei)(e);return function(n,r,o,i){for(var a="",s=0;s{"use strict";n.d(t,{MY:()=>a});var r=n(2471),o=n(5586),i=n(7e3);function a(e){return(0,i.cE)(s("",null,null,null,[""],e=(0,i.un)(e),0,[0],e))}function s(e,t,n,r,a,d,p,f,h){for(var m=0,y=0,v=p,b=0,g=0,S=0,w=1,k=1,O=1,P=0,E="",C=a,T=d,x=r,R=E;k;)switch(S=P,P=(0,i.lp)()){case 40:if(108!=S&&58==(0,o.uO)(R,v-1)){-1!=(0,o.Cw)(R+=(0,o.gx)((0,i.iF)(P),"&","&\f"),"&\f")&&(O=-1);break}case 34:case 39:case 91:R+=(0,i.iF)(P);break;case 9:case 10:case 13:case 32:R+=(0,i.Qb)(S);break;case 92:R+=(0,i.kq)((0,i.Ud)()-1,7);continue;case 47:switch((0,i.fj)()){case 42:case 47:(0,o.R3)(l((0,i.q6)((0,i.lp)(),(0,i.Ud)()),t,n),h);break;default:R+="/"}break;case 123*w:f[m++]=(0,o.to)(R)*O;case 125*w:case 59:case 0:switch(P){case 0:case 125:k=0;case 59+y:g>0&&(0,o.to)(R)-v&&(0,o.R3)(g>32?u(R+";",r,n,v-1):u((0,o.gx)(R," ","")+";",r,n,v-2),h);break;case 59:R+=";";default:if((0,o.R3)(x=c(R,t,n,m,y,a,f,E,C=[],T=[],v),d),123===P)if(0===y)s(R,t,x,x,C,d,v,f,T);else switch(99===b&&110===(0,o.uO)(R,3)?100:b){case 100:case 109:case 115:s(e,x,x,r&&(0,o.R3)(c(e,x,x,0,0,a,f,E,a,C=[],v),T),a,T,v,f,r?C:T);break;default:s(R,x,x,x,[""],T,0,f,T)}}m=y=g=0,w=O=1,E=R="",v=p;break;case 58:v=1+(0,o.to)(R),g=S;default:if(w<1)if(123==P)--w;else if(125==P&&0==w++&&125==(0,i.mp)())continue;switch(R+=(0,o.Dp)(P),P*w){case 38:O=y>0?1:(R+="\f",-1);break;case 44:f[m++]=((0,o.to)(R)-1)*O,O=1;break;case 64:45===(0,i.fj)()&&(R+=(0,i.iF)((0,i.lp)())),b=(0,i.fj)(),y=v=(0,o.to)(E=R+=(0,i.QU)((0,i.Ud)())),P++;break;case 45:45===S&&2==(0,o.to)(R)&&(w=0)}}return d}function c(e,t,n,a,s,c,l,u,d,p,f){for(var h=s-1,m=0===s?c:[""],y=(0,o.Ei)(m),v=0,b=0,g=0;v0?m[S]+" "+w:(0,o.gx)(w,/&\f/g,m[S])))&&(d[g++]=k);return(0,i.dH)(e,t,n,0===s?r.Fr:u,d,p,f)}function l(e,t,n){return(0,i.dH)(e,t,n,r.Ab,(0,o.Dp)((0,i.Tb)()),(0,o.tb)(e,2,-2),0)}function u(e,t,n,a){return(0,i.dH)(e,t,n,r.h5,(0,o.tb)(e,0,a),(0,o.tb)(e,a+1,-1),a)}},2137:(e,t,n)=>{"use strict";n.d(t,{P:()=>a,q:()=>i});var r=n(2471),o=n(5586);function i(e,t){for(var n="",r=(0,o.Ei)(e),i=0;i{"use strict";n.d(t,{FK:()=>s,JG:()=>d,QU:()=>C,Qb:()=>k,Tb:()=>p,Ud:()=>y,cE:()=>S,dH:()=>u,fj:()=>m,iF:()=>w,kq:()=>O,lp:()=>h,mp:()=>f,q6:()=>E,r:()=>b,tP:()=>v,un:()=>g});var r=n(5586),o=1,i=1,a=0,s=0,c=0,l="";function u(e,t,n,r,a,s,c){return{value:e,root:t,parent:n,type:r,props:a,children:s,line:o,column:i,length:c,return:""}}function d(e,t){return(0,r.f0)(u("",null,null,"",null,null,0),e,{length:-e.length},t)}function p(){return c}function f(){return c=s>0?(0,r.uO)(l,--s):0,i--,10===c&&(i=1,o--),c}function h(){return c=s2||b(c)>3?"":" "}function O(e,t){for(;--t&&h()&&!(c<48||c>102||c>57&&c<65||c>70&&c<97););return v(e,y()+(t<6&&32==m()&&32==h()))}function P(e){for(;h();)switch(c){case e:return s;case 34:case 39:34!==e&&39!==e&&P(c);break;case 40:41===e&&P(e);break;case 92:h()}return s}function E(e,t){for(;h()&&e+c!==57&&(e+c!==84||47!==m()););return"/*"+v(t,s-1)+"*"+(0,r.Dp)(47===e?e:h())}function C(e){for(;!b(m());)h();return v(e,s)}},5586:(e,t,n)=>{"use strict";n.d(t,{$e:()=>y,Cw:()=>u,Dp:()=>o,EQ:()=>c,Ei:()=>h,R3:()=>m,Wn:()=>r,f0:()=>i,fy:()=>s,gx:()=>l,tb:()=>p,to:()=>f,uO:()=>d,vp:()=>a});var r=Math.abs,o=String.fromCharCode,i=Object.assign;function a(e,t){return 45^d(e,0)?(((t<<2^d(e,0))<<2^d(e,1))<<2^d(e,2))<<2^d(e,3):0}function s(e){return e.trim()}function c(e,t){return(e=t.exec(e))?e[0]:e}function l(e,t,n){return e.replace(t,n)}function u(e,t){return e.indexOf(t)}function d(e,t){return 0|e.charCodeAt(t)}function p(e,t,n){return e.slice(t,n)}function f(e){return e.length}function h(e){return e.length}function m(e,t){return t.push(e),e}function y(e,t){return e.map(t).join("")}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>"rgl.min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="gui.ajax:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="plug/gui.ajax/res/dist/libs/",(()=>{var e={543:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=a.p+a.u(t),s=new Error;a.l(i,(n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,s,c]=n,l=0;if(i.some((t=>0!==e[t]))){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);c&&c(a)}for(t&&t(n);l{"use strict";a.r(s),a.d(s,{default:()=>y_});var e=a(6689),t=a.n(e),n=a(6405),r=a.n(n),o=a(4603),i=a.n(o);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ee);return t().createElement("div",n)};pe=ue(pe),de.propTypes={showSelector:z().bool,selected:z().bool,selectorDisabled:z().bool,onSelect:z().func,onClick:z().func,iconCell:z().element,mainIcon:z().string,firstLine:z().node,secondLine:z().node,thirdLine:z().node,actions:z().element,activeDroppable:z().bool,className:z().string,style:z().object,noHover:z().bool},de=(0,K.muiThemeable)()(de);var fe=(0,S.flow)((0,S.DragSource)(p.NODE_PROVIDER,v,f),(0,S.DropTarget)(p.NODE_PROVIDER,b,h))(de);const he=require("pydio/util/path");var me=a.n(he),ye=a(212),ve=a(305),be=a(633),ge=a(9807),Se=a(127),we=a(7116),ke=a(1788);function Oe(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Pe(e){return e instanceof Oe(e).Element||e instanceof Element}function Ee(e){return e instanceof Oe(e).HTMLElement||e instanceof HTMLElement}function Ce(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Oe(e).ShadowRoot||e instanceof ShadowRoot)}var Te=Math.max,xe=Math.min,Re=Math.round;function je(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Ie(){return!/^((?!chrome|android).)*safari/i.test(je())}function _e(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Ee(e)&&(o=e.offsetWidth>0&&Re(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Re(r.height)/e.offsetHeight||1);var a=(Pe(e)?Oe(e):window).visualViewport,s=!Ie()&&n,c=(r.left+(s&&a?a.offsetLeft:0))/o,l=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function Ae(e){var t=Oe(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Me(e){return e?(e.nodeName||"").toLowerCase():null}function Ne(e){return((Pe(e)?e.ownerDocument:e.document)||window.document).documentElement}function De(e){return _e(Ne(e)).left+Ae(e).scrollLeft}function Le(e){return Oe(e).getComputedStyle(e)}function Ue(e){var t=Le(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Be(e,t,n){void 0===n&&(n=!1);var r,o,i=Ee(t),a=Ee(t)&&function(e){var t=e.getBoundingClientRect(),n=Re(t.width)/e.offsetWidth||1,r=Re(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=Ne(t),c=_e(e,a,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==Me(t)||Ue(s))&&(l=(r=t)!==Oe(r)&&Ee(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:Ae(r)),Ee(t)?((u=_e(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=De(s))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function Fe(e){var t=_e(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ze(e){return"html"===Me(e)?e:e.assignedSlot||e.parentNode||(Ce(e)?e.host:null)||Ne(e)}function We(e){return["html","body","#document"].indexOf(Me(e))>=0?e.ownerDocument.body:Ee(e)&&Ue(e)?e:We(ze(e))}function Ze(e,t){var n;void 0===t&&(t=[]);var r=We(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Oe(r),a=o?[i].concat(i.visualViewport||[],Ue(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Ze(ze(a)))}function He(e){return["table","td","th"].indexOf(Me(e))>=0}function qe(e){return Ee(e)&&"fixed"!==Le(e).position?e.offsetParent:null}function $e(e){for(var t=Oe(e),n=qe(e);n&&He(n)&&"static"===Le(n).position;)n=qe(n);return n&&("html"===Me(n)||"body"===Me(n)&&"static"===Le(n).position)?t:n||function(e){var t=/firefox/i.test(je());if(/Trident/i.test(je())&&Ee(e)&&"fixed"===Le(e).position)return null;var n=ze(e);for(Ce(n)&&(n=n.host);Ee(n)&&["html","body"].indexOf(Me(n))<0;){var r=Le(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Ve="top",Ge="bottom",Je="right",Ke="left",Ye="auto",Qe=[Ve,Ge,Je,Ke],Xe="start",et="end",tt="viewport",nt="popper",rt=Qe.reduce((function(e,t){return e.concat([t+"-"+Xe,t+"-"+et])}),[]),ot=[].concat(Qe,[Ye]).reduce((function(e,t){return e.concat([t,t+"-"+Xe,t+"-"+et])}),[]),it=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function at(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var st={placement:"bottom",modifiers:[],strategy:"absolute"};function ct(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ht(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?dt(o):null,a=o?pt(o):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case Ve:t={x:s,y:n.y-r.height};break;case Ge:t={x:s,y:n.y+n.height};break;case Je:t={x:n.x+n.width,y:c};break;case Ke:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=i?ft(i):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case Xe:t[l]=t[l]-(n[u]/2-r[u]/2);break;case et:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var mt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,f=void 0===p?0:p,h=a.y,m=void 0===h?0:h,y="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var v=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),g=Ke,S=Ve,w=window;if(l){var k=$e(n),O="clientHeight",P="clientWidth";k===Oe(n)&&"static"!==Le(k=Ne(n)).position&&"absolute"===s&&(O="scrollHeight",P="scrollWidth"),(o===Ve||(o===Ke||o===Je)&&i===et)&&(S=Ge,m-=(d&&k===w&&w.visualViewport?w.visualViewport.height:k[O])-r.height,m*=c?1:-1),o!==Ke&&(o!==Ve&&o!==Ge||i!==et)||(g=Je,f-=(d&&k===w&&w.visualViewport?w.visualViewport.width:k[P])-r.width,f*=c?1:-1)}var E,C=Object.assign({position:s},l&&mt),T=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Re(t*r)/r||0,y:Re(n*r)/r||0}}({x:f,y:m}):{x:f,y:m};return f=T.x,m=T.y,c?Object.assign({},C,((E={})[S]=b?"0":"",E[g]=v?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[S]=b?m+"px":"",t[g]=v?f+"px":"",t.transform="",t))}const vt={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];Ee(o)&&Me(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ee(r)&&Me(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},bt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=ot.reduce((function(e,n){return e[n]=function(e,t,n){var r=dt(e),o=[Ke,Ve].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Ke,Je].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}};var gt={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e){return e.replace(/left|right|bottom|top/g,(function(e){return gt[e]}))}var wt={start:"end",end:"start"};function kt(e){return e.replace(/start|end/g,(function(e){return wt[e]}))}function Ot(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ce(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Pt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Et(e,t,n){return t===tt?Pt(function(e,t){var n=Oe(e),r=Ne(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;var l=Ie();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s+De(e),y:c}}(e,n)):Pe(t)?function(e,t){var n=_e(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Pt(function(e){var t,n=Ne(e),r=Ae(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Te(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Te(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+De(e),c=-r.scrollTop;return"rtl"===Le(o||n).direction&&(s+=Te(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}(Ne(e)))}function Ct(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Tt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function xt(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,c=void 0===s?"clippingParents":s,l=n.rootBoundary,u=void 0===l?tt:l,d=n.elementContext,p=void 0===d?nt:d,f=n.altBoundary,h=void 0!==f&&f,m=n.padding,y=void 0===m?0:m,v=Ct("number"!=typeof y?y:Tt(y,Qe)),b=p===nt?"reference":nt,g=e.rects.popper,S=e.elements[h?b:p],w=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=Ze(ze(e)),n=["absolute","fixed"].indexOf(Le(e).position)>=0&&Ee(e)?$e(e):e;return Pe(n)?t.filter((function(e){return Pe(e)&&Ot(e,n)&&"body"!==Me(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=Et(e,n,r);return t.top=Te(o.top,t.top),t.right=xe(o.right,t.right),t.bottom=xe(o.bottom,t.bottom),t.left=Te(o.left,t.left),t}),Et(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(Pe(S)?S:S.contextElement||Ne(e.elements.popper),c,u,a),k=_e(e.elements.reference),O=ht({reference:k,element:g,strategy:"absolute",placement:o}),P=Pt(Object.assign({},g,O)),E=p===nt?P:k,C={top:w.top-E.top+v.top,bottom:E.bottom-w.bottom+v.bottom,left:w.left-E.left+v.left,right:E.right-w.right+v.right},T=e.modifiersData.offset;if(p===nt&&T){var x=T[o];Object.keys(C).forEach((function(e){var t=[Je,Ge].indexOf(e)>=0?1:-1,n=[Ve,Ge].indexOf(e)>=0?"y":"x";C[e]+=x[n]*t}))}return C}const Rt={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,y=t.options.placement,v=dt(y),b=c||(v!==y&&h?function(e){if(dt(e)===Ye)return[];var t=St(e);return[kt(e),t,kt(t)]}(y):[St(y)]),g=[y].concat(b).reduce((function(e,n){return e.concat(dt(n)===Ye?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?ot:c,u=pt(r),d=u?s?rt:rt.filter((function(e){return pt(e)===u})):Qe,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=xt(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[dt(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),S=t.rects.reference,w=t.rects.popper,k=new Map,O=!0,P=g[0],E=0;E=0,j=R?"width":"height",I=xt(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),_=R?x?Je:Ke:x?Ge:Ve;S[j]>w[j]&&(_=St(_));var A=St(_),M=[];if(i&&M.push(I[T]<=0),s&&M.push(I[_]<=0,I[A]<=0),M.every((function(e){return e}))){P=C,O=!1;break}k.set(C,M)}if(O)for(var N=function(e){var t=g.find((function(t){var n=k.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return P=t,"break"},D=h?3:1;D>0&&"break"!==N(D);D--);t.placement!==P&&(t.modifiersData[r]._skip=!0,t.placement=P,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jt(e,t,n){return Te(e,xe(t,n))}const It={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,y=xt(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),v=dt(t.placement),b=pt(t.placement),g=!b,S=ft(v),w="x"===S?"y":"x",k=t.modifiersData.popperOffsets,O=t.rects.reference,P=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,x={x:0,y:0};if(k){if(i){var R,j="y"===S?Ve:Ke,I="y"===S?Ge:Je,_="y"===S?"height":"width",A=k[S],M=A+y[j],N=A-y[I],D=f?-P[_]/2:0,L=b===Xe?O[_]:P[_],U=b===Xe?-P[_]:-O[_],B=t.elements.arrow,F=f&&B?Fe(B):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=z[j],Z=z[I],H=jt(0,O[_],F[_]),q=g?O[_]/2-D-H-W-C.mainAxis:L-H-W-C.mainAxis,$=g?-O[_]/2+D+H+Z+C.mainAxis:U+H+Z+C.mainAxis,V=t.elements.arrow&&$e(t.elements.arrow),G=V?"y"===S?V.clientTop||0:V.clientLeft||0:0,J=null!=(R=null==T?void 0:T[S])?R:0,K=A+$-J,Y=jt(f?xe(M,A+q-J-G):M,A,f?Te(N,K):N);k[S]=Y,x[S]=Y-A}if(s){var Q,X="x"===S?Ve:Ke,ee="x"===S?Ge:Je,te=k[w],ne="y"===w?"height":"width",re=te+y[X],oe=te-y[ee],ie=-1!==[Ve,Ke].indexOf(v),ae=null!=(Q=null==T?void 0:T[w])?Q:0,se=ie?re:te-O[ne]-P[ne]-ae+C.altAxis,ce=ie?te+O[ne]+P[ne]-ae-C.altAxis:oe,le=f&&ie?function(e,t,n){var r=jt(e,t,n);return r>n?n:r}(se,te,ce):jt(f?se:re,te,f?ce:oe);k[w]=le,x[w]=le-te}t.modifiersData[r]=x}},requiresIfExists:["offset"]};function _t(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function At(e){return[Ve,Je,Ge,Ke].some((function(t){return e[t]>=0}))}var Mt=lt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,c=Oe(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,ut)})),s&&c.addEventListener("resize",n.update,ut),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,ut)})),s&&c.removeEventListener("resize",n.update,ut)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ht({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,c=void 0===s||s,l={placement:dt(t.placement),variation:pt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,yt(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,yt(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},vt,bt,Rt,It,{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=dt(n.placement),c=ft(s),l=[Ke,Je].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return Ct("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Tt(e,Qe))}(o.padding,n),d=Fe(i),p="y"===c?Ve:Ke,f="y"===c?Ge:Je,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],y=$e(i),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=h/2-m/2,g=u[p],S=v-d[l]-u[f],w=v/2-d[l]/2+b,k=jt(g,w,S),O=c;n.modifiersData[r]=((t={})[O]=k,t.centerOffset=k-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Ot(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=xt(t,{elementContext:"reference"}),s=xt(t,{altBoundary:!0}),c=_t(a,r),l=_t(s,o,i),u=At(c),d=At(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),Nt=a(7283),Dt=a(7630),Lt=a(1827);function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(c.className=a),Object.keys(s).length>0&&(c.style=s),{props:c,internalRef:void 0}}var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};var n={};return Object.keys(e).filter((function(n){return n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)})).forEach((function(t){n[t]=e[t]})),n}((0,be.Z)({},o,r)),u=Ht(r),d=Ht(o),p=t(l),f=(0,Zt.Z)(null==p?void 0:p.className,null==n?void 0:n.className,i,null==o?void 0:o.className,null==r?void 0:r.className),h=(0,be.Z)({},null==p?void 0:p.style,null==n?void 0:n.style,null==o?void 0:o.style,null==r?void 0:r.style),m=(0,be.Z)({},p,n,d,u);return f.length>0&&(m.className=f),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:p.ref}}((0,be.Z)({},i,{externalSlotProps:a})),c=s.props,l=s.internalRef,u=(0,Se.Z)(l,null==a?void 0:a.ref,null==(t=e.additionalProps)?void 0:t.ref),d=function(e,t,n){return void 0===e||"string"==typeof e?t:(0,be.Z)({},t,{ownerState:(0,be.Z)({},t.ownerState,n)})}(n,(0,be.Z)({},c,{ref:u}),o);return d}function Vt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(e,t):void 0}}(e,t)||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.")}()}function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.setState({value:e,errorString:null,warningString:null});var n=Z().getMessages(),r=bn.ApplyChecks(this.errorChecks,this.warningChecks,e),o=r.error,i=r.warning;o?this.setState({errorString:n[o]},t):i?this.setState({warningString:n[i]},t):t&&t()}},{key:"submit",value:function(){var e=this.state,t=e.value;e.errorString||(this.props.callback(t),this.props.onClose())}},{key:"catchClicks",value:function(e){e.stopPropagation()}},{key:"onKeyDown",value:function(e){e.stopPropagation(),"Enter"===e.key?this.submit():"Escape"===e.key&&this.props.onClose()}},{key:"render",value:function(){var e=this,n=Z().getMessages(),r=this.props,o=r.node,i=r.onClose,a=r.anchor,s=r.muiTheme,c=r.editorStyle,l=void 0===c?{}:c,u=this.state,d=u.value,p=u.errorString,f=u.warningString;return t().createElement(sn,{id:"rename-popper:"+o.getPath(),open:!0,anchorEl:a,placement:"bottom-start"},t().createElement(Sn,{style:un({width:320,padding:8,fontWeight:"initial",background:s.palette.mui3?s.palette.mui3["surface-2"]:"white"},l),zDepth:2},t().createElement(kn,{value:d,onChange:function(t,n){return e.setValue(n)},onClick:function(t){return e.catchClicks(t)},onDoubleClick:function(t){return e.catchClicks(t)},tabIndex:"0",onKeyDown:function(t){return e.onKeyDown(t)},selectBaseOnMount:!0,hintText:n[6],variant:"v2",fullWidth:!0}),p&&t().createElement("div",{style:{color:"var(--md-sys-color-error)",fontSize:13,padding:"0 6px"}},p),f&&t().createElement("div",{style:{fontSize:13,padding:"0 6px",opacity:.73}},f),t().createElement("div",{style:{textAlign:"right",paddingTop:8}},t().createElement(wn,{style:{height:32,lineHeight:"32px"},label:n[54],onClick:i}),t().createElement(wn,{style:{height:32,lineHeight:"32px"},label:n[48],onClick:function(){e.setValue(d,(function(){return e.submit()}))}}))))}}],r&&pn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function Pn(e){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pn(e)}function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:void 0,o=function(o){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tn(e,t)}(u,o);var i,a,s,c,l=(s=u,c=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}}(),function(){var e,t=Rn(s);if(c){var n=Rn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xn(e)}(this,e)});function u(){var e,t,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var o=arguments.length,i=new Array(o),a=0;a-1&&(f=p.fromNow()),n=f}else n="bytesize"===e?parseInt(u.get(e))?me().roundFileSize(parseInt(u.get(e))):"-":u.get(e);o=u.get(e);var h=null;l&&(h=a),c.push(t().createElement("span",{key:e,className:"cell cell-"+e,title:o,style:d,"data-label":s.label,ref:h},n)),l=!1})),t().createElement(fe,_n({},n,{iconCell:null,firstLine:c,actions:s}))}));function Nn(e){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(e)}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Nn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Nn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Un={pydioActionsToItems:function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],r=!1,o=Z().getMessages();return t.map(function(t){if(t.separator){if(r)return;return n.push(t),void(r=!0)}var i;r=!1,i=t.label_id&&o[t.label_id]?o[t.label_id]:t.raw_name?t.raw_name:t.name;var a=t.icon_class;if(t.subMenu){var s=t.subMenuBeforeShow?e(t.subMenuBeforeShow()):t.subMenu;n.push({text:i,iconClassName:a,subItems:s})}else n.push({text:i,iconClassName:a,payload:t.callback})}.bind(this)),r&&(n=n.slice(0,n.length-1)),n.length&&n[0]&&n[0].separator&&n.shift(),n},itemsToMenu:function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};o=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,o=function(){r&&r.notify("actions_refreshed")},i=this.props,a=i.tableKeys,s=i.sortingInfo;return Object.keys(a).map((function(r){var i,c,l=a[r],u=l.width?{width:l.width}:null,d="cell header_cell cell-"+r;return l.sortType&&(d+=" sortable",s&&(s.attribute===r||s.remote&&l.remoteSortAttribute&&s.attribute===l.remoteSortAttribute)&&(i="number"===l.sortType?"asc"===s.direction?"mdi mdi-sort-numeric-ascending":"mdi mdi-sort-numeric-descending":"asc"===s.direction?"mdi mdi-sort-alphabetical-ascending":"mdi mdi-sort-alphabetical-descending",d+=" active-sort-"+s.direction,c=!0)),"menu"===e?(l.name=r,{payload:l,text:l.label,iconClassName:i}):"menu_data"===e?{name:t().createElement("span",{style:{display:"flex"}},t().createElement("span",{style:{flex:1,fontWeight:c?500:"inherit"}},l.label),c&&t().createElement("span",{className:"mdi mdi-checkbox-marked-circle-outline"})),callback:function(){n.onHeaderClick(r,o)},icon_class:i||"mdi mdi-sort"}:t().createElement("span",{key:r,className:d,style:u,onClick:function(){n.onHeaderClick(r,o)}},l.label)}))}},{key:"buildSortingMenuItems",value:function(e){return this.getColumnsItems("menu_data",e)}},{key:"componentDidMount",value:function(){var e=new Action({name:"sort_action",icon_class:"mdi mdi-sort-descending",text_id:450,title_id:450,text:this.props.getMessage(450),title:this.props.getMessage(450),hasAccessKey:!1,subMenu:!0,subMenuUpdateImage:!0,weight:50},{selection:!1,dir:!0,actionBar:!0,actionBarGroup:"display_toolbar",contextMenu:!1,infoPanel:!1},{},{},{dynamicBuilder:this.buildSortingMenuItems.bind(this)}),t=new Map;t.set("sort_action",e),this.props.pydio.getController().updateGuiActions(t)}},{key:"componentWillUnmount",value:function(){this.props.pydio.getController().deleteFromGuiActions("sort_action")}},{key:"render",value:function(){var e=this;return"hidden"===this.props.displayMode?null:"menu"===this.props.displayMode?t().createElement(ir,{buttonTitle:"Sort by...",buttonClassName:"mdi mdi-sort-descending",menuItems:this.getColumnsItems("menu",this.props.pydio.getController()),onMenuClicked:function(t){return e.onMenuClicked(t)}}):t().createElement("div",{className:"mui-toolbar-group mui-left"},this.getColumnsItems("header",this.props.pydio.getController()))}}],r&&sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function pr(e){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(e)}function fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t0,S=[],w=Z().getMessages()[331];if(b){for(var k=1;k<=v;k++)S.push(t().createElement(g.MenuItem,{value:k,primaryText:w+" "+k+(k===y?" / "+v:"")}));if(S.length<=1)return null}return o&&(i&&(p={color:i}),a&&(f={fontSize:13},h={fontSize:20})),d=t().createElement(g.IconButton,{onClick:function(){e.onMenuChange(null,0,y-1)},iconClassName:"mdi mdi-chevron-left",disabled:1===y,iconStyle:hr(hr({},p),h),style:a?{marginRight:-10,marginTop:-2,width:40,height:40}:null}),u=t().createElement(g.IconButton,{onClick:function(){e.onMenuChange(null,0,y+1)},iconClassName:"mdi mdi-chevron-right",disabled:v>-1&&y===v,style:a?{marginLeft:-40,marginTop:-2,width:40,height:40}:{marginLeft:-20},iconStyle:hr(hr({},p),h)}),t().createElement("div",{id:l,style:hr({display:"flex",alignItems:"center"},s)},d,b&&t().createElement(g.DropDownMenu,{style:{width:150,marginTop:-6},onChange:this.onMenuChange.bind(this),value:y,underlineStyle:{display:"none"},labelStyle:hr(hr({},p),f),menuStyle:c},S),!b&&t().createElement("div",{style:{width:100,paddingLeft:10}},w+" "+y),u)}}],r&&yr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function wr(e){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(e)}function kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&(e=t().createElement(Sr,{dataModel:this.props.dm,node:this.props.node})),t().createElement("div",{className:"mui-toolbar toolbarTableHeader"},t().createElement(dr,kr({displayMode:"tableHeader"},this.props,{columnClicked:this.props.onHeaderClick})),t().createElement("div",{className:"mui-toolbar-group mui-right"},e,t().createElement(g.FontIcon,{key:1,title:Z().getMessages[149],className:"mdi mdi-refresh"+(this.props.loading?" rotating":""),onClick:this.props.reload,style:{padding:16,display:"block",cursor:"pointer",fontSize:24,color:"#9E9E9E"}}),this.props.additionalActions))}}])&&Or(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component),Tr=a(6880),xr=a.n(Tr);const Rr=require("pydio/model/node");var jr=a.n(Rr);function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.props,a=i.node,s=i.pydio,c=i.defaultSortingInfo,l=i.sortingPreferenceKey,u=s.user,d=a.getMetadata(),p=d.get("paginationData");if(e.remoteSortAttribute&&p&&p.get("total")>1){var f=d.get("remoteOrder")||new Map,h="asc"===f.get("order_direction")?"desc":"asc";if(f.get("order_column")===e.remoteSortAttribute&&("asc"===h&&r||o))d.delete("remoteOrder"),this.setState({sortingInfo:null},(function(){return t.sortingInfoChange({})}));else{var m=new Map;m.set("order_column",e.remoteSortAttribute),m.set("order_direction",h),d.set("remoteOrder",m)}this.props.dataModel.requireContextChange(a,!0)}else{d.has("remoteOrder")&&d.delete("remoteOrder");var y,v=e.sortAttribute?e.sortAttribute:e.name,b=this.state.sortingInfo,g=b.attribute,S=b.direction;g===v&&S?(console.log(S,r,o,e),y=o||"desc"===S&&r?c||{}:{attribute:v,sortType:e.sortType,direction:"asc"===S?"desc":"asc"}):y={attribute:v,sortType:e.sortType,direction:"asc"},this.setState({sortingInfo:y},(function(){if(t.rebuildLoadedElements(),null!==n&&n instanceof Function&&n(),l){var e=u.getActiveRepositoryObject().getSlug(),r=u.getGUIPreference(l)||{};r[e]=y,u.setGUIPreference(l,r,!0)}t.sortingInfoChange(y)}))}},computeSelectionFromCurrentPlusTargetNode:function(e,t){var n,r,o=!1;if(!this.indexedElements)return[];for(var i=e[0],a=e[e.length-1],s=[],c=0;c1&&("ArrowRight"===a?d=n+1:"ArrowLeft"===a&&(d=t-1)),i&&void 0!==d){var h=Math.min(t,n,d),m=Math.max(t,n,d);if(h!==m){for(var y=[],v=h;v0&&void 0!==arguments[0]&&arguments[0],r=t.props.sortKeys,o=e.remote?{remoteSortAttribute:e.attribute}:r[e.attribute];console.log("TOGGLE",o,n),t.onColumnSort(o,null,!1,n)}})):o({}))},observeNodeChildren:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&!this._childrenObserver||(this._childrenObserver||(this._childrenObserver=function(){this.indexedElements=null,this.rebuildLoadedElements()}.bind(this)),t?(e.stopObserving("child_added",this._childrenObserver),e.stopObserving("child_removed",this._childrenObserver),e.stopObserving("child_replaced",this._childrenObserver)):(e.observe("child_added",this._childrenObserver),e.observe("child_removed",this._childrenObserver),e.observe("child_replaced",this._childrenObserver)))},_loadNodeIfNotLoaded:function(){var e=this.props.node;e.isLoaded()?this.observeNodeChildren(e):(e.observeOnce("loaded",function(){this.props.node===e&&(this.observeNodeChildren(e),this.setState({loaded:!0,loading:!1,elements:this.buildElements()}))}.bind(this)),e.load())},_loadingListener:function(){this.observeNodeChildren(this.props.node,!0),this.setState({loaded:!1,loading:!0}),this.indexedElements=null},_loadedListener:function(){this.setState({loading:!1,elements:this.buildElements()}),this.observeNodeChildren(this.props.node)},reload:function(){this.props.reloadAtCursor&&this._currentCursor?this.loadStartingAtCursor():(this.props.clearSelectionOnReload&&this.props.dataModel.setSelectedNodes([]),this._loadingListener(),this.props.node.observeOnce("loaded",this._loadedListener),this.props.node.reload())},loadStartingAtCursor:function(){this._loadingListener();var e=this.props.node,t=e.getChildren(),n=[];e.observeOnce("loaded",function(){var r=new Map;n.map((function(e){r.set(e.getPath(),e)})),t.forEach((function(e){r.set(e.getPath(),e)})),e._children=r,this._loadedListener()}.bind(this)),e.setLoaded(!1),e.observe("child_added",(function(t){n.push(e._children.get(t))})),this.props.node.load(null,{cursor:this._currentCursor})},wireReloadListeners:function(){this.wrappedLoading=this._loadingListener,this.wrappedLoaded=this._loadedListener,this.props.node.observe("loading",this.wrappedLoading),this.props.node.observe("loaded",this.wrappedLoaded)},stopReloadListeners:function(){this.props.node.stopObserving("loading",this.wrappedLoading),this.props.node.stopObserving("loaded",this.wrappedLoaded)},toggleSelector:function(){this.setState({showSelector:!this.state.showSelector,selection:new Map,bulkSelectorChecked:!1},this.rebuildLoadedElements)},toggleSelection:function(e){var t=this.state.selection||new Map;t.get(e)?t.delete(e):t.set(e,!0),this.setState({selection:t,bulkSelectorChecked:!1},this.rebuildLoadedElements)},selectAll:function(e){if(e){var t=new Map;this.props.node.getChildren().forEach(function(e){this.props.filterNodes&&!this.props.filterNodes(e)||e.isLeaf()&&t.set(e,!0)}.bind(this)),this.setState({selection:t,bulkSelectorChecked:!0},this.rebuildLoadedElements)}else this.setState({selection:new Map,bulkSelectorChecked:!1},this.rebuildLoadedElements)},applyMultipleAction:function(e){if(this.state.selection&&this.state.selection.size){var t=e.currentTarget.getAttribute("data-action"),n=this.dm||new Io;n.setContextNode(this.props.node);var r=[];this.state.selection.forEach((function(e,t){r.push(t)})),n.setSelectedNodes(r);var o=this.props.pydio.Controller.getActionByName(t);o.fireContextChange(n,!0,this.props.pydio.user),o.apply([n]),e.stopPropagation(),e.preventDefault()}},getActionsForNode:function(e,t){var n=this.props,r=n.computeActionsForNode,o=n.pydio;if(!r)return[];var i=t.isLeaf()?"file-"+t.getAjxpMime():"folder",a=t.isLeaf()?"file":"dir",s=[];return this.actionsCache[i]?s=this.actionsCache[i]:(e.setSelectedNodes([t]),o.Controller.actions.forEach(function(n){n.fireContextChange(e,!0,o.user),!(n.context.selection&&n.context.actionBar&&n.selectionContext[a]&&!n.deny&&n.options.icon_class)||this.props.actionBarGroups&&-1===this.props.actionBarGroups.indexOf(n.context.actionBarGroup)||n.selectionContext.allowedMimes.length&&-1===n.selectionContext.allowedMimes.indexOf(t.getAjxpMime())||(s.push(n),t.isLeaf()&&!1===n.selectionContext.unique&&this.actionsCache.multiple.set(n.options.name,n))}.bind(this)),this.actionsCache[i]=s),s},patchInfiniteGrid:function(e){this.infinite.current&&e>1&&(this.infinite.current.state.infiniteComputer.__proto__.getDisplayIndexStart=function(t){return e*Math.floor(t/this.heightData/e)},this.infinite.current.state.infiniteComputer.__proto__.getDisplayIndexEnd=function(t){return e*Math.ceil(t/this.heightData/e)})},componentWillMount:function(){this.infinite=(0,e.createRef)()},componentDidMount:function(){var e=this;this.props.delayInitialLoad?setTimeout((function(){e._loadNodeIfNotLoaded()}),this.props.delayInitialLoad):this._loadNodeIfNotLoaded(),this.patchInfiniteGrid(this.props.elementsPerLine),this.props.autoRefresh&&(this.refreshInterval=window.setInterval(this.reload,this.props.autoRefresh)),this.props.observeNodeReload&&this.wireReloadListeners(),this.props.dataModel.observe("root_node_changed",(function(t){e.rootNodeChangedFlag=!0})),this.props.dataModel.observe("selection_changed",function(){var e=this;if(this.isMounted()){var t=new Map,n=this.props.dataModel.getSelectedNodes();n.map((function(e){t.set(e,!0)})),this.setState({selection:t},(function(){e.rebuildLoadedElements(),1===n.length&&e.scrollToView(n[0])}))}}.bind(this));var t=new Map,n=this.props.dataModel.getSelectedNodes();n.length&&(n.map((function(e){t.set(e,!0)})),this.setState({selection:t},(function(){setTimeout((function(){e.scrollToView(n[0])}),500)})))},componentWillUnmount:function(){this.refreshInterval&&window.clearInterval(this.refreshInterval),this.props.observeNodeReload&&this.stopReloadListeners(),this.props.node&&this.observeNodeChildren(this.props.node,!0)},componentDidUpdate:function(e,t){!this.rootNodeChangedFlag&&e.node&&this.props.node&&e.node.getPath()===this.props.node.getPath()||(this._loadNodeIfNotLoaded(),this.rootNodeChangedFlag=!1)},onScroll:function(e){if(this.props.onScroll&&this.props.onScroll(e),this.props.passScrollingStateToChildren){this.state.scrollTimeout&&clearTimeout(this.state.scrollTimeout);var t=this,n=setTimeout((function(){t.setState({isScrolling:!1,scrollTimeout:void 0})}),150);this.setState({isScrolling:!0,scrollTimeout:n})}},scrollToLast:function(){this.indexedElements&&this.indexedElements[this.indexedElements.length-1].node&&this.scrollToView(this.indexedElements[this.indexedElements.length-1].node)},scrollToView:function(e){var t=this;if(this.indexedElements&&this.infinite.current&&this.infinite.current.scrollable){var n=r().findDOMNode(this.infinite.current),o=this.infinite.current.scrollable,i=o.scrollTop+this.props.elementHeight/2,a=o.scrollTop+n.clientHeight-this.props.elementHeight/2,s=this.indexedElements.length*this.props.elementHeight-n.clientHeight,c=-1;if(this.indexedElements.forEach((function(t,n){t.node&&t.node===e&&(c=n)})),-1!==c){var l=this.props.elementHeight,u=c*l;u>i&&u=a&&(u-=n.clientHeight-2*l),u=Math.min(u,s),o.scrollTop=u,this._manualScrollPe&&this._manualScrollPe.stop(),o.scrollHeight=u&&(t._manualScrollPe.stop(),t._manualScrollPe=null)}),.25)))}}},buildElementsFromNodeEntries:function(e,n){var r=[],o=e.length,i=this.props,a=i.entriesProps,s=i.elementStyle,c=i.tableKeys,l=i.passScrollingStateToChildren;return a=To(To({},a),{},{style:s}),l&&(a.parentIsScrolling=this.state.isScrolling),e.forEach(function(e,i){var s;if(e.parent)s=To({node:e.node,key:i+":"+e.node.getPath(),id:e.node.getPath(),mainIcon:Mo.PARENT_FOLDER_ICON,firstLine:"..",className:"list-parent-node",secondLine:this.getMessage("react.1"),onClick:this.clickRow.bind(this),onDoubleClick:this.doubleClickRow.bind(this),showSelector:!1,selectorDisabled:!0,noHover:!1},a),this.props.entryRenderParentIcon&&!this.props.tableKeys?s.iconCell=this.props.entryRenderParentIcon(e.node,e):s.mainIcon=Mo.PARENT_FOLDER_ICON,c&&(s.onClick=s.onDoubleClick),r.push(t().createElement(de,s));else if(e.groupHeader){var l=e.groupHeader,u=e.groupHeaderLabel;this.props.entryRenderGroupHeader&&(u=this.props.entryRenderGroupHeader(l,u)),s=To({node:null,key:i+":"+l,id:l,mainIcon:null,firstLine:u,className:"list-group-header",onClick:null,showSelector:!1,selectorDisabled:!0,noHover:!0},a),e.groupFill&&(s.style=To(To({},s.style),{},{visibility:"hidden"})),r.push(t().createElement(de,s))}else(s=To({node:e.node,onClick:this.clickRow.bind(this),onDoubleClick:this.doubleClickRow.bind(this),onSelect:this.toggleSelection.bind(this),key:i+":"+e.node.getPath(),id:e.node.getPath(),renderIcon:this.props.entryRenderIcon,renderFirstLine:this.props.entryRenderFirstLine,renderSecondLine:this.props.entryRenderSecondLine,renderThirdLine:this.props.entryRenderThirdLine,renderActions:this.props.entryRenderActions,showSelector:n,selected:!(!this.state||!this.state.selection)&&this.state.selection.get(e.node),actions:t().createElement(Vr,{node:e.node,actions:e.actions,dataModel:this.dm}),selectorDisabled:!(this.props.entryEnableSelector?this.props.entryEnableSelector(e.node):e.node.isLeaf())},a)).isFirst=0===i,s.isLast=i===o-1,i++,this.props.renderCustomEntry?r.push(this.props.renderCustomEntry(s)):c?(this.props.defaultGroupBy?(s.tableKeys=To({},c),delete s.tableKeys[this.props.defaultGroupBy]):s.tableKeys=c,r.push(t().createElement(Mn,s))):!e.node.isLeaf()||e.node.getMetadata().has("local:dropFunc")?r.push(t().createElement(Ur,s)):r.push(t().createElement(Lr,s))}.bind(this)),r},prepareSortFunction:function(){var e=(this.state||{}).sortingInfo;if(!e)return null;var t,n=e.attribute,r=e.direction,o=e.sortType;return t="file-natural"===o?bo:function(e,t,n){return function(r,o){if(r.getMetadata().has("local:pinSort")&&!o.getMetadata().has("local:pinSort"))return-1;if(o.getMetadata().has("local:pinSort")&&!r.getMetadata().has("local:pinSort"))return 1;var i;if("number"===t){var a=r.getMetadata().get(e)||0,s=o.getMetadata().get(e)||0;a=parseFloat(a),s=parseFloat(s),i="asc"===n?a-s:s-a}else if("string"===t){var c=r.getMetadata().get(e)||"",l=o.getMetadata().get(e)||"";i="asc"===n?c.localeCompare(l):l.localeCompare(c)}if(0===i){var u=r.getLabel().localeCompare(o.getLabel(),void 0,{numeric:!0});i="asc"===n?u:-u}return i}}(n,o,r),function(e,n){return e.parent?-1:n.parent?1:t(e.node,n.node)}},buildElements:function(){var e,t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0)||this.props.node,i=r||this.props,a=this.prepareSortFunction();if(!this.indexedElements||this.indexedElements.length!==o.getChildren().size){this.indexedElements=[];var s,c,l,u,d=i.defaultGroupBy,p=i.groupByLabel,f=void 0!==p&&p;d&&(s={},c=[],l={}),i.skipParentNavigation||!o.getParent()||i.dataModel.getContextNode()===o&&!i.skipInternalDataModel||(t=!0,this.indexedElements.push({node:o.getParent(),parent:!0,actions:null})),o.getChildren().forEach(function(e){if(e.getMetadata().has("cursor")){var t=parseInt(e.getMetadata().get("cursor"));this._currentCursor=Math.max(this._currentCursor?this._currentCursor:0,t)}if(!i.filterNodes||i.filterNodes(e)){var n,r=this.getActionsForNode(this.dm,e);d?(n=i.groupByValueFunc?i.groupByValueFunc(e.getMetadata().get(d))||"N/A":e.getMetadata().get(d)||"N/A",s[n]||(s[n]=[],c.push(n)),f&&e.getMetadata().has(f)&&!l[n]&&(l[n]=e.getMetadata().get(f)),s[n].push({node:e,parent:!1,actions:r})):this.indexedElements.push({node:e,parent:!1,actions:r})}}.bind(this)),d&&(i.groupSkipUnique&&1===c.length?(u=this.indexedElements).push.apply(u,function(e){if(Array.isArray(e))return jo(e)}(n=s[c[0]])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||Ro(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):(e=!0,(c=c.sort()).map(function(e,n){var r=e;if(l[e]?r=l[e]:i.renderGroupLabels&&(r=i.renderGroupLabels(d,e)),this.indexedElements.push({node:null,groupHeader:e,groupHeaderLabel:r,parent:!1,actions:null}),a&&s[e].sort(a),this.indexedElements=this.indexedElements.concat(s[e]),i.elementsPerLine>1){var o=i.elementsPerLine-s[e].length%i.elementsPerLine-1;0===n&&t&&(o-=1);for(var c=0;c1?r.has("order_column")&&r.has("order_direction")?{remote:!0,attribute:r.get("order_column"),direction:r.get("order_direction")}:-1:0},renderToolbar:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.state.sortingInfo;if(n)return this.props.sortKeys?t().createElement(dr,{displayMode:"hidden",tableKeys:this.props.sortKeys,columnClicked:this.onColumnSort,sortingInfo:r}):null;var o,i,a=[t().createElement(g.FontIcon,{key:1,tooltip:"Reload",className:"mdi mdi-reload"+(this.state.loading?" rotating":""),onClick:this.reload})],s=2;if(this.props.sortKeys&&(a.push(t().createElement(dr,{key:s,displayMode:"menu",tableKeys:this.props.sortKeys,columnClicked:this.onColumnSort,sortingInfo:r})),s++),this.props.additionalActions&&a.push(this.props.additionalActions),this.props.node.getMetadata().get("paginationData")&&this.props.node.getMetadata().get("paginationData").get("total")>1&&(i=t().createElement(Sr,{dataModel:this.dm,node:this.props.node})),this.props.listTitle&&(o=t().createElement(g.ToolbarGroup,{key:0,float:"left"},t().createElement("div",{className:"list-title"},this.props.listTitle))),this.props.searchResultData)o=t().createElement(g.ToolbarGroup,{key:0,float:"left"},t().createElement("div",{style:{fontSize:12,fontWeight:500,color:"#9e9e9e"}},this.getMessage("searchengine.topbar.title")+" "+this.props.searchResultData.term)),a=t().createElement(g.RaisedButton,{key:1,label:this.getMessage("86"),primary:!0,onClick:this.props.searchResultData.toggleState,style:{marginRight:-10}});else if(this.actionsCache.multiple.size||this.props.multipleActions){var c=this.getMessage("react.2"),l={transform:"translateX(-80px)"},u=To({width:24},l),d=To({},l),p=this.state,f=p.showSelector,h=p.selection,m=p.bulkSelectorChecked;f&&(u={width:24,transform:"translateX(-12px)"},d={transform:"translateX(-40px)"}),h&&f&&(c+=" ("+h.size+")"),o=t().createElement(g.ToolbarGroup,{key:0,float:"left",className:"hide-on-vertical-layout"},t().createElement(g.Checkbox,{checked:m,onCheck:function(t,n){return e.selectAll(n)},style:u}),t().createElement(g.FlatButton,{label:c,onClick:function(){return e.toggleSelector()},style:d})),f&&(a=[],(this.props.multipleActions||this.actionsCache.multiple).forEach(function(e){a.push(t().createElement(g.RaisedButton,{key:0,label:e.options.text,"data-action":e.options.name,onClick:this.applyMultipleAction,primary:!0,disabled:!h||!h.size,style:{marginLeft:5}}))}.bind(this)),a=t().createElement("span",null,a))}return t().createElement(g.Toolbar,{style:this.props.toolbarStyle},o,t().createElement(g.ToolbarGroup,{key:1,float:"right"},i,a))},render:function(){var e,n,r,o=this,i="material-list vertical-layout layout-fill",a=this.props,s=a.className,c=a.showSelector,l=a.tableKeys,u=a.defaultGroupBy,d=a.dataModel,p=a.node,f=a.additionalActions,h=a.customToolbar,m=a.hideToolbar,y=a.emptyStateProps,v=a.entryHandleClicks;if(s&&(i+=" "+s),c&&(i+=" list-show-selectors"),l&&(i+=" table-mode"),l){var b;u?delete(b=To({},l))[u]:b=this.props.tableKeys;var g=this.state,S=g.sortingInfo,w=g.loading;e=t().createElement(Cr,{tableKeys:b,loading:w,reload:this.reload,ref:"loading_indicator",dm:d,node:p,additionalActions:f,onHeaderClick:this.onColumnSort,sortingInfo:S})}else e=h||(m?null:this.renderToolbar()),(m||h)&&(n=this.renderToolbar(!0));if(y&&p.isLoaded()&&!p.isLoading()&&(!this.state.elements.length||1===this.state.elements.length&&this.state.elements[0].parent)){var k={};if(1===this.state.elements.length&&this.state.elements[0].parent){var O=this.state.elements[0].node;k={actionLabelId:"react.1",actionIconClassName:Mo.PARENT_FOLDER_ICON,actionCallback:function(e){v&&v(O,Mo.CLICK_TYPE_DOUBLE,e)}}}r=t().createElement(po,Eo({},y,k))}else y&&y.checkEmptyState&&y.checkEmptyState(p)&&(r=t().createElement(po,y));var P,E,C=this.buildElementsFromNodeEntries(this.state.elements,this.state.showSelector),T=this.props,x=T.verticalScroller,R=T.usePlaceHolder,j=C;if(!C.length&&R&&(j=t().createElement(vo,this.props)),r)j=r;else if(x)P=function(e){return t().createElement(V(),{speed:.8,horizontalScroll:!1,style:{height:e},verticalScrollbarStyle:{borderRadius:10,width:6},verticalContainerStyle:{width:8}},t().createElement("div",null,j))};else{if(l)return t().createElement("div",{className:i,tabIndex:"0",onKeyDown:this.onKeyDown,style:To(To({},this.props.style),{},{overflowX:"auto"})},n,t().createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,height:"100%",width:"100%",minWidth:"fit-content"}},e,t().createElement(Ao,{className:r?"layout-fill vertical_layout":"layout-fill"},(function(e){return t().createElement(q(),{elementHeight:o.state.elementHeight?o.state.elementHeight:o.props.elementHeight,containerHeight:e||1,handleScroll:o.onScroll,ref:o.infinite},j)}))));E=function(e){return t().createElement(q(),{elementHeight:o.state.elementHeight?o.state.elementHeight:o.props.elementHeight,containerHeight:e||1,handleScroll:o.onScroll,ref:o.infinite},P?P(e):j)}}return t().createElement("div",{className:i,tabIndex:"0",onKeyDown:this.onKeyDown,style:this.props.style},e,n,t().createElement(Ao,{className:r?"layout-fill vertical_layout":"layout-fill"},E||function(){return j}))}});function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Yo(this,e),this.state=Jo({},t),!t.sortCol&&r&&(this.state.sortCol=r,this.state.sortDir=o||"asc"),this.onSort=n}return Xo(e,[{key:"renderHeader",value:function(e,n){var r=this,o=this.state,i=o.sortCol,a=o.sortDir,s={cursor:"pointer",position:"relative"},c={left:-17,position:"absolute"};if(i!==e||""===a)return t().createElement("span",{onClick:function(){r.onSort(e,"asc")},style:s},n);var l=n;return"asc"===a?l=t().createElement("span",{onClick:function(){r.onSort(e,"desc")},style:s},n," ",t().createElement("span",{style:c,className:"mdi mdi-arrow-up"})):"desc"===a&&(l=t().createElement("span",{onClick:function(){r.onSort(e,"")},style:s},n," ",t().createElement("span",{style:c,className:"mdi mdi-arrow-down"}))),l}},{key:"setData",value:function(e,t){this.columns=e,this.data=t}},{key:"sorted",value:function(){var e=this.state,t=e.sortCol,n=e.sortDir;if(!t||!n)return this.data;var r,o=function(e){if(Array.isArray(e))return Vo(e)}(r=this.data)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return Vo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vo(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=this.columns.filter((function(e){return e.name===t}))[0],a=i.sorter;return a?(o.sort((function(e,r){var o,s;return a.value?(o=a.value(e),s=a.value(r)):i.renderCell?(o=i.renderCell(e),s=i.renderCell(r)):(o=e[t],s=r[t]),"string"===a.type?(o||(o=""),s||(s=""),o=o.toLowerCase(),s=s.toLowerCase()):"number"===a.type&&(o=parseInt(o),s=parseInt(s)),"asc"===n?o>s?1:os?-1:0})),o):this.data}}]),e}(),oi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(i,e);var n,r,o=(n=i,r=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}}(),function(){var e,t=qo(n);if(r){var o=qo(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function i(e){var t;return Yo(this,i),(t=o.call(this,e)).state={},t}return Xo(i,[{key:"onRowSelection",value:function(e){var t=this.props,n=t.data,r=t.onSelectRows;if(r)if("none"===e)r([]);else if("all"===e)r(n);else{var o=n,i=this.computeSorter();i&&(o=i.sorted());var a=this.computePagination();a.use&&(o=o.slice(a.sliceStart,a.sliceEnd));var s=[];e.map((function(e){var t=o.slice(0,e).filter((function(e){return e.expandedRow})).length;t&&(e-=t),s.push(o[e])})),r(s)}}},{key:"loadStoredValue",value:function(){var e=this.props,t=e.storageKey,n=e.columns;if(!t)return null;if(!localStorage.getItem(t+".sort"))return null;try{var r=JSON.parse(localStorage.getItem(t+".sort")),o=r.col,i=r.dir;return 0===n.filter((function(e){return e.name===o})).length||-1===["asc","desc",""].indexOf(i)?null:{col:o,dir:i}}catch(e){return null}}},{key:"computeSorter",value:function(){var e,t=this,n=this.props,r=n.columns,o=n.data,i=n.storageKey,a=r.filter((function(e){return e.sorter}));if(a.length){var s,c=a[0].name,l=a.filter((function(e){return e.sorter.default})),u=this.loadStoredValue();u?(c=u.col,s=u.dir):l.length&&(c=l[0].name,l[0].sorter.defaultDir&&(s=l[0].sorter.defaultDir)),(e=new ri(this.state,(function(e,n){t.setState({sortCol:e,sortDir:n}),i&&localStorage.setItem(i+".sort",JSON.stringify({col:e,dir:n}))}),c,s)).setData(r,o)}return e}},{key:"computePagination",value:function(){var e=this.props,t=e.data,n=e.paginate,r=e.defaultPageSize,o=e.pagination;if(o)return Jo(Jo({},o),{},{use:!0});if(!n||!t||!t.length)return{use:!1};var i=this.state.pageSize||r||n[0];if(t.length<=i)return{use:!1};for(var a=this.state.page,s=void 0===a?1:a,c=Math.ceil(t.length/i),l=(s-1)*i,u=Math.min(s*i,t.length),d=[],p=1;p<=c;p++)d.push(p);return{use:!0,sliceStart:l,sliceEnd:u,pages:d,page:s,pageSize:i,pageSizes:n}}},{key:"renderPagination",value:function(e){var n=this,r=this.props,o=r.data,i=r.muiTheme,a=e.page,s=e.pageSize,c=e.pages,l=e.pageSizes,u=e.sliceStart,d=e.sliceEnd,p=e.nextDisabled,f=e.prevDisabled,h=e.onPageNext,m=e.onPagePrev,y=e.onPageSizeChange;return t().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",color:"#757575"}},l.length>1&&t().createElement("div",{style:{paddingRight:10}},Z().getMessages()["material.paginator.rows"]," :"),l.length>1&&t().createElement("div",{style:{width:90}},t().createElement(g.SelectField,Zo({},ni(i).selectField,{fullWidth:!0,value:s,onChange:function(e,t,r){y?y(r):n.setState({page:1,pageSize:r})}}),l.map((function(e){return t().createElement(g.MenuItem,{value:e,primaryText:e})})))),m&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-left",disabled:f,onClick:function(){return m()}}),!m&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-left",disabled:1===a,onClick:function(){return n.setState({page:a-1})}}),(u||d)&&t().createElement("div",null,u+1,"-",d," ",Z().getMessages()["material.paginator.of"]," ",o.length),h&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-right",disabled:p,onClick:function(){return h()}}),!h&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-chevron-right",disabled:a===c.length,onClick:function(){return n.setState({page:a+1})}}))}},{key:"render",value:function(){var e=this.props,n=e.columns,r=e.deselectOnClickAway,o=e.emptyStateString,i=e.masterStyles,a=void 0===i?{}:i,s=e.emptyStateStyle,c=e.onSelectRows,l=e.computeRowStyle,u=e.rowSelected,d=this.props,p=d.actions,f=d.hideHeaders,h=this.props,m=h.data,y=h.showCheckboxes,v=a.actionsColor||"rgba(0,0,0,.33)",b=this.computeSorter();b&&(m=b.sorted());var S,w=this.computePagination();w.use&&(m=m.slice(w.sliceStart,w.sliceEnd),S=this.renderPagination(w));var k,O=0;p&&p.length&&(k=!0,O=1);var P=[];m.map((function(e){var r;if(l&&(r=l(e)),e.Subheader){var o=Jo({fontSize:12,color:"#616161",backgroundColor:"#FAFAFA",fontWeight:500},e.style);P.push(t().createElement(g.TableRow,{className:"media-small-hide",style:Jo({},a.row)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:o},e.Subheader)))}else if(e.colSpan)P.push(t().createElement(g.TableRow,{style:Jo(Jo({},e.rowStyle),a.row)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:Jo({height:"auto",paddingLeft:0,paddingRight:0,backgroundColor:"transparent"},e.cellStyle)},e.element)));else{var i=Jo(Jo({},r),a.row);e.expandedRow&&(i=Jo(Jo({},i),a.expanderRow)),P.push(t().createElement(g.TableRow,{selectable:void 0!==c,style:i,selected:u&&u(e)},n.map((function(n){var r=e[n.name],o=r;return n.useMoment&&r?o=r=ti(new Date(1e3*parseInt(r))).fromNow():n.renderCell&&(r=n.renderCell(e))&&"object"===$o(r)&&r.element&&r.text&&(o=r.text,r=r.element),t().createElement(g.TableRowColumn,{style:n.style||{},title:"object"===$o(o)?null:o,className:n.hideSmall?"media-small-hide":null},r)})),k&&t().createElement(g.TableRowColumn,{style:{overflow:"visible",textOverflow:"none",width:48*p.length+32}},p.map((function(n){var r=!!n.disable&&n.disable(e);return t().createElement(g.IconButton,{style:{padding:14,opacity:r?.5:null},iconStyle:{fontSize:20,color:v},onClick:function(t){t.stopPropagation(),n.onClick(e)},iconClassName:n.iconClassName,tooltip:n.tooltip,disabled:r})}))))),e.expandedRow&&P.push(t().createElement(g.TableRow,{selectable:!1,style:Jo(Jo({},a.row),a.expandedRow)},t().createElement(g.TableRowColumn,{colSpan:n.length+O,style:Jo({height:"auto",paddingLeft:0,paddingRight:0,backgroundColor:"transparent"},e.cellStyle)},e.expandedRow)))}}));var E=n.map((function(e){var n=e.label;return b&&e.sorter&&(n=b.renderHeader(e.name,e.label)),t().createElement(g.TableHeaderColumn,{style:Jo(Jo({},e.headerStyle),{},{height:48,backgroundColor:"#F5F5F5",fontWeight:500},a.head),className:e.hideSmall?"media-small-hide":null},n)}));return k&&E.push(t().createElement(g.TableHeaderColumn,{style:Jo({width:48*p.length+32,height:48,backgroundColor:"#F5F5F5"},a.head)})),o&&!P.length&&(y=!1,P=[t().createElement(g.TableRow,null,t().createElement(g.TableRowColumn,{colSpan:n.length,style:s},o))]),(m.length&&m[0].Subheader||o&&!P.length)&&P.unshift(t().createElement(g.TableRow,{style:Jo({borderBottom:"none",height:0},a.row)},n.map((function(e){var n=e.style||{};return t().createElement(g.TableRowColumn,{style:Jo(Jo({},n),{},{height:0}),className:e.hideSmall?"media-small-hide":null})})))),t().createElement(g.Table,{onRowSelection:this.onRowSelection.bind(this),multiSelectable:y},!f&&t().createElement(g.TableHeader,{displaySelectAll:y,adjustForCheckbox:y,enableSelectAll:y},t().createElement(g.TableRow,{style:a.row},E)),t().createElement(g.TableBody,{deselectOnClickaway:r,displayRowCheckbox:y},P),S&&t().createElement(g.TableFooter,null,t().createElement(g.TableRow,{style:{backgroundColor:"#fafafa"}},t().createElement(g.TableRowColumn,{colSpan:n.length},S))))}}]),i}(t().Component);(oi=(0,K.muiThemeable)()(oi)).PropTypes={data:z().array,columns:z().array,onSelectRows:z().func,emptyStateString:z().string};const ii=t()["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"],ai=function(t,n,r,o){var i=e.useRef(r),a=e.useRef(o);ii((function(){i.current=r,a.current=o})),ii((function(){var e=t&&"current"in t?t.current:t;if(e){var r=0;e.addEventListener(n,s);var o=a.current;return function(){r=1,e.removeEventListener(n,s),o&&o()}}function s(){if(!r){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=gi(t),i=1e3/n,a=e.useRef(0),s=e.useRef(),c=function(){return s.current&&clearTimeout(s.current)},l=[n,r,o];function u(){a.current=0,c()}return e.useEffect((function(){return u}),l),e.useCallback((function(){var e=arguments,t=wi(),n=function(){a.current=t,c(),o.current.apply(null,e)},l=a.current;if(r&&0===l)return n();if(t-l>i){if(l>0)return n();a.current=t}c(),s.current=setTimeout((function(){n(),a.current=0}),i)}),l)}function Oi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pi(e,t):void 0}}(e,t)||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.")}()}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=n.offset,o=void 0===r?0:r,i=n.fps,a=void 0===i?12:i,s=t&&"current"in t?t.current:t,c=function(){return s?"scrollTop"in s?s.scrollTop:s.pageYOffset||s.scrollY:0},l=function(t,n,r){var o=e.useState(t);return[o[0],ki(o[1],n,void 0)]}(c,a),u=Oi(l,2),d=u[0],p=u[1],f=Oi(e.useState(!1),2),h=f[0],m=f[1];function y(){m(!1)}return ii((function(){if(s){var e,t=!1,n=function(){return e&&void vi(e.v||-1)},r=function(){t||(p(c()),m(!0),n(),e=function(e,t){var n=pi(),r={};return r.v=yi((function o(){pi()-n>=t?e.call(null):r.v=yi(o)})),r}(y,1e3/a))};return s.addEventListener("scroll",r),function(){s.removeEventListener("scroll",r),n(),t=!0}}}),[s,a]),{scrollTop:Math.max(0,d-o),isScrolling:h}}var Ci={low:0,max:0,high:0,C:2,P:void 0,R:void 0,L:void 0,list:void 0};function Ti(e){var t=e.high;e.L===Ci&&e.R===Ci?e.max=t:e.L===Ci?e.max=Math.max(e.R.max,t):e.R===Ci?e.max=Math.max(e.L.max,t):e.max=Math.max(Math.max(e.L.max,e.R.max),t)}function xi(e){for(var t=e;t.P!==Ci;)Ti(t.P),t=t.P}function Ri(e,t){if(t.R!==Ci){var n=t.R;t.R=n.L,n.L!==Ci&&(n.L.P=t),n.P=t.P,t.P===Ci?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,Ti(t),Ti(n)}}function ji(e,t){if(t.L!==Ci){var n=t.L;t.L=n.R,n.R!==Ci&&(n.R.P=t),n.P=t.P,t.P===Ci?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,Ti(t),Ti(n)}}function Ii(e,t,n){t.P===Ci?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:0,r=function(){var e={root:Ci,size:0},t={};return{insert:function(n,r,o){for(var i=e.root,a=Ci;i!==Ci&&n!==(a=i).low;)i=no.high)break;r=o,o=o.next}return r||(e.list={index:n,high:t,next:o}),r&&(r.next={index:n,high:t,next:r.next}),!0}(a,r,o))return;return a.high=Math.max(a.high,r),Ti(a),xi(a),t[o]=a,void e.size++}var s={low:n,high:r,max:r,C:0,P:a,L:Ci,R:Ci,list:{index:o,high:r,next:null}};a===Ci?e.root=s:(s.lowi.max)&&(i.L!==Ci&&o.push(i.L),i.R!==Ci&&o.push(i.R),i.low<=n&&i.high>=t))for(var a=i.list;null!==a;)a.high>=t&&r(a.index,i.low),a=a.next}},get size(){return e.size}}}(),o=new Array(e),i=[],a=new Array(e),s=0;s1&&void 0!==arguments[1]?arguments[1]:0,c=0,l=1;l1?Math.min.apply(null,o):o[0]||0},size:function(){return r.size}}},Mi=function(e,t){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>>1,i=e[o];if(i===t)return o;i<=t?n=o+1:r=o-1}return-1},Ni=[],Di=function(e){try{return new e}catch(e){var t={};return{set:function(e,n){t[e]=n},get:function(e){return t[e]}}}};const Li=function(e,t){var n,r=function(e){var t,n,r,o,i=e.length,a=Di(e[0]),s=1===i;return i<3?{g:function(e){return void 0===(t=a.get(e[0]))||s?t:t.get(e[1])},s:function(r,o){return s?a.set(r[0],o):void 0===(t=a.get(r[0]))?((n=Di(e[1])).set(r[1],o),a.set(r[0],n)):t.set(r[1],o),o}}:{g:function(e){for(o=a,r=0;r0},e.prototype.connect_=function(){Bi&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Zi?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Bi&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=Wi.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),qi=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),na="undefined"!=typeof WeakMap?new WeakMap:new Ui,ra=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Hi.getInstance(),r=new ta(t,n,this);na.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){ra.prototype[e]=function(){var t;return(t=na.get(this))[e].apply(t,arguments)}}));const oa=void 0!==Fi.ResizeObserver?Fi.ResizeObserver:ra;var ia=new WeakMap;function aa(){var t=e.useState(sa)[1];return e.useRef((function(){return t({})})).current}var sa={},ca=Li([WeakMap],(function(e,t){var n,r,o,i,a=(n=function(n){for(var r=[],o=0;o0){var s=ia.get(i.target);if(void 0!==s){var c=e.get(s);void 0!==c&&a!==c.height&&r.push(s,a)}}}r.length>0&&(e.update(r),t(r))},r=[],o=null,i=function(){for(var e=arguments.length,t=new Array(e),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1),2),h=f[0],m=f[1],y=_a((0,e.useState)(!1),2),v=y[0],b=y[1];(0,e.useEffect)((function(){var e=function(){m(s.getSelectedNodes().indexOf(i)>-1)};return s.observe("selection_changed",e),function(){s.stopObserving("selection_changed",e)}}),[h,i]);var g=c.handleClicks,S=c.renderIcon,w=c.renderActions,k=Z().getMessages()["react.1"],O={};if(p&&d&&i.getMetadata().get("image_exif_orientation")){var P=parseInt(i.getMetadata().get("image_exif_orientation"));if(Na[P]){var E=ja({},Na[P]);if(P<5)O={transform:Da(E)};else{var C=r*(d=1/d),T=(r-C)/2;E.translateX=T*E.tX,E.translateY=T*E.tY,O={transform:Da(E),width:C}}}}var x=["masonry-card"];v&&x.push("hover"),h&&x.push("selected"),p&&x.push("has-src");var R=(0,e.useRef)(null);return(0,e.useEffect)((function(){l&&R.current&&l(R.current)}),[i]),t().createElement(pe,{node:i,style:{width:r,height:r*d,position:"relative"},className:x.join(" "),onClick:function(e){return g(i,a?Mo.CLICK_TYPE_DOUBLE:Mo.CLICK_TYPE_SIMPLE,e)},onDoubleClick:function(e){return g(i,Mo.CLICK_TYPE_DOUBLE,e)},onMouseOver:function(){return b(!0)},onMouseOut:function(){return b(!1)}},p&&t().createElement(Ba,{className:"masonry-image",src:p,alt:i.getPath(),style:ja({width:r},O)}),a&&t().createElement("div",{className:"mimefont-container"},t().createElement("div",{className:"mimefont mdi mdi-chevron-left"})),!a&&!p&&S(i),!a&&t().createElement("div",{style:{position:"absolute",top:0,left:0}},w(i)),p&&t().createElement("div",{className:"masonry-label-overlay",style:{position:"absolute",bottom:0,left:0,right:0,height:50}}),t().createElement("div",{className:"masonry-label",ref:R,style:ja({display:v||h||!p?"block":"none"},{position:"absolute",bottom:0,left:0,right:0,height:32,padding:"6px 10px",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:"0 0 2px 2px"})},a?k:i.getLabel()))}),(function(e){return e.data.node})),Ba=function(n){var r=n.src,o=n.alt,i=n.style,a=n.className,s=(0,e.useRef)(),c=function(t){var n=_a((0,e.useState)(!1),2),r=n[0],o=n[1];return(0,e.useEffect)((function(){var e=new IntersectionObserver((function(e){var t,n,r=_a(e,1)[0];if(!(r.target&&!r.rootBounds&&(t=r.target,n=t.getBoundingClientRect(),n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth))))return r.isIntersecting?o(r.isIntersecting):void 0;o(!0)}),{threshold:.1,root:null});return e.observe(t.current),function(){e.disconnect()}}),[t]),r}(s),l=ja({},i);return l.transition="opacity 550ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",c||(l.opacity=0),t().createElement("img",{ref:s,alt:o,src:c?r:null,style:l,className:a})};function Fa(e,t){var n=[];return e.getChildren().forEach((function(e,r){n.push(ja({id:"item-"+r,node:e},t))})),n.sort((function(e,t){return bo(e.node,t.node)})),e.getParent()&&n.unshift(ja({id:"item-parent",parent:!0,node:e.getParent()},t)),n}const za=t().memo((function(n){var r=n.className,o=n.dataModel,i=n.entryProps,a=n.emptyStateProps,s=n.containerStyle,c=void 0===s?{}:s,l=n.columnWidth,u=void 0===l?220:l,d=n.onScroll,p={dataModel:o,entryProps:i},f=function(){return Fa(o.getContextNode(),p)},h=_a((0,e.useState)(f),2),m=h[0],y=h[1],v=_a((0,e.useState)(o.getContextNode()),2),b=v[0],g=v[1];(0,e.useEffect)((function(){var e=function(){var e=o.getContextNode();e.isLoaded()?g(e):e.observeOnce("loaded",(function(){return g(e)}))};return o.observe("context_changed",e),function(){o.stopObserving("context_changed",e)}})),(0,e.useEffect)((function(){y(f());var e=function(){y(Fa(b,p)),La()},t=function(){y(Fa(b,p)),window.dispatchEvent(new Event("resize")),La()};return b.observe("child_added",t),b.observe("child_removed",e),b.observe("child_replaced",t),function(){b.stopObserving("child_added",t),b.stopObserving("child_removed",e),b.stopObserving("child_replaced",t)}}),[b]),b.isLoaded()||(b.observeOnce("loaded",(function(){y(Fa(b,p))})),b.load());var S,w,k,O,P,E,C=(0,e.useRef)(null),T=(S=C,w=function(){var e=S.current;if(e){var t=getComputedStyle(e),n=parseFloat;return{width:e.clientWidth-n(t.paddingTop)-n(t.paddingBottom),height:e.clientHeight-n(t.paddingLeft)-n(t.paddingRight)}}return{width:0,height:0}},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(e,t):void 0}}(e,t)||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.")}()}(e.useState(w),2),O=k[0],P=k[1],E=function(){return P(w())},ai(window,"resize",E),ai(window,"orientationchange",E),ii((function(){P(w())}),[]),O),x=T.width,R=T.height,j=Ei(C),I=j.scrollTop,_=j.isScrolling;(0,e.useEffect)((function(){La()}),[c.marginLeft]),d&&(0,e.useEffect)((function(){d({scrollTop:I})}),[I]);var A=function(t){var n=t.width,r=t.columnWidth,o=void 0===r?200:r,i=t.columnGutter,a=void 0===i?0:i,s=t.columnCount,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ni,l=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}(e,t)||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.")}()}(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3?arguments[3]:void 0;return r=r||Math.floor(e/(t+n))||1,[Math.floor((e-n*(r-1))/r),r]}(n,o,a,s),2),t=e[0],r=e[1];return Ai(r,t,a)},u=e.useRef();void 0===u.current&&(u.current=l());var d=e.useRef(c),p=[n,o,a,s],f=e.useRef(p),h=!p.every((function(e,t){return f.current[t]===e}));if(h||!c.every((function(e,t){return d.current[t]===e}))){var m=u.current,y=l();if(d.current=c,f.current=p,h)for(var v=m.size(),b=0;b0?i[o-1]:null,next:o1&&t().createElement(bs,{node:o,dataModel:i,depth:f+1,offsetSize:m,paddingOffset:h}),F))}}),vs=ys;w()&&(vs=w().flow(w().DragSource(p.NODE_PROVIDER,v,f),w().DropTarget(p.NODE_PROVIDER,b,h))(ys));var bs=function(e){is(r,e);var n=ss(r);function r(){return ns(this,r),n.apply(this,arguments)}return os(r,[{key:"goTo",value:function(e){var t=this.props,n=t.dataModel,r=t.node;r.getMetadata().get("paginationData").set("new_page",e),n.requireContextChange(r)}},{key:"render",value:function(){var e=this,n=this.props,r=n.node,o=n.depth,i=n.paddingOffset,a=n.offsetSize,s={style:{width:24,height:24,padding:0}},c=r.getMetadata().get("paginationData"),l=c.get("current"),u=c.get("total"),d=Z().getMessages()[331]+" "+l+" / "+u;return t().createElement("li",null,t().createElement("div",{style:{paddingLeft:i+o*a+5,paddingTop:5,paddingBottom:5,display:"flex",alignItems:"center"}},t().createElement("div",{style:{paddingLeft:14,paddingRight:6},className:"mdi mdi-format-list-bulleted"}),t().createElement("div",{style:{display:"flex",alignItems:"center",borderRadius:3,marginRight:10}},t().createElement(g.IconButton,ts({iconClassName:"mdi mdi-chevron-left",onClick:function(){e.goTo(l-1)},disabled:1===l},s)),t().createElement("div",{style:{padding:"0 20px",flex:1,textAlign:"center",fontSize:13}},d),t().createElement(g.IconButton,ts({iconClassName:"mdi mdi-chevron-right",onClick:function(){e.goTo(l+1)},disabled:l===u},s)))))}}]),r}(t().Component);bs=(0,K.muiThemeable)()(bs);var gs=function(e){is(r,e);var n=ss(r);function r(){var e;ns(this,r);for(var t=arguments.length,o=new Array(t),i=0;i0&&t().createElement(g.IconMenu,{anchorOrigin:{vertical:"top",horizontal:d?"right":"left"},targetOrigin:{vertical:"top",horizontal:d?"right":"left"},iconButtonElement:t().createElement(g.IconButton,{style:w.button.style,iconStyle:w.button.iconStyle,iconClassName:"mdi mdi-dots-vertical"})},s),r&&t().createElement(g.IconButton,{style:oc(oc({},w.button.style),{},{backgroundColor:l.palette.mui3["surface-variant"],borderRadius:"50%"}),iconStyle:w.button.iconStyle,iconClassName:"mdi mdi-close",onClick:r})),!d&&t().createElement("div",{style:w.title},n)),t().createElement("div",{style:oc({paddingTop:12,paddingBottom:8,position:"relative"},w.childrenContainer)},!m&&o&&!d&&t().createElement(g.FloatingActionButton,{onClick:o,backgroundColor:l.palette.mui3.tertiary,mini:!0,style:{position:"absolute",top:-20,left:10}},t().createElement(g.FontIcon,{className:"mdi mdi-pencil",style:{color:l.palette.mui3["on-tertiary"]}})),c),(o||i)&&!d&&m&&t().createElement("div",{style:{padding:"12px 0",margin:"0 20px",display:"flex",borderTop:"1px solid "+l.palette.mui3["outline-variant"]}},t().createElement("span",{style:{flex:1}}),i&&t().createElement(g.FlatButton,{label:f,onClick:function(){return i()}}),o&&t().createElement(g.RaisedButton,{style:{marginLeft:5},label:p,onClick:function(){return o()}})))}}]),r}(t().Component);function mc(e){return mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mc(e)}function yc(e,t){for(var n=0;n90?s="#e53935":a>60&&(s="#ff9800");var c=Z().getMessages()["workspace.quota-usage"]+" ("+me().roundFileSize(i)+")",l=t().createElement("div",{style:{display:"flex",maxWidth:200,alignItems:"center",marginTop:5}},t().createElement("div",{style:{flex:1,paddingRight:12}},t().createElement(g.LinearProgress,{mode:"determinate",min:0,max:i,value:o,color:s})),t().createElement("div",{style:{color:"#bdbdbd",fontWeight:500,fontSize:15}},a,"%"));return r?t().createElement(pc,{legend:c,data:l}):t().createElement(fc,{iconClassName:"mdi mdi-gauge",legend:c,data:l,iconStyle:{marginTop:30}})}}])&&yc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function wc(e){return wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wc(e)}var kc=["style","titleStyle","iconStyleRight","iconStyleLeft"];function Oc(){return Oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=LangUtils.computeStringSlug(e.title);t&&(n+="-"+Math.round(100*Math.random()+10));var r=!1;return this._cards.map(function(e){e.id==n&&(r=!0)}.bind(this)),r&&(n=this.createCardId(e,!0)),n}},{key:"addCard",value:function(e){e.id=this.createCardId(e),this.setCards(this._cards.concat([e]))}}],n&&Fc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}();function qc(e){return qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qc(e)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=[],n=[];return this.props.namespaces.map((function(e){if(a.g[e]){for(var r in a.g[e])if(a.g[e].hasOwnProperty(r)){var o=a.g[e][r];o.hasBuilderFields&&o.hasBuilderFields()&&t.push({reactClass:o,fullName:e+"."+o.displayName})}}else n.push(e)})),n.length&&!e&&ResourcesManager.loadClassesAndApply(n,function(){this.setState({availableWidgets:this.listAvailableWidgets(!0)})}.bind(this)),t}},{key:"onDropDownChange",value:function(e,t,n){var r={};0!=t&&n.payload.reactClass.getBuilderFields().map((function(e){e.default&&(r[e.name]=e.default)})),this.props.onEditStatusChange&&this.props.onEditStatusChange(0!=t),this.setState({selectedIndex:t,selectedWidget:n.payload,currentFormValues:r})}},{key:"cancel",value:function(){this.props.onEditStatusChange&&this.props.onEditStatusChange(!1),this.setState({selectedIndex:0})}},{key:"onFormValueChange",value:function(e){this.setState({currentFormValues:e})}},{key:"onFormSubmit",value:function(){var e=this.state.currentFormValues,t=this.state.selectedWidget,n=e.title?e.title:e.legend;n||(n=this.state.selectedWidget.reactClass.builderDisplayName),this.props.onCreateCard({componentClass:t.fullName,title:n,props:e}),this.cancel()}},{key:"resetLayout",value:function(){window.confirm(this.props.getMessage("home.51"))&&this.props.onResetLayout()}},{key:"render",value:function(){var e,t,n=this.props.getMessage,r=([{payload:0,text:n("home.50")}].concat(this.state.availableWidgets.map((function(e,t){return{payload:e,text:e.reactClass.builderDisplayName}}))),Yc.createElement("div",null,"DropDownMenu (to be re-implemented)"));if(0!==this.state.selectedIndex){var o=this.state.selectedWidget.reactClass.getBuilderFields(),i={};o.map((function(e){e.default&&(i[e.name]=e.default)})),this.state.currentFormValues&&(i=LangUtils.mergeObjectsRecursive(i,this.state.currentFormValues)),e=Yc.createElement(el,{namespace:"PydioForm",componentName:"FormPanel",parameters:o,depth:-1,values:i,onChange:this.onFormValueChange}),t=Yc.createElement("div",{style:{textAlign:"center",paddingBottom:100}},Yc.createElement(g.RaisedButton,{label:n("home.52"),onClick:this.onFormSubmit})," ",Yc.createElement(g.RaisedButton,{label:n("54",""),onClick:this.cancel}))}return Yc.createElement(g.Paper,$c({},this.props,{zDepth:3}),Yc.createElement("h3",null,n("home.53")),Yc.createElement("div",{className:"legend"},n("home.54"),Yc.createElement("br",null),n("home.55")),r,e,t,Yc.createElement("div",{style:{position:"absolute",bottom:30,left:10}},Yc.createElement(g.FlatButton,{disabled:0!=this.state.selectedIndex,label:n("home.56"),secondary:!0,onClick:this.resetLayout})))}}],n&&Vc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(Yc.Component);function nl(e){return nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nl(e)}function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"ajxp_admin";return t.props.getMessage(e,n)}}));var r=this.props.rglStyle||{};return ml.createElement("div",{style:ol(ol({},this.props.style),{},{width:"100%",flex:"1"}),className:this.state.editMode?"builder-open":""},!this.props.disableEdit&&ml.createElement("div",{style:{position:"absolute",bottom:30,right:18,zIndex:11}},ml.createElement(g.FloatingActionButton,{tooltip:this.props.getMessage("home.49"),onClick:this.toggleEditMode.bind(this),iconClassName:this.state.editMode?"mdi mdi-check":"mdi mdi-pencil",mini:this.state.editMode,disabled:this.state.editMode&&this.state.widgetEditing})),e,ml.createElement("div",{className:"home-dashboard",style:{height:"100%"}},ml.createElement(vl,{disableDrag:this.props.disableDrag,cols:this.props.cols,store:this.state.store,style:r,pydio:this.props.pydio,editMode:this.state.editMode,removeCard:this.removeCard.bind(this)})))}}]),n}(ml.Component);function gl(e){return gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gl(e)}function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e?this.setState({showCloseAction:!(this.state&&this.state.showCloseAction)}):this.setState({showCloseAction:e})},getCloseButton:function(){if(this.state&&this.state.showCloseAction){var e=this.props.onCloseAction||function(){};return React.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(0,0,0,0.53)",zIndex:10,top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center"}},React.createElement(g.FlatButton,{label:Z().getInstance().MessageHash["ajxp_admin.home.48"],className:"card-close-button",onClick:e,style:{color:"white"}}))}return null},statics:{getGridLayout:function(e,t){return{x:e||0,y:t||0,w:this.gridWidth||4,h:this.gridHeight||12,isResizable:!1}},hasBuilderFields:function(){return!!this.builderFields},getBuilderFields:function(){return this.builderFields}}};function Pl(e){return Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pl(e)}function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props={pydio:t,cellModel:n,acl:r,addressBookItem:o}}var t,n;return t=e,n=[{key:"createCell",value:function(){var e,t=this.props,n=t.addressBookItem,r=t.pydio,o=r.MessageHash;n.IdmUser?e=n.IdmUser:n.IdmRole&&(e=n.IdmRole),e&&r.user.getIdmUser().then((function(t){var i=su().extractLabelFromIdmObject(t),a=su().extractLabelFromIdmObject(n.IdmUser||n.IdmRole),s=new(lu());s.setLabel(i+", "+a),s.setDescription("Created by "+i),s.addUser(e),s.save().then((function(e){r.UI.displayMessage("SUCCESS",o[643].replace("%s",a))})).catch((function(e){r.UI.displayMessage("ERROR",o[644].replace("%s",e.message))}))}))}},{key:"addToCell",value:function(){var e,t=this.props,n=t.addressBookItem,r=t.cellModel;n.IdmUser?e=n.IdmUser:n.IdmRole&&(e=n.IdmRole),e&&(r.addUser(e),r.save())}},{key:"removeFromCell",value:function(){var e=this.props,t=e.acl,n=e.cellModel;n.removeUser(t.RoleId),n.save()}},{key:"renderItems",value:function(){var e,t,n,r=this.props,o=r.pydio,i=r.cellModel,a=r.acl,s=r.addressBookItem,c=o.MessageHash,l=[];if(a?a.User&&a.User.Login===o.user.id:"user"===t&&o.user.id===e)return l;if(s&&(e=s.id,"group"===(t=s.type)&&s.IdmRole&&(e=s.IdmRole.Uuid,t="team")),n=a?su().extractLabel(o,a):s.label,!0===i)return o.getPluginConfigs("auth").get("USER_CREATE_CELLS")?[React.createElement(g.MenuItem,{primaryText:c[640].replace("%s",n),onClick:this.createCell.bind(this)})]:[];var u,d=i.isEditable(),p=i.getAcls();return Object.keys(p).map((function(n){var r=p[n];(a?a.RoleId===r.RoleId:"user"===t&&r.User&&r.User.Login===e||"group"===t&&r.Group&&r.Group.Uuid===e||"team"===t&&r.Role&&r.Role.Uuid===e)&&(u=!0)})),u?l.push(React.createElement(g.MenuItem,{primaryText:c[641],disabled:!d,onClick:this.removeFromCell.bind(this)})):l.push(React.createElement(g.MenuItem,{primaryText:c[642],disabled:!d,onClick:this.addToCell.bind(this)})),o.getPluginConfigs("auth").get("USER_CREATE_CELLS")&&l.push(React.createElement(g.Divider,null),React.createElement(g.MenuItem,{primaryText:c[640].replace("%s",n),onClick:this.createCell.bind(this)})),l}}],n&&du(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const hu=fu,mu={list:{},listItem:{style:{fontSize:13},innerDivStyle:{padding:"10px 56px 10px 62px"}},avatar:{avatarSize:26,style:{top:5}},iconMenu:{style:{top:4,right:8}},iconButton:{style:{width:26,height:26,padding:5,right:8},iconStyle:{color:"rgba(0,0,0,.33)",fontSize:20}},divider:{style:{marginLeft:62}},className:"compact"},yu=require("pydio/lang/observable");var vu=a.n(yu);function bu(e){return bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(e)}function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Su(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=e.childrenLoader,r=e.itemsLoader,o=e.leafLoaded,i=e.collectionsLoaded,a=e.leafs,s=e.collections,c=t?r:n,l=t?o:i;return new Promise((function(n,r){!l&&c?c(e,(function(r){t?(e.leafs=r,e.leafLoaded=!0):(e.collections=r,e.collectionsLoaded=!0),n(r)})):n((t?a:s)||[])}))}},{key:"computePagination",value:function(e){var t;return e.Users?t=e.Users.length:e.Groups?t=e.Groups.length:e.Teams&&(t=e.Teams.length),e.Total>t?{start:e.Offset,end:e.Offset+e.Limit,max:e.Total,interval:e.Limit}:null}},{key:"prepareIdmUser",value:function(e){var t;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var n=[];n.push(Z().getMessages()[e.Attributes&&"shared"===e.Attributes.profile?"589":"590"]),"/"!==e.GroupPath&&n.push(e.GroupPath),t=n.join(" - ")}return{id:e.Login,label:e.Attributes&&e.Attributes.displayName?e.Attributes.displayName:e.Login,avatar:e.Attributes&&e.Attributes.avatar?e.Attributes.avatar:void 0,type:"user",IdmUser:e,secondaryText:t}}},{key:"prepareIdmGroup",value:function(e){var t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(t=e.GroupPath+e.GroupLabel),{id:e.Uuid,label:e.Attributes&&e.Attributes.displayName?e.Attributes.displayName:e.GroupLabel,type:"group",icon:"mdi mdi-account-multiple",secondaryText:t,IdmUser:e}}},{key:"prepareTeam",value:function(t){var n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(n=Z().getMessages()[603]),{id:t.Uuid,label:t.Label,type:"team",icon:"mdi mdi-account-multiple-outline",itemsLoader:e.loadTeamUsers,_notSelectable:!0,secondaryText:n,IdmRole:t}}},{key:"loadTeams",value:function(t,n){var r=0,o=50;if(t.range){var i=ku(t.range.split("-"),2),a=i[0],s=i[1];r=parseInt(a),o=(s=parseInt(s))-r}var c={};Z().getInstance().getController().actions.has("user_team_create")&&(c={type:"team",remove:"574",multiple:!0}),Cu.listTeams("",r,o).then((function(r){t.pagination=e.computePagination(r);var o=r.Teams.map((function(n){return Su(Su({_parent:t},e.prepareTeam(n)),{},{actions:c})}));n(o)}))}},{key:"loadGroups",value:function(t,n){var r="/",o="";t.IdmUser&&(r=J().trimRight(t.IdmUser.GroupPath,"/")+"/"+t.IdmUser.GroupLabel),t.currentParams&&t.currentParams.has_search&&(o=t.currentParams.value),Cu.listGroups(r,o,!1,0,1e3).then((function(r){var o=r.Groups.map((function(n){return Su(Su({_parent:t},e.prepareIdmGroup(n)),{},{childrenLoader:t.childrenLoader?e.loadGroups:null,itemsLoader:t.itemsLoader?e.loadGroupUsers:null,currentParams:t.currentParams&&t.currentParams.alpha_pages?Su({},t.currentParams):{}})}));n(o)}))}},{key:"loadExternalUsers",value:function(t,n){var r="",o=0,i=50;if(t.currentParams&&t.currentParams.alpha_pages&&(r=t.currentParams.value),t.range){var a=ku(t.range.split("-"),2),s=a[0],c=a[1];o=parseInt(s),i=(c=parseInt(c))-o}var l=xr().getClient().getPydioObject();Cu.listUsers("/",r,!0,o,i,"shared").then((function(r){t.pagination=e.computePagination(r);var o=r.Users.filter((function(e){return e.Login!==l.user.id})).map((function(n){return Su(Su({_parent:t},e.prepareIdmUser(n)),{},{external:!0})}));n(o)}))}},{key:"loadGroupUsers",value:function(t,n){var r="/",o="",i=0,a=50;if(t.IdmUser&&(r=J().trimRight(t.IdmUser.GroupPath,"/")+"/"+t.IdmUser.GroupLabel),t.currentParams&&(t.currentParams.alpha_pages||t.currentParams.has_search)&&(o=t.currentParams.value),t.range){var s=ku(t.range.split("-"),2),c=s[0],l=s[1];i=parseInt(c),a=(l=parseInt(l))-i}var u=xr().getClient().getPydioObject();Cu.listUsers(r,o,!1,i,a,"!shared").then((function(r){t.pagination=e.computePagination(r);var o=r.Users.filter((function(e){return e.Login!==u.user.id&&"pydio.anon.user"!==e.Login})).map((function(n){return Su({_parent:t},e.prepareIdmUser(n))}));n(o)}))}},{key:"loadTeamUsers",value:function(t,n){var r=0,o=50,i="";if(t.range){var a=ku(t.range.split("-"),2),s=a[0],c=a[1];r=parseInt(s),o=(c=parseInt(c))-r}t.currentParams&&(t.currentParams.alpha_pages||t.currentParams.has_search)&&(i=t.currentParams.value),Cu.listUsersWithRole(t.IdmRole.Uuid,r,o,i).then((function(r){t.pagination=e.computePagination(r);var o=r.Users.map((function(n){return Su({_parent:t},e.prepareIdmUser(n))}));n(o)}))}},{key:"globalSearch",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];t="*"+t;var c=xr().getClient().getPydioObject(),l=[];if(i||a){var u=i?a?"":"shared":"!shared",d=Cu.listUsers("/",t,!0,r,o,u).then((function(t){return t.Users.filter((function(e){return e.Login!==c.user.id&&"pydio.anon.user"!==e.Login})).map((function(t){return Su(Su({},e.prepareIdmUser(t,!0)),{},{external:t.Attributes&&"shared"===t.Attributes.profile})}))})).then((function(e){return{users:e}}));l.push(d);var p=Cu.listGroups("/",t,!0,r,o).then((function(t){return t.Groups.map((function(t){return Su(Su({},e.prepareIdmGroup(t,!0)),{},{childrenLoader:e.loadGroups,itemsLoader:e.loadGroupUsers})}))})).then((function(e){return{groups:e}}));l.push(p)}if(s){var f=Cu.listTeams(t,r,o).then((function(t){return t.Teams.map((function(t){return Su({},e.prepareTeam(t,!0))}))})).then((function(e){return{teams:e}}));l.push(f)}return Promise.all(l).then((function(e){var t=e.reduce((function(e,t){return Su(Su({},e),t)}),{});return n(t),t}))}}],null&&Pu(t.prototype,null),n&&Pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),xu=a(2702);function Ru(e){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(e)}function ju(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"local",s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),Uu(Du(n=i.call(this)),"pydio",null),Uu(Du(n),"mode","book"),Uu(Du(n),"teamsOnly",!1),Uu(Du(n),"usersOnly",!1),Uu(Du(n),"usersFrom","local"),Uu(Du(n),"loading",!1),Uu(Du(n),"root",null),Uu(Du(n),"selectedItem",null),Uu(Du(n),"rightPanelItem",null),Uu(Du(n),"onItemSelected",null),Uu(Du(n),"pendingCreateItem",null),Uu(Du(n),"searchTerm",""),Uu(Du(n),"searchMode",!1),Uu(Du(n),"searchItem",null),Uu(Du(n),"selectionMode",!1),Uu(Du(n),"multipleSelection",[]),Uu(Du(n),"reloadCurrentAtPage",(function(e){var t=n.selectedItem;t.leafLoaded=!1,t.collectionsLoaded=!1,-1===e?t.currentParams=null:-1!==e.indexOf("-")?t.range=e:(t.range=null,t.currentParams={alpha_pages:"true",value:e}),n.setContext(t)})),Uu(Du(n),"reloadCurrentWithSearch",(function(e){if(e){var t=n.selectedItem;t.leafLoaded=!1,t.collectionsLoaded=!1,t.currentParams={has_search:!0,value:e,existing_only:!0},n.setContext(t)}else n.reloadCurrentAtPage(-1)})),Uu(Du(n),"deleteItems",(function(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||confirm(n.m(278)))switch(e.actions.type){case"users":Promise.all(t.map((function(e){return n.rightPanelItem===e&&(n.rightPanelItem=null),xr().getRestClient().getIdmApi().deleteIdmUser(e.IdmUser)}))).then((function(){n.reloadContext()}));break;case"teams":Promise.all(t.map((function(e){return n.rightPanelItem===e&&(n.rightPanelItem=null),xr().getRestClient().getIdmApi().deleteRole(e.IdmRole.Uuid)}))).then((function(){n.reloadContext()}));break;case"team":Promise.all(t.map((function(t){return xr().getRestClient().getIdmApi().removeUserFromTeam(e.IdmRole.Uuid,t.IdmUser.Login)}))).then((function(){n.reloadContext()}))}})),n.pydio=e,n.mode=t,n.teamsOnly=s,n.usersOnly=r,n.usersFrom=o,n.onItemSelected=c;var l=n.pydio.getPluginConfigs("core.auth");return n._teamsEditable=n.pydio.getController().actions.has("user_team_create"),n._externalsAllowed=l.get("USER_CREATE_USERS"),n}return t=a,n=[{key:"getRoot",value:function(){return this.searchMode&&this.searchItem?this.searchItem:this.root}},{key:"contextItem",value:function(){return this.selectedItem}},{key:"setContext",value:function(e,t){var n=this;return"selector"===this.mode&&e.IdmRole&&e.IdmRole.IsTeam?(this.leafItemClicked(e),Promise.resolve()):(this.loading=!0,this.notify("update"),Tu.childrenAsPromise(e,!1).then((function(){Tu.childrenAsPromise(e,!0).then((function(){n.selectedItem=e,n.loading=!1,n.notify("update")})).then((function(){t&&t()}))})))}},{key:"contextIsGroup",value:function(){return this.selectedItem&&(this.selectedItem.IdmUser&&this.selectedItem.IdmUser.IsGroup||"PYDIO_GRP_/"===this.selectedItem.id)}},{key:"contextIsTeam",value:function(){return this.selectedItem&&this.selectedItem.IdmRole&&this.selectedItem.IdmRole.IsTeam}},{key:"reloadContext",value:function(){var e=this;return this.selectedItem?(this.selectedItem.leafLoaded=!1,this.selectedItem.collectionsLoaded=!1,this.setContext(this.selectedItem,(function(){if(e.rightPanelItem){var t=e.rightPanelItem.id,n=null,r=e.selectedItem.leafs||[],o=e.selectedItem.collections||[];[].concat(_u(r),_u(o)).forEach((function(e){e.id===t&&(n=e)})),e.rightPanelItem=n,e.notify("update")}}))):Promise.resolve}},{key:"setGlobalSearch",value:function(e,t){var n=this;e!==this.searchMode&&(e?(this.searchItem||(this.searchItem={id:"search",label:this.m("583"),type:"root"}),this.savedContext=this.contextItem(),this.searchItem.collections=[],this.setContext(this.searchItem)):(this.searchItem.collections=[],this.setContext(this.savedContext))),this.searchMode=e,this.searchTerm=t,this.searchTerm&&Fu(t,(function(e){n.searchItem.collections=[];var t,r,o=n.prepareTopFolders(n.searchItem);e.users&&(t=e.users.filter((function(e){return e.external})),r=e.users.filter((function(e){return!e.external}))),void 0!==t&&n.searchItem.collections.push(Iu(Iu({},o.shared),{},{leafs:t})),e.teams&&n.searchItem.collections.push(Iu(Iu({},o.teams),{},{collections:e.teams})),(void 0!==r||e.groups)&&(r&&r.length,e.groups&&e.groups.length,n.searchItem.collections.push(Iu(Iu({},o.directory),{},{collections:e.groups,leafs:r})));var i=Iu({},o.results);n.searchItem.collections.forEach((function(e){var t,n;(t=i.collections).push.apply(t,_u(e.collections.map((function(t){return t._parent=e,Iu(Iu({},t),{},{_parent:i})})))),(n=i.leafs).push.apply(n,_u(e.leafs.map((function(t){return t._parent=e,Iu(Iu({},t),{},{_parent:i})})))),e.notExpandable=!0,e.label+=" (".concat(e.collections.length+e.leafs.length,")")})),i.label+=" (".concat(i.collections.length+i.leafs.length,")"),n.searchItem.collections.unshift(i),n.setContext(i),n.notify("update")}),0,50,this._externalsAllowed),this.notify("update")}},{key:"getSearchStatus",value:function(){return{searchMode:this.searchMode,searchTerm:this.searchTerm}}},{key:"rightItem",value:function(){return this.rightPanelItem}},{key:"leafItemClicked",value:function(e){if(this.onItemSelected){var t=new xu.User(e.id,e.label,e.type,e.group,e.avatar,e.temporary,e.external);return e.trusted_server_id&&(t.trustedServerId=e.trusted_server_id,t.trustedServerLabel=e.trusted_server_label),t._uuid=e.uuid,e.IdmUser&&(t.IdmUser=e.IdmUser),e.IdmRole&&(t.IdmRole=e.IdmRole),void this.onItemSelected(t)}this.rightPanelItem=e,this.notify("update")}},{key:"clearRightItem",value:function(){this.rightPanelItem=null,this.notify("update")}},{key:"teamsEditable",value:function(){return this._teamsEditable}},{key:"deleteMultipleSelection",value:function(){this.selectionMode=!1,this.deleteItems(this.selectedItem,this.multipleSelection)}},{key:"setCreateItem",value:function(){this.pendingCreateItem=this.selectedItem,this.notify("update")}},{key:"clearCreateItem",value:function(){this.pendingCreateItem=null,this.notify("update")}},{key:"createItem",value:function(){return this.pendingCreateItem}},{key:"setSelectionMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.selectionMode=void 0===e?!this.selectionMode:e,this.multipleSelection=[],this.notify("update")}},{key:"getSelectionMode",value:function(){return this.selectionMode}},{key:"setMultipleSelection",value:function(e){this.multipleSelection=e,this.notify("update")}},{key:"getMultipleSelection",value:function(){return this.multipleSelection}},{key:"initTree",value:function(){var e={};if(this._teamsEditable&&(e={type:"teams",create:"+ "+this.m(569),remove:this.m(570),multiple:!0}),this.teamsOnly)return this.root=Iu(Iu({},this.prepareTopFolders(null).teams),{},{childrenLoader:Tu.loadTeams,actions:e}),void(this.selectedItem=this.root);this.root={id:"root",label:this.m(592),type:"root",collections:[]};var t=this.prepareTopFolders(this.root);"remote"!==this.usersFrom&&(this._externalsAllowed&&this.root.collections.push(Iu(Iu({},t.shared),{},{itemsLoader:Tu.loadExternalUsers,actions:{type:"users",create:"+ "+this.m(484),remove:this.m(582),multiple:!0}})),this.usersOnly||this.root.collections.push(Iu(Iu({},t.teams),{},{childrenLoader:Tu.loadTeams,actions:e})),this.root.collections.push(Iu(Iu({},t.directory),{},{childrenLoader:Tu.loadGroups,itemsLoader:Tu.loadGroupUsers}))),this.selectedItem="selector"===this.mode?this.root:this.root.collections[0]}},{key:"prepareTopFolders",value:function(e){return{shared:{id:"ext",label:this.m(593),icon:"mdi mdi-account-network",_parent:e,_notSelectable:!0,collections:[],leafs:[]},teams:{id:"teams",label:this.m(568),icon:"mdi mdi-account-multiple",_parent:e,_notSelectable:!0,collections:[],leafs:[]},directory:{id:"PYDIO_GRP_/",label:this.m(584),icon:"mdi mdi-account-box",_parent:e,_notSelectable:!0,collections:[],leafs:[]},results:{id:"results",label:this.m("599-a"),icon:"mdi mdi-magnify",_parent:e,notExpandable:!0,collections:[],leafs:[]}}}},{key:"m",value:function(e){return this.pydio.MessageHash[e]||e}}],n&&Mu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(vu());const Wu=zu;function Zu(e){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zu(e)}function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qu(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1?(c=function(t){t.stopPropagation(),h.setContext(e)},"selector"!==o||e._notSelectable||this.props.usersOnly||(a=t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-account-multiple-plus",tooltip:u("addressbook.pick.group"),tooltipPosition:"top-left",iconStyle:{color:"rgba(0,0,0,0.33)"},onClick:function(){i.props.onItemClicked(e)}},b.iconButton)))):"inner"===o&&this.props.onDeleteAction&&(a=t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-delete",tooltip:u(257),tooltipPosition:"top-left",iconStyle:{color:"rgba(0,0,0,0.13)",hoverColor:"rgba(0,0,0,0.53)"},onClick:function(){i.props.onDeleteAction(i.props.item,[e])}},b.iconButton))),d&&this.props.actionsForCell&&e.type){var l=new hu(n,this.props.actionsForCell,null,e).renderItems();a=l.length?t().createElement(g.IconMenu,Ju({},b.iconMenu,{iconButtonElement:t().createElement(g.IconButton,Ju({iconClassName:"mdi mdi-dots-vertical",iconStyle:{color:"rgba(0,0,0,.33)"}},b.iconButton)),targetOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},desktop:!0}),l):null}var p,f={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};e.secondaryText&&(f.fontWeight=500,p=t().createElement("span",{style:{fontSize:13,color:"var(--md-sys-color-on-surface-variant)"}},e.secondaryText)),A.push(t().createElement(g.ListItem,Ju({key:e.id,primaryText:t().createElement("div",{style:f},e.label),secondaryText:p,onClick:c,disabled:"inner"===o,leftAvatar:!y&&s,rightIconButton:a,leftCheckbox:y&&t().createElement(g.Checkbox,{checked:m.indexOf(e)>-1,onCheck:function(t,n){if(n)h.setMultipleSelection([].concat(Vu(m),[e]));else{var r=[].concat(Vu(m.slice(0,m.indexOf(e))),Vu(m.slice(m.indexOf(e)+1)));h.setMultipleSelection(r)}}})},b.listItem))),"inner"!==o&&r<_-1&&A.push(t().createElement(g.Divider,Ju({inset:!0,key:e.id+"-divider"},b.divider)))}}.bind(this)),!A.length){var M={style:{backgroundColor:"transparent",minHeight:300},iconClassName:"mdi mdi-account-off",primaryTextId:S||u(629),secondaryTextId:"book"===o&&w||null};"book"===o&&r.actions&&r.actions.create&&(M=qu(qu({},M),{},{actionLabelId:u(r.actions.create),actionCallback:function(){return h.setCreateItem()}})),"compact"===O&&(M=qu(qu({},M),{},{style:{backgroundColor:"transparent",minHeight:150},iconStyle:{fontSize:40},legendStyle:{fontSize:13}})),j=t().createElement(po,M)}return t().createElement("div",{style:qu({flex:1,flexDirection:"column",display:"flex",width:"100%",overflowX:"hidden"},f),onClick:this.props.onClick,className:O},p,!j&&!i&&t().createElement(g.List,{style:{flex:1,overflowY:"inner"!==o?"auto":"initial"}},this.props.subHeader&&t().createElement(g.Subheader,null,this.props.subHeader),A),i&&t().createElement(td,{style:{flex:1}}),!i&&j,"selector"===o&&s&&d&&t().createElement(iu,{searchLabel:c,onSearch:l,style:{padding:"0 20px",minWidth:null},underlineShow:!1}))}}],r&&Ku(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function od(e){return od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},od(e)}function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Td(e){for(var t=1;tO&&(V.split(" ").length>1?(N=V,V=V.split(" ").map((function(e){return e[0]})).join("")):V.split("@").length>1&&(N=V,V=V.split("@")[0].split(".").length>1?V.split("@")[0].split(".").map((function(e){return e[0]})).join(""):V.split("@")[0])),_&&(j=!0,I=!0,C=!0),j&&!o&&V&&(!C||I)){var K,Y=A.palette.avatarsColor;switch("group"!==p&&"team"!==p&&0!==d.indexOf("PYDIO_GRP_/")&&0!==d.indexOf("/USER_TEAM/")||(Y=Md(Y).darken(.2).toString()),p){case"group":K="mdi mdi-account-multiple",D="289",F="folder-avatar";break;case"team":K="mdi mdi-account-multiple-outline",D="603",F="folder-avatar";break;case"remote":K="mdi mdi-account-network",D="604",F="folder-avatar";break;default:K="mdi mdi-account",r?r.getExternal()?(D="589",r.isPublic()&&(D="589",V=u.MessageHash.public_link_user,K="mdi mdi-link")):D="590":D="288"}f&&(K=f),D&&(D=u.MessageHash[D]),_?(B=t().createElement(Dd,{className:K,style:{color:Y}}),U="#f5f5f5"):(U=Y,K&&!y?B=t().createElement(Dd,{className:K}):(L=V.split(" ").map((function(e){return e[0]})).join("").substring(0,2)).length<2&&(L=V.substring(0,2)))}if(_){j=!0,h=Td(Td({},h),{},{flexDirection:"column"}),void 0===b&&(b=50),v=Td({position:"absolute",right:16,top:12},v);var Q=function(){zd.getInstance().deleteKey("user_public_data-graph",e.props.userId),e.loadPublicData(e.props.userId,e.props.idmUser)};z=function(){Q(),e.props.reloadAction&&e.props.reloadAction()},W=function(){Q(),e.props.onEditAction&&e.props.onEditAction()}}else if(a||G||J||!this.props.richOnHover){if(!a&&!G&&!J&&this.props.richOnClick){H=Ad(H=function(){e.lockedBySubPopover||e.setState({showPopover:!1})},350),q=function(t){e.setState({showPopover:!0,popoverAnchor:t.currentTarget}),H.cancel()};var X=function(t){e.setState({showPopover:!0}),H.cancel()},ee=this.props,te=(ee.style,Ed(ee,Od));$=t().createElement(Zd,{open:this.state.showPopover,anchorEl:this.state.popoverAnchor,onRequestClose:function(t){"clickAway"===t&&e.lockedBySubPopover||e.setState({showPopover:!1})},anchorOrigin:{horizontal:"left",vertical:"bottom"},targetOrigin:{horizontal:"left",vertical:"top"},useLayerForClickAway:!1},t().createElement(Ld,{zDepth:2,style:{width:220,height:320,overflowY:"auto"},onMouseOver:X,onMouseOut:H},t().createElement(s,Pd({},te,{richCard:!0,richOnHover:!1,cardSize:220,lockOnSubPopoverOpen:function(t){e.lockedBySubPopover=t,X()}}))))}}else{H=Ad(H=function(){e.lockedBySubPopover||e.setState({showPopover:!1})},350),Z=function(t){e.setState({showPopover:!0,popoverAnchor:t.currentTarget}),H.cancel()};var ne=function(t){e.setState({showPopover:!0}),H.cancel()},re=this.props,oe=(re.style,Ed(re,kd));$=t().createElement(Zd,{open:this.state.showPopover,anchorEl:this.state.popoverAnchor,onRequestClose:function(t){"clickAway"===t&&e.lockedBySubPopover||e.setState({showPopover:!1})},anchorOrigin:{horizontal:"left",vertical:"center"},targetOrigin:{horizontal:"right",vertical:"center"},useLayerForClickAway:!1},t().createElement(Ld,{zDepth:2,style:{width:220,height:320,overflowY:"auto"},onMouseOver:ne,onMouseOut:H},t().createElement(s,Pd({},oe,{richCard:!0,richOnHover:!1,cardSize:220,lockOnSubPopoverOpen:function(t){e.lockedBySubPopover=t,ne()}}))))}if(o){var ie=o;ie.indexOf("?")>=0?ie+="&dim="+b:ie+="?dim="+b,B=t().createElement(Dd,{style:{backgroundImage:"url("+ie+")",backgroundSize:"cover",margin:0,width:"100%",height:"100%",borderRadius:"50%",backgroundPosition:"center"}})}var ae,se=t().createElement(Ud,{icon:B,size:b,style:this.props.avatarOnly?this.props.style:v,backgroundColor:U,className:F||E},L);return this.props.avatarOnly?se:(_?se=t().createElement("div",{style:{textAlign:"center"}},se):G&&(V=u.MessageHash["user.unknown"]),C&&x&&(ae=t().createElement("span",{className:"mdi mdi-chevron-down",style:Td(Td({},R),{},{marginLeft:4,fontSize:"0.8em"})})),t().createElement("div",{className:k,style:h,onMouseOver:Z,onMouseOut:H,onClick:q},j&&(o||L||B)&&se,C&&!_&&t().createElement("div",{title:N,className:P,style:m},V),ae,C&&_&&t().createElement(Bd,{style:Td({textAlign:"center"},g),title:V,subtitle:D,titleStyle:Td({},S),subtitleStyle:Td({},w)}),_&&r&&this.props.actionsPanel,_&&i&&!M&&t().createElement(Sd,Pd({graph:i},this.props,{userLabel:V,reloadAction:z,onEditAction:W})),this.props.children,$))}}],r&&Rd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);Hd.propTypes={userId:z().string.isRequired,pydio:z().instanceOf(Z()),userLabel:z().string,userType:z().oneOf(["user","group","remote","team"]),icon:z().string,richCard:z().bool,richOnHover:z().bool,richOnClick:z().bool,userEditable:z().bool,onEditAction:z().func,onDeleteAction:z().func,reloadAction:z().func,displayLabel:z().bool,displayLocalLabel:z().bool,displayAvatar:z().bool,avatarOnly:z().bool,useDefaultAvatar:z().bool,avatarSize:z().number,avatarLetters:z().bool,noActionsPanel:z().bool,className:z().string,labelClassName:z().string,avatarClassName:z().string,style:z().object,labelStyle:z().object,avatarStyle:z().object},Hd.defaultProps={displayLabel:!0,displayAvatar:!0,avatarSize:40,userType:"user",className:"user-avatar-widget",labelClassName:"user-label"},Hd=Fd()(Hd);var qd=a(7180),$d=a.n(qd);const Vd=require("pydio/util/pass");var Gd=a.n(Vd);const Jd=require("pydio/http/policies");var Kd=a.n(Jd);const Yd=require("cells-sdk");function Qd(e){return Qd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qd(e)}function Xd(e){return function(e){if(Array.isArray(e))return ep(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ep(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ep(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2],r=this.state,o=r.policies,i=r.dirtyPolicies,a=r.resourceUuid,s=r.diffPolicies,c=Xd(i||o),l=new Yd.ServiceResourcePolicy;l.Resource=a,l.Effect="allow",l.Subject=t,l.Action=e,c.push(l),s.add[e+"///"+t]=!0,s.remove[e+"///"+t]&&delete s.remove[e+"///"+t],n?this.setState({dirtyPolicies:c,diffPolicies:s,pickedUser:null,pickedLabel:null}):this.setState({dirtyPolicies:c,diffPolicies:s})}},{key:"hasOneWrite",value:function(e){var t=this.state.idmUser,n=t.Roles.map((function(e){return"role:"+e.Uuid}));n.push("user:"+t.Login);for(var r=0;r-1}));return r.length?r[0].Subject:n[0]}},{key:"listUserRoles",value:function(e){var t=this.state,n=t.hideGroups,r=t.idmUser,o=this.findCrtUserSubject(e),i=this.hasOneWrite(e),a={};r.Roles.map((function(e){e.GroupRole&&!n&&(a["role:"+e.Uuid]=e.Label)})),(a=np(np({},this.listOtherUsersSubjects(e,o)),a))[o]="You";for(var s=Object.keys(a),c=[],l=s.length-1;l>=0;l--){var u=s[l],d=a[u];c.push(this.renderLine(u,d,e,!i||u===o))}return{groupBlocks:c,hasWrite:i}}},{key:"listUserTeams",value:function(e,t,n){var r=this;return e.map((function(e){return r.renderLine("role:"+e.Uuid,e.Label,t,n)}))}},{key:"listOtherUsersSubjects",value:function(e,t){var n=this.props,r=n.resourceId,o=n.cellAcls,i=this.state.hideGroups,a={};return e.map((function(e){if(0===e.Subject.indexOf("user:")&&e.Subject!==t&&e.Subject!=="user:"+r&&(a[e.Subject]=e.Subject.substr(5)),o&&0===e.Subject.indexOf("role:")&&o[e.Subject.substr(5)]){var n=e.Subject.substr(5);if(o[n].User){var s=o[n].User;t!=="user:"+s.Login&&t!=="role:"+s.Uuid&&(a[e.Subject]=s.Attributes&&s.Attributes.displayName?s.Attributes.displayName:s.Login)}else if(o[n].Group&&!i){var c=o[n].Group;a[e.Subject]=c.Attributes&&c.Attributes.displayName?c.Attributes.displayName:c.GroupLabel}}})),a}},{key:"pickUser",value:function(e){var t,n;if(e.IdmUser){var r=e.IdmUser,o=r.Attributes||{};r.IsGroup?(t="role:"+r.Uuid,n=o.displayName||r.GroupLabel):(t="user:"+r.Login,n=o.displayName||r.Login)}else{var i=e.IdmRole;t="role:"+i.Uuid,n=i.Label}this.setState({pickedUser:t,pickedLabel:n})}},{key:"renderLine",value:function(e,n,r,o){var i=this,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.props,c=s.subjectsDisabled,l=s.subjectsHidden,u=s.readonly;if(l&&l[e])return null;var d=!1,p=!1,f=function(){i.addPolicy("READ",e,a)},h=function(){i.addPolicy("WRITE",e,a)};r.map((function(t){t.Subject===e&&("WRITE"===t.Action?(p="WRITE"===t.Action,h=function(){i.removePolicy("WRITE",e)}):"READ"===t.Action&&(d="READ"===t.Action,f=function(){i.removePolicy("READ",e)}))}));var m=o,y=o;return u?(y=!0,m=!0):(c&&c.READ&&c.READ[e]&&(y=!0),c&&c.WRITE&&c.WRITE[e]&&(m=!0)),t().createElement("div",{style:{display:"flex",margin:10,marginRight:0}},t().createElement("div",{style:{flex:1}},n),t().createElement(g.Checkbox,{checked:d,disabled:y,style:{width:40},onCheck:f}),t().createElement(g.Checkbox,{checked:p,disabled:m,style:{width:40},onCheck:h}))}},{key:"render",value:function(){var e=this,n=this.props.muiTheme,r=n.appBar,o=n.palette.mui3,i=void 0===o?{}:o,a={title:{paddingLeft:10,backgroundColor:r.color,display:"flex",alignItems:"center",fontSize:16,color:r.textColor},subheader:{margin:10,fontWeight:500,color:i["on-surface-variant"],display:"flex"},subject:{margin:10},head:{display:"inline-block",width:40,textAlign:"center",fontSize:10}},s=this.state,c=s.edit,l=s.policies,u=s.dirtyPolicies,d=s.error,p=s.idmUser,f=s.userTeams,h=s.loading,m=s.pickedUser,y=s.pickedLabel,v=this.props,b=v.onDismiss,S=v.style,w=v.skipTitle,k=v.resourceId,O=v.pydio,P=v.userListExcludes,E=void 0===P?[]:P,C=v.readonly,T=v.description,x=[],R=O.MessageHash;if(!c)return t().createElement("div",{style:S},!w&&t().createElement("div",{style:np(np({},a.title),{},{height:48})},t().createElement("span",{style:{flex:1}},R["visibility.panel.title"]),b&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-close",onClick:b,iconStyle:{color:r.textColor}})),t().createElement("div",{style:{padding:20,fontWeight:500,textAlign:"justify"}},t().createElement("div",{style:{paddingBottom:20}},T),t().createElement("div",{style:{textAlign:"center"}},t().createElement(g.RaisedButton,{label:R["visibility.panel.edit"],primary:!0,onClick:function(){e.setState({edit:!0})}}))));if(!h&&!d){var j=this.listUserRoles(u||l),I=j.groupBlocks,_=j.hasWrite,A=this.listUserTeams(f,u||l,!_),M=t().createElement("div",null,t().createElement("span",{style:a.head},R["visibility.panel.right-read"]),t().createElement("span",{style:a.head},R["visibility.panel.right-edit"]));if(I.length&&(x.push(t().createElement("div",{style:a.subheader},t().createElement("span",{style:{flex:1}},R["visibility.panel.list.users"]),M)),x.push(I),x.push(t().createElement(g.Divider,null))),A.length&&(x.push(t().createElement("div",{style:a.subheader},t().createElement("span",{style:{flex:1}},R["visibility.panel.list.teams"]),M)),x.push(A),x.push(t().createElement(g.Divider,null))),m)x.push(t().createElement("div",{style:a.subheader},R["visibility.panel.setvisible"])),x.push(this.renderLine(m,y,l,!1,!0)),x.push(t().createElement("div",{style:{textAlign:"right"}},t().createElement(g.FlatButton,{label:R[54],onClick:function(){e.setState({pickedUser:null,pickedLabel:null})}}))),x.push(t().createElement(g.Divider,null));else if(!C){var N="user:"+p.Login,D=this.listOtherUsersSubjects(u||l,N),L=[];Object.keys(D).map((function(e){L.push(D[e])})),x.push(t().createElement("div",{style:a.subheader},R["visibility.panel.setvisible"])),x.push(t().createElement("div",{style:{margin:"-10px 10px 0"}},t().createElement(tv,{className:"share-form-users",fieldLabel:R["visibility.panel.pickuser"],renderSuggestion:function(e){return t().createElement("div",{style:{fontSize:13}},e.getExtendedLabel())},onValueSelected:this.pickUser.bind(this),usersOnly:!1,existingOnly:!0,excludes:[k].concat(Xd(E),L),pydio:O,showAddressBook:!1,usersFrom:"local"}))),x.push(t().createElement(g.Divider,null))}x.pop()}return t().createElement("div",{style:S},t().createElement("div",{style:a.title},t().createElement("span",{style:{flex:1}},w?"":R["visibility.panel.title"]),u&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-undo-variant",tooltip:R["visibility.panel.revert"],onClick:this.revert.bind(this),iconStyle:{color:r.textColor}}),u&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-content-save",tooltip:R["visibility.panel.save"],onClick:this.save.bind(this),iconStyle:{color:r.textColor}}),!u&&b&&t().createElement(g.IconButton,{iconClassName:"mdi mdi-close",onClick:b,iconStyle:{color:r.textColor}})),d&&t().createElement("div",null,R["visibility.panel.error"],": ",d),t().createElement("div",null,x))}}],r&&op(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function lp(e){return lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lp(e)}function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(p,Rp)),h={};return"mui3"!==u.userTheme&&(h={borderTop:"1px solid #e0e0e0",borderBottom:"1px solid #e0e0e0"}),t().createElement("div",null,t().createElement("div",{style:{paddingBottom:4}},e,t().createElement(Tp,jp({},f,d,{style:_p({paddingLeft:8},h)}))),t().createElement(rd,{model:o,subHeader:s(575),onItemClicked:function(){},item:i,mode:"inner",onDeleteAction:a}))}}],r&&Mp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function Hp(e){return Hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hp(e)}function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $p(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=[],n=this.props.pydio,r=n.MessageHash,o=n.getPluginConfigs("action.share").get("SHARED_USERS_TMP_PREFIX");t.push({IdmUserField:"Login",description:r[533],readonly:e,expose:"true",label:r[522],name:e?"existing_user_id":"new_user_id",scope:"user",type:"valid-login",mandatory:!0,default:o||""},{IdmUserField:"Password",description:r[534],editable:"true",expose:"true",label:r[523],name:"new_password",scope:"user",type:"valid-password",mandatory:!0,direction:"column"});for(var i=n.getPluginConfigs("auth").get("NEWUSERS_EDIT_PARAMETERS").split(","),a=0;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=t.defaultTheme,r=t.defaultClassName,o=void 0===r?"MuiBox-root":r,i=t.generateClassName,a=(0,gh.ZP)("div",{shouldForwardProp:function(e){return"theme"!==e&&"sx"!==e&&"as"!==e}})(Sh.Z),s=e.forwardRef((function(e,t){var r,s,c,l,u,d,p,f=(0,Eh.Z)(n),h=(l=(r=e).sx,u=function(e){var t,n,r={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:kh.Z;return Object.keys(e).forEach((function(t){o[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]})),r}((0,ge.Z)(r,Ph)),d=u.systemProps,p=u.otherProps,s=Array.isArray(l)?[d].concat(function(e){if(Array.isArray(e))return Oh(e)}(c=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return Oh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oh(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):"function"==typeof l?function(){var e=l.apply(void 0,arguments);return(0,wh.P)(e)?(0,be.Z)({},d,e):d}:(0,be.Z)({},d,l),(0,be.Z)({},p,{sx:s})),m=h.className,y=h.component,v=void 0===y?"div":y,b=(0,ge.Z)(h,Ch);return(0,Lt.jsx)(a,(0,be.Z)({as:v,ref:t,className:(0,Zt.Z)(m,i?i(o):o),theme:f},b))}));return s}({defaultTheme:(0,a(8662).Z)(),defaultClassName:"MuiBox-root",generateClassName:Th.Z.generate});const Rh=xh;var jh=a(6651);function Ih(){return(0,Eh.Z)(jh.Z)}function _h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r={};return Object.keys(e).forEach((function(o){r[o]=e[o].reduce((function(e,r){if(r){var o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e}),[]).join(" ")})),r}var Ah=a(9813),Mh=a(8241),Nh=a(7181),Dh=a(3499);const Lh=e.createContext({});var Uh=a(4017);function Bh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fh(e,t):void 0}}(e,t)||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.")}()}function Fh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)return Q(e)[0];for(var t=B.current[e];null!=t;){var n=Q(t.parentId),r=n[n.indexOf(t.id)+1];if(r)return r;t=B.current[t.parentId]}return null},ee=function(e){var t=B.current[e],n=Q(t.parentId),r=n.indexOf(e);if(0===r)return t.parentId;for(var o=n[r-1];V(o)&&Q(o).length>0;)o=Q(o).pop();return o},te=function(){for(var e=Q(null).pop();V(e);)e=Q(e).pop();return e},ne=function(){return Q(null)[0]},re=function(e,t){t&&(U(t),E&&E(e,t))},oe=function(e,t){return re(e,X(t))},ie=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;t=-1!==W.indexOf(n)?W.filter((function(e){return e!==n})):[n].concat(W),T&&T(e,t),Z(t)},ae=e.useRef(null),se=e.useRef(!1),ce=e.useRef([]),le=function(e,t){return!!t&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(e,t){var n;n=-1!==q.indexOf(t)?q.filter((function(e){return e!==t})):[t].concat(q),C&&C(e,n),$(n)}(e,t):function(e,t){var n=w?[t]:t;C&&C(e,n),$(n)}(e,t),ae.current=t,se.current=!1,ce.current=[],!0)},ue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.start,o=void 0===r?ae.current:r,i=t.end,a=t.current;n?function(e,t){var n=q.slice(),r=t.start,o=t.next,i=t.current;o&&i&&(-1===ce.current.indexOf(i)&&(ce.current=[]),se.current?-1!==ce.current.indexOf(o)?(n=n.filter((function(e){return e===r||e!==i})),ce.current=ce.current.filter((function(e){return e===r||e!==i}))):(n.push(o),ce.current.push(o)):(n.push(o),ce.current.push(i,o)),C&&C(e,n),$(n))}(e,{start:o,next:i,current:a}):null!=o&&null!=i&&function(e,t){var n=q.slice(),r=t.start,o=t.end;se.current&&(n=n.filter((function(e){return-1===ce.current.indexOf(e)})));var i=function(e,t){for(var n=function(e,t){if(e===t)return[e,t];var n=B.current[e],r=B.current[t];if(n.parentId===r.id||r.parentId===n.id)return r.parentId===n.id?[n.id,r.id]:[r.id,n.id];for(var o=[n.id],i=[r.id],a=n.parentId,s=r.parentId,c=-1!==i.indexOf(a),l=-1!==o.indexOf(s),u=!0,d=!0;!l&&!c;)u&&(o.push(a),u=null!==a,!(c=-1!==i.indexOf(a))&&u&&(a=B.current[a].parentId)),d&&!c&&(i.push(s),d=null!==s,!(l=-1!==o.indexOf(s))&&d&&(s=B.current[s].parentId));var p=c?a:s,f=Y(p),h=o[o.indexOf(p)-1],m=i[i.indexOf(p)-1];return f.indexOf(h)0&&(Z(o),T&&T(e,o))}(e,L),t=!0):w&&o&&"a"===n.toLowerCase()&&!v?(function(e){ue(e,{start:ne(),end:te()})}(e),t=!0):!o&&!e.shiftKey&&(r=n)&&1===r.length&&r.match(/\S/)&&(function(e,t,n){var r,o,i=n.toLowerCase(),a=[],s=[];Object.keys(F.current).forEach((function(e){var t=F.current[e],n=B.current[e],r=!n.parentId||V(n.parentId),o=!m&&K(e);r&&!o&&(a.push(e),s.push(t))})),(r=a.indexOf(t)+1)>=a.length&&(r=0),-1===(o=Kh(s,r,i))&&(o=Kh(s,0,i)),o>-1&&re(e,a[o])}(e,L,n),t=!0)}t&&(e.preventDefault(),e.stopPropagation()),P&&P(e)}},onFocus:function(e){if(e.target===e.currentTarget){var t=Array.isArray(q)?q[0]:q;re(e,t||Q(null)[0])}O&&O(e)},onBlur:function(e){U(null),k&&k(e)},ownerState:I},R,{children:o}))})})}));const tm=em;function nm(e,t){return nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nm(e,t)}const rm=t().createContext(null);var om="unmounted",im="exited",am="entering",sm="entered",cm="exiting",lm=function(e){var n,o;function i(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=im,r.appearStatus=am):o=sm:o=t.unmountOnExit||t.mountOnEnter?om:im,r.state={status:o},r.nextCallback=null,r}o=e,(n=i).prototype=Object.create(o.prototype),n.prototype.constructor=n,nm(n,o),i.getDerivedStateFromProps=function(e,t){return e.in&&t.status===om?{status:im}:null};var a=i.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==am&&n!==sm&&(t=am):n!==am&&n!==sm||(t=cm)}this.updateStatus(!1,t)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},a.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===am){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:r().findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===im&&this.setState({status:om})},a.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,i=this.props.nodeRef?[o]:[r().findDOMNode(this),o],a=i[0],s=i[1],c=this.getTimeouts(),l=o?c.appear:c.enter;e||n?(this.props.onEnter(a,s),this.safeSetState({status:am},(function(){t.props.onEntering(a,s),t.onTransitionEnd(l,(function(){t.safeSetState({status:sm},(function(){t.props.onEntered(a,s)}))}))}))):this.safeSetState({status:sm},(function(){t.props.onEntered(a)}))},a.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:r().findDOMNode(this);t?(this.props.onExit(o),this.safeSetState({status:cm},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:im},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:im},(function(){e.props.onExited(o)}))},a.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},a.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},a.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:r().findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],s=i[1];this.props.addEndListener(a,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},a.render=function(){var e=this.state.status;if(e===om)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,(0,ge.Z)(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t().createElement(rm.Provider,{value:null},"function"==typeof r?r(e,o):t().cloneElement(t().Children.only(r),o))},i}(t().Component);function um(){}lm.contextType=rm,lm.propTypes={},lm.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:um,onEntering:um,onEntered:um,onExit:um,onExiting:um,onExited:um},lm.UNMOUNTED=om,lm.EXITED=im,lm.ENTERING=am,lm.ENTERED=sm,lm.EXITING=cm;const dm=lm;var pm=a(4681);function fm(e){return fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fm(e)}function hm(e,t){var n,r,o=e.timeout,i=e.easing,a=e.style,s=void 0===a?{}:a;return{duration:null!=(n=s.transitionDuration)?n:"number"==typeof o?o:o[t.mode]||0,easing:null!=(r=s.transitionTimingFunction)?r:"object"===fm(i)?i[t.mode]:i,delay:s.transitionDelay}}function mm(e){return(0,Ft.Z)("MuiCollapse",e)}function ym(e){return ym="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ym(e)}function vm(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ym(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ym(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ym(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(0,zt.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var bm=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],gm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.orientation],"entered"===n.state&&t.entered,"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&t.hidden]}})((function(e){var t=e.theme,n=e.ownerState;return(0,ye.Z)({height:0,overflow:"hidden",transition:t.transitions.create("height")},"horizontal"===n.orientation&&{height:"auto",width:0,transition:t.transitions.create("width")},"entered"===n.state&&(0,ye.Z)({height:"auto",overflow:"visible"},"horizontal"===n.orientation&&{width:"auto"}),"exited"===n.state&&!n.in&&"0px"===n.collapsedSize&&{visibility:"hidden"})})),Sm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:function(e,t){return t.wrapper}})((function(e){var t=e.ownerState;return(0,ye.Z)({display:"flex",width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),wm=(0,nn.ZP)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:function(e,t){return t.wrapperInner}})((function(e){var t=e.ownerState;return(0,ye.Z)({width:"100%"},"horizontal"===t.orientation&&{width:"auto",height:"100%"})})),km=e.forwardRef((function(t,n){var r=(0,rn.Z)({props:t,name:"MuiCollapse"}),o=r.addEndListener,i=r.children,a=r.className,s=r.collapsedSize,c=void 0===s?"0px":s,l=r.component,u=r.easing,d=r.in,p=r.onEnter,f=r.onEntered,h=r.onEntering,m=r.onExit,y=r.onExited,v=r.onExiting,b=r.orientation,g=void 0===b?"vertical":b,S=r.style,w=r.timeout,k=void 0===w?pm.x9.standard:w,O=r.TransitionComponent,P=void 0===O?dm:O,E=(0,ve.Z)(r,bm),C=(0,ye.Z)({},r,{orientation:g,collapsedSize:c}),T=function(e){var t=e.orientation,n=e.classes,r={root:["root","".concat(t)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(t)],wrapperInner:["wrapperInner","".concat(t)]};return(0,Nt.Z)(r,mm,n)}(C),x=Ih(),R=e.useRef(),j=e.useRef(null),I=e.useRef(),_="number"==typeof c?"".concat(c,"px"):c,A="horizontal"===g,M=A?"width":"height";e.useEffect((function(){return function(){clearTimeout(R.current)}}),[]);var N=e.useRef(null),D=(0,Mh.Z)(n,N),L=function(e){return function(t){if(e){var n=N.current;void 0===t?e(n):e(n,t)}}},U=function(){return j.current?j.current[A?"clientWidth":"clientHeight"]:0},B=L((function(e,t){j.current&&A&&(j.current.style.position="absolute"),e.style[M]=_,p&&p(e,t)})),F=L((function(e,t){var n=U();j.current&&A&&(j.current.style.position="");var r=hm({style:S,timeout:k,easing:u},{mode:"enter"}),o=r.duration,i=r.easing;if("auto"===k){var a=x.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(a,"ms"),I.current=a}else e.style.transitionDuration="string"==typeof o?o:"".concat(o,"ms");e.style[M]="".concat(n,"px"),e.style.transitionTimingFunction=i,h&&h(e,t)})),z=L((function(e,t){e.style[M]="auto",f&&f(e,t)})),W=L((function(e){e.style[M]="".concat(U(),"px"),m&&m(e)})),Z=L(y),H=L((function(e){var t=U(),n=hm({style:S,timeout:k,easing:u},{mode:"exit"}),r=n.duration,o=n.easing;if("auto"===k){var i=x.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(i,"ms"),I.current=i}else e.style.transitionDuration="string"==typeof r?r:"".concat(r,"ms");e.style[M]=_,e.style.transitionTimingFunction=o,v&&v(e)}));return(0,Lt.jsx)(P,(0,ye.Z)({in:d,onEnter:B,onEntered:z,onEntering:F,onExit:W,onExited:Z,onExiting:H,addEndListener:function(e){"auto"===k&&(R.current=setTimeout(e,I.current||0)),o&&o(N.current,e)},nodeRef:N,timeout:"auto"===k?null:k},E,{children:function(e,t){return(0,Lt.jsx)(gm,(0,ye.Z)({as:l,className:(0,Zt.Z)(T.root,a,{entered:T.entered,exited:!d&&"0px"===_&&T.hidden}[e]),style:(0,ye.Z)(vm({},A?"minWidth":"minHeight",_),S),ownerState:(0,ye.Z)({},C,{state:e}),ref:D},t,{children:(0,Lt.jsx)(Sm,{ownerState:(0,ye.Z)({},C,{state:e}),className:T.wrapper,ref:j,children:(0,Lt.jsx)(wm,{ownerState:(0,ye.Z)({},C,{state:e}),className:T.wrapperInner,children:i})})}))}}))}));km.muiSupportAuto=!0;const Om=km;var Pm=a(4951),Em=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"];const Cm=e.forwardRef((function(t,n){var r=t.classes,o=t.className,i=t.displayIcon,a=t.expansionIcon,s=t.icon,c=t.label,l=t.nodeId,u=t.onClick,d=t.onMouseDown,p=(0,ge.Z)(t,Em),f=function(t){var n=e.useContext(Lh),r=n.focus,o=n.isExpanded,i=n.isExpandable,a=n.isFocused,s=n.isDisabled,c=n.isSelected,l=n.multiSelect,u=n.selectNode,d=n.selectRange,p=n.toggleExpansion,f=!!i&&i(t),h=!!o&&o(t),m=!!a&&a(t),y=!!s&&s(t),v=!!c&&c(t);return{disabled:y,expanded:h,selected:v,focused:m,handleExpansion:function(e){if(!y){m||r(e,t);var n=l&&(e.shiftKey||e.ctrlKey||e.metaKey);!f||n&&o(t)||p(e,t)}},handleSelection:function(e){y||(m||r(e,t),l&&(e.shiftKey||e.ctrlKey||e.metaKey)?e.shiftKey?d(e,{end:t}):u(e,t,!0):u(e,t))},preventSelection:function(e){(e.shiftKey||e.ctrlKey||e.metaKey||y)&&e.preventDefault()}}}(l),h=f.disabled,m=f.expanded,y=f.selected,v=f.focused,b=f.handleExpansion,g=f.handleSelection,S=f.preventSelection,w=s||a||i;return(0,Lt.jsxs)("div",(0,be.Z)({className:(0,Zt.Z)(o,r.root,m&&r.expanded,y&&r.selected,v&&r.focused,h&&r.disabled),onClick:function(e){b(e),g(e),u&&u(e)},onMouseDown:function(e){S(e),d&&d(e)},ref:n},p,{children:[(0,Lt.jsx)("div",{className:r.iconContainer,children:w}),(0,Lt.jsx)("div",{className:r.label,children:c})]}))}));function Tm(e){return(0,Ft.Z)("MuiTreeItem",e)}const xm=(0,zt.Z)("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]);function Rm(e){return Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rm(e)}function jm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Fm);return t().createElement(Hm,Wm({label:t().createElement(Rh,{sx:{display:"flex",alignItems:"center",p:.5,pr:0}},n,t().createElement("span",{style:{flex:1,fontWeight:"inherit",flexGrow:1}},o),t().createElement("span",null,r)),style:{color:"inherit"}},i))}function $m(e){e.pydio;var n=e.muiTheme,r=e.style,o=e.model,i={},a=function e(r){return!r.collections||r.notExpandable?[]:r.collections.map((function(r){return i[r.id]=r,t().createElement(qm,{muiTheme:n,nodeId:r.id,labelText:r.label,labelIcon:t().createElement("span",{style:{fontSize:16,marginRight:10},className:r.icon})},e(r))}))}(o.getRoot());return t().createElement(tm,{"aria-label":"gmail",defaultExpanded:["3"],defaultCollapseIcon:t().createElement(Um.Z,null),defaultExpandIcon:t().createElement(Bm.Z,null),defaultEndIcon:t().createElement("div",{style:{width:24}}),selected:o.contextItem().id,onNodeSelect:function(e,t){i[t]&&o.setContext(i[t])},style:r},a)}qm.propTypes={labelIcon:z().object.isRequired,labelInfo:z().string,labelText:z().string.isRequired};var Vm=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gm=function(){return Gm=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1)})).filter((function(e){return!s||(e.IdmUser&&e.IdmUser.IsGroup?0===s.filter((function(t){return t===e.IdmUser.Uuid})).length:e.IdmUser?0===s.filter((function(t){return t===e.IdmUser.Login})).length:0===s.filter((function(t){return t===e.IdmRole.Uuid})).length)})).map((function(e){var r,i,a;return e.IdmUser&&e.IdmUser.IsGroup?(r=e.IdmUser.GroupLabel,a=e.IdmUser.Attributes&&e.IdmUser.Attributes.displayName?e.IdmUser.Attributes.displayName:r,i="mdi mdi-folder-account"):e.IdmUser?(r=e.IdmUser.Login,a=e.IdmUser.Attributes&&e.IdmUser.Attributes.displayName?e.IdmUser.Attributes.displayName:r,i=e.IdmUser.Attributes&&"shared"===e.IdmUser.Attributes.profile?"mdi mdi-account":"mdi mdi-account-box-outline"):(r=e.IdmRole.Uuid,a=e.IdmRole.Label,i="mdi mdi-account-multiple-outline"),o|=a===n,{userObject:e,text:r,value:t().createElement(g.MenuItem,{primaryText:a,leftIcon:t().createElement(g.FontIcon,{className:i,style:{margin:"0 12px"}})})}}));if(n||(this._emptyValueList=c),n&&!o&&(!i||a)){n=this.slugLogin(n);var l=Z().getMessages()[448]||"create",u=t().createElement(g.MenuItem,{primaryText:n+(a?"":" ("+l+")"),leftIcon:t().createElement(g.FontIcon,{className:"mdi mdi-account-plus",style:{margin:"0 12px"}})});c=[{text:n,value:u}].concat(Zy(c))}this.setState({dataSource:c,loading:!1})}.bind(this))}.bind(Gy(e)))}else e.setState({dataSource:e._emptyValueList})})),Ky(Gy(e),"onCompleterRequest",(function(t,n){var r=e.props,o=r.freeValueAllowed,i=r.onValueSelected;if(-1===n&&(e.state.dataSource.map((function(e){e.text===t&&(t=e)})),t&&!t.userObject&&o))return i({FreeValue:t.text}),void e.setState({searchText:"",dataSource:[]});t&&(t.userObject?i(t.userObject):o?i({FreeValue:t.text}):e.setState({createUser:t.text}),e.setState({searchText:"",dataSource:[]}))})),Ky(Gy(e),"onUserCreated",(function(t){e.props.onValueSelected(t),e.setState({createUser:null})})),Ky(Gy(e),"onCreationCancelled",(function(){e.setState({createUser:null})})),Ky(Gy(e),"openAddressBook",(function(t){e.setState({addressBookOpen:!0,addressBookAnchor:t.currentTarget})})),Ky(Gy(e),"closeAddressBook",(function(){e.setState({addressBookOpen:!1})})),Ky(Gy(e),"onAddressBookItemSelected",(function(t){e.props.onValueSelected(t)})),e}return n=s,(r=[{key:"componentWillReceiveProps",value:function(){this._emptyValueList=null}},{key:"slugLogin",value:function(e){return e=e.toLowerCase(),""===Gd().isValidLogin(e)?e:J().computeStringSlug(e)}},{key:"render",value:function(){var e=this,n=this.props,r=n.pydio,o=n.className,i=n.fieldLabel,a=n.underlineHide,s=n.showAddressBook,c=n.usersFrom,l=this.state,u=l.dataSource,d=l.createUser;return t().createElement("div",{style:{position:"relative",overflow:"visible"},ref:function(t){e._popoverAnchor=t}},t().createElement(Xy,{filter:g.AutoComplete.noFilter,dataSource:u,searchText:this.state.searchText,onUpdateInput:this.textFieldUpdate,className:o,openOnFocus:!0,floatingLabelText:i,floatingLabelFixed:!0,underlineShow:!a,fullWidth:!0,onNewRequest:this.onCompleterRequest,listStyle:{maxHeight:350,overflowY:"auto"},onFocus:function(){e.loadBuffered(e.state.searchText,100)},disabled:d,hintText:d?r.MessageHash[485]+" ("+d+")":null}),!d&&t().createElement("div",{style:{position:"absolute",right:s?44:10,bottom:14,height:20,width:20}},t().createElement(g.RefreshIndicator,{size:20,left:0,top:0,status:this.state.loading?"loading":"hide"})),!d&&s&&t().createElement(zy,{mode:"popover",pydio:r,loaderStyle:{width:320,height:420},onItemSelected:this.onAddressBookItemSelected,usersFrom:c,disableSearch:!0}),t().createElement(ev,{open:d,anchorEl:this._popoverAnchor,anchorOrigin:{horizontal:"left",vertical:"bottom"},targetOrigin:{horizontal:"left",vertical:"top"},onRequestClose:this.onCreationCancelled,canAutoPosition:!1,style:this._popoverAnchor?{width:this._popoverAnchor.clientWidth}:{},zDepth:3},d&&t().createElement(tf,{onUserCreated:this.onUserCreated.bind(this),onCancel:this.onCreationCancelled.bind(this),style:{width:"100%",height:320},newUserName:d,pydio:r})))}}])&&$y(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function nv(e){return nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nv(e)}function rv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ov(e){for(var t=1;t1?m["share_center.cell.participant.other.multiple"].replace("%d",i):m["share_center.cell.participant.other.single"]:su().extractLabelFromIdmObject(i),t().createElement(av,{PopperProps:{style:{zIndex:2200}},placement:"bottom",title:t().createElement("div",{style:{padding:"0 6px"}},h)},n)}return n}));function cv(e){return cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cv(e)}function lv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t-1)&&(a.border="2px solid #4caf50");else if(s.Group)r="group",o=s.Group;else{if(!s.Role)return null;r="team",o=s.Role}return{type:r,object:o,style:a,online:i}})).filter((function(e){return null!==e}));if(void 0!==c&&u.sort((function(e,t){return e.online?-1:t.online?1:0})),u=u.map((function(e,t){return t>0&&(e.style=uv(uv({},e.style),{},{marginLeft:-10,zIndex:2*t})),e})),u.length>o){var d=u.length-o;(u=u.slice(0,o)).push({type:"more",object:d,style:uv(uv({},l),{},{marginLeft:-10,zIndex:16,fontWeight:500,fontSize:14})})}return t().createElement("div",{style:{display:"flex",height:a}},u.map((function(e){var n=e.type,r=e.object,o=e.style;return t().createElement(sv,{size:a,type:n,idmObject:r,style:o,tooltip:!0})})))};function fv(e){return fv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fv(e)}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.setState({showMenu:!0,style:e,menuItems:t||n.state.menuItems})})),Nv(Av(n),"hideMenu",(function(e){if(!e)return n.setState({showMenu:!1}),void(n.props.onMenuClosed&&n.props.onMenuClosed());if(void 0===e||2!==e.button||"contextmenu"===e.type){var t=Uv.findDOMNode(n.menuRef.current);t&&t.contains(e.target)||t===e.target||(n.setState({showMenu:!1}),n.props.onMenuClosed&&n.props.onMenuClosed())}})),Nv(Av(n),"menuClicked",(function(e,t,r){n.hideMenu()})),n.menuRef=(0,e.createRef)(),n.state={showMenu:!1,menuItems:t.menuItems},n}return r=c,(o=[{key:"componentDidMount",value:function(){this._observer=this.hideMenu.bind(this)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this._observer,!1)}},{key:"componentWillReceiveProps",value:function(e){e.menuItems&&this.setState({menuItems:e.menuItems})}},{key:"componentDidUpdate",value:function(e,t){this.state.showMenu?document.addEventListener("click",this._observer,!1):document.removeEventListener("click",this._observer,!1)}},{key:"render",value:function(){var e=this.props,n=e.menuProps,r=e.zDepth,o=void 0===r?1:r,i=this.state,a=i.style,s=void 0===a?{}:a,c=i.menuItems,l=jv(jv({},s),{},{zIndex:1e3}),u=Un.itemsToMenu(c,this.menuClicked.bind(this),!1,jv({ref:this.menuRef,desktop:!0,display:"right",width:250},n));return this.state.showMenu?t().createElement(Bv,{zDepth:o||1,ref:"menuContainer",className:"menu-positioner",style:l},u):null}}])&&Iv(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);function zv(e){return zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zv(e)}function Wv(e,t){for(var n=0;nr?e.x=Math.max(e.x-250,10)-8:e.x+=8,e.y+n>o?e.y=Math.max(e.y-n,10)-8:e.y+=8,e}},{key:"componentDidMount",value:function(){this._modelOpen=this.modelOpen.bind(this),Tv().getInstance().observe("open",this._modelOpen)}},{key:"componentWillUnmount",value:function(){Tv().getInstance().stopObserving("open",this._modelOpen)}},{key:"render",value:function(){var e=this.props.pydio.UI.MOBILE_EXTENSIONS;return React.createElement(Fv,{ref:this.menu,menuItems:this._items||[],onMenuClosed:this.props.onMenuClosed,menuProps:e?{width:600,autoWidth:!1,desktop:!1}:{},zDepth:e?2:1})}}],n&&Wv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Vv);function Kv(e){return Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(e)}function Yv(){return Yv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:0,a=this.getIdentifier(e,t);if(this.subscriptions[a]){var s=!1;return this.subscriptions[a].map((function(e){e.messageHandler===n&&(s=!0)})),s||this.subscriptions[a].push({messageHandler:n,roomUpdateHandler:r}),this.roomInfos[a]}if(this.connecting){if(i<3)return setTimeout((function(){o.joinRoom(e,t,n,r,i+1)}),1500),null}else if(!this.connOpen)return this.open(),setTimeout((function(){o.joinRoom(e,t,n,r,i+1)}),1500),null;this.subscriptions[e+":"+t]=[{messageHandler:n,roomUpdateHandler:r}];var c={"@type":"JOIN",Room:{Type:e,RoomTypeObject:t}};return this.ws.send(JSON.stringify(c)),this.roomInfos[a]}},{key:"loadHistory",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.connecting&&i<3)setTimeout((function(){n.loadHistory(e,t,r,o,i+1)}),1500);else{var a={"@type":"HISTORY",Room:{Type:e,RoomTypeObject:t},Message:{Message:JSON.stringify({Offset:r,Limit:o})}};this.ws.send(JSON.stringify(a))}}},{key:"leaveRoom",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=!1,i=this.getIdentifier(e,t);if(this.subscriptions[i]&&(r?(this.subscriptions[i]=this.subscriptions[i].filter((function(e){return e.messageHandler!==r})),this.subscriptions[i].length?o=!0:delete this.subscriptions[i]):delete this.subscriptions[i]),!o&&(Object.keys(this.rooms).map((function(e){n.rooms[e]===i&&delete n.rooms[e]})),this.connOpen)){var a={"@type":"LEAVE",Room:{Type:e,RoomTypeObject:t}};this.ws.send(JSON.stringify(a))}}},{key:"handleMessageReceived",value:function(e){var t=JSON.parse(e.data);if("ROOM_UPDATE"===t["@type"]){var n=this.getIdentifier(t.Room.Type,t.Room.RoomTypeObject);this.subscriptions[n]&&(this.rooms[t.Room.Uuid]||(this.rooms[t.Room.Uuid]=n),this.onRoomMessage(t),this.subscriptions[n].map((function(e){if(e.roomUpdateHandler)try{e.roomUpdateHandler(t)}catch(e){}})))}else{var r,o=!1;if("DELETE_MSG"===t["@type"]?(o=!0,r=t.Message):r=t,r.RoomUuid&&this.rooms[r.RoomUuid]){var i=this.subscriptions[this.rooms[r.RoomUuid]],a=i.filter((function(e){return e.roomUpdateHandler}));a.length&&(i=a),i.map((function(e){try{e.messageHandler(r,o)}catch(e){}}))}}}},{key:"send",value:function(e){this.ws.send(e)}},{key:"open",value:function(){var e=this;if(this.close(),this.currentRepo){var t=this.pydio.Parameters.get("ENDPOINT_WEBSOCKET").replace("/event","/chat");t&&"/"===t[0]&&(t=t.substr(1));var n=this.pydio.getFrontendUrl(),r="https:"===n.protocol?"wss":"ws",o="".concat(r,"://").concat(n.host,"/")+t;this.ws=new(_b())(o,[],{maxReconnectionDelay:6e4,reconnectionDelayGrowFactor:1.6,maxRetries:10}),this.connecting=!0,this.ws.addEventListener("open",(function(){jb().subscribeJWT(e.ws).then((function(){e.connecting=!1,e.connOpen=!0})).catch((function(){e.connecting=!1,e.connOpen=!1}))})),this.ws.addEventListener("message",(function(t){e.handleMessageReceived(t)})),this.ws.addEventListener("close",(function(t){e.connOpen=!1,e.connecting=!1,jb().logClose(t)})),this.ws.addEventListener("error",(function(e){"EHOSTDOWN"===e.code&&console.error("WebSocket maxRetries reached, host is down!")})),this.hbInterval=setInterval((function(){return e.heartbeat()}),15e3),window.onbeforeunload=function(){e.close()}}}},{key:"close",value:function(){var e=this;null!==this.ws&&(Object.keys(this.subscriptions).map((function(t){var n=e.getRoomInfoFromIdentifier(t),r=n.roomType,o=n.objectId;e.leaveRoom(r,o)})),this.ws.close(1e3,"Closing",{keepClosed:!0}),this.hbInterval&&clearInterval(this.hbInterval))}},{key:"heartbeat",value:function(){var e=this;Object.keys(this.subscriptions).map((function(t){var n=e.getRoomInfoFromIdentifier(t),r={"@type":"JOIN",Room:{Type:n.roomType,RoomTypeObject:n.objectId},Message:{Message:"PING"}};try{e.ws.send(JSON.stringify(r))}catch(e){}}))}}],r=[{key:"getInstance",value:function(e){return void 0!==s._instance||(s._instance=new s(e)),s._instance}}],n&&Nb(t.prototype,n),r&&Nb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(jb());const zb=require("pydio/util/dom");var Wb=a.n(zb);const Zb=require("react-markdown");var Hb=a.n(Zb);function qb(e){return qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qb(e)}function $b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vb(e){for(var t=1;t=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==o&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),a.call(s,n,e),typeof console===t&&n>>=0)&&e<256)&&(r=bg[e])?r:(n=wg(e,(0|e)<0?-1:0,!0),o&&(bg[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=vg[e])?r:(n=wg(e,e<0?-1:0,!1),o&&(vg[e]=n),n)}function Sg(e,t){if(isNaN(e))return t?jg:Rg;if(t){if(e<0)return jg;if(e>=Cg)return Ng}else{if(e<=-Tg)return Dg;if(e+1>=Tg)return Mg}return e<0?Sg(-e,t).neg():wg(e%Eg|0,e/Eg|0,t)}function wg(e,t,n){return new mg(e,t,n)}mg.fromInt=gg,mg.fromNumber=Sg,mg.fromBits=wg;var kg=Math.pow;function Og(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return Rg;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return Og(e.substring(1),t,n).neg();for(var o=Sg(kg(n,8)),i=Rg,a=0;a>>0:this.low},Lg.toNumber=function(){return this.unsigned?(this.high>>>0)*Eg+(this.low>>>0):this.high*Eg+(this.low>>>0)},Lg.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},Lg.getHighBits=function(){return this.high},Lg.getHighBitsUnsigned=function(){return this.high>>>0},Lg.getLowBits=function(){return this.low},Lg.getLowBitsUnsigned=function(){return this.low>>>0},Lg.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Dg)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},Lg.isOdd=function(){return 1==(1&this.low)},Lg.isEven=function(){return 0==(1&this.low)},Lg.equals=function(e){return yg(e)||(e=Pg(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},Lg.eq=Lg.equals,Lg.notEquals=function(e){return!this.eq(e)},Lg.neq=Lg.notEquals,Lg.ne=Lg.notEquals,Lg.lessThan=function(e){return this.comp(e)<0},Lg.lt=Lg.lessThan,Lg.lessThanOrEqual=function(e){return this.comp(e)<=0},Lg.lte=Lg.lessThanOrEqual,Lg.le=Lg.lessThanOrEqual,Lg.greaterThan=function(e){return this.comp(e)>0},Lg.gt=Lg.greaterThan,Lg.greaterThanOrEqual=function(e){return this.comp(e)>=0},Lg.gte=Lg.greaterThanOrEqual,Lg.ge=Lg.greaterThanOrEqual,Lg.compare=function(e){if(yg(e)||(e=Pg(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Lg.comp=Lg.compare,Lg.negate=function(){return!this.unsigned&&this.eq(Dg)?Dg:this.not().add(Ig)},Lg.neg=Lg.negate,Lg.add=function(e){yg(e)||(e=Pg(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,l=0,u=0,d=0;return u+=(d+=o+(65535&e.low))>>>16,l+=(u+=r+s)>>>16,c+=(l+=n+a)>>>16,c+=t+i,wg((u&=65535)<<16|(d&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},Lg.subtract=function(e){return yg(e)||(e=Pg(e)),this.add(e.neg())},Lg.sub=Lg.subtract,Lg.multiply=function(e){if(this.isZero())return Rg;if(yg(e)||(e=Pg(e)),hg)return wg(hg.mul(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned);if(e.isZero())return Rg;if(this.eq(Dg))return e.isOdd()?Dg:Rg;if(e.eq(Dg))return this.isOdd()?Dg:Rg;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(xg)&&e.lt(xg))return Sg(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=65535&e.low,l=0,u=0,d=0,p=0;return d+=(p+=o*c)>>>16,u+=(d+=r*c)>>>16,d&=65535,u+=(d+=o*s)>>>16,l+=(u+=n*c)>>>16,u&=65535,l+=(u+=r*s)>>>16,u&=65535,l+=(u+=o*a)>>>16,l+=t*c+n*s+r*a+o*i,wg((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(u&=65535),this.unsigned)},Lg.mul=Lg.multiply,Lg.divide=function(e){if(yg(e)||(e=Pg(e)),e.isZero())throw Error("division by zero");var t,n,r;if(hg)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?wg((this.unsigned?hg.div_u:hg.div_s)(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?jg:Rg;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return jg;if(e.gt(this.shru(1)))return _g;r=jg}else{if(this.eq(Dg))return e.eq(Ig)||e.eq(Ag)?Dg:e.eq(Dg)?Ig:(t=this.shr(1).div(e).shl(1)).eq(Rg)?e.isNegative()?Ig:Ag:(n=this.sub(e.mul(t)),r=t.add(n.div(e)));if(e.eq(Dg))return this.unsigned?jg:Rg;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=Rg}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),i=o<=48?1:kg(2,o-48),a=Sg(t),s=a.mul(e);s.isNegative()||s.gt(n);)s=(a=Sg(t-=i,this.unsigned)).mul(e);a.isZero()&&(a=Ig),r=r.add(a),n=n.sub(s)}return r},Lg.div=Lg.divide,Lg.modulo=function(e){return yg(e)||(e=Pg(e)),hg?wg((this.unsigned?hg.rem_u:hg.rem_s)(this.low,this.high,e.low,e.high),hg.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Lg.mod=Lg.modulo,Lg.rem=Lg.modulo,Lg.not=function(){return wg(~this.low,~this.high,this.unsigned)},Lg.and=function(e){return yg(e)||(e=Pg(e)),wg(this.low&e.low,this.high&e.high,this.unsigned)},Lg.or=function(e){return yg(e)||(e=Pg(e)),wg(this.low|e.low,this.high|e.high,this.unsigned)},Lg.xor=function(e){return yg(e)||(e=Pg(e)),wg(this.low^e.low,this.high^e.high,this.unsigned)},Lg.shiftLeft=function(e){return yg(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?wg(this.low<>>32-e,this.unsigned):wg(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):wg(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Lg.shr=Lg.shiftRight,Lg.shiftRightUnsigned=function(e){if(yg(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?wg(this.low>>>e|t<<32-e,t>>>e,this.unsigned):wg(32===e?t:t>>>e-32,0,this.unsigned)},Lg.shru=Lg.shiftRightUnsigned,Lg.shr_u=Lg.shiftRightUnsigned,Lg.toSigned=function(){return this.unsigned?wg(this.low,this.high,!1):this},Lg.toUnsigned=function(){return this.unsigned?this:wg(this.low,this.high,!0)},Lg.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Lg.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Lg.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},mg.fromBytes=function(e,t,n){return n?mg.fromBytesLE(e,t):mg.fromBytesBE(e,t)},mg.fromBytesLE=function(e,t){return new mg(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},mg.fromBytesBE=function(e,t){return new mg(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var Ug,Bg,Fg,zg,Wg,Zg,Hg,qg,$g,Vg,Gg,Jg,Kg,Yg,Qg,Xg=ig(fg),eS={},tS={},nS={},rS={};function oS(){return Qg||(Qg=1,function(e){var t=e;function n(e,t,n){for(var r=Object.keys(t),o=0;o1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),r=new Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t>2],o=(3&l)<<4,c=1;break;case 1:a[s++]=n[o|l>>4],o=(15&l)<<2,c=2;break;case 2:a[s++]=n[o|l>>6],a[s++]=n[63&l],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var o,a=n,s=0,c=0;c1)break;if(void 0===(l=r[l]))throw Error(i);switch(s){case 0:o=l,s=1;break;case 1:t[n++]=o<<2|(48&l)>>4,o=l,s=2;break;case 2:t[n++]=(15&o)<<4|(60&l)>>2,o=l,s=3;break;case 3:t[n++]=(3&o)<<6|l,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(nS)),nS),t.EventEmitter=function(){if(Wg)return zg;function e(){this._listeners={}}return Wg=1,zg=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,r),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function i(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=r*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,c=a>>>20&2047,l=4294967296*(1048575&a)+i;return 2047===c?l?NaN:s*(1/0):0===c?5e-324*s*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,r,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return Hg=1,Zg=e(e)}(),t.inquire=$g?qg:($g=1,qg=function(e){return null}),t.utf8=(Vg||(Vg=1,function(e){var t=e;t.length=function(e){for(var t=0,n=0,r=0;r191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,n){for(var r,o,i=n,a=0;a>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}}(rS)),rS),t.pool=(Jg||(Jg=1,Gg=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}),Gg),t.LongBits=function(){if(Yg)return Kg;Yg=1,Kg=t;var e=oS();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var r=e<0;r&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return r&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(r){if("number"==typeof r)return t.fromNumber(r);if(e.isString(r)){if(!e.Long)return t.fromNumber(parseInt(r,10));r=e.Long.fromString(r)}return r.low||r.high?new t(r.low>>>0,r.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===r?n:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},Kg}(),t.isNode=Boolean(void 0!==og&&og&&og.process&&og.process.versions&&og.process.versions.node),t.global=t.isNode&&og||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||og,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function gS(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}hS.create=mS(),hS.alloc=function(e){return new sS.Array(e)},sS.Array!==Array&&(hS.alloc=sS.pool(hS.alloc,sS.Array.prototype.subarray)),hS.prototype._push=function(e,t,n){return this.tail=this.tail.next=new dS(e,t,n),this.len+=t,this},vS.prototype=Object.create(dS.prototype),vS.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},hS.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new vS((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},hS.prototype.int32=function(e){return e<0?this._push(bS,10,cS.fromNumber(e)):this.uint32(e)},hS.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},hS.prototype.uint64=function(e){var t=cS.from(e);return this._push(bS,t.length(),t)},hS.prototype.int64=hS.prototype.uint64,hS.prototype.sint64=function(e){var t=cS.from(e).zzEncode();return this._push(bS,t.length(),t)},hS.prototype.bool=function(e){return this._push(yS,1,e?1:0)},hS.prototype.fixed32=function(e){return this._push(gS,4,e>>>0)},hS.prototype.sfixed32=hS.prototype.fixed32,hS.prototype.fixed64=function(e){var t=cS.from(e);return this._push(gS,4,t.lo)._push(gS,4,t.hi)},hS.prototype.sfixed64=hS.prototype.fixed64,hS.prototype.float=function(e){return this._push(sS.float.writeFloatLE,4,e)},hS.prototype.double=function(e){return this._push(sS.float.writeDoubleLE,8,e)};var SS=sS.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(yS,1,0);if(sS.isString(e)){var n=hS.alloc(t=lS.length(e));lS.decode(e,n,0),e=n}return this.uint32(t)._push(SS,t,e)},hS.prototype.string=function(e){var t=uS.length(e);return t?this.uint32(t)._push(uS.write,t,e):this._push(yS,1,0)},hS.prototype.fork=function(){return this.states=new fS(this),this.head=this.tail=new dS(pS,0,0),this.len=0,this},hS.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new dS(pS,0,0),this.len=0),this},hS.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},hS.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},hS._configure=function(e){iS=e,hS.create=mS(),iS._configure()};var wS=PS,kS=aS;(PS.prototype=Object.create(kS.prototype)).constructor=PS;var OS=oS();function PS(){kS.call(this)}function ES(e,t,n){e.length<40?OS.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}PS._configure=function(){PS.alloc=OS._Buffer_allocUnsafe,PS.writeBytesBuffer=OS.Buffer&&OS.Buffer.prototype instanceof Uint8Array&&"set"===OS.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(PS.writeBytesBuffer,t,e),this},PS.prototype.string=function(e){var t=OS.Buffer.byteLength(e);return this.uint32(t),t&&this._push(ES,t,e),this},PS._configure();var CS,TS=_S,xS=oS(),RS=xS.LongBits,jS=xS.utf8;function IS(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function _S(e){this.buf=e,this.pos=0,this.len=e.length}var AS="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new _S(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new _S(e);throw Error("illegal buffer")},MS=function(){return xS.Buffer?function(e){return(_S.create=function(e){return xS.Buffer.isBuffer(e)?new CS(e):AS(e)})(e)}:AS};function NS(){var e=new RS(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw IS(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw IS(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function DS(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function LS(){if(this.pos+8>this.len)throw IS(this,8);return new RS(DS(this.buf,this.pos+=4),DS(this.buf,this.pos+=4))}_S.create=MS(),_S.prototype._slice=xS.Array.prototype.subarray||xS.Array.prototype.slice,_S.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,IS(this,10);return e}}(),_S.prototype.int32=function(){return 0|this.uint32()},_S.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},_S.prototype.bool=function(){return 0!==this.uint32()},_S.prototype.fixed32=function(){if(this.pos+4>this.len)throw IS(this,4);return DS(this.buf,this.pos+=4)},_S.prototype.sfixed32=function(){if(this.pos+4>this.len)throw IS(this,4);return 0|DS(this.buf,this.pos+=4)},_S.prototype.float=function(){if(this.pos+4>this.len)throw IS(this,4);var e=xS.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},_S.prototype.double=function(){if(this.pos+8>this.len)throw IS(this,4);var e=xS.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},_S.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw IS(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},_S.prototype.string=function(){var e=this.bytes();return jS.read(e,0,e.length)},_S.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw IS(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw IS(this)}while(128&this.buf[this.pos++]);return this},_S.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},_S._configure=function(e){CS=e,_S.create=MS(),CS._configure();var t=xS.Long?"toLong":"toNumber";xS.merge(_S.prototype,{int64:function(){return NS.call(this)[t](!1)},uint64:function(){return NS.call(this)[t](!0)},sint64:function(){return NS.call(this).zzDecode()[t](!1)},fixed64:function(){return LS.call(this)[t](!0)},sfixed64:function(){return LS.call(this)[t](!1)}})};var US=zS,BS=TS;(zS.prototype=Object.create(BS.prototype)).constructor=zS;var FS=oS();function zS(e){BS.call(this,e)}zS._configure=function(){FS.Buffer&&(zS.prototype._slice=FS.Buffer.prototype.slice)},zS.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},zS._configure();var WS={},ZS=qS,HS=oS();function qS(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");HS.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(qS.prototype=Object.create(HS.EventEmitter.prototype)).constructor=qS,qS.prototype.rpcCall=function e(t,n,r,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return HS.asPromise(e,a,t,n,r,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof r))try{n=r[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},qS.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},WS.Service=ZS;var $S={};!function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=aS,t.BufferWriter=wS,t.Reader=TS,t.BufferReader=US,t.util=oS(),t.rpc=WS,t.roots=$S,t.configure=n,n()}(eS);var VS,GS,JS,KS,YS,QS,XS,ew,tw,nw,rw,ow,iw,aw,sw,cw=ig(eS);function lw(e){switch(e){case 0:case"AUDIO":return JS.AUDIO;case 1:case"VIDEO":return JS.VIDEO;case 2:case"DATA":return JS.DATA;default:return JS.UNRECOGNIZED}}function uw(e){switch(e){case JS.AUDIO:return"AUDIO";case JS.VIDEO:return"VIDEO";case JS.DATA:return"DATA";case JS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function dw(e){switch(e){case 0:case"UNKNOWN":return KS.UNKNOWN;case 1:case"CAMERA":return KS.CAMERA;case 2:case"MICROPHONE":return KS.MICROPHONE;case 3:case"SCREEN_SHARE":return KS.SCREEN_SHARE;case 4:case"SCREEN_SHARE_AUDIO":return KS.SCREEN_SHARE_AUDIO;default:return KS.UNRECOGNIZED}}function pw(e){switch(e){case KS.UNKNOWN:return"UNKNOWN";case KS.CAMERA:return"CAMERA";case KS.MICROPHONE:return"MICROPHONE";case KS.SCREEN_SHARE:return"SCREEN_SHARE";case KS.SCREEN_SHARE_AUDIO:return"SCREEN_SHARE_AUDIO";case KS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function fw(e){switch(e){case 0:case"LOW":return YS.LOW;case 1:case"MEDIUM":return YS.MEDIUM;case 2:case"HIGH":return YS.HIGH;case 3:case"OFF":return YS.OFF;default:return YS.UNRECOGNIZED}}function hw(e){switch(e){case YS.LOW:return"LOW";case YS.MEDIUM:return"MEDIUM";case YS.HIGH:return"HIGH";case YS.OFF:return"OFF";case YS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function mw(e){switch(e){case 0:case"POOR":return QS.POOR;case 1:case"GOOD":return QS.GOOD;case 2:case"EXCELLENT":return QS.EXCELLENT;default:return QS.UNRECOGNIZED}}function yw(e){switch(e){case 0:case"UNSET":return XS.UNSET;case 1:case"DISABLED":return XS.DISABLED;case 2:case"ENABLED":return XS.ENABLED;default:return XS.UNRECOGNIZED}}function vw(e){switch(e){case XS.UNSET:return"UNSET";case XS.DISABLED:return"DISABLED";case XS.ENABLED:return"ENABLED";case XS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function bw(e){switch(e){case 0:case"UNKNOWN_REASON":return ew.UNKNOWN_REASON;case 1:case"CLIENT_INITIATED":return ew.CLIENT_INITIATED;case 2:case"DUPLICATE_IDENTITY":return ew.DUPLICATE_IDENTITY;case 3:case"SERVER_SHUTDOWN":return ew.SERVER_SHUTDOWN;case 4:case"PARTICIPANT_REMOVED":return ew.PARTICIPANT_REMOVED;case 5:case"ROOM_DELETED":return ew.ROOM_DELETED;case 6:case"STATE_MISMATCH":return ew.STATE_MISMATCH;case 7:case"JOIN_FAILURE":return ew.JOIN_FAILURE;default:return ew.UNRECOGNIZED}}function gw(e){switch(e){case 0:case"JOINING":return nw.JOINING;case 1:case"JOINED":return nw.JOINED;case 2:case"ACTIVE":return nw.ACTIVE;case 3:case"DISCONNECTED":return nw.DISCONNECTED;default:return nw.UNRECOGNIZED}}function Sw(e){switch(e){case 0:case"NONE":return rw.NONE;case 1:case"GCM":return rw.GCM;case 2:case"CUSTOM":return rw.CUSTOM;default:return rw.UNRECOGNIZED}}function ww(e){switch(e){case rw.NONE:return"NONE";case rw.GCM:return"GCM";case rw.CUSTOM:return"CUSTOM";case rw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function kw(e){switch(e){case 0:case"RELIABLE":return ow.RELIABLE;case 1:case"LOSSY":return ow.LOSSY;default:return ow.UNRECOGNIZED}}function Ow(e){switch(e){case 0:case"Standard":return iw.Standard;case 1:case"Cloud":return iw.Cloud;default:return iw.UNRECOGNIZED}}function Pw(e){switch(e){case 0:case"UNKNOWN":return aw.UNKNOWN;case 1:case"JS":return aw.JS;case 2:case"SWIFT":return aw.SWIFT;case 3:case"ANDROID":return aw.ANDROID;case 4:case"FLUTTER":return aw.FLUTTER;case 5:case"GO":return aw.GO;case 6:case"UNITY":return aw.UNITY;case 7:case"REACT_NATIVE":return aw.REACT_NATIVE;case 8:case"RUST":return aw.RUST;default:return aw.UNRECOGNIZED}}(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})(),cw.util.Long!==Xg&&(cw.util.Long=Xg,cw.configure()),function(e){e[e.DEFAULT_AC=0]="DEFAULT_AC",e[e.OPUS=1]="OPUS",e[e.AAC=2]="AAC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(VS||(VS={})),function(e){e[e.DEFAULT_VC=0]="DEFAULT_VC",e[e.H264_BASELINE=1]="H264_BASELINE",e[e.H264_MAIN=2]="H264_MAIN",e[e.H264_HIGH=3]="H264_HIGH",e[e.VP8=4]="VP8",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(GS||(GS={})),function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO",e[e.DATA=2]="DATA",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(JS||(JS={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.CAMERA=1]="CAMERA",e[e.MICROPHONE=2]="MICROPHONE",e[e.SCREEN_SHARE=3]="SCREEN_SHARE",e[e.SCREEN_SHARE_AUDIO=4]="SCREEN_SHARE_AUDIO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(KS||(KS={})),function(e){e[e.LOW=0]="LOW",e[e.MEDIUM=1]="MEDIUM",e[e.HIGH=2]="HIGH",e[e.OFF=3]="OFF",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(YS||(YS={})),function(e){e[e.POOR=0]="POOR",e[e.GOOD=1]="GOOD",e[e.EXCELLENT=2]="EXCELLENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(QS||(QS={})),function(e){e[e.UNSET=0]="UNSET",e[e.DISABLED=1]="DISABLED",e[e.ENABLED=2]="ENABLED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(XS||(XS={})),function(e){e[e.UNKNOWN_REASON=0]="UNKNOWN_REASON",e[e.CLIENT_INITIATED=1]="CLIENT_INITIATED",e[e.DUPLICATE_IDENTITY=2]="DUPLICATE_IDENTITY",e[e.SERVER_SHUTDOWN=3]="SERVER_SHUTDOWN",e[e.PARTICIPANT_REMOVED=4]="PARTICIPANT_REMOVED",e[e.ROOM_DELETED=5]="ROOM_DELETED",e[e.STATE_MISMATCH=6]="STATE_MISMATCH",e[e.JOIN_FAILURE=7]="JOIN_FAILURE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(ew||(ew={})),function(e){e[e.RR_UNKOWN=0]="RR_UNKOWN",e[e.RR_SIGNAL_DISCONNECTED=1]="RR_SIGNAL_DISCONNECTED",e[e.RR_PUBLISHER_FAILED=2]="RR_PUBLISHER_FAILED",e[e.RR_SUBSCRIBER_FAILED=3]="RR_SUBSCRIBER_FAILED",e[e.RR_SWITCH_CANDIDATE=4]="RR_SWITCH_CANDIDATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(tw||(tw={})),function(e){e[e.JOINING=0]="JOINING",e[e.JOINED=1]="JOINED",e[e.ACTIVE=2]="ACTIVE",e[e.DISCONNECTED=3]="DISCONNECTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(nw||(nw={})),function(e){e[e.NONE=0]="NONE",e[e.GCM=1]="GCM",e[e.CUSTOM=2]="CUSTOM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(rw||(rw={})),(sw=ow||(ow={}))[sw.RELIABLE=0]="RELIABLE",sw[sw.LOSSY=1]="LOSSY",sw[sw.UNRECOGNIZED=-1]="UNRECOGNIZED",function(e){e[e.Standard=0]="Standard",e[e.Cloud=1]="Cloud",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(iw||(iw={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JS=1]="JS",e[e.SWIFT=2]="SWIFT",e[e.ANDROID=3]="ANDROID",e[e.FLUTTER=4]="FLUTTER",e[e.GO=5]="GO",e[e.UNITY=6]="UNITY",e[e.REACT_NATIVE=7]="REACT_NATIVE",e[e.RUST=8]="RUST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(aw||(aw={}));const Ew={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),""!==e.name&&t.uint32(18).string(e.name),0!==e.emptyTimeout&&t.uint32(24).uint32(e.emptyTimeout),0!==e.maxParticipants&&t.uint32(32).uint32(e.maxParticipants),0!==e.creationTime&&t.uint32(40).int64(e.creationTime),""!==e.turnPassword&&t.uint32(50).string(e.turnPassword);for(const n of e.enabledCodecs)Cw.encode(n,t.uint32(58).fork()).ldelim();return""!==e.metadata&&t.uint32(66).string(e.metadata),0!==e.numParticipants&&t.uint32(72).uint32(e.numParticipants),!0===e.activeRecording&&t.uint32(80).bool(e.activeRecording),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",name:"",emptyTimeout:0,maxParticipants:0,creationTime:0,turnPassword:"",enabledCodecs:[],metadata:"",numParticipants:0,activeRecording:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue;case 3:if(24!=e)break;o.emptyTimeout=n.uint32();continue;case 4:if(32!=e)break;o.maxParticipants=n.uint32();continue;case 5:if(40!=e)break;o.creationTime=qw(n.int64());continue;case 6:if(50!=e)break;o.turnPassword=n.string();continue;case 7:if(58!=e)break;o.enabledCodecs.push(Cw.decode(n,n.uint32()));continue;case 8:if(66!=e)break;o.metadata=n.string();continue;case 9:if(72!=e)break;o.numParticipants=n.uint32();continue;case 10:if(80!=e)break;o.activeRecording=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",name:$w(e.name)?String(e.name):"",emptyTimeout:$w(e.emptyTimeout)?Number(e.emptyTimeout):0,maxParticipants:$w(e.maxParticipants)?Number(e.maxParticipants):0,creationTime:$w(e.creationTime)?Number(e.creationTime):0,turnPassword:$w(e.turnPassword)?String(e.turnPassword):"",enabledCodecs:Array.isArray(null==e?void 0:e.enabledCodecs)?e.enabledCodecs.map((e=>Cw.fromJSON(e))):[],metadata:$w(e.metadata)?String(e.metadata):"",numParticipants:$w(e.numParticipants)?Number(e.numParticipants):0,activeRecording:!!$w(e.activeRecording)&&Boolean(e.activeRecording)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.name&&(t.name=e.name),void 0!==e.emptyTimeout&&(t.emptyTimeout=Math.round(e.emptyTimeout)),void 0!==e.maxParticipants&&(t.maxParticipants=Math.round(e.maxParticipants)),void 0!==e.creationTime&&(t.creationTime=Math.round(e.creationTime)),void 0!==e.turnPassword&&(t.turnPassword=e.turnPassword),e.enabledCodecs?t.enabledCodecs=e.enabledCodecs.map((e=>e?Cw.toJSON(e):void 0)):t.enabledCodecs=[],void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.numParticipants&&(t.numParticipants=Math.round(e.numParticipants)),void 0!==e.activeRecording&&(t.activeRecording=e.activeRecording),t},create:e=>Ew.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sid:"",name:"",emptyTimeout:0,maxParticipants:0,creationTime:0,turnPassword:"",enabledCodecs:[],metadata:"",numParticipants:0,activeRecording:!1};return d.sid=null!==(t=e.sid)&&void 0!==t?t:"",d.name=null!==(n=e.name)&&void 0!==n?n:"",d.emptyTimeout=null!==(r=e.emptyTimeout)&&void 0!==r?r:0,d.maxParticipants=null!==(o=e.maxParticipants)&&void 0!==o?o:0,d.creationTime=null!==(i=e.creationTime)&&void 0!==i?i:0,d.turnPassword=null!==(a=e.turnPassword)&&void 0!==a?a:"",d.enabledCodecs=(null===(s=e.enabledCodecs)||void 0===s?void 0:s.map((e=>Cw.fromPartial(e))))||[],d.metadata=null!==(c=e.metadata)&&void 0!==c?c:"",d.numParticipants=null!==(l=e.numParticipants)&&void 0!==l?l:0,d.activeRecording=null!==(u=e.activeRecording)&&void 0!==u&&u,d}},Cw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.mime&&t.uint32(10).string(e.mime),""!==e.fmtpLine&&t.uint32(18).string(e.fmtpLine),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={mime:"",fmtpLine:""};for(;n.pos>>3){case 1:if(10!=e)break;o.mime=n.string();continue;case 2:if(18!=e)break;o.fmtpLine=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({mime:$w(e.mime)?String(e.mime):"",fmtpLine:$w(e.fmtpLine)?String(e.fmtpLine):""}),toJSON(e){const t={};return void 0!==e.mime&&(t.mime=e.mime),void 0!==e.fmtpLine&&(t.fmtpLine=e.fmtpLine),t},create:e=>Cw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={mime:"",fmtpLine:""};return r.mime=null!==(t=e.mime)&&void 0!==t?t:"",r.fmtpLine=null!==(n=e.fmtpLine)&&void 0!==n?n:"",r}},Tw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();!0===e.canSubscribe&&t.uint32(8).bool(e.canSubscribe),!0===e.canPublish&&t.uint32(16).bool(e.canPublish),!0===e.canPublishData&&t.uint32(24).bool(e.canPublishData),t.uint32(74).fork();for(const n of e.canPublishSources)t.int32(n);return t.ldelim(),!0===e.hidden&&t.uint32(56).bool(e.hidden),!0===e.recorder&&t.uint32(64).bool(e.recorder),!0===e.canUpdateMetadata&&t.uint32(80).bool(e.canUpdateMetadata),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={canSubscribe:!1,canPublish:!1,canPublishData:!1,canPublishSources:[],hidden:!1,recorder:!1,canUpdateMetadata:!1};for(;n.pos>>3){case 1:if(8!=e)break;o.canSubscribe=n.bool();continue;case 2:if(16!=e)break;o.canPublish=n.bool();continue;case 3:if(24!=e)break;o.canPublishData=n.bool();continue;case 9:if(72==e){o.canPublishSources.push(n.int32());continue}if(74==e){const e=n.uint32()+n.pos;for(;n.pos({canSubscribe:!!$w(e.canSubscribe)&&Boolean(e.canSubscribe),canPublish:!!$w(e.canPublish)&&Boolean(e.canPublish),canPublishData:!!$w(e.canPublishData)&&Boolean(e.canPublishData),canPublishSources:Array.isArray(null==e?void 0:e.canPublishSources)?e.canPublishSources.map((e=>dw(e))):[],hidden:!!$w(e.hidden)&&Boolean(e.hidden),recorder:!!$w(e.recorder)&&Boolean(e.recorder),canUpdateMetadata:!!$w(e.canUpdateMetadata)&&Boolean(e.canUpdateMetadata)}),toJSON(e){const t={};return void 0!==e.canSubscribe&&(t.canSubscribe=e.canSubscribe),void 0!==e.canPublish&&(t.canPublish=e.canPublish),void 0!==e.canPublishData&&(t.canPublishData=e.canPublishData),e.canPublishSources?t.canPublishSources=e.canPublishSources.map((e=>pw(e))):t.canPublishSources=[],void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.recorder&&(t.recorder=e.recorder),void 0!==e.canUpdateMetadata&&(t.canUpdateMetadata=e.canUpdateMetadata),t},create:e=>Tw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={canSubscribe:!1,canPublish:!1,canPublishData:!1,canPublishSources:[],hidden:!1,recorder:!1,canUpdateMetadata:!1};return c.canSubscribe=null!==(t=e.canSubscribe)&&void 0!==t&&t,c.canPublish=null!==(n=e.canPublish)&&void 0!==n&&n,c.canPublishData=null!==(r=e.canPublishData)&&void 0!==r&&r,c.canPublishSources=(null===(o=e.canPublishSources)||void 0===o?void 0:o.map((e=>e)))||[],c.hidden=null!==(i=e.hidden)&&void 0!==i&&i,c.recorder=null!==(a=e.recorder)&&void 0!==a&&a,c.canUpdateMetadata=null!==(s=e.canUpdateMetadata)&&void 0!==s&&s,c}},xw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),""!==e.identity&&t.uint32(18).string(e.identity),0!==e.state&&t.uint32(24).int32(e.state);for(const n of e.tracks)jw.encode(n,t.uint32(34).fork()).ldelim();return""!==e.metadata&&t.uint32(42).string(e.metadata),0!==e.joinedAt&&t.uint32(48).int64(e.joinedAt),""!==e.name&&t.uint32(74).string(e.name),0!==e.version&&t.uint32(80).uint32(e.version),void 0!==e.permission&&Tw.encode(e.permission,t.uint32(90).fork()).ldelim(),""!==e.region&&t.uint32(98).string(e.region),!0===e.isPublisher&&t.uint32(104).bool(e.isPublisher),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",identity:"",state:0,tracks:[],metadata:"",joinedAt:0,name:"",version:0,permission:void 0,region:"",isPublisher:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(18!=e)break;o.identity=n.string();continue;case 3:if(24!=e)break;o.state=n.int32();continue;case 4:if(34!=e)break;o.tracks.push(jw.decode(n,n.uint32()));continue;case 5:if(42!=e)break;o.metadata=n.string();continue;case 6:if(48!=e)break;o.joinedAt=qw(n.int64());continue;case 9:if(74!=e)break;o.name=n.string();continue;case 10:if(80!=e)break;o.version=n.uint32();continue;case 11:if(90!=e)break;o.permission=Tw.decode(n,n.uint32());continue;case 12:if(98!=e)break;o.region=n.string();continue;case 13:if(104!=e)break;o.isPublisher=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",identity:$w(e.identity)?String(e.identity):"",state:$w(e.state)?gw(e.state):0,tracks:Array.isArray(null==e?void 0:e.tracks)?e.tracks.map((e=>jw.fromJSON(e))):[],metadata:$w(e.metadata)?String(e.metadata):"",joinedAt:$w(e.joinedAt)?Number(e.joinedAt):0,name:$w(e.name)?String(e.name):"",version:$w(e.version)?Number(e.version):0,permission:$w(e.permission)?Tw.fromJSON(e.permission):void 0,region:$w(e.region)?String(e.region):"",isPublisher:!!$w(e.isPublisher)&&Boolean(e.isPublisher)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.identity&&(t.identity=e.identity),void 0!==e.state&&(t.state=function(e){switch(e){case nw.JOINING:return"JOINING";case nw.JOINED:return"JOINED";case nw.ACTIVE:return"ACTIVE";case nw.DISCONNECTED:return"DISCONNECTED";case nw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.state)),e.tracks?t.tracks=e.tracks.map((e=>e?jw.toJSON(e):void 0)):t.tracks=[],void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.joinedAt&&(t.joinedAt=Math.round(e.joinedAt)),void 0!==e.name&&(t.name=e.name),void 0!==e.version&&(t.version=Math.round(e.version)),void 0!==e.permission&&(t.permission=e.permission?Tw.toJSON(e.permission):void 0),void 0!==e.region&&(t.region=e.region),void 0!==e.isPublisher&&(t.isPublisher=e.isPublisher),t},create:e=>xw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sid:"",identity:"",state:0,tracks:[],metadata:"",joinedAt:0,name:"",version:0,permission:void 0,region:"",isPublisher:!1};return d.sid=null!==(t=e.sid)&&void 0!==t?t:"",d.identity=null!==(n=e.identity)&&void 0!==n?n:"",d.state=null!==(r=e.state)&&void 0!==r?r:0,d.tracks=(null===(o=e.tracks)||void 0===o?void 0:o.map((e=>jw.fromPartial(e))))||[],d.metadata=null!==(i=e.metadata)&&void 0!==i?i:"",d.joinedAt=null!==(a=e.joinedAt)&&void 0!==a?a:0,d.name=null!==(s=e.name)&&void 0!==s?s:"",d.version=null!==(c=e.version)&&void 0!==c?c:0,d.permission=void 0!==e.permission&&null!==e.permission?Tw.fromPartial(e.permission):void 0,d.region=null!==(l=e.region)&&void 0!==l?l:"",d.isPublisher=null!==(u=e.isPublisher)&&void 0!==u&&u,d}},Rw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.mimeType&&t.uint32(10).string(e.mimeType),""!==e.mid&&t.uint32(18).string(e.mid),""!==e.cid&&t.uint32(26).string(e.cid);for(const n of e.layers)Iw.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={mimeType:"",mid:"",cid:"",layers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.mimeType=n.string();continue;case 2:if(18!=e)break;o.mid=n.string();continue;case 3:if(26!=e)break;o.cid=n.string();continue;case 4:if(34!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({mimeType:$w(e.mimeType)?String(e.mimeType):"",mid:$w(e.mid)?String(e.mid):"",cid:$w(e.cid)?String(e.cid):"",layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mid&&(t.mid=e.mid),void 0!==e.cid&&(t.cid=e.cid),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],t},create:e=>Rw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i={mimeType:"",mid:"",cid:"",layers:[]};return i.mimeType=null!==(t=e.mimeType)&&void 0!==t?t:"",i.mid=null!==(n=e.mid)&&void 0!==n?n:"",i.cid=null!==(r=e.cid)&&void 0!==r?r:"",i.layers=(null===(o=e.layers)||void 0===o?void 0:o.map((e=>Iw.fromPartial(e))))||[],i}},jw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.sid&&t.uint32(10).string(e.sid),0!==e.type&&t.uint32(16).int32(e.type),""!==e.name&&t.uint32(26).string(e.name),!0===e.muted&&t.uint32(32).bool(e.muted),0!==e.width&&t.uint32(40).uint32(e.width),0!==e.height&&t.uint32(48).uint32(e.height),!0===e.simulcast&&t.uint32(56).bool(e.simulcast),!0===e.disableDtx&&t.uint32(64).bool(e.disableDtx),0!==e.source&&t.uint32(72).int32(e.source);for(const n of e.layers)Iw.encode(n,t.uint32(82).fork()).ldelim();""!==e.mimeType&&t.uint32(90).string(e.mimeType),""!==e.mid&&t.uint32(98).string(e.mid);for(const n of e.codecs)Rw.encode(n,t.uint32(106).fork()).ldelim();return!0===e.stereo&&t.uint32(112).bool(e.stereo),!0===e.disableRed&&t.uint32(120).bool(e.disableRed),0!==e.encryption&&t.uint32(128).int32(e.encryption),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",type:0,name:"",muted:!1,width:0,height:0,simulcast:!1,disableDtx:!1,source:0,layers:[],mimeType:"",mid:"",codecs:[],stereo:!1,disableRed:!1,encryption:0};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(16!=e)break;o.type=n.int32();continue;case 3:if(26!=e)break;o.name=n.string();continue;case 4:if(32!=e)break;o.muted=n.bool();continue;case 5:if(40!=e)break;o.width=n.uint32();continue;case 6:if(48!=e)break;o.height=n.uint32();continue;case 7:if(56!=e)break;o.simulcast=n.bool();continue;case 8:if(64!=e)break;o.disableDtx=n.bool();continue;case 9:if(72!=e)break;o.source=n.int32();continue;case 10:if(82!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue;case 11:if(90!=e)break;o.mimeType=n.string();continue;case 12:if(98!=e)break;o.mid=n.string();continue;case 13:if(106!=e)break;o.codecs.push(Rw.decode(n,n.uint32()));continue;case 14:if(112!=e)break;o.stereo=n.bool();continue;case 15:if(120!=e)break;o.disableRed=n.bool();continue;case 16:if(128!=e)break;o.encryption=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",type:$w(e.type)?lw(e.type):0,name:$w(e.name)?String(e.name):"",muted:!!$w(e.muted)&&Boolean(e.muted),width:$w(e.width)?Number(e.width):0,height:$w(e.height)?Number(e.height):0,simulcast:!!$w(e.simulcast)&&Boolean(e.simulcast),disableDtx:!!$w(e.disableDtx)&&Boolean(e.disableDtx),source:$w(e.source)?dw(e.source):0,layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[],mimeType:$w(e.mimeType)?String(e.mimeType):"",mid:$w(e.mid)?String(e.mid):"",codecs:Array.isArray(null==e?void 0:e.codecs)?e.codecs.map((e=>Rw.fromJSON(e))):[],stereo:!!$w(e.stereo)&&Boolean(e.stereo),disableRed:!!$w(e.disableRed)&&Boolean(e.disableRed),encryption:$w(e.encryption)?Sw(e.encryption):0}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.type&&(t.type=uw(e.type)),void 0!==e.name&&(t.name=e.name),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.simulcast&&(t.simulcast=e.simulcast),void 0!==e.disableDtx&&(t.disableDtx=e.disableDtx),void 0!==e.source&&(t.source=pw(e.source)),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],void 0!==e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mid&&(t.mid=e.mid),e.codecs?t.codecs=e.codecs.map((e=>e?Rw.toJSON(e):void 0)):t.codecs=[],void 0!==e.stereo&&(t.stereo=e.stereo),void 0!==e.disableRed&&(t.disableRed=e.disableRed),void 0!==e.encryption&&(t.encryption=ww(e.encryption)),t},create:e=>jw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y;const v={sid:"",type:0,name:"",muted:!1,width:0,height:0,simulcast:!1,disableDtx:!1,source:0,layers:[],mimeType:"",mid:"",codecs:[],stereo:!1,disableRed:!1,encryption:0};return v.sid=null!==(t=e.sid)&&void 0!==t?t:"",v.type=null!==(n=e.type)&&void 0!==n?n:0,v.name=null!==(r=e.name)&&void 0!==r?r:"",v.muted=null!==(o=e.muted)&&void 0!==o&&o,v.width=null!==(i=e.width)&&void 0!==i?i:0,v.height=null!==(a=e.height)&&void 0!==a?a:0,v.simulcast=null!==(s=e.simulcast)&&void 0!==s&&s,v.disableDtx=null!==(c=e.disableDtx)&&void 0!==c&&c,v.source=null!==(l=e.source)&&void 0!==l?l:0,v.layers=(null===(u=e.layers)||void 0===u?void 0:u.map((e=>Iw.fromPartial(e))))||[],v.mimeType=null!==(d=e.mimeType)&&void 0!==d?d:"",v.mid=null!==(p=e.mid)&&void 0!==p?p:"",v.codecs=(null===(f=e.codecs)||void 0===f?void 0:f.map((e=>Rw.fromPartial(e))))||[],v.stereo=null!==(h=e.stereo)&&void 0!==h&&h,v.disableRed=null!==(m=e.disableRed)&&void 0!==m&&m,v.encryption=null!==(y=e.encryption)&&void 0!==y?y:0,v}},Iw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.quality&&t.uint32(8).int32(e.quality),0!==e.width&&t.uint32(16).uint32(e.width),0!==e.height&&t.uint32(24).uint32(e.height),0!==e.bitrate&&t.uint32(32).uint32(e.bitrate),0!==e.ssrc&&t.uint32(40).uint32(e.ssrc),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={quality:0,width:0,height:0,bitrate:0,ssrc:0};for(;n.pos>>3){case 1:if(8!=e)break;o.quality=n.int32();continue;case 2:if(16!=e)break;o.width=n.uint32();continue;case 3:if(24!=e)break;o.height=n.uint32();continue;case 4:if(32!=e)break;o.bitrate=n.uint32();continue;case 5:if(40!=e)break;o.ssrc=n.uint32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({quality:$w(e.quality)?fw(e.quality):0,width:$w(e.width)?Number(e.width):0,height:$w(e.height)?Number(e.height):0,bitrate:$w(e.bitrate)?Number(e.bitrate):0,ssrc:$w(e.ssrc)?Number(e.ssrc):0}),toJSON(e){const t={};return void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.bitrate&&(t.bitrate=Math.round(e.bitrate)),void 0!==e.ssrc&&(t.ssrc=Math.round(e.ssrc)),t},create:e=>Iw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i;const a={quality:0,width:0,height:0,bitrate:0,ssrc:0};return a.quality=null!==(t=e.quality)&&void 0!==t?t:0,a.width=null!==(n=e.width)&&void 0!==n?n:0,a.height=null!==(r=e.height)&&void 0!==r?r:0,a.bitrate=null!==(o=e.bitrate)&&void 0!==o?o:0,a.ssrc=null!==(i=e.ssrc)&&void 0!==i?i:0,a}},_w={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(0!==e.kind&&t.uint32(8).int32(e.kind),null===(n=e.value)||void 0===n?void 0:n.$case){case"user":Dw.encode(e.value.user,t.uint32(18).fork()).ldelim();break;case"speaker":Aw.encode(e.value.speaker,t.uint32(26).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={kind:0,value:void 0};for(;n.pos>>3){case 1:if(8!=e)break;o.kind=n.int32();continue;case 2:if(18!=e)break;o.value={$case:"user",user:Dw.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.value={$case:"speaker",speaker:Aw.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({kind:$w(e.kind)?kw(e.kind):0,value:$w(e.user)?{$case:"user",user:Dw.fromJSON(e.user)}:$w(e.speaker)?{$case:"speaker",speaker:Aw.fromJSON(e.speaker)}:void 0}),toJSON(e){var t,n,r,o,i,a;const s={};return void 0!==e.kind&&(s.kind=function(e){switch(e){case ow.RELIABLE:return"RELIABLE";case ow.LOSSY:return"LOSSY";case ow.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.kind)),"user"===(null===(t=e.value)||void 0===t?void 0:t.$case)&&(s.user=(null===(n=e.value)||void 0===n?void 0:n.user)?Dw.toJSON(null===(r=e.value)||void 0===r?void 0:r.user):void 0),"speaker"===(null===(o=e.value)||void 0===o?void 0:o.$case)&&(s.speaker=(null===(i=e.value)||void 0===i?void 0:i.speaker)?Aw.toJSON(null===(a=e.value)||void 0===a?void 0:a.speaker):void 0),s},create:e=>_w.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={kind:0,value:void 0};return c.kind=null!==(t=e.kind)&&void 0!==t?t:0,"user"===(null===(n=e.value)||void 0===n?void 0:n.$case)&&void 0!==(null===(r=e.value)||void 0===r?void 0:r.user)&&null!==(null===(o=e.value)||void 0===o?void 0:o.user)&&(c.value={$case:"user",user:Dw.fromPartial(e.value.user)}),"speaker"===(null===(i=e.value)||void 0===i?void 0:i.$case)&&void 0!==(null===(a=e.value)||void 0===a?void 0:a.speaker)&&null!==(null===(s=e.value)||void 0===s?void 0:s.speaker)&&(c.value={$case:"speaker",speaker:Aw.fromPartial(e.value.speaker)}),c}},Aw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.speakers)Mw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={speakers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.speakers.push(Mw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({speakers:Array.isArray(null==e?void 0:e.speakers)?e.speakers.map((e=>Mw.fromJSON(e))):[]}),toJSON(e){const t={};return e.speakers?t.speakers=e.speakers.map((e=>e?Mw.toJSON(e):void 0)):t.speakers=[],t},create:e=>Aw.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={speakers:[]};return n.speakers=(null===(t=e.speakers)||void 0===t?void 0:t.map((e=>Mw.fromPartial(e))))||[],n}},Mw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.sid&&t.uint32(10).string(e.sid),0!==e.level&&t.uint32(21).float(e.level),!0===e.active&&t.uint32(24).bool(e.active),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",level:0,active:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(21!=e)break;o.level=n.float();continue;case 3:if(24!=e)break;o.active=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:$w(e.sid)?String(e.sid):"",level:$w(e.level)?Number(e.level):0,active:!!$w(e.active)&&Boolean(e.active)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.level&&(t.level=e.level),void 0!==e.active&&(t.active=e.active),t},create:e=>Mw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={sid:"",level:0,active:!1};return o.sid=null!==(t=e.sid)&&void 0!==t?t:"",o.level=null!==(n=e.level)&&void 0!==n?n:0,o.active=null!==(r=e.active)&&void 0!==r&&r,o}};function Nw(){return{participantSid:"",payload:new Uint8Array,destinationSids:[],topic:void 0}}const Dw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid),0!==e.payload.length&&t.uint32(18).bytes(e.payload);for(const n of e.destinationSids)t.uint32(26).string(n);return void 0!==e.topic&&t.uint32(34).string(e.topic),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o=Nw();for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.payload=n.bytes();continue;case 3:if(26!=e)break;o.destinationSids.push(n.string());continue;case 4:if(34!=e)break;o.topic=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:$w(e.participantSid)?String(e.participantSid):"",payload:$w(e.payload)?Hw(e.payload):new Uint8Array,destinationSids:Array.isArray(null==e?void 0:e.destinationSids)?e.destinationSids.map((e=>String(e))):[],topic:$w(e.topic)?String(e.topic):void 0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.payload&&(t.payload=function(e){if(Zw.Buffer)return Zw.Buffer.from(e).toString("base64");{const t=[];return e.forEach((e=>{t.push(String.fromCharCode(e))})),Zw.btoa(t.join(""))}}(void 0!==e.payload?e.payload:new Uint8Array)),e.destinationSids?t.destinationSids=e.destinationSids.map((e=>e)):t.destinationSids=[],void 0!==e.topic&&(t.topic=e.topic),t},create:e=>Dw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i=Nw();return i.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",i.payload=null!==(n=e.payload)&&void 0!==n?n:new Uint8Array,i.destinationSids=(null===(r=e.destinationSids)||void 0===r?void 0:r.map((e=>e)))||[],i.topic=null!==(o=e.topic)&&void 0!==o?o:void 0,i}},Lw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid);for(const n of e.trackSids)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSids:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSids.push(n.string());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:$w(e.participantSid)?String(e.participantSid):"",trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[]}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],t},create:e=>Lw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={participantSid:"",trackSids:[]};return r.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",r.trackSids=(null===(n=e.trackSids)||void 0===n?void 0:n.map((e=>e)))||[],r}},Uw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.edition&&t.uint32(8).int32(e.edition),""!==e.version&&t.uint32(18).string(e.version),0!==e.protocol&&t.uint32(24).int32(e.protocol),""!==e.region&&t.uint32(34).string(e.region),""!==e.nodeId&&t.uint32(42).string(e.nodeId),""!==e.debugInfo&&t.uint32(50).string(e.debugInfo),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={edition:0,version:"",protocol:0,region:"",nodeId:"",debugInfo:""};for(;n.pos>>3){case 1:if(8!=e)break;o.edition=n.int32();continue;case 2:if(18!=e)break;o.version=n.string();continue;case 3:if(24!=e)break;o.protocol=n.int32();continue;case 4:if(34!=e)break;o.region=n.string();continue;case 5:if(42!=e)break;o.nodeId=n.string();continue;case 6:if(50!=e)break;o.debugInfo=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({edition:$w(e.edition)?Ow(e.edition):0,version:$w(e.version)?String(e.version):"",protocol:$w(e.protocol)?Number(e.protocol):0,region:$w(e.region)?String(e.region):"",nodeId:$w(e.nodeId)?String(e.nodeId):"",debugInfo:$w(e.debugInfo)?String(e.debugInfo):""}),toJSON(e){const t={};return void 0!==e.edition&&(t.edition=function(e){switch(e){case iw.Standard:return"Standard";case iw.Cloud:return"Cloud";case iw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.edition)),void 0!==e.version&&(t.version=e.version),void 0!==e.protocol&&(t.protocol=Math.round(e.protocol)),void 0!==e.region&&(t.region=e.region),void 0!==e.nodeId&&(t.nodeId=e.nodeId),void 0!==e.debugInfo&&(t.debugInfo=e.debugInfo),t},create:e=>Uw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a;const s={edition:0,version:"",protocol:0,region:"",nodeId:"",debugInfo:""};return s.edition=null!==(t=e.edition)&&void 0!==t?t:0,s.version=null!==(n=e.version)&&void 0!==n?n:"",s.protocol=null!==(r=e.protocol)&&void 0!==r?r:0,s.region=null!==(o=e.region)&&void 0!==o?o:"",s.nodeId=null!==(i=e.nodeId)&&void 0!==i?i:"",s.debugInfo=null!==(a=e.debugInfo)&&void 0!==a?a:"",s}},Bw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.sdk&&t.uint32(8).int32(e.sdk),""!==e.version&&t.uint32(18).string(e.version),0!==e.protocol&&t.uint32(24).int32(e.protocol),""!==e.os&&t.uint32(34).string(e.os),""!==e.osVersion&&t.uint32(42).string(e.osVersion),""!==e.deviceModel&&t.uint32(50).string(e.deviceModel),""!==e.browser&&t.uint32(58).string(e.browser),""!==e.browserVersion&&t.uint32(66).string(e.browserVersion),""!==e.address&&t.uint32(74).string(e.address),""!==e.network&&t.uint32(82).string(e.network),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sdk:0,version:"",protocol:0,os:"",osVersion:"",deviceModel:"",browser:"",browserVersion:"",address:"",network:""};for(;n.pos>>3){case 1:if(8!=e)break;o.sdk=n.int32();continue;case 2:if(18!=e)break;o.version=n.string();continue;case 3:if(24!=e)break;o.protocol=n.int32();continue;case 4:if(34!=e)break;o.os=n.string();continue;case 5:if(42!=e)break;o.osVersion=n.string();continue;case 6:if(50!=e)break;o.deviceModel=n.string();continue;case 7:if(58!=e)break;o.browser=n.string();continue;case 8:if(66!=e)break;o.browserVersion=n.string();continue;case 9:if(74!=e)break;o.address=n.string();continue;case 10:if(82!=e)break;o.network=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sdk:$w(e.sdk)?Pw(e.sdk):0,version:$w(e.version)?String(e.version):"",protocol:$w(e.protocol)?Number(e.protocol):0,os:$w(e.os)?String(e.os):"",osVersion:$w(e.osVersion)?String(e.osVersion):"",deviceModel:$w(e.deviceModel)?String(e.deviceModel):"",browser:$w(e.browser)?String(e.browser):"",browserVersion:$w(e.browserVersion)?String(e.browserVersion):"",address:$w(e.address)?String(e.address):"",network:$w(e.network)?String(e.network):""}),toJSON(e){const t={};return void 0!==e.sdk&&(t.sdk=function(e){switch(e){case aw.UNKNOWN:return"UNKNOWN";case aw.JS:return"JS";case aw.SWIFT:return"SWIFT";case aw.ANDROID:return"ANDROID";case aw.FLUTTER:return"FLUTTER";case aw.GO:return"GO";case aw.UNITY:return"UNITY";case aw.REACT_NATIVE:return"REACT_NATIVE";case aw.RUST:return"RUST";case aw.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.sdk)),void 0!==e.version&&(t.version=e.version),void 0!==e.protocol&&(t.protocol=Math.round(e.protocol)),void 0!==e.os&&(t.os=e.os),void 0!==e.osVersion&&(t.osVersion=e.osVersion),void 0!==e.deviceModel&&(t.deviceModel=e.deviceModel),void 0!==e.browser&&(t.browser=e.browser),void 0!==e.browserVersion&&(t.browserVersion=e.browserVersion),void 0!==e.address&&(t.address=e.address),void 0!==e.network&&(t.network=e.network),t},create:e=>Bw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u;const d={sdk:0,version:"",protocol:0,os:"",osVersion:"",deviceModel:"",browser:"",browserVersion:"",address:"",network:""};return d.sdk=null!==(t=e.sdk)&&void 0!==t?t:0,d.version=null!==(n=e.version)&&void 0!==n?n:"",d.protocol=null!==(r=e.protocol)&&void 0!==r?r:0,d.os=null!==(o=e.os)&&void 0!==o?o:"",d.osVersion=null!==(i=e.osVersion)&&void 0!==i?i:"",d.deviceModel=null!==(a=e.deviceModel)&&void 0!==a?a:"",d.browser=null!==(s=e.browser)&&void 0!==s?s:"",d.browserVersion=null!==(c=e.browserVersion)&&void 0!==c?c:"",d.address=null!==(l=e.address)&&void 0!==l?l:"",d.network=null!==(u=e.network)&&void 0!==u?u:"",d}},Fw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return void 0!==e.video&&zw.encode(e.video,t.uint32(10).fork()).ldelim(),void 0!==e.screen&&zw.encode(e.screen,t.uint32(18).fork()).ldelim(),0!==e.resumeConnection&&t.uint32(24).int32(e.resumeConnection),void 0!==e.disabledCodecs&&Ww.encode(e.disabledCodecs,t.uint32(34).fork()).ldelim(),0!==e.forceRelay&&t.uint32(40).int32(e.forceRelay),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={video:void 0,screen:void 0,resumeConnection:0,disabledCodecs:void 0,forceRelay:0};for(;n.pos>>3){case 1:if(10!=e)break;o.video=zw.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.screen=zw.decode(n,n.uint32());continue;case 3:if(24!=e)break;o.resumeConnection=n.int32();continue;case 4:if(34!=e)break;o.disabledCodecs=Ww.decode(n,n.uint32());continue;case 5:if(40!=e)break;o.forceRelay=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({video:$w(e.video)?zw.fromJSON(e.video):void 0,screen:$w(e.screen)?zw.fromJSON(e.screen):void 0,resumeConnection:$w(e.resumeConnection)?yw(e.resumeConnection):0,disabledCodecs:$w(e.disabledCodecs)?Ww.fromJSON(e.disabledCodecs):void 0,forceRelay:$w(e.forceRelay)?yw(e.forceRelay):0}),toJSON(e){const t={};return void 0!==e.video&&(t.video=e.video?zw.toJSON(e.video):void 0),void 0!==e.screen&&(t.screen=e.screen?zw.toJSON(e.screen):void 0),void 0!==e.resumeConnection&&(t.resumeConnection=vw(e.resumeConnection)),void 0!==e.disabledCodecs&&(t.disabledCodecs=e.disabledCodecs?Ww.toJSON(e.disabledCodecs):void 0),void 0!==e.forceRelay&&(t.forceRelay=vw(e.forceRelay)),t},create:e=>Fw.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={video:void 0,screen:void 0,resumeConnection:0,disabledCodecs:void 0,forceRelay:0};return r.video=void 0!==e.video&&null!==e.video?zw.fromPartial(e.video):void 0,r.screen=void 0!==e.screen&&null!==e.screen?zw.fromPartial(e.screen):void 0,r.resumeConnection=null!==(t=e.resumeConnection)&&void 0!==t?t:0,r.disabledCodecs=void 0!==e.disabledCodecs&&null!==e.disabledCodecs?Ww.fromPartial(e.disabledCodecs):void 0,r.forceRelay=null!==(n=e.forceRelay)&&void 0!==n?n:0,r}},zw={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.hardwareEncoder&&t.uint32(8).int32(e.hardwareEncoder),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={hardwareEncoder:0};for(;n.pos>>3){case 1:if(8!=e)break;o.hardwareEncoder=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({hardwareEncoder:$w(e.hardwareEncoder)?yw(e.hardwareEncoder):0}),toJSON(e){const t={};return void 0!==e.hardwareEncoder&&(t.hardwareEncoder=vw(e.hardwareEncoder)),t},create:e=>zw.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={hardwareEncoder:0};return n.hardwareEncoder=null!==(t=e.hardwareEncoder)&&void 0!==t?t:0,n}},Ww={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.codecs)Cw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codecs:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.codecs.push(Cw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codecs:Array.isArray(null==e?void 0:e.codecs)?e.codecs.map((e=>Cw.fromJSON(e))):[]}),toJSON(e){const t={};return e.codecs?t.codecs=e.codecs.map((e=>e?Cw.toJSON(e):void 0)):t.codecs=[],t},create:e=>Ww.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={codecs:[]};return n.codecs=(null===(t=e.codecs)||void 0===t?void 0:t.map((e=>Cw.fromPartial(e))))||[],n}};var Zw=(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function Hw(e){if(Zw.Buffer)return Uint8Array.from(Zw.Buffer.from(e,"base64"));{const t=Zw.atob(e),n=new Uint8Array(t.length);for(let e=0;e=n&&parseInt(r[n],10)}function rk(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);const i=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,i),o.apply(this,[e,i])};const i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(n))return i.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,i.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function ok(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(ek=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function ik(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(tk=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function ak(){if("object"==typeof window){if(ek)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function sk(e,t){tk&&console.warn(e+" is deprecated, please use "+t+" instead.")}function ck(e){return"[object Object]"===Object.prototype.toString.call(e)}function lk(e){return ck(e)?Object.keys(e).reduce((function(t,n){const r=ck(e[n]),o=r?lk(e[n]):e[n],i=r&&!Object.keys(o).length;return void 0===o||i?t:Object.assign(t,{[n]:o})}),{}):e}function uk(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((r=>{r.endsWith("Id")?uk(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((t=>{uk(e,e.get(t),n)}))})))}function dk(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;const i=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((t=>{e.forEach((n=>{n.type===r&&n.trackId===t.id&&uk(e,n,o)}))})),o}const pk=ak;function fk(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[o("min",n)]=r.ideal,t.optional.push(e),e={},e[o("max",n)]=r.ideal,t.optional.push(e)):(e[o("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach((e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},o=function(e,o){if(t.version>=61)return o(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let i=e.video.facingMode;i=i&&("object"==typeof i?i:{ideal:i});const a=t.version<66;if(i&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||a)){let t;if(delete e.video.facingMode,"environment"===i.exact||"environment"===i.ideal?t=["back","rear"]:"user"!==i.exact&&"user"!==i.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{let a=(n=n.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!a&&n.length&&t.includes("back")&&(a=n[n.length-1]),a&&(e.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),e.video=r(e.video),pk("chrome: "+JSON.stringify(e)),o(e)}))}e.video=r(e.video)}return pk("chrome: "+JSON.stringify(e)),o(e)},i=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){o(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{r&&r(i(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return o(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(i(e))))))}}}function hk(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function mk(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const o=new Event("track");o.track=n.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)})),t.stream.getTracks().forEach((n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],this.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else rk(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function yk(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let o=n.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function vk(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const o=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},i=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const r=function(e){n(i(o(e)))};return t.apply(this,[r,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(i(o(t)))},n])})).then(n,r)}}function bk(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>dk(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),rk(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>dk(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach((n=>{n.track===e&&(t?r=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?r=!0:n=t),t.track===e))),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function gk(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),o.apply(this,arguments)}}function Sk(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return gk(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{const t=this.getSenders().find((t=>t.track===e));if(t)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const o=e.RTCPeerConnection.prototype.removeStream;function i(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const o=this.getSenders().find((e=>e.track===t));if(o)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=i(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>i(this,e)))}};e.RTCPeerConnection.prototype[t]=r[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const s=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=s.get.apply(this);return""===e.type?e:i(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function wk(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function kk(e,t){rk(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}var Ok=Object.freeze({__proto__:null,fixNegotiationNeeded:kk,shimAddTrackRemoveTrack:Sk,shimAddTrackRemoveTrackWithNative:gk,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))},shimGetSendersWithDtmf:yk,shimGetStats:vk,shimGetUserMedia:fk,shimMediaStream:hk,shimOnTrack:mk,shimPeerConnection:wk,shimSenderReceiverGetStats:bk});function Pk(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){sk("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function Ek(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ck(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,o,i]=arguments;return r.apply(this,[e||null]).then((e=>{if(t.version<53&&!o)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(o,i)}}function Tk(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function xk(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),rk(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Rk(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){sk("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function jk(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Ik(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})}function _k(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function Ak(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function Mk(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var Nk=Object.freeze({__proto__:null,shimAddTransceiver:Ik,shimCreateAnswer:Mk,shimCreateOffer:Ak,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})},shimGetParameters:_k,shimGetUserMedia:Pk,shimOnTrack:Ek,shimPeerConnection:Ck,shimRTCDataChannel:jk,shimReceiverGetStats:xk,shimRemoveStream:Rk,shimSenderGetStats:Tk});function Dk(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function Lk(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function Uk(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,i=t.setRemoteDescription,a=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o};let s=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){const r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function Bk(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(Fk(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function Fk(e){return e&&void 0!==e.video?Object.assign({},e,{video:lk(e.video)}):e}function zk(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;nt.generateCertificate})}function Wk(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Zk(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Hk(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var qk=Object.freeze({__proto__:null,shimAudioContext:Hk,shimCallbacksAPI:Uk,shimConstraints:Fk,shimCreateOfferLegacy:Zk,shimGetUserMedia:Bk,shimLocalStreamsAPI:Dk,shimRTCIceServerUrls:zk,shimRemoteStreamsAPI:Lk,shimTrackEventTransceiver:Wk}),$k={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],o=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substring(12),password:o.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" ");n.profile=r[2];for(let o=3;o{n.headerExtensions.push(t.parseExtmap(e))}));const o=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return n.codecs.forEach((e=>{o.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)}));let o=0;return n.codecs.forEach((e=>{e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),i=-1!==r.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),s=a.length>0&&a[0].ssrc;let c;const l=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));l.length>0&&l[0].length>1&&l[0][0]===s&&(c=l[0][1]),r.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(t.rtx={ssrc:c}),n.push(t),o&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:s,mechanism:i?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&s&&n.push({ssrc:s});let u=t.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substring(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substring(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=u}))),n},t.parseRtcpParameters=function(e){const n={},r=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const o=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=o.length>0,n.compound=0===o.length;const i=t.matchPrefix(e,"a=rtcp-mux");return n.mux=i.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const r=t.matchPrefix(e,"a=msid:");if(1===r.length)return n=r[0].substring(7).split(" "),{stream:n[0],track:n[1]};const o=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return o.length>0?(n=o[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");let o;r.length>0&&(o=parseInt(r[0].substring(19),10)),isNaN(o)&&(o=65536);const i=t.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substring(12),10),protocol:n.fmt,maxMessageSize:o};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:o}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,n,r){let o;const i=void 0!==n?n:2;return o=e||t.generateSessionId(),"v=0\r\no="+(r||"thisisadapterortc")+" "+o+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const r=t.splitLines(e);for(let e=0;e(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function Yk(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||rk(e,"icecandidate",(e=>{if(e.candidate){const t=Gk.parseCandidate(e.candidate.candidate);"relay"===t.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e}))}function Qk(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;const t=Gk.splitSections(e.sdp);return t.shift(),t.some((e=>{const t=Gk.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const e=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),n=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n}(e),r=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const o=Gk.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substring(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r}(arguments[0],e);let o;o=0===n&&0===r?Number.POSITIVE_INFINITY:0===n||0===r?Math.max(n,r):Math.min(n,r);const i={};Object.defineProperty(i,"maxMessageSize",{get:()=>o}),this._sctp=i}return n.apply(this,arguments)}}function Xk(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},rk(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function eO(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function tO(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function nO(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function rO(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}return e.sdp||"offer"!==e.type&&"answer"!==e.type?n.apply(this,[e]):("offer"===e.type?this.createOffer:this.createAnswer).apply(this).then((e=>n.apply(this,[e])))})}var oO,iO,aO,sO=Object.freeze({__proto__:null,removeExtmapAllowMixed:tO,shimAddIceCandidateNullOrEmpty:nO,shimConnectionState:eO,shimMaxMessageSize:Qk,shimParameterlessSetLocalDescription:rO,shimRTCIceCandidate:Kk,shimRTCIceCandidateRelayProtocol:Yk,shimSendThrowTypeError:Xk});function cO(e){switch(e){case 0:case"PUBLISHER":return oO.PUBLISHER;case 1:case"SUBSCRIBER":return oO.SUBSCRIBER;default:return oO.UNRECOGNIZED}}function lO(e){switch(e){case oO.PUBLISHER:return"PUBLISHER";case oO.SUBSCRIBER:return"SUBSCRIBER";case oO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function uO(e){switch(e){case 0:case"ACTIVE":return iO.ACTIVE;case 1:case"PAUSED":return iO.PAUSED;default:return iO.UNRECOGNIZED}}function dO(e){switch(e){case 0:case"UDP":return aO.UDP;case 1:case"TCP":return aO.TCP;case 2:case"TLS":return aO.TLS;default:return aO.UNRECOGNIZED}}!function(){let{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=ak,r=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=nk(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection)t.browser="chrome",t.version=nk(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=nk(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(e),o={browserDetails:r,commonShim:sO,extractVersion:nk,disableLog:ok,disableWarnings:ik,sdp:Jk};switch(r.browser){case"chrome":if(!Ok||!wk||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),o;if(null===r.version)return n("Chrome shim can not determine version, not shimming."),o;n("adapter.js shimming chrome."),o.browserShim=Ok,nO(e,r),rO(e),fk(e,r),hk(e),wk(e,r),mk(e),Sk(e,r),yk(e),vk(e),bk(e),kk(e,r),Kk(e),Yk(e),eO(e),Qk(e,r),Xk(e),tO(e,r);break;case"firefox":if(!Nk||!Ck||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),o;n("adapter.js shimming firefox."),o.browserShim=Nk,nO(e,r),rO(e),Pk(e,r),Ck(e,r),Ek(e),Rk(e),Tk(e),xk(e),jk(e),Ik(e),_k(e),Ak(e),Mk(e),Kk(e),eO(e),Qk(e,r),Xk(e);break;case"safari":if(!qk||!t.shimSafari)return n("Safari shim is not included in this adapter release."),o;n("adapter.js shimming safari."),o.browserShim=qk,nO(e,r),rO(e),zk(e),Zk(e),Uk(e),Dk(e),Lk(e),Wk(e),Bk(e),Hk(e),Kk(e),Yk(e),Qk(e,r),Xk(e),tO(e,r);break;default:n("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window}),function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(oO||(oO={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.PAUSED=1]="PAUSED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(iO||(iO={})),function(e){e[e.UDP=0]="UDP",e[e.TCP=1]="TCP",e[e.TLS=2]="TLS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(aO||(aO={}));const pO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.message)||void 0===n?void 0:n.$case){case"offer":kO.encode(e.message.offer,t.uint32(10).fork()).ldelim();break;case"answer":kO.encode(e.message.answer,t.uint32(18).fork()).ldelim();break;case"trickle":yO.encode(e.message.trickle,t.uint32(26).fork()).ldelim();break;case"addTrack":mO.encode(e.message.addTrack,t.uint32(34).fork()).ldelim();break;case"mute":vO.encode(e.message.mute,t.uint32(42).fork()).ldelim();break;case"subscription":PO.encode(e.message.subscription,t.uint32(50).fork()).ldelim();break;case"trackSetting":EO.encode(e.message.trackSetting,t.uint32(58).fork()).ldelim();break;case"leave":CO.encode(e.message.leave,t.uint32(66).fork()).ldelim();break;case"updateLayers":TO.encode(e.message.updateLayers,t.uint32(82).fork()).ldelim();break;case"subscriptionPermission":FO.encode(e.message.subscriptionPermission,t.uint32(90).fork()).ldelim();break;case"syncState":WO.encode(e.message.syncState,t.uint32(98).fork()).ldelim();break;case"simulate":HO.encode(e.message.simulate,t.uint32(106).fork()).ldelim();break;case"ping":t.uint32(112).int64(e.message.ping);break;case"updateMetadata":xO.encode(e.message.updateMetadata,t.uint32(122).fork()).ldelim();break;case"pingReq":qO.encode(e.message.pingReq,t.uint32(130).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={message:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.message={$case:"offer",offer:kO.decode(n,n.uint32())};continue;case 2:if(18!=e)break;o.message={$case:"answer",answer:kO.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.message={$case:"trickle",trickle:yO.decode(n,n.uint32())};continue;case 4:if(34!=e)break;o.message={$case:"addTrack",addTrack:mO.decode(n,n.uint32())};continue;case 5:if(42!=e)break;o.message={$case:"mute",mute:vO.decode(n,n.uint32())};continue;case 6:if(50!=e)break;o.message={$case:"subscription",subscription:PO.decode(n,n.uint32())};continue;case 7:if(58!=e)break;o.message={$case:"trackSetting",trackSetting:EO.decode(n,n.uint32())};continue;case 8:if(66!=e)break;o.message={$case:"leave",leave:CO.decode(n,n.uint32())};continue;case 10:if(82!=e)break;o.message={$case:"updateLayers",updateLayers:TO.decode(n,n.uint32())};continue;case 11:if(90!=e)break;o.message={$case:"subscriptionPermission",subscriptionPermission:FO.decode(n,n.uint32())};continue;case 12:if(98!=e)break;o.message={$case:"syncState",syncState:WO.decode(n,n.uint32())};continue;case 13:if(106!=e)break;o.message={$case:"simulate",simulate:HO.decode(n,n.uint32())};continue;case 14:if(112!=e)break;o.message={$case:"ping",ping:eP(n.int64())};continue;case 15:if(122!=e)break;o.message={$case:"updateMetadata",updateMetadata:xO.decode(n,n.uint32())};continue;case 16:if(130!=e)break;o.message={$case:"pingReq",pingReq:qO.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({message:tP(e.offer)?{$case:"offer",offer:kO.fromJSON(e.offer)}:tP(e.answer)?{$case:"answer",answer:kO.fromJSON(e.answer)}:tP(e.trickle)?{$case:"trickle",trickle:yO.fromJSON(e.trickle)}:tP(e.addTrack)?{$case:"addTrack",addTrack:mO.fromJSON(e.addTrack)}:tP(e.mute)?{$case:"mute",mute:vO.fromJSON(e.mute)}:tP(e.subscription)?{$case:"subscription",subscription:PO.fromJSON(e.subscription)}:tP(e.trackSetting)?{$case:"trackSetting",trackSetting:EO.fromJSON(e.trackSetting)}:tP(e.leave)?{$case:"leave",leave:CO.fromJSON(e.leave)}:tP(e.updateLayers)?{$case:"updateLayers",updateLayers:TO.fromJSON(e.updateLayers)}:tP(e.subscriptionPermission)?{$case:"subscriptionPermission",subscriptionPermission:FO.fromJSON(e.subscriptionPermission)}:tP(e.syncState)?{$case:"syncState",syncState:WO.fromJSON(e.syncState)}:tP(e.simulate)?{$case:"simulate",simulate:HO.fromJSON(e.simulate)}:tP(e.ping)?{$case:"ping",ping:Number(e.ping)}:tP(e.updateMetadata)?{$case:"updateMetadata",updateMetadata:xO.fromJSON(e.updateMetadata)}:tP(e.pingReq)?{$case:"pingReq",pingReq:qO.fromJSON(e.pingReq)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H;const q={};return"offer"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&(q.offer=(null===(n=e.message)||void 0===n?void 0:n.offer)?kO.toJSON(null===(r=e.message)||void 0===r?void 0:r.offer):void 0),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&(q.answer=(null===(i=e.message)||void 0===i?void 0:i.answer)?kO.toJSON(null===(a=e.message)||void 0===a?void 0:a.answer):void 0),"trickle"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&(q.trickle=(null===(c=e.message)||void 0===c?void 0:c.trickle)?yO.toJSON(null===(l=e.message)||void 0===l?void 0:l.trickle):void 0),"addTrack"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&(q.addTrack=(null===(d=e.message)||void 0===d?void 0:d.addTrack)?mO.toJSON(null===(p=e.message)||void 0===p?void 0:p.addTrack):void 0),"mute"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&(q.mute=(null===(h=e.message)||void 0===h?void 0:h.mute)?vO.toJSON(null===(m=e.message)||void 0===m?void 0:m.mute):void 0),"subscription"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&(q.subscription=(null===(v=e.message)||void 0===v?void 0:v.subscription)?PO.toJSON(null===(b=e.message)||void 0===b?void 0:b.subscription):void 0),"trackSetting"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&(q.trackSetting=(null===(S=e.message)||void 0===S?void 0:S.trackSetting)?EO.toJSON(null===(w=e.message)||void 0===w?void 0:w.trackSetting):void 0),"leave"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&(q.leave=(null===(O=e.message)||void 0===O?void 0:O.leave)?CO.toJSON(null===(P=e.message)||void 0===P?void 0:P.leave):void 0),"updateLayers"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&(q.updateLayers=(null===(C=e.message)||void 0===C?void 0:C.updateLayers)?TO.toJSON(null===(T=e.message)||void 0===T?void 0:T.updateLayers):void 0),"subscriptionPermission"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&(q.subscriptionPermission=(null===(R=e.message)||void 0===R?void 0:R.subscriptionPermission)?FO.toJSON(null===(j=e.message)||void 0===j?void 0:j.subscriptionPermission):void 0),"syncState"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&(q.syncState=(null===(_=e.message)||void 0===_?void 0:_.syncState)?WO.toJSON(null===(A=e.message)||void 0===A?void 0:A.syncState):void 0),"simulate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&(q.simulate=(null===(N=e.message)||void 0===N?void 0:N.simulate)?HO.toJSON(null===(D=e.message)||void 0===D?void 0:D.simulate):void 0),"ping"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&(q.ping=Math.round(null===(U=e.message)||void 0===U?void 0:U.ping)),"updateMetadata"===(null===(B=e.message)||void 0===B?void 0:B.$case)&&(q.updateMetadata=(null===(F=e.message)||void 0===F?void 0:F.updateMetadata)?xO.toJSON(null===(z=e.message)||void 0===z?void 0:z.updateMetadata):void 0),"pingReq"===(null===(W=e.message)||void 0===W?void 0:W.$case)&&(q.pingReq=(null===(Z=e.message)||void 0===Z?void 0:Z.pingReq)?qO.toJSON(null===(H=e.message)||void 0===H?void 0:H.pingReq):void 0),q},create:e=>pO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q;const $={message:void 0};return"offer"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.message)||void 0===n?void 0:n.offer)&&null!==(null===(r=e.message)||void 0===r?void 0:r.offer)&&($.message={$case:"offer",offer:kO.fromPartial(e.message.offer)}),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.message)||void 0===i?void 0:i.answer)&&null!==(null===(a=e.message)||void 0===a?void 0:a.answer)&&($.message={$case:"answer",answer:kO.fromPartial(e.message.answer)}),"trickle"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.message)||void 0===c?void 0:c.trickle)&&null!==(null===(l=e.message)||void 0===l?void 0:l.trickle)&&($.message={$case:"trickle",trickle:yO.fromPartial(e.message.trickle)}),"addTrack"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.message)||void 0===d?void 0:d.addTrack)&&null!==(null===(p=e.message)||void 0===p?void 0:p.addTrack)&&($.message={$case:"addTrack",addTrack:mO.fromPartial(e.message.addTrack)}),"mute"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.message)||void 0===h?void 0:h.mute)&&null!==(null===(m=e.message)||void 0===m?void 0:m.mute)&&($.message={$case:"mute",mute:vO.fromPartial(e.message.mute)}),"subscription"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.message)||void 0===v?void 0:v.subscription)&&null!==(null===(b=e.message)||void 0===b?void 0:b.subscription)&&($.message={$case:"subscription",subscription:PO.fromPartial(e.message.subscription)}),"trackSetting"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&void 0!==(null===(S=e.message)||void 0===S?void 0:S.trackSetting)&&null!==(null===(w=e.message)||void 0===w?void 0:w.trackSetting)&&($.message={$case:"trackSetting",trackSetting:EO.fromPartial(e.message.trackSetting)}),"leave"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&void 0!==(null===(O=e.message)||void 0===O?void 0:O.leave)&&null!==(null===(P=e.message)||void 0===P?void 0:P.leave)&&($.message={$case:"leave",leave:CO.fromPartial(e.message.leave)}),"updateLayers"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&void 0!==(null===(C=e.message)||void 0===C?void 0:C.updateLayers)&&null!==(null===(T=e.message)||void 0===T?void 0:T.updateLayers)&&($.message={$case:"updateLayers",updateLayers:TO.fromPartial(e.message.updateLayers)}),"subscriptionPermission"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&void 0!==(null===(R=e.message)||void 0===R?void 0:R.subscriptionPermission)&&null!==(null===(j=e.message)||void 0===j?void 0:j.subscriptionPermission)&&($.message={$case:"subscriptionPermission",subscriptionPermission:FO.fromPartial(e.message.subscriptionPermission)}),"syncState"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&void 0!==(null===(_=e.message)||void 0===_?void 0:_.syncState)&&null!==(null===(A=e.message)||void 0===A?void 0:A.syncState)&&($.message={$case:"syncState",syncState:WO.fromPartial(e.message.syncState)}),"simulate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&void 0!==(null===(N=e.message)||void 0===N?void 0:N.simulate)&&null!==(null===(D=e.message)||void 0===D?void 0:D.simulate)&&($.message={$case:"simulate",simulate:HO.fromPartial(e.message.simulate)}),"ping"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&void 0!==(null===(U=e.message)||void 0===U?void 0:U.ping)&&null!==(null===(B=e.message)||void 0===B?void 0:B.ping)&&($.message={$case:"ping",ping:e.message.ping}),"updateMetadata"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&void 0!==(null===(z=e.message)||void 0===z?void 0:z.updateMetadata)&&null!==(null===(W=e.message)||void 0===W?void 0:W.updateMetadata)&&($.message={$case:"updateMetadata",updateMetadata:xO.fromPartial(e.message.updateMetadata)}),"pingReq"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&void 0!==(null===(H=e.message)||void 0===H?void 0:H.pingReq)&&null!==(null===(q=e.message)||void 0===q?void 0:q.pingReq)&&($.message={$case:"pingReq",pingReq:qO.fromPartial(e.message.pingReq)}),$}},fO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.message)||void 0===n?void 0:n.$case){case"join":bO.encode(e.message.join,t.uint32(10).fork()).ldelim();break;case"answer":kO.encode(e.message.answer,t.uint32(18).fork()).ldelim();break;case"offer":kO.encode(e.message.offer,t.uint32(26).fork()).ldelim();break;case"trickle":yO.encode(e.message.trickle,t.uint32(34).fork()).ldelim();break;case"update":OO.encode(e.message.update,t.uint32(42).fork()).ldelim();break;case"trackPublished":SO.encode(e.message.trackPublished,t.uint32(50).fork()).ldelim();break;case"leave":CO.encode(e.message.leave,t.uint32(66).fork()).ldelim();break;case"mute":vO.encode(e.message.mute,t.uint32(74).fork()).ldelim();break;case"speakersChanged":jO.encode(e.message.speakersChanged,t.uint32(82).fork()).ldelim();break;case"roomUpdate":IO.encode(e.message.roomUpdate,t.uint32(90).fork()).ldelim();break;case"connectionQuality":AO.encode(e.message.connectionQuality,t.uint32(98).fork()).ldelim();break;case"streamStateUpdate":NO.encode(e.message.streamStateUpdate,t.uint32(106).fork()).ldelim();break;case"subscribedQualityUpdate":UO.encode(e.message.subscribedQualityUpdate,t.uint32(114).fork()).ldelim();break;case"subscriptionPermissionUpdate":zO.encode(e.message.subscriptionPermissionUpdate,t.uint32(122).fork()).ldelim();break;case"refreshToken":t.uint32(130).string(e.message.refreshToken);break;case"trackUnpublished":wO.encode(e.message.trackUnpublished,t.uint32(138).fork()).ldelim();break;case"pong":t.uint32(144).int64(e.message.pong);break;case"reconnect":gO.encode(e.message.reconnect,t.uint32(154).fork()).ldelim();break;case"pongResp":$O.encode(e.message.pongResp,t.uint32(162).fork()).ldelim()}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={message:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.message={$case:"join",join:bO.decode(n,n.uint32())};continue;case 2:if(18!=e)break;o.message={$case:"answer",answer:kO.decode(n,n.uint32())};continue;case 3:if(26!=e)break;o.message={$case:"offer",offer:kO.decode(n,n.uint32())};continue;case 4:if(34!=e)break;o.message={$case:"trickle",trickle:yO.decode(n,n.uint32())};continue;case 5:if(42!=e)break;o.message={$case:"update",update:OO.decode(n,n.uint32())};continue;case 6:if(50!=e)break;o.message={$case:"trackPublished",trackPublished:SO.decode(n,n.uint32())};continue;case 8:if(66!=e)break;o.message={$case:"leave",leave:CO.decode(n,n.uint32())};continue;case 9:if(74!=e)break;o.message={$case:"mute",mute:vO.decode(n,n.uint32())};continue;case 10:if(82!=e)break;o.message={$case:"speakersChanged",speakersChanged:jO.decode(n,n.uint32())};continue;case 11:if(90!=e)break;o.message={$case:"roomUpdate",roomUpdate:IO.decode(n,n.uint32())};continue;case 12:if(98!=e)break;o.message={$case:"connectionQuality",connectionQuality:AO.decode(n,n.uint32())};continue;case 13:if(106!=e)break;o.message={$case:"streamStateUpdate",streamStateUpdate:NO.decode(n,n.uint32())};continue;case 14:if(114!=e)break;o.message={$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.decode(n,n.uint32())};continue;case 15:if(122!=e)break;o.message={$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.decode(n,n.uint32())};continue;case 16:if(130!=e)break;o.message={$case:"refreshToken",refreshToken:n.string()};continue;case 17:if(138!=e)break;o.message={$case:"trackUnpublished",trackUnpublished:wO.decode(n,n.uint32())};continue;case 18:if(144!=e)break;o.message={$case:"pong",pong:eP(n.int64())};continue;case 19:if(154!=e)break;o.message={$case:"reconnect",reconnect:gO.decode(n,n.uint32())};continue;case 20:if(162!=e)break;o.message={$case:"pongResp",pongResp:$O.decode(n,n.uint32())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({message:tP(e.join)?{$case:"join",join:bO.fromJSON(e.join)}:tP(e.answer)?{$case:"answer",answer:kO.fromJSON(e.answer)}:tP(e.offer)?{$case:"offer",offer:kO.fromJSON(e.offer)}:tP(e.trickle)?{$case:"trickle",trickle:yO.fromJSON(e.trickle)}:tP(e.update)?{$case:"update",update:OO.fromJSON(e.update)}:tP(e.trackPublished)?{$case:"trackPublished",trackPublished:SO.fromJSON(e.trackPublished)}:tP(e.leave)?{$case:"leave",leave:CO.fromJSON(e.leave)}:tP(e.mute)?{$case:"mute",mute:vO.fromJSON(e.mute)}:tP(e.speakersChanged)?{$case:"speakersChanged",speakersChanged:jO.fromJSON(e.speakersChanged)}:tP(e.roomUpdate)?{$case:"roomUpdate",roomUpdate:IO.fromJSON(e.roomUpdate)}:tP(e.connectionQuality)?{$case:"connectionQuality",connectionQuality:AO.fromJSON(e.connectionQuality)}:tP(e.streamStateUpdate)?{$case:"streamStateUpdate",streamStateUpdate:NO.fromJSON(e.streamStateUpdate)}:tP(e.subscribedQualityUpdate)?{$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.fromJSON(e.subscribedQualityUpdate)}:tP(e.subscriptionPermissionUpdate)?{$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.fromJSON(e.subscriptionPermissionUpdate)}:tP(e.refreshToken)?{$case:"refreshToken",refreshToken:String(e.refreshToken)}:tP(e.trackUnpublished)?{$case:"trackUnpublished",trackUnpublished:wO.fromJSON(e.trackUnpublished)}:tP(e.pong)?{$case:"pong",pong:Number(e.pong)}:tP(e.reconnect)?{$case:"reconnect",reconnect:gO.fromJSON(e.reconnect)}:tP(e.pongResp)?{$case:"pongResp",pongResp:$O.fromJSON(e.pongResp)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q,$,V,G,J,K,Y,Q,X,ee,te;const ne={};return"join"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&(ne.join=(null===(n=e.message)||void 0===n?void 0:n.join)?bO.toJSON(null===(r=e.message)||void 0===r?void 0:r.join):void 0),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&(ne.answer=(null===(i=e.message)||void 0===i?void 0:i.answer)?kO.toJSON(null===(a=e.message)||void 0===a?void 0:a.answer):void 0),"offer"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&(ne.offer=(null===(c=e.message)||void 0===c?void 0:c.offer)?kO.toJSON(null===(l=e.message)||void 0===l?void 0:l.offer):void 0),"trickle"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&(ne.trickle=(null===(d=e.message)||void 0===d?void 0:d.trickle)?yO.toJSON(null===(p=e.message)||void 0===p?void 0:p.trickle):void 0),"update"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&(ne.update=(null===(h=e.message)||void 0===h?void 0:h.update)?OO.toJSON(null===(m=e.message)||void 0===m?void 0:m.update):void 0),"trackPublished"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&(ne.trackPublished=(null===(v=e.message)||void 0===v?void 0:v.trackPublished)?SO.toJSON(null===(b=e.message)||void 0===b?void 0:b.trackPublished):void 0),"leave"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&(ne.leave=(null===(S=e.message)||void 0===S?void 0:S.leave)?CO.toJSON(null===(w=e.message)||void 0===w?void 0:w.leave):void 0),"mute"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&(ne.mute=(null===(O=e.message)||void 0===O?void 0:O.mute)?vO.toJSON(null===(P=e.message)||void 0===P?void 0:P.mute):void 0),"speakersChanged"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&(ne.speakersChanged=(null===(C=e.message)||void 0===C?void 0:C.speakersChanged)?jO.toJSON(null===(T=e.message)||void 0===T?void 0:T.speakersChanged):void 0),"roomUpdate"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&(ne.roomUpdate=(null===(R=e.message)||void 0===R?void 0:R.roomUpdate)?IO.toJSON(null===(j=e.message)||void 0===j?void 0:j.roomUpdate):void 0),"connectionQuality"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&(ne.connectionQuality=(null===(_=e.message)||void 0===_?void 0:_.connectionQuality)?AO.toJSON(null===(A=e.message)||void 0===A?void 0:A.connectionQuality):void 0),"streamStateUpdate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&(ne.streamStateUpdate=(null===(N=e.message)||void 0===N?void 0:N.streamStateUpdate)?NO.toJSON(null===(D=e.message)||void 0===D?void 0:D.streamStateUpdate):void 0),"subscribedQualityUpdate"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&(ne.subscribedQualityUpdate=(null===(U=e.message)||void 0===U?void 0:U.subscribedQualityUpdate)?UO.toJSON(null===(B=e.message)||void 0===B?void 0:B.subscribedQualityUpdate):void 0),"subscriptionPermissionUpdate"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&(ne.subscriptionPermissionUpdate=(null===(z=e.message)||void 0===z?void 0:z.subscriptionPermissionUpdate)?zO.toJSON(null===(W=e.message)||void 0===W?void 0:W.subscriptionPermissionUpdate):void 0),"refreshToken"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&(ne.refreshToken=null===(H=e.message)||void 0===H?void 0:H.refreshToken),"trackUnpublished"===(null===(q=e.message)||void 0===q?void 0:q.$case)&&(ne.trackUnpublished=(null===($=e.message)||void 0===$?void 0:$.trackUnpublished)?wO.toJSON(null===(V=e.message)||void 0===V?void 0:V.trackUnpublished):void 0),"pong"===(null===(G=e.message)||void 0===G?void 0:G.$case)&&(ne.pong=Math.round(null===(J=e.message)||void 0===J?void 0:J.pong)),"reconnect"===(null===(K=e.message)||void 0===K?void 0:K.$case)&&(ne.reconnect=(null===(Y=e.message)||void 0===Y?void 0:Y.reconnect)?gO.toJSON(null===(Q=e.message)||void 0===Q?void 0:Q.reconnect):void 0),"pongResp"===(null===(X=e.message)||void 0===X?void 0:X.$case)&&(ne.pongResp=(null===(ee=e.message)||void 0===ee?void 0:ee.pongResp)?$O.toJSON(null===(te=e.message)||void 0===te?void 0:te.pongResp):void 0),ne},create:e=>fO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b,g,S,w,k,O,P,E,C,T,x,R,j,I,_,A,M,N,D,L,U,B,F,z,W,Z,H,q,$,V,G,J,K,Y,Q,X,ee,te,ne,re;const oe={message:void 0};return"join"===(null===(t=e.message)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.message)||void 0===n?void 0:n.join)&&null!==(null===(r=e.message)||void 0===r?void 0:r.join)&&(oe.message={$case:"join",join:bO.fromPartial(e.message.join)}),"answer"===(null===(o=e.message)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.message)||void 0===i?void 0:i.answer)&&null!==(null===(a=e.message)||void 0===a?void 0:a.answer)&&(oe.message={$case:"answer",answer:kO.fromPartial(e.message.answer)}),"offer"===(null===(s=e.message)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.message)||void 0===c?void 0:c.offer)&&null!==(null===(l=e.message)||void 0===l?void 0:l.offer)&&(oe.message={$case:"offer",offer:kO.fromPartial(e.message.offer)}),"trickle"===(null===(u=e.message)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.message)||void 0===d?void 0:d.trickle)&&null!==(null===(p=e.message)||void 0===p?void 0:p.trickle)&&(oe.message={$case:"trickle",trickle:yO.fromPartial(e.message.trickle)}),"update"===(null===(f=e.message)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.message)||void 0===h?void 0:h.update)&&null!==(null===(m=e.message)||void 0===m?void 0:m.update)&&(oe.message={$case:"update",update:OO.fromPartial(e.message.update)}),"trackPublished"===(null===(y=e.message)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.message)||void 0===v?void 0:v.trackPublished)&&null!==(null===(b=e.message)||void 0===b?void 0:b.trackPublished)&&(oe.message={$case:"trackPublished",trackPublished:SO.fromPartial(e.message.trackPublished)}),"leave"===(null===(g=e.message)||void 0===g?void 0:g.$case)&&void 0!==(null===(S=e.message)||void 0===S?void 0:S.leave)&&null!==(null===(w=e.message)||void 0===w?void 0:w.leave)&&(oe.message={$case:"leave",leave:CO.fromPartial(e.message.leave)}),"mute"===(null===(k=e.message)||void 0===k?void 0:k.$case)&&void 0!==(null===(O=e.message)||void 0===O?void 0:O.mute)&&null!==(null===(P=e.message)||void 0===P?void 0:P.mute)&&(oe.message={$case:"mute",mute:vO.fromPartial(e.message.mute)}),"speakersChanged"===(null===(E=e.message)||void 0===E?void 0:E.$case)&&void 0!==(null===(C=e.message)||void 0===C?void 0:C.speakersChanged)&&null!==(null===(T=e.message)||void 0===T?void 0:T.speakersChanged)&&(oe.message={$case:"speakersChanged",speakersChanged:jO.fromPartial(e.message.speakersChanged)}),"roomUpdate"===(null===(x=e.message)||void 0===x?void 0:x.$case)&&void 0!==(null===(R=e.message)||void 0===R?void 0:R.roomUpdate)&&null!==(null===(j=e.message)||void 0===j?void 0:j.roomUpdate)&&(oe.message={$case:"roomUpdate",roomUpdate:IO.fromPartial(e.message.roomUpdate)}),"connectionQuality"===(null===(I=e.message)||void 0===I?void 0:I.$case)&&void 0!==(null===(_=e.message)||void 0===_?void 0:_.connectionQuality)&&null!==(null===(A=e.message)||void 0===A?void 0:A.connectionQuality)&&(oe.message={$case:"connectionQuality",connectionQuality:AO.fromPartial(e.message.connectionQuality)}),"streamStateUpdate"===(null===(M=e.message)||void 0===M?void 0:M.$case)&&void 0!==(null===(N=e.message)||void 0===N?void 0:N.streamStateUpdate)&&null!==(null===(D=e.message)||void 0===D?void 0:D.streamStateUpdate)&&(oe.message={$case:"streamStateUpdate",streamStateUpdate:NO.fromPartial(e.message.streamStateUpdate)}),"subscribedQualityUpdate"===(null===(L=e.message)||void 0===L?void 0:L.$case)&&void 0!==(null===(U=e.message)||void 0===U?void 0:U.subscribedQualityUpdate)&&null!==(null===(B=e.message)||void 0===B?void 0:B.subscribedQualityUpdate)&&(oe.message={$case:"subscribedQualityUpdate",subscribedQualityUpdate:UO.fromPartial(e.message.subscribedQualityUpdate)}),"subscriptionPermissionUpdate"===(null===(F=e.message)||void 0===F?void 0:F.$case)&&void 0!==(null===(z=e.message)||void 0===z?void 0:z.subscriptionPermissionUpdate)&&null!==(null===(W=e.message)||void 0===W?void 0:W.subscriptionPermissionUpdate)&&(oe.message={$case:"subscriptionPermissionUpdate",subscriptionPermissionUpdate:zO.fromPartial(e.message.subscriptionPermissionUpdate)}),"refreshToken"===(null===(Z=e.message)||void 0===Z?void 0:Z.$case)&&void 0!==(null===(H=e.message)||void 0===H?void 0:H.refreshToken)&&null!==(null===(q=e.message)||void 0===q?void 0:q.refreshToken)&&(oe.message={$case:"refreshToken",refreshToken:e.message.refreshToken}),"trackUnpublished"===(null===($=e.message)||void 0===$?void 0:$.$case)&&void 0!==(null===(V=e.message)||void 0===V?void 0:V.trackUnpublished)&&null!==(null===(G=e.message)||void 0===G?void 0:G.trackUnpublished)&&(oe.message={$case:"trackUnpublished",trackUnpublished:wO.fromPartial(e.message.trackUnpublished)}),"pong"===(null===(J=e.message)||void 0===J?void 0:J.$case)&&void 0!==(null===(K=e.message)||void 0===K?void 0:K.pong)&&null!==(null===(Y=e.message)||void 0===Y?void 0:Y.pong)&&(oe.message={$case:"pong",pong:e.message.pong}),"reconnect"===(null===(Q=e.message)||void 0===Q?void 0:Q.$case)&&void 0!==(null===(X=e.message)||void 0===X?void 0:X.reconnect)&&null!==(null===(ee=e.message)||void 0===ee?void 0:ee.reconnect)&&(oe.message={$case:"reconnect",reconnect:gO.fromPartial(e.message.reconnect)}),"pongResp"===(null===(te=e.message)||void 0===te?void 0:te.$case)&&void 0!==(null===(ne=e.message)||void 0===ne?void 0:ne.pongResp)&&null!==(null===(re=e.message)||void 0===re?void 0:re.pongResp)&&(oe.message={$case:"pongResp",pongResp:$O.fromPartial(e.message.pongResp)}),oe}},hO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.codec&&t.uint32(10).string(e.codec),""!==e.cid&&t.uint32(18).string(e.cid),!0===e.enableSimulcastLayers&&t.uint32(24).bool(e.enableSimulcastLayers),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codec:"",cid:"",enableSimulcastLayers:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.codec=n.string();continue;case 2:if(18!=e)break;o.cid=n.string();continue;case 3:if(24!=e)break;o.enableSimulcastLayers=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codec:tP(e.codec)?String(e.codec):"",cid:tP(e.cid)?String(e.cid):"",enableSimulcastLayers:!!tP(e.enableSimulcastLayers)&&Boolean(e.enableSimulcastLayers)}),toJSON(e){const t={};return void 0!==e.codec&&(t.codec=e.codec),void 0!==e.cid&&(t.cid=e.cid),void 0!==e.enableSimulcastLayers&&(t.enableSimulcastLayers=e.enableSimulcastLayers),t},create:e=>hO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={codec:"",cid:"",enableSimulcastLayers:!1};return o.codec=null!==(t=e.codec)&&void 0!==t?t:"",o.cid=null!==(n=e.cid)&&void 0!==n?n:"",o.enableSimulcastLayers=null!==(r=e.enableSimulcastLayers)&&void 0!==r&&r,o}},mO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.cid&&t.uint32(10).string(e.cid),""!==e.name&&t.uint32(18).string(e.name),0!==e.type&&t.uint32(24).int32(e.type),0!==e.width&&t.uint32(32).uint32(e.width),0!==e.height&&t.uint32(40).uint32(e.height),!0===e.muted&&t.uint32(48).bool(e.muted),!0===e.disableDtx&&t.uint32(56).bool(e.disableDtx),0!==e.source&&t.uint32(64).int32(e.source);for(const n of e.layers)Iw.encode(n,t.uint32(74).fork()).ldelim();for(const n of e.simulcastCodecs)hO.encode(n,t.uint32(82).fork()).ldelim();return""!==e.sid&&t.uint32(90).string(e.sid),!0===e.stereo&&t.uint32(96).bool(e.stereo),!0===e.disableRed&&t.uint32(104).bool(e.disableRed),0!==e.encryption&&t.uint32(112).int32(e.encryption),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={cid:"",name:"",type:0,width:0,height:0,muted:!1,disableDtx:!1,source:0,layers:[],simulcastCodecs:[],sid:"",stereo:!1,disableRed:!1,encryption:0};for(;n.pos>>3){case 1:if(10!=e)break;o.cid=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue;case 3:if(24!=e)break;o.type=n.int32();continue;case 4:if(32!=e)break;o.width=n.uint32();continue;case 5:if(40!=e)break;o.height=n.uint32();continue;case 6:if(48!=e)break;o.muted=n.bool();continue;case 7:if(56!=e)break;o.disableDtx=n.bool();continue;case 8:if(64!=e)break;o.source=n.int32();continue;case 9:if(74!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue;case 10:if(82!=e)break;o.simulcastCodecs.push(hO.decode(n,n.uint32()));continue;case 11:if(90!=e)break;o.sid=n.string();continue;case 12:if(96!=e)break;o.stereo=n.bool();continue;case 13:if(104!=e)break;o.disableRed=n.bool();continue;case 14:if(112!=e)break;o.encryption=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({cid:tP(e.cid)?String(e.cid):"",name:tP(e.name)?String(e.name):"",type:tP(e.type)?lw(e.type):0,width:tP(e.width)?Number(e.width):0,height:tP(e.height)?Number(e.height):0,muted:!!tP(e.muted)&&Boolean(e.muted),disableDtx:!!tP(e.disableDtx)&&Boolean(e.disableDtx),source:tP(e.source)?dw(e.source):0,layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[],simulcastCodecs:Array.isArray(null==e?void 0:e.simulcastCodecs)?e.simulcastCodecs.map((e=>hO.fromJSON(e))):[],sid:tP(e.sid)?String(e.sid):"",stereo:!!tP(e.stereo)&&Boolean(e.stereo),disableRed:!!tP(e.disableRed)&&Boolean(e.disableRed),encryption:tP(e.encryption)?Sw(e.encryption):0}),toJSON(e){const t={};return void 0!==e.cid&&(t.cid=e.cid),void 0!==e.name&&(t.name=e.name),void 0!==e.type&&(t.type=uw(e.type)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.muted&&(t.muted=e.muted),void 0!==e.disableDtx&&(t.disableDtx=e.disableDtx),void 0!==e.source&&(t.source=pw(e.source)),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],e.simulcastCodecs?t.simulcastCodecs=e.simulcastCodecs.map((e=>e?hO.toJSON(e):void 0)):t.simulcastCodecs=[],void 0!==e.sid&&(t.sid=e.sid),void 0!==e.stereo&&(t.stereo=e.stereo),void 0!==e.disableRed&&(t.disableRed=e.disableRed),void 0!==e.encryption&&(t.encryption=ww(e.encryption)),t},create:e=>mO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h;const m={cid:"",name:"",type:0,width:0,height:0,muted:!1,disableDtx:!1,source:0,layers:[],simulcastCodecs:[],sid:"",stereo:!1,disableRed:!1,encryption:0};return m.cid=null!==(t=e.cid)&&void 0!==t?t:"",m.name=null!==(n=e.name)&&void 0!==n?n:"",m.type=null!==(r=e.type)&&void 0!==r?r:0,m.width=null!==(o=e.width)&&void 0!==o?o:0,m.height=null!==(i=e.height)&&void 0!==i?i:0,m.muted=null!==(a=e.muted)&&void 0!==a&&a,m.disableDtx=null!==(s=e.disableDtx)&&void 0!==s&&s,m.source=null!==(c=e.source)&&void 0!==c?c:0,m.layers=(null===(l=e.layers)||void 0===l?void 0:l.map((e=>Iw.fromPartial(e))))||[],m.simulcastCodecs=(null===(u=e.simulcastCodecs)||void 0===u?void 0:u.map((e=>hO.fromPartial(e))))||[],m.sid=null!==(d=e.sid)&&void 0!==d?d:"",m.stereo=null!==(p=e.stereo)&&void 0!==p&&p,m.disableRed=null!==(f=e.disableRed)&&void 0!==f&&f,m.encryption=null!==(h=e.encryption)&&void 0!==h?h:0,m}},yO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.candidateInit&&t.uint32(10).string(e.candidateInit),0!==e.target&&t.uint32(16).int32(e.target),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={candidateInit:"",target:0};for(;n.pos>>3){case 1:if(10!=e)break;o.candidateInit=n.string();continue;case 2:if(16!=e)break;o.target=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({candidateInit:tP(e.candidateInit)?String(e.candidateInit):"",target:tP(e.target)?cO(e.target):0}),toJSON(e){const t={};return void 0!==e.candidateInit&&(t.candidateInit=e.candidateInit),void 0!==e.target&&(t.target=lO(e.target)),t},create:e=>yO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={candidateInit:"",target:0};return r.candidateInit=null!==(t=e.candidateInit)&&void 0!==t?t:"",r.target=null!==(n=e.target)&&void 0!==n?n:0,r}},vO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.sid&&t.uint32(10).string(e.sid),!0===e.muted&&t.uint32(16).bool(e.muted),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={sid:"",muted:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.sid=n.string();continue;case 2:if(16!=e)break;o.muted=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({sid:tP(e.sid)?String(e.sid):"",muted:!!tP(e.muted)&&Boolean(e.muted)}),toJSON(e){const t={};return void 0!==e.sid&&(t.sid=e.sid),void 0!==e.muted&&(t.muted=e.muted),t},create:e=>vO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={sid:"",muted:!1};return r.sid=null!==(t=e.sid)&&void 0!==t?t:"",r.muted=null!==(n=e.muted)&&void 0!==n&&n,r}},bO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();void 0!==e.room&&Ew.encode(e.room,t.uint32(10).fork()).ldelim(),void 0!==e.participant&&xw.encode(e.participant,t.uint32(18).fork()).ldelim();for(const n of e.otherParticipants)xw.encode(n,t.uint32(26).fork()).ldelim();""!==e.serverVersion&&t.uint32(34).string(e.serverVersion);for(const n of e.iceServers)RO.encode(n,t.uint32(42).fork()).ldelim();return!0===e.subscriberPrimary&&t.uint32(48).bool(e.subscriberPrimary),""!==e.alternativeUrl&&t.uint32(58).string(e.alternativeUrl),void 0!==e.clientConfiguration&&Fw.encode(e.clientConfiguration,t.uint32(66).fork()).ldelim(),""!==e.serverRegion&&t.uint32(74).string(e.serverRegion),0!==e.pingTimeout&&t.uint32(80).int32(e.pingTimeout),0!==e.pingInterval&&t.uint32(88).int32(e.pingInterval),void 0!==e.serverInfo&&Uw.encode(e.serverInfo,t.uint32(98).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={room:void 0,participant:void 0,otherParticipants:[],serverVersion:"",iceServers:[],subscriberPrimary:!1,alternativeUrl:"",clientConfiguration:void 0,serverRegion:"",pingTimeout:0,pingInterval:0,serverInfo:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.room=Ew.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.participant=xw.decode(n,n.uint32());continue;case 3:if(26!=e)break;o.otherParticipants.push(xw.decode(n,n.uint32()));continue;case 4:if(34!=e)break;o.serverVersion=n.string();continue;case 5:if(42!=e)break;o.iceServers.push(RO.decode(n,n.uint32()));continue;case 6:if(48!=e)break;o.subscriberPrimary=n.bool();continue;case 7:if(58!=e)break;o.alternativeUrl=n.string();continue;case 8:if(66!=e)break;o.clientConfiguration=Fw.decode(n,n.uint32());continue;case 9:if(74!=e)break;o.serverRegion=n.string();continue;case 10:if(80!=e)break;o.pingTimeout=n.int32();continue;case 11:if(88!=e)break;o.pingInterval=n.int32();continue;case 12:if(98!=e)break;o.serverInfo=Uw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({room:tP(e.room)?Ew.fromJSON(e.room):void 0,participant:tP(e.participant)?xw.fromJSON(e.participant):void 0,otherParticipants:Array.isArray(null==e?void 0:e.otherParticipants)?e.otherParticipants.map((e=>xw.fromJSON(e))):[],serverVersion:tP(e.serverVersion)?String(e.serverVersion):"",iceServers:Array.isArray(null==e?void 0:e.iceServers)?e.iceServers.map((e=>RO.fromJSON(e))):[],subscriberPrimary:!!tP(e.subscriberPrimary)&&Boolean(e.subscriberPrimary),alternativeUrl:tP(e.alternativeUrl)?String(e.alternativeUrl):"",clientConfiguration:tP(e.clientConfiguration)?Fw.fromJSON(e.clientConfiguration):void 0,serverRegion:tP(e.serverRegion)?String(e.serverRegion):"",pingTimeout:tP(e.pingTimeout)?Number(e.pingTimeout):0,pingInterval:tP(e.pingInterval)?Number(e.pingInterval):0,serverInfo:tP(e.serverInfo)?Uw.fromJSON(e.serverInfo):void 0}),toJSON(e){const t={};return void 0!==e.room&&(t.room=e.room?Ew.toJSON(e.room):void 0),void 0!==e.participant&&(t.participant=e.participant?xw.toJSON(e.participant):void 0),e.otherParticipants?t.otherParticipants=e.otherParticipants.map((e=>e?xw.toJSON(e):void 0)):t.otherParticipants=[],void 0!==e.serverVersion&&(t.serverVersion=e.serverVersion),e.iceServers?t.iceServers=e.iceServers.map((e=>e?RO.toJSON(e):void 0)):t.iceServers=[],void 0!==e.subscriberPrimary&&(t.subscriberPrimary=e.subscriberPrimary),void 0!==e.alternativeUrl&&(t.alternativeUrl=e.alternativeUrl),void 0!==e.clientConfiguration&&(t.clientConfiguration=e.clientConfiguration?Fw.toJSON(e.clientConfiguration):void 0),void 0!==e.serverRegion&&(t.serverRegion=e.serverRegion),void 0!==e.pingTimeout&&(t.pingTimeout=Math.round(e.pingTimeout)),void 0!==e.pingInterval&&(t.pingInterval=Math.round(e.pingInterval)),void 0!==e.serverInfo&&(t.serverInfo=e.serverInfo?Uw.toJSON(e.serverInfo):void 0),t},create:e=>bO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c;const l={room:void 0,participant:void 0,otherParticipants:[],serverVersion:"",iceServers:[],subscriberPrimary:!1,alternativeUrl:"",clientConfiguration:void 0,serverRegion:"",pingTimeout:0,pingInterval:0,serverInfo:void 0};return l.room=void 0!==e.room&&null!==e.room?Ew.fromPartial(e.room):void 0,l.participant=void 0!==e.participant&&null!==e.participant?xw.fromPartial(e.participant):void 0,l.otherParticipants=(null===(t=e.otherParticipants)||void 0===t?void 0:t.map((e=>xw.fromPartial(e))))||[],l.serverVersion=null!==(n=e.serverVersion)&&void 0!==n?n:"",l.iceServers=(null===(r=e.iceServers)||void 0===r?void 0:r.map((e=>RO.fromPartial(e))))||[],l.subscriberPrimary=null!==(o=e.subscriberPrimary)&&void 0!==o&&o,l.alternativeUrl=null!==(i=e.alternativeUrl)&&void 0!==i?i:"",l.clientConfiguration=void 0!==e.clientConfiguration&&null!==e.clientConfiguration?Fw.fromPartial(e.clientConfiguration):void 0,l.serverRegion=null!==(a=e.serverRegion)&&void 0!==a?a:"",l.pingTimeout=null!==(s=e.pingTimeout)&&void 0!==s?s:0,l.pingInterval=null!==(c=e.pingInterval)&&void 0!==c?c:0,l.serverInfo=void 0!==e.serverInfo&&null!==e.serverInfo?Uw.fromPartial(e.serverInfo):void 0,l}},gO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.iceServers)RO.encode(n,t.uint32(10).fork()).ldelim();return void 0!==e.clientConfiguration&&Fw.encode(e.clientConfiguration,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={iceServers:[],clientConfiguration:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.iceServers.push(RO.decode(n,n.uint32()));continue;case 2:if(18!=e)break;o.clientConfiguration=Fw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({iceServers:Array.isArray(null==e?void 0:e.iceServers)?e.iceServers.map((e=>RO.fromJSON(e))):[],clientConfiguration:tP(e.clientConfiguration)?Fw.fromJSON(e.clientConfiguration):void 0}),toJSON(e){const t={};return e.iceServers?t.iceServers=e.iceServers.map((e=>e?RO.toJSON(e):void 0)):t.iceServers=[],void 0!==e.clientConfiguration&&(t.clientConfiguration=e.clientConfiguration?Fw.toJSON(e.clientConfiguration):void 0),t},create:e=>gO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={iceServers:[],clientConfiguration:void 0};return n.iceServers=(null===(t=e.iceServers)||void 0===t?void 0:t.map((e=>RO.fromPartial(e))))||[],n.clientConfiguration=void 0!==e.clientConfiguration&&null!==e.clientConfiguration?Fw.fromPartial(e.clientConfiguration):void 0,n}},SO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.cid&&t.uint32(10).string(e.cid),void 0!==e.track&&jw.encode(e.track,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={cid:"",track:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.cid=n.string();continue;case 2:if(18!=e)break;o.track=jw.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({cid:tP(e.cid)?String(e.cid):"",track:tP(e.track)?jw.fromJSON(e.track):void 0}),toJSON(e){const t={};return void 0!==e.cid&&(t.cid=e.cid),void 0!==e.track&&(t.track=e.track?jw.toJSON(e.track):void 0),t},create:e=>SO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={cid:"",track:void 0};return n.cid=null!==(t=e.cid)&&void 0!==t?t:"",n.track=void 0!==e.track&&null!==e.track?jw.fromPartial(e.track):void 0,n}},wO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.trackSid&&t.uint32(10).string(e.trackSid),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:""};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):""}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),t},create:e=>wO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={trackSid:""};return n.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",n}},kO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.type&&t.uint32(10).string(e.type),""!==e.sdp&&t.uint32(18).string(e.sdp),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={type:"",sdp:""};for(;n.pos>>3){case 1:if(10!=e)break;o.type=n.string();continue;case 2:if(18!=e)break;o.sdp=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({type:tP(e.type)?String(e.type):"",sdp:tP(e.sdp)?String(e.sdp):""}),toJSON(e){const t={};return void 0!==e.type&&(t.type=e.type),void 0!==e.sdp&&(t.sdp=e.sdp),t},create:e=>kO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={type:"",sdp:""};return r.type=null!==(t=e.type)&&void 0!==t?t:"",r.sdp=null!==(n=e.sdp)&&void 0!==n?n:"",r}},OO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.participants)xw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participants:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.participants.push(xw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participants:Array.isArray(null==e?void 0:e.participants)?e.participants.map((e=>xw.fromJSON(e))):[]}),toJSON(e){const t={};return e.participants?t.participants=e.participants.map((e=>e?xw.toJSON(e):void 0)):t.participants=[],t},create:e=>OO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={participants:[]};return n.participants=(null===(t=e.participants)||void 0===t?void 0:t.map((e=>xw.fromPartial(e))))||[],n}},PO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.trackSids)t.uint32(10).string(n);!0===e.subscribe&&t.uint32(16).bool(e.subscribe);for(const n of e.participantTracks)Lw.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSids:[],subscribe:!1,participantTracks:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSids.push(n.string());continue;case 2:if(16!=e)break;o.subscribe=n.bool();continue;case 3:if(26!=e)break;o.participantTracks.push(Lw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],subscribe:!!tP(e.subscribe)&&Boolean(e.subscribe),participantTracks:Array.isArray(null==e?void 0:e.participantTracks)?e.participantTracks.map((e=>Lw.fromJSON(e))):[]}),toJSON(e){const t={};return e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.subscribe&&(t.subscribe=e.subscribe),e.participantTracks?t.participantTracks=e.participantTracks.map((e=>e?Lw.toJSON(e):void 0)):t.participantTracks=[],t},create:e=>PO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={trackSids:[],subscribe:!1,participantTracks:[]};return o.trackSids=(null===(t=e.trackSids)||void 0===t?void 0:t.map((e=>e)))||[],o.subscribe=null!==(n=e.subscribe)&&void 0!==n&&n,o.participantTracks=(null===(r=e.participantTracks)||void 0===r?void 0:r.map((e=>Lw.fromPartial(e))))||[],o}},EO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.trackSids)t.uint32(10).string(n);return!0===e.disabled&&t.uint32(24).bool(e.disabled),0!==e.quality&&t.uint32(32).int32(e.quality),0!==e.width&&t.uint32(40).uint32(e.width),0!==e.height&&t.uint32(48).uint32(e.height),0!==e.fps&&t.uint32(56).uint32(e.fps),0!==e.priority&&t.uint32(64).uint32(e.priority),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSids:[],disabled:!1,quality:0,width:0,height:0,fps:0,priority:0};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSids.push(n.string());continue;case 3:if(24!=e)break;o.disabled=n.bool();continue;case 4:if(32!=e)break;o.quality=n.int32();continue;case 5:if(40!=e)break;o.width=n.uint32();continue;case 6:if(48!=e)break;o.height=n.uint32();continue;case 7:if(56!=e)break;o.fps=n.uint32();continue;case 8:if(64!=e)break;o.priority=n.uint32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],disabled:!!tP(e.disabled)&&Boolean(e.disabled),quality:tP(e.quality)?fw(e.quality):0,width:tP(e.width)?Number(e.width):0,height:tP(e.height)?Number(e.height):0,fps:tP(e.fps)?Number(e.fps):0,priority:tP(e.priority)?Number(e.priority):0}),toJSON(e){const t={};return e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.disabled&&(t.disabled=e.disabled),void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.width&&(t.width=Math.round(e.width)),void 0!==e.height&&(t.height=Math.round(e.height)),void 0!==e.fps&&(t.fps=Math.round(e.fps)),void 0!==e.priority&&(t.priority=Math.round(e.priority)),t},create:e=>EO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s;const c={trackSids:[],disabled:!1,quality:0,width:0,height:0,fps:0,priority:0};return c.trackSids=(null===(t=e.trackSids)||void 0===t?void 0:t.map((e=>e)))||[],c.disabled=null!==(n=e.disabled)&&void 0!==n&&n,c.quality=null!==(r=e.quality)&&void 0!==r?r:0,c.width=null!==(o=e.width)&&void 0!==o?o:0,c.height=null!==(i=e.height)&&void 0!==i?i:0,c.fps=null!==(a=e.fps)&&void 0!==a?a:0,c.priority=null!==(s=e.priority)&&void 0!==s?s:0,c}},CO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return!0===e.canReconnect&&t.uint32(8).bool(e.canReconnect),0!==e.reason&&t.uint32(16).int32(e.reason),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={canReconnect:!1,reason:0};for(;n.pos>>3){case 1:if(8!=e)break;o.canReconnect=n.bool();continue;case 2:if(16!=e)break;o.reason=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({canReconnect:!!tP(e.canReconnect)&&Boolean(e.canReconnect),reason:tP(e.reason)?bw(e.reason):0}),toJSON(e){const t={};return void 0!==e.canReconnect&&(t.canReconnect=e.canReconnect),void 0!==e.reason&&(t.reason=function(e){switch(e){case ew.UNKNOWN_REASON:return"UNKNOWN_REASON";case ew.CLIENT_INITIATED:return"CLIENT_INITIATED";case ew.DUPLICATE_IDENTITY:return"DUPLICATE_IDENTITY";case ew.SERVER_SHUTDOWN:return"SERVER_SHUTDOWN";case ew.PARTICIPANT_REMOVED:return"PARTICIPANT_REMOVED";case ew.ROOM_DELETED:return"ROOM_DELETED";case ew.STATE_MISMATCH:return"STATE_MISMATCH";case ew.JOIN_FAILURE:return"JOIN_FAILURE";case ew.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.reason)),t},create:e=>CO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={canReconnect:!1,reason:0};return r.canReconnect=null!==(t=e.canReconnect)&&void 0!==t&&t,r.reason=null!==(n=e.reason)&&void 0!==n?n:0,r}},TO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.trackSid&&t.uint32(10).string(e.trackSid);for(const n of e.layers)Iw.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:"",layers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue;case 2:if(18!=e)break;o.layers.push(Iw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):"",layers:Array.isArray(null==e?void 0:e.layers)?e.layers.map((e=>Iw.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),e.layers?t.layers=e.layers.map((e=>e?Iw.toJSON(e):void 0)):t.layers=[],t},create:e=>TO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={trackSid:"",layers:[]};return r.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",r.layers=(null===(n=e.layers)||void 0===n?void 0:n.map((e=>Iw.fromPartial(e))))||[],r}},xO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.metadata&&t.uint32(10).string(e.metadata),""!==e.name&&t.uint32(18).string(e.name),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={metadata:"",name:""};for(;n.pos>>3){case 1:if(10!=e)break;o.metadata=n.string();continue;case 2:if(18!=e)break;o.name=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({metadata:tP(e.metadata)?String(e.metadata):"",name:tP(e.name)?String(e.name):""}),toJSON(e){const t={};return void 0!==e.metadata&&(t.metadata=e.metadata),void 0!==e.name&&(t.name=e.name),t},create:e=>xO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={metadata:"",name:""};return r.metadata=null!==(t=e.metadata)&&void 0!==t?t:"",r.name=null!==(n=e.name)&&void 0!==n?n:"",r}},RO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.urls)t.uint32(10).string(n);return""!==e.username&&t.uint32(18).string(e.username),""!==e.credential&&t.uint32(26).string(e.credential),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={urls:[],username:"",credential:""};for(;n.pos>>3){case 1:if(10!=e)break;o.urls.push(n.string());continue;case 2:if(18!=e)break;o.username=n.string();continue;case 3:if(26!=e)break;o.credential=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({urls:Array.isArray(null==e?void 0:e.urls)?e.urls.map((e=>String(e))):[],username:tP(e.username)?String(e.username):"",credential:tP(e.credential)?String(e.credential):""}),toJSON(e){const t={};return e.urls?t.urls=e.urls.map((e=>e)):t.urls=[],void 0!==e.username&&(t.username=e.username),void 0!==e.credential&&(t.credential=e.credential),t},create:e=>RO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={urls:[],username:"",credential:""};return o.urls=(null===(t=e.urls)||void 0===t?void 0:t.map((e=>e)))||[],o.username=null!==(n=e.username)&&void 0!==n?n:"",o.credential=null!==(r=e.credential)&&void 0!==r?r:"",o}},jO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.speakers)Mw.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={speakers:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.speakers.push(Mw.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({speakers:Array.isArray(null==e?void 0:e.speakers)?e.speakers.map((e=>Mw.fromJSON(e))):[]}),toJSON(e){const t={};return e.speakers?t.speakers=e.speakers.map((e=>e?Mw.toJSON(e):void 0)):t.speakers=[],t},create:e=>jO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={speakers:[]};return n.speakers=(null===(t=e.speakers)||void 0===t?void 0:t.map((e=>Mw.fromPartial(e))))||[],n}},IO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return void 0!==e.room&&Ew.encode(e.room,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={room:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.room=Ew.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({room:tP(e.room)?Ew.fromJSON(e.room):void 0}),toJSON(e){const t={};return void 0!==e.room&&(t.room=e.room?Ew.toJSON(e.room):void 0),t},create:e=>IO.fromPartial(null!=e?e:{}),fromPartial(e){const t={room:void 0};return t.room=void 0!==e.room&&null!==e.room?Ew.fromPartial(e.room):void 0,t}},_O={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),0!==e.quality&&t.uint32(16).int32(e.quality),0!==e.score&&t.uint32(29).float(e.score),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",quality:0,score:0};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(16!=e)break;o.quality=n.int32();continue;case 3:if(29!=e)break;o.score=n.float();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",quality:tP(e.quality)?mw(e.quality):0,score:tP(e.score)?Number(e.score):0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.quality&&(t.quality=function(e){switch(e){case QS.POOR:return"POOR";case QS.GOOD:return"GOOD";case QS.EXCELLENT:return"EXCELLENT";case QS.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.quality)),void 0!==e.score&&(t.score=e.score),t},create:e=>_O.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",quality:0,score:0};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.quality=null!==(n=e.quality)&&void 0!==n?n:0,o.score=null!==(r=e.score)&&void 0!==r?r:0,o}},AO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.updates)_O.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={updates:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.updates.push(_O.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({updates:Array.isArray(null==e?void 0:e.updates)?e.updates.map((e=>_O.fromJSON(e))):[]}),toJSON(e){const t={};return e.updates?t.updates=e.updates.map((e=>e?_O.toJSON(e):void 0)):t.updates=[],t},create:e=>AO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={updates:[]};return n.updates=(null===(t=e.updates)||void 0===t?void 0:t.map((e=>_O.fromPartial(e))))||[],n}},MO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),""!==e.trackSid&&t.uint32(18).string(e.trackSid),0!==e.state&&t.uint32(24).int32(e.state),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSid:"",state:0};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSid=n.string();continue;case 3:if(24!=e)break;o.state=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",trackSid:tP(e.trackSid)?String(e.trackSid):"",state:tP(e.state)?uO(e.state):0}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.trackSid&&(t.trackSid=e.trackSid),void 0!==e.state&&(t.state=function(e){switch(e){case iO.ACTIVE:return"ACTIVE";case iO.PAUSED:return"PAUSED";case iO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(e.state)),t},create:e=>MO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",trackSid:"",state:0};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.trackSid=null!==(n=e.trackSid)&&void 0!==n?n:"",o.state=null!==(r=e.state)&&void 0!==r?r:0,o}},NO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();for(const n of e.streamStates)MO.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={streamStates:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.streamStates.push(MO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({streamStates:Array.isArray(null==e?void 0:e.streamStates)?e.streamStates.map((e=>MO.fromJSON(e))):[]}),toJSON(e){const t={};return e.streamStates?t.streamStates=e.streamStates.map((e=>e?MO.toJSON(e):void 0)):t.streamStates=[],t},create:e=>NO.fromPartial(null!=e?e:{}),fromPartial(e){var t;const n={streamStates:[]};return n.streamStates=(null===(t=e.streamStates)||void 0===t?void 0:t.map((e=>MO.fromPartial(e))))||[],n}},DO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.quality&&t.uint32(8).int32(e.quality),!0===e.enabled&&t.uint32(16).bool(e.enabled),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={quality:0,enabled:!1};for(;n.pos>>3){case 1:if(8!=e)break;o.quality=n.int32();continue;case 2:if(16!=e)break;o.enabled=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({quality:tP(e.quality)?fw(e.quality):0,enabled:!!tP(e.enabled)&&Boolean(e.enabled)}),toJSON(e){const t={};return void 0!==e.quality&&(t.quality=hw(e.quality)),void 0!==e.enabled&&(t.enabled=e.enabled),t},create:e=>DO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={quality:0,enabled:!1};return r.quality=null!==(t=e.quality)&&void 0!==t?t:0,r.enabled=null!==(n=e.enabled)&&void 0!==n&&n,r}},LO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.codec&&t.uint32(10).string(e.codec);for(const n of e.qualities)DO.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={codec:"",qualities:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.codec=n.string();continue;case 2:if(18!=e)break;o.qualities.push(DO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({codec:tP(e.codec)?String(e.codec):"",qualities:Array.isArray(null==e?void 0:e.qualities)?e.qualities.map((e=>DO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.codec&&(t.codec=e.codec),e.qualities?t.qualities=e.qualities.map((e=>e?DO.toJSON(e):void 0)):t.qualities=[],t},create:e=>LO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={codec:"",qualities:[]};return r.codec=null!==(t=e.codec)&&void 0!==t?t:"",r.qualities=(null===(n=e.qualities)||void 0===n?void 0:n.map((e=>DO.fromPartial(e))))||[],r}},UO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.trackSid&&t.uint32(10).string(e.trackSid);for(const n of e.subscribedQualities)DO.encode(n,t.uint32(18).fork()).ldelim();for(const n of e.subscribedCodecs)LO.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={trackSid:"",subscribedQualities:[],subscribedCodecs:[]};for(;n.pos>>3){case 1:if(10!=e)break;o.trackSid=n.string();continue;case 2:if(18!=e)break;o.subscribedQualities.push(DO.decode(n,n.uint32()));continue;case 3:if(26!=e)break;o.subscribedCodecs.push(LO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({trackSid:tP(e.trackSid)?String(e.trackSid):"",subscribedQualities:Array.isArray(null==e?void 0:e.subscribedQualities)?e.subscribedQualities.map((e=>DO.fromJSON(e))):[],subscribedCodecs:Array.isArray(null==e?void 0:e.subscribedCodecs)?e.subscribedCodecs.map((e=>LO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.trackSid&&(t.trackSid=e.trackSid),e.subscribedQualities?t.subscribedQualities=e.subscribedQualities.map((e=>e?DO.toJSON(e):void 0)):t.subscribedQualities=[],e.subscribedCodecs?t.subscribedCodecs=e.subscribedCodecs.map((e=>e?LO.toJSON(e):void 0)):t.subscribedCodecs=[],t},create:e=>UO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={trackSid:"",subscribedQualities:[],subscribedCodecs:[]};return o.trackSid=null!==(t=e.trackSid)&&void 0!==t?t:"",o.subscribedQualities=(null===(n=e.subscribedQualities)||void 0===n?void 0:n.map((e=>DO.fromPartial(e))))||[],o.subscribedCodecs=(null===(r=e.subscribedCodecs)||void 0===r?void 0:r.map((e=>LO.fromPartial(e))))||[],o}},BO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();""!==e.participantSid&&t.uint32(10).string(e.participantSid),!0===e.allTracks&&t.uint32(16).bool(e.allTracks);for(const n of e.trackSids)t.uint32(26).string(n);return""!==e.participantIdentity&&t.uint32(34).string(e.participantIdentity),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",allTracks:!1,trackSids:[],participantIdentity:""};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(16!=e)break;o.allTracks=n.bool();continue;case 3:if(26!=e)break;o.trackSids.push(n.string());continue;case 4:if(34!=e)break;o.participantIdentity=n.string();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",allTracks:!!tP(e.allTracks)&&Boolean(e.allTracks),trackSids:Array.isArray(null==e?void 0:e.trackSids)?e.trackSids.map((e=>String(e))):[],participantIdentity:tP(e.participantIdentity)?String(e.participantIdentity):""}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.allTracks&&(t.allTracks=e.allTracks),e.trackSids?t.trackSids=e.trackSids.map((e=>e)):t.trackSids=[],void 0!==e.participantIdentity&&(t.participantIdentity=e.participantIdentity),t},create:e=>BO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o;const i={participantSid:"",allTracks:!1,trackSids:[],participantIdentity:""};return i.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",i.allTracks=null!==(n=e.allTracks)&&void 0!==n&&n,i.trackSids=(null===(r=e.trackSids)||void 0===r?void 0:r.map((e=>e)))||[],i.participantIdentity=null!==(o=e.participantIdentity)&&void 0!==o?o:"",i}},FO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();!0===e.allParticipants&&t.uint32(8).bool(e.allParticipants);for(const n of e.trackPermissions)BO.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={allParticipants:!1,trackPermissions:[]};for(;n.pos>>3){case 1:if(8!=e)break;o.allParticipants=n.bool();continue;case 2:if(18!=e)break;o.trackPermissions.push(BO.decode(n,n.uint32()));continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({allParticipants:!!tP(e.allParticipants)&&Boolean(e.allParticipants),trackPermissions:Array.isArray(null==e?void 0:e.trackPermissions)?e.trackPermissions.map((e=>BO.fromJSON(e))):[]}),toJSON(e){const t={};return void 0!==e.allParticipants&&(t.allParticipants=e.allParticipants),e.trackPermissions?t.trackPermissions=e.trackPermissions.map((e=>e?BO.toJSON(e):void 0)):t.trackPermissions=[],t},create:e=>FO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={allParticipants:!1,trackPermissions:[]};return r.allParticipants=null!==(t=e.allParticipants)&&void 0!==t&&t,r.trackPermissions=(null===(n=e.trackPermissions)||void 0===n?void 0:n.map((e=>BO.fromPartial(e))))||[],r}},zO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.participantSid&&t.uint32(10).string(e.participantSid),""!==e.trackSid&&t.uint32(18).string(e.trackSid),!0===e.allowed&&t.uint32(24).bool(e.allowed),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={participantSid:"",trackSid:"",allowed:!1};for(;n.pos>>3){case 1:if(10!=e)break;o.participantSid=n.string();continue;case 2:if(18!=e)break;o.trackSid=n.string();continue;case 3:if(24!=e)break;o.allowed=n.bool();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({participantSid:tP(e.participantSid)?String(e.participantSid):"",trackSid:tP(e.trackSid)?String(e.trackSid):"",allowed:!!tP(e.allowed)&&Boolean(e.allowed)}),toJSON(e){const t={};return void 0!==e.participantSid&&(t.participantSid=e.participantSid),void 0!==e.trackSid&&(t.trackSid=e.trackSid),void 0!==e.allowed&&(t.allowed=e.allowed),t},create:e=>zO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={participantSid:"",trackSid:"",allowed:!1};return o.participantSid=null!==(t=e.participantSid)&&void 0!==t?t:"",o.trackSid=null!==(n=e.trackSid)&&void 0!==n?n:"",o.allowed=null!==(r=e.allowed)&&void 0!==r&&r,o}},WO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();void 0!==e.answer&&kO.encode(e.answer,t.uint32(10).fork()).ldelim(),void 0!==e.subscription&&PO.encode(e.subscription,t.uint32(18).fork()).ldelim();for(const n of e.publishTracks)SO.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.dataChannels)ZO.encode(n,t.uint32(34).fork()).ldelim();return void 0!==e.offer&&kO.encode(e.offer,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={answer:void 0,subscription:void 0,publishTracks:[],dataChannels:[],offer:void 0};for(;n.pos>>3){case 1:if(10!=e)break;o.answer=kO.decode(n,n.uint32());continue;case 2:if(18!=e)break;o.subscription=PO.decode(n,n.uint32());continue;case 3:if(26!=e)break;o.publishTracks.push(SO.decode(n,n.uint32()));continue;case 4:if(34!=e)break;o.dataChannels.push(ZO.decode(n,n.uint32()));continue;case 5:if(42!=e)break;o.offer=kO.decode(n,n.uint32());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({answer:tP(e.answer)?kO.fromJSON(e.answer):void 0,subscription:tP(e.subscription)?PO.fromJSON(e.subscription):void 0,publishTracks:Array.isArray(null==e?void 0:e.publishTracks)?e.publishTracks.map((e=>SO.fromJSON(e))):[],dataChannels:Array.isArray(null==e?void 0:e.dataChannels)?e.dataChannels.map((e=>ZO.fromJSON(e))):[],offer:tP(e.offer)?kO.fromJSON(e.offer):void 0}),toJSON(e){const t={};return void 0!==e.answer&&(t.answer=e.answer?kO.toJSON(e.answer):void 0),void 0!==e.subscription&&(t.subscription=e.subscription?PO.toJSON(e.subscription):void 0),e.publishTracks?t.publishTracks=e.publishTracks.map((e=>e?SO.toJSON(e):void 0)):t.publishTracks=[],e.dataChannels?t.dataChannels=e.dataChannels.map((e=>e?ZO.toJSON(e):void 0)):t.dataChannels=[],void 0!==e.offer&&(t.offer=e.offer?kO.toJSON(e.offer):void 0),t},create:e=>WO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={answer:void 0,subscription:void 0,publishTracks:[],dataChannels:[],offer:void 0};return r.answer=void 0!==e.answer&&null!==e.answer?kO.fromPartial(e.answer):void 0,r.subscription=void 0!==e.subscription&&null!==e.subscription?PO.fromPartial(e.subscription):void 0,r.publishTracks=(null===(t=e.publishTracks)||void 0===t?void 0:t.map((e=>SO.fromPartial(e))))||[],r.dataChannels=(null===(n=e.dataChannels)||void 0===n?void 0:n.map((e=>ZO.fromPartial(e))))||[],r.offer=void 0!==e.offer&&null!==e.offer?kO.fromPartial(e.offer):void 0,r}},ZO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return""!==e.label&&t.uint32(10).string(e.label),0!==e.id&&t.uint32(16).uint32(e.id),0!==e.target&&t.uint32(24).int32(e.target),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={label:"",id:0,target:0};for(;n.pos>>3){case 1:if(10!=e)break;o.label=n.string();continue;case 2:if(16!=e)break;o.id=n.uint32();continue;case 3:if(24!=e)break;o.target=n.int32();continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({label:tP(e.label)?String(e.label):"",id:tP(e.id)?Number(e.id):0,target:tP(e.target)?cO(e.target):0}),toJSON(e){const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.id&&(t.id=Math.round(e.id)),void 0!==e.target&&(t.target=lO(e.target)),t},create:e=>ZO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r;const o={label:"",id:0,target:0};return o.label=null!==(t=e.label)&&void 0!==t?t:"",o.id=null!==(n=e.id)&&void 0!==n?n:0,o.target=null!==(r=e.target)&&void 0!==r?r:0,o}},HO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();var n;switch(null===(n=e.scenario)||void 0===n?void 0:n.$case){case"speakerUpdate":t.uint32(8).int32(e.scenario.speakerUpdate);break;case"nodeFailure":t.uint32(16).bool(e.scenario.nodeFailure);break;case"migration":t.uint32(24).bool(e.scenario.migration);break;case"serverLeave":t.uint32(32).bool(e.scenario.serverLeave);break;case"switchCandidateProtocol":t.uint32(40).int32(e.scenario.switchCandidateProtocol);break;case"subscriberBandwidth":t.uint32(48).int64(e.scenario.subscriberBandwidth)}return t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={scenario:void 0};for(;n.pos>>3){case 1:if(8!=e)break;o.scenario={$case:"speakerUpdate",speakerUpdate:n.int32()};continue;case 2:if(16!=e)break;o.scenario={$case:"nodeFailure",nodeFailure:n.bool()};continue;case 3:if(24!=e)break;o.scenario={$case:"migration",migration:n.bool()};continue;case 4:if(32!=e)break;o.scenario={$case:"serverLeave",serverLeave:n.bool()};continue;case 5:if(40!=e)break;o.scenario={$case:"switchCandidateProtocol",switchCandidateProtocol:n.int32()};continue;case 6:if(48!=e)break;o.scenario={$case:"subscriberBandwidth",subscriberBandwidth:eP(n.int64())};continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({scenario:tP(e.speakerUpdate)?{$case:"speakerUpdate",speakerUpdate:Number(e.speakerUpdate)}:tP(e.nodeFailure)?{$case:"nodeFailure",nodeFailure:Boolean(e.nodeFailure)}:tP(e.migration)?{$case:"migration",migration:Boolean(e.migration)}:tP(e.serverLeave)?{$case:"serverLeave",serverLeave:Boolean(e.serverLeave)}:tP(e.switchCandidateProtocol)?{$case:"switchCandidateProtocol",switchCandidateProtocol:dO(e.switchCandidateProtocol)}:tP(e.subscriberBandwidth)?{$case:"subscriberBandwidth",subscriberBandwidth:Number(e.subscriberBandwidth)}:void 0}),toJSON(e){var t,n,r,o,i,a,s,c,l,u,d,p,f;const h={};return"speakerUpdate"===(null===(t=e.scenario)||void 0===t?void 0:t.$case)&&(h.speakerUpdate=Math.round(null===(n=e.scenario)||void 0===n?void 0:n.speakerUpdate)),"nodeFailure"===(null===(r=e.scenario)||void 0===r?void 0:r.$case)&&(h.nodeFailure=null===(o=e.scenario)||void 0===o?void 0:o.nodeFailure),"migration"===(null===(i=e.scenario)||void 0===i?void 0:i.$case)&&(h.migration=null===(a=e.scenario)||void 0===a?void 0:a.migration),"serverLeave"===(null===(s=e.scenario)||void 0===s?void 0:s.$case)&&(h.serverLeave=null===(c=e.scenario)||void 0===c?void 0:c.serverLeave),"switchCandidateProtocol"===(null===(l=e.scenario)||void 0===l?void 0:l.$case)&&(h.switchCandidateProtocol=void 0!==(null===(u=e.scenario)||void 0===u?void 0:u.switchCandidateProtocol)?function(e){switch(e){case aO.UDP:return"UDP";case aO.TCP:return"TCP";case aO.TLS:return"TLS";case aO.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(null===(d=e.scenario)||void 0===d?void 0:d.switchCandidateProtocol):void 0),"subscriberBandwidth"===(null===(p=e.scenario)||void 0===p?void 0:p.$case)&&(h.subscriberBandwidth=Math.round(null===(f=e.scenario)||void 0===f?void 0:f.subscriberBandwidth)),h},create:e=>HO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n,r,o,i,a,s,c,l,u,d,p,f,h,m,y,v,b;const g={scenario:void 0};return"speakerUpdate"===(null===(t=e.scenario)||void 0===t?void 0:t.$case)&&void 0!==(null===(n=e.scenario)||void 0===n?void 0:n.speakerUpdate)&&null!==(null===(r=e.scenario)||void 0===r?void 0:r.speakerUpdate)&&(g.scenario={$case:"speakerUpdate",speakerUpdate:e.scenario.speakerUpdate}),"nodeFailure"===(null===(o=e.scenario)||void 0===o?void 0:o.$case)&&void 0!==(null===(i=e.scenario)||void 0===i?void 0:i.nodeFailure)&&null!==(null===(a=e.scenario)||void 0===a?void 0:a.nodeFailure)&&(g.scenario={$case:"nodeFailure",nodeFailure:e.scenario.nodeFailure}),"migration"===(null===(s=e.scenario)||void 0===s?void 0:s.$case)&&void 0!==(null===(c=e.scenario)||void 0===c?void 0:c.migration)&&null!==(null===(l=e.scenario)||void 0===l?void 0:l.migration)&&(g.scenario={$case:"migration",migration:e.scenario.migration}),"serverLeave"===(null===(u=e.scenario)||void 0===u?void 0:u.$case)&&void 0!==(null===(d=e.scenario)||void 0===d?void 0:d.serverLeave)&&null!==(null===(p=e.scenario)||void 0===p?void 0:p.serverLeave)&&(g.scenario={$case:"serverLeave",serverLeave:e.scenario.serverLeave}),"switchCandidateProtocol"===(null===(f=e.scenario)||void 0===f?void 0:f.$case)&&void 0!==(null===(h=e.scenario)||void 0===h?void 0:h.switchCandidateProtocol)&&null!==(null===(m=e.scenario)||void 0===m?void 0:m.switchCandidateProtocol)&&(g.scenario={$case:"switchCandidateProtocol",switchCandidateProtocol:e.scenario.switchCandidateProtocol}),"subscriberBandwidth"===(null===(y=e.scenario)||void 0===y?void 0:y.$case)&&void 0!==(null===(v=e.scenario)||void 0===v?void 0:v.subscriberBandwidth)&&null!==(null===(b=e.scenario)||void 0===b?void 0:b.subscriberBandwidth)&&(g.scenario={$case:"subscriberBandwidth",subscriberBandwidth:e.scenario.subscriberBandwidth}),g}},qO={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.timestamp&&t.uint32(8).int64(e.timestamp),0!==e.rtt&&t.uint32(16).int64(e.rtt),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={timestamp:0,rtt:0};for(;n.pos>>3){case 1:if(8!=e)break;o.timestamp=eP(n.int64());continue;case 2:if(16!=e)break;o.rtt=eP(n.int64());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({timestamp:tP(e.timestamp)?Number(e.timestamp):0,rtt:tP(e.rtt)?Number(e.rtt):0}),toJSON(e){const t={};return void 0!==e.timestamp&&(t.timestamp=Math.round(e.timestamp)),void 0!==e.rtt&&(t.rtt=Math.round(e.rtt)),t},create:e=>qO.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={timestamp:0,rtt:0};return r.timestamp=null!==(t=e.timestamp)&&void 0!==t?t:0,r.rtt=null!==(n=e.rtt)&&void 0!==n?n:0,r}},$O={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cw.Writer.create();return 0!==e.lastPingTimestamp&&t.uint32(8).int64(e.lastPingTimestamp),0!==e.timestamp&&t.uint32(16).int64(e.timestamp),t},decode(e,t){const n=e instanceof cw.Reader?e:cw.Reader.create(e);let r=void 0===t?n.len:n.pos+t;const o={lastPingTimestamp:0,timestamp:0};for(;n.pos>>3){case 1:if(8!=e)break;o.lastPingTimestamp=eP(n.int64());continue;case 2:if(16!=e)break;o.timestamp=eP(n.int64());continue}if(4==(7&e)||0==e)break;n.skipType(7&e)}return o},fromJSON:e=>({lastPingTimestamp:tP(e.lastPingTimestamp)?Number(e.lastPingTimestamp):0,timestamp:tP(e.timestamp)?Number(e.timestamp):0}),toJSON(e){const t={};return void 0!==e.lastPingTimestamp&&(t.lastPingTimestamp=Math.round(e.lastPingTimestamp)),void 0!==e.timestamp&&(t.timestamp=Math.round(e.timestamp)),t},create:e=>$O.fromPartial(null!=e?e:{}),fromPartial(e){var t,n;const r={lastPingTimestamp:0,timestamp:0};return r.lastPingTimestamp=null!==(t=e.lastPingTimestamp)&&void 0!==t?t:0,r.timestamp=null!==(n=e.timestamp)&&void 0!==n?n:0,r}};var VO,GO,JO,KO,YO,QO,XO=(()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function eP(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new XO.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}function tP(e){return null!=e}cw.util.Long!==Xg&&(cw.util.Long=Xg,cw.configure());class nP extends Error{constructor(e,t){super(t||"an error has occured"),this.code=e}}class rP extends nP{constructor(e,t,n){super(1,e),this.status=n,this.reason=t}}class oP extends nP{constructor(e){super(21,null!=e?e:"device is unsupported")}}class iP extends nP{constructor(e){super(20,null!=e?e:"track is invalid")}}class aP extends nP{constructor(e){super(10,null!=e?e:"unsupported server")}}class sP extends nP{constructor(e){super(12,null!=e?e:"unexpected connection state")}}class cP extends nP{constructor(e){super(13,null!=e?e:"unable to negotiate")}}!function(e){e.PermissionDenied="PermissionDenied",e.NotFound="NotFound",e.DeviceInUse="DeviceInUse",e.Other="Other"}(VO||(VO={})),function(e){e.getFailure=function(t){if(t&&"name"in t)return"NotFoundError"===t.name||"DevicesNotFoundError"===t.name?e.NotFound:"NotAllowedError"===t.name||"PermissionDeniedError"===t.name?e.PermissionDenied:"NotReadableError"===t.name||"TrackStartError"===t.name?e.DeviceInUse:e.Other}}(VO||(VO={})),function(e){e.Connected="connected",e.Reconnecting="reconnecting",e.Reconnected="reconnected",e.Disconnected="disconnected",e.ConnectionStateChanged="connectionStateChanged",e.StateChanged="connectionStateChanged",e.MediaDevicesChanged="mediaDevicesChanged",e.ParticipantConnected="participantConnected",e.ParticipantDisconnected="participantDisconnected",e.TrackPublished="trackPublished",e.TrackSubscribed="trackSubscribed",e.TrackSubscriptionFailed="trackSubscriptionFailed",e.TrackUnpublished="trackUnpublished",e.TrackUnsubscribed="trackUnsubscribed",e.TrackMuted="trackMuted",e.TrackUnmuted="trackUnmuted",e.LocalTrackPublished="localTrackPublished",e.LocalTrackUnpublished="localTrackUnpublished",e.LocalAudioSilenceDetected="localAudioSilenceDetected",e.ActiveSpeakersChanged="activeSpeakersChanged",e.ParticipantMetadataChanged="participantMetadataChanged",e.RoomMetadataChanged="roomMetadataChanged",e.DataReceived="dataReceived",e.ConnectionQualityChanged="connectionQualityChanged",e.TrackStreamStateChanged="trackStreamStateChanged",e.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",e.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",e.AudioPlaybackStatusChanged="audioPlaybackChanged",e.MediaDevicesError="mediaDevicesError",e.ParticipantPermissionsChanged="participantPermissionsChanged",e.SignalConnected="signalConnected",e.RecordingStatusChanged="recordingStatusChanged",e.DCBufferStatusChanged="dcBufferStatusChanged"}(GO||(GO={})),function(e){e.TrackPublished="trackPublished",e.TrackSubscribed="trackSubscribed",e.TrackSubscriptionFailed="trackSubscriptionFailed",e.TrackUnpublished="trackUnpublished",e.TrackUnsubscribed="trackUnsubscribed",e.TrackMuted="trackMuted",e.TrackUnmuted="trackUnmuted",e.LocalTrackPublished="localTrackPublished",e.LocalTrackUnpublished="localTrackUnpublished",e.ParticipantMetadataChanged="participantMetadataChanged",e.DataReceived="dataReceived",e.IsSpeakingChanged="isSpeakingChanged",e.ConnectionQualityChanged="connectionQualityChanged",e.TrackStreamStateChanged="trackStreamStateChanged",e.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",e.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",e.MediaDevicesError="mediaDevicesError",e.ParticipantPermissionsChanged="participantPermissionsChanged"}(JO||(JO={})),function(e){e.TransportsCreated="transportsCreated",e.Connected="connected",e.Disconnected="disconnected",e.Resuming="resuming",e.Resumed="resumed",e.Restarting="restarting",e.Restarted="restarted",e.SignalResumed="signalResumed",e.Closing="closing",e.MediaTrackAdded="mediaTrackAdded",e.ActiveSpeakersUpdate="activeSpeakersUpdate",e.DataPacketReceived="dataPacketReceived",e.DCBufferStatusChanged="dcBufferStatusChanged"}(KO||(KO={})),(QO=YO||(YO={})).Message="message",QO.Muted="muted",QO.Unmuted="unmuted",QO.Restarted="restarted",QO.Ended="ended",QO.Subscribed="subscribed",QO.Unsubscribed="unsubscribed",QO.UpdateSettings="updateSettings",QO.UpdateSubscription="updateSubscription",QO.AudioPlaybackStarted="audioPlaybackStarted",QO.AudioPlaybackFailed="audioPlaybackFailed",QO.AudioSilenceDetected="audioSilenceDetected",QO.VisibilityChanged="visibilityChanged",QO.VideoDimensionsChanged="videoDimensionsChanged",QO.ElementAttached="elementAttached",QO.ElementDetached="elementDetached",QO.UpstreamPaused="upstreamPaused",QO.UpstreamResumed="upstreamResumed",QO.SubscriptionPermissionChanged="subscriptionPermissionChanged",QO.SubscriptionStatusChanged="subscriptionStatusChanged";const lP=2e3;function uP(e,t){if(!t)return 0;let n,r;return"bytesReceived"in e?(n=e.bytesReceived,r=t.bytesReceived):"bytesSent"in e&&(n=e.bytesSent,r=t.bytesSent),void 0===n||void 0===r||void 0===e.timestamp||void 0===t.timestamp?0:8*(n-r)*1e3/(e.timestamp-t.timestamp)}var dP={exports:{}};!function(e,t){!function(n,r){var o="function",i="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",f="version",h="architecture",m="console",y="mobile",v="tablet",b="smarttv",g="wearable",S="embedded",w="Amazon",k="Apple",O="ASUS",P="BlackBerry",E="Browser",C="Chrome",T="Firefox",x="Google",R="Huawei",j="LG",I="Microsoft",_="Motorola",A="Opera",M="Samsung",N="Sharp",D="Sony",L="Xiaomi",U="Zebra",B="Facebook",F="Chromium OS",z="Mac OS",W=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==o?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==o||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;d+=2}},V=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o2&&(e[l]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,$.call(e,b,S.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,$.call(e,b,S.os),w&&!e[u]&&g&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===s&&e.length>350?q(e,350):e,this},this.setUA(b),this};K.VERSION="1.0.35",K.BROWSER=W([u,f,c]),K.CPU=W([h]),K.DEVICE=W([l,p,d,m,y,b,v,g,S]),K.ENGINE=K.OS=W([u,f]),e.exports&&(t=e.exports=K),t.UAParser=K;var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new K;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:og)}(dP,dP.exports);var pP=ig(dP.exports);function fP(e,t){return Object.keys(t).forEach((n=>{void 0===e[n]&&(e[n]=t[n])})),e}function hP(e){const t={};if(e.video)if("object"==typeof e.video){const n={},r=n,o=e.video;Object.keys(o).forEach((e=>{"resolution"===e?fP(r,o.resolution):r[e]=o[e]})),t.video=n}else t.video=e.video;else t.video=!1;return e.audio?"object"==typeof e.audio?t.audio=e.audio:t.audio=!0:t.audio=!1,t}function mP(){const e="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(e)return new e({latencyHint:"interactive"})}async function yP(e){return new Promise((t=>setTimeout(t,e)))}function vP(){return"addTransceiver"in RTCPeerConnection.prototype}function bP(){return"addTrack"in RTCPeerConnection.prototype}function gP(e){return!!document&&(e||(e=document.createElement("audio")),"setSinkId"in e)}const SP={Chrome:"100",Chromium:"100",Safari:"15",Firefox:"100",Edge:"100",Brave:"1.40"};function wP(){return!!PP()&&-1!==navigator.userAgent.indexOf("Firefox")}function kP(){return!!PP()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function OP(){return!!PP()&&/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent)}function PP(){return"undefined"!=typeof document}function EP(){return"ReactNative"==navigator.product}function CP(e){return e.hostname.endsWith(".livekit.cloud")}function TP(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function xP(){if(PP())return window.devicePixelRatio;if(EP()){let e=TP();if(e)return e.devicePixelRatio}return 1}function RP(e){for(const t of e)t.target.handleResize(t)}function jP(e){for(const t of e)t.target.handleVisibilityChanged(t)}let IP=null;const _P=()=>(IP||(IP=new ResizeObserver(RP)),IP);let AP=null;const MP=()=>(AP||(AP=new IntersectionObserver(jP,{root:document,rootMargin:"0px"})),AP);let NP,DP;function LP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=document.createElement("canvas");o.width=e,o.height=t;const i=o.getContext("2d");null==i||i.fillRect(0,0,o.width,o.height),r&&i&&(i.beginPath(),i.arc(e/2,t/2,50,0,2*Math.PI,!0),i.closePath(),i.fillStyle="grey",i.fill());const a=o.captureStream(),[s]=a.getTracks();if(!s)throw Error("Could not get empty media stream video track");return s.enabled=n,s}function UP(){if(!DP){const e=new AudioContext,t=e.createOscillator(),n=e.createMediaStreamDestination();if(t.connect(n),t.start(),[DP]=n.stream.getAudioTracks(),!DP)throw Error("Could not get empty media stream audio track");DP.enabled=!1}return DP}class BP{constructor(e,t){this.onFinally=t,this.promise=new Promise((async(t,n)=>{this.resolve=t,this.reject=n,e&&await e(t,n)})).finally((()=>{var e;return null===(e=this.onFinally)||void 0===e?void 0:e.call(this)}))}}class FP{constructor(){this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){let e;this._locks+=1;const t=new Promise((t=>e=()=>{this._locks-=1,t()})),n=this._locking.then((()=>e));return this._locking=this._locking.then((()=>t)),n}}const zP="default";class WP{static getInstance(){return void 0===this.instance&&(this.instance=new WP),this.instance}async getDevices(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n;if((null===(n=WP.userMediaPromiseMap)||void 0===n?void 0:n.size)>0){pg.debug("awaiting getUserMedia promise");try{e?await WP.userMediaPromiseMap.get(e):await Promise.all(WP.userMediaPromiseMap.values())}catch(e){pg.warn("error waiting for media permissons")}}let r=await navigator.mediaDevices.enumerateDevices();if(t&&e&&(!WP.userMediaPromiseMap.get(e)||!kP())&&(0===r.length||r.some((t=>{const n=""===t.label,r=!e||t.kind===e;return n&&r})))){const t={video:"audioinput"!==e&&"audiooutput"!==e,audio:"videoinput"!==e},n=await navigator.mediaDevices.getUserMedia(t);r=await navigator.mediaDevices.enumerateDevices(),n.getTracks().forEach((e=>{e.stop()}))}return e&&(r=r.filter((t=>t.kind===e))),r}async normalizeDeviceId(e,t,n){if(t!==zP)return t;const r=(await this.getDevices(e)).find((e=>e.groupId===n&&e.deviceId!==zP));return null==r?void 0:r.deviceId}}WP.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],WP.userMediaPromiseMap=new Map;var ZP,HP={exports:{}},qP="object"==typeof Reflect?Reflect:null,$P=qP&&"function"==typeof qP.apply?qP.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};ZP=qP&&"function"==typeof qP.ownKeys?qP.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var VP=Number.isNaN||function(e){return e!=e};function GP(){GP.init.call(this)}HP.exports=GP,HP.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}oE(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&oE(e,"error",t,{once:!0})}(e,o)}))},GP.EventEmitter=GP,GP.prototype._events=void 0,GP.prototype._eventsCount=0,GP.prototype._maxListeners=void 0;var JP=10;function KP(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function YP(e){return void 0===e._maxListeners?GP.defaultMaxListeners:e._maxListeners}function QP(e,t,n,r){var o,i,a,s;if(KP(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=YP(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function XP(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function eE(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=XP.bind(r);return o.listener=n,r.wrapFn=o,o}function tE(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)$P(s,this,t);else{var c=s.length,l=rE(s,c);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},GP.prototype.listeners=function(e){return tE(this,e,!0)},GP.prototype.rawListeners=function(e){return tE(this,e,!1)},GP.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):nE.call(e,t)},GP.prototype.listenerCount=nE,GP.prototype.eventNames=function(){return this._eventsCount>0?ZP(this._events):[]};var iE=HP.exports,aE=ig(iE);const sE=[];class cE extends iE.EventEmitter{constructor(e,t){super(),this.attachedElements=[],this.isMuted=!1,this.streamState=cE.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout((()=>this.handleAppVisibilityChanged()),5e3):this.handleAppVisibilityChanged()},this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=cE.Source.Unknown}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===cE.Kind.Video&&(t="video"),0===this.attachedElements.length&&cE.Kind.Video&&this.addAppVisibilityListener(),e||("audio"===t&&(sE.forEach((t=>{null!==t.parentElement||e||(e=t)})),e&&sE.splice(sE.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),lE(this._mediaStreamTrack,e);const n=e.srcObject.getTracks();return n.some((e=>"audio"===e.kind))&&e.play().then((()=>{this.emit(YO.AudioPlaybackStarted)})).catch((t=>{"NotAllowedError"===t.name?this.emit(YO.AudioPlaybackFailed,t):pg.warn("could not playback audio",t),e&&n.some((e=>"video"===e.kind))&&"NotAllowedError"===t.name&&(e.muted=!0,e.play().catch((()=>{})))})),this.emit(YO.ElementAttached,e),e}detach(e){try{if(e){uE(this._mediaStreamTrack,e);const t=this.attachedElements.indexOf(e);return t>=0&&(this.attachedElements.splice(t,1),this.recycleElement(e),this.emit(YO.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e),t.push(e),this.recycleElement(e),this.emit(YO.ElementDetached,e)})),this.attachedElements=[],t}finally{0===this.attachedElements.length&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),sE.forEach((e=>{e.parentElement||(t=!1)})),t&&sE.push(e)}}async handleAppVisibilityChanged(){this.isInBackground="hidden"===document.visibilityState}addAppVisibilityListener(){PP()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){PP()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function lE(e,t){let n,r;n=t.srcObject instanceof MediaStream?t.srcObject:new MediaStream,r="audio"===e.kind?n.getAudioTracks():n.getVideoTracks(),r.includes(e)||(r.forEach((e=>{n.removeTrack(e)})),n.addTrack(e)),t.autoplay=!0,t.muted=0===n.getAudioTracks().length,t instanceof HTMLVideoElement&&(t.playsInline=!0),t.srcObject!==n&&(t.srcObject=n,(kP()||wP())&&t instanceof HTMLVideoElement&&setTimeout((()=>{t.srcObject=n,t.play().catch((()=>{}))}),0))}function uE(e,t){if(t.srcObject instanceof MediaStream){const n=t.srcObject;n.removeTrack(e),n.getTracks().length>0?t.srcObject=n:t.srcObject=null}}!function(e){let t,n,r;!function(e){e.Audio="audio",e.Video="video",e.Unknown="unknown"}(t=e.Kind||(e.Kind={})),function(e){e.Camera="camera",e.Microphone="microphone",e.ScreenShare="screen_share",e.ScreenShareAudio="screen_share_audio",e.Unknown="unknown"}(n=e.Source||(e.Source={})),function(e){e.Active="active",e.Paused="paused",e.Unknown="unknown"}(r=e.StreamState||(e.StreamState={})),e.kindToProto=function(e){switch(e){case t.Audio:return JS.AUDIO;case t.Video:return JS.VIDEO;default:return JS.UNRECOGNIZED}},e.kindFromProto=function(e){switch(e){case JS.AUDIO:return t.Audio;case JS.VIDEO:return t.Video;default:return t.Unknown}},e.sourceToProto=function(e){switch(e){case n.Camera:return KS.CAMERA;case n.Microphone:return KS.MICROPHONE;case n.ScreenShare:return KS.SCREEN_SHARE;case n.ScreenShareAudio:return KS.SCREEN_SHARE_AUDIO;default:return KS.UNRECOGNIZED}},e.sourceFromProto=function(e){switch(e){case KS.CAMERA:return n.Camera;case KS.MICROPHONE:return n.Microphone;case KS.SCREEN_SHARE:return n.ScreenShare;case KS.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}},e.streamStateFromProto=function(e){switch(e){case iO.ACTIVE:return r.Active;case iO.PAUSED:return r.Paused;default:return r.Unknown}}}(cE||(cE={}));class dE extends cE{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(e,t),this._isUpstreamPaused=!1,this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this.emit(YO.Ended,this)},this._mediaStreamTrack.addEventListener("ended",this.handleEnded),this.constraints=null!=n?n:e.getConstraints(),this.reacquireTrack=!1,this.providedByUser=r,this.muteLock=new FP,this.pauseUpstreamLock=new FP}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==cE.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();return e&&t?{width:e,height:t}:void 0}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}async waitForDimensions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;if(this.kind===cE.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");const t=Date.now();for(;Date.now()-t1&&void 0!==arguments[1])||arguments[1];if(!this.sender)throw new iP("unable to replace an unpublished track");return this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this.providedByUser||this._mediaStreamTrack.stop(),e.addEventListener("ended",this.handleEnded),pg.debug("replace MediaStreamTrack"),this.sender&&await this.sender.replaceTrack(e),this._mediaStreamTrack=e,this._mediaStreamTrack.enabled=!this.isMuted,await this.resumeUpstream(),this.attachedElements.forEach((t=>{lE(e,t)})),this.mediaStream=new MediaStream([e]),this.providedByUser=t,this}async restart(e){e||(e=this.constraints),pg.debug("restarting track with constraints",e);const t={audio:!1,video:!1};this.kind===cE.Kind.Video?t.video=e:t.audio=e,this.attachedElements.forEach((e=>{uE(this._mediaStreamTrack,e)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const n=await navigator.mediaDevices.getUserMedia(t),r=n.getTracks()[0];return r.addEventListener("ended",this.handleEnded),pg.debug("re-acquired MediaStreamTrack"),this.sender&&await this.sender.replaceTrack(r),this._mediaStreamTrack=r,await this.resumeUpstream(),this.attachedElements.forEach((e=>{lE(r,e)})),this.mediaStream=n,this.constraints=e,this.emit(YO.Restarted,this),this}setTrackMuted(e){pg.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted")),this.isMuted===e&&this._mediaStreamTrack.enabled!==e||(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?YO.Muted:YO.Unmuted,this))}get needsReAcquisition(){return"live"!==this._mediaStreamTrack.readyState||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),OP()&&(pg.debug("visibility changed, is in Background: ".concat(this.isInBackground)),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted||(pg.debug("track needs to be reaquired, restarting ".concat(this.source)),await this.restart(),this.reacquireTrack=!1))}async pauseUpstream(){const e=await this.pauseUpstreamLock.lock();try{if(!0===this._isUpstreamPaused)return;if(!this.sender)return void pg.warn("unable to pause upstream for an unpublished track");this._isUpstreamPaused=!0,this.emit(YO.UpstreamPaused,this);const e=this.kind===cE.Kind.Audio?UP():(NP||(NP=LP()),NP);await this.sender.replaceTrack(e)}finally{e()}}async resumeUpstream(){const e=await this.pauseUpstreamLock.lock();try{if(!1===this._isUpstreamPaused)return;if(!this.sender)return void pg.warn("unable to resume upstream for an unpublished track");this._isUpstreamPaused=!1,this.emit(YO.UpstreamResumed,this),await this.sender.replaceTrack(this._mediaStreamTrack)}finally{e()}}}class pE extends dE{constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,cE.Kind.Audio,t,n),this.stopOnMute=!1,this.monitorSender=async()=>{if(!this.sender)return void(this._currentBitrate=0);let e;try{e=await this.getSenderStats()}catch(e){return void pg.error("could not get audio sender stats",{error:e})}e&&this.prevStats&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.checkForSilence()}async setDeviceId(e){this.constraints.deviceId!==e&&(this.constraints.deviceId=e,this.isMuted||await this.restartTrack())}async mute(){const e=await this.muteLock.lock();try{return this.source===cE.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(pg.debug("stopping mic track"),this._mediaStreamTrack.stop()),await super.mute(),this}finally{e()}}async unmute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Microphone||!this.stopOnMute&&"ended"!==this._mediaStreamTrack.readyState||this.isUserProvided||(pg.debug("reacquiring mic track"),await this.restartTrack()),await super.unmute(),this}finally{e()}}async restartTrack(e){let t;if(e){const n=hP({audio:e});"boolean"!=typeof n.audio&&(t=n.audio)}await this.restart(t)}async restart(e){const t=await super.restart(e);return this.checkForSilence(),t}startMonitor(){PP()&&(this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),lP)))}async getSenderStats(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return;let t;return(await this.sender.getStats()).forEach((e=>{"outbound-rtp"===e.type&&(t={type:"audio",streamId:e.id,packetsSent:e.packetsSent,packetsLost:e.packetsLost,bytesSent:e.bytesSent,timestamp:e.timestamp,roundTripTime:e.roundTripTime,jitter:e.jitter})})),t}async checkForSilence(){const e=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;const n=mP();if(n){const r=n.createAnalyser();r.fftSize=2048;const o=r.frequencyBinCount,i=new Uint8Array(o);n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(r),await yP(t),r.getByteTimeDomainData(i);const a=i.some((e=>128!==e&&0!==e));return n.close(),!a}return!1}(this);return e&&(this.isMuted||pg.warn("silence detected on local audio track"),this.emit(YO.AudioSilenceDetected)),e}}class fE extends dE{constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,cE.Kind.Video,t,n),this.simulcastCodecs=new Map,this.monitorSender=async()=>{if(!this.sender)return void(this._currentBitrate=0);let e;try{e=await this.getSenderStats()}catch(e){return void pg.error("could not get audio sender stats",{error:e})}const t=new Map(e.map((e=>[e.rid,e])));if(this.prevStats){let e=0;t.forEach(((t,n)=>{var r;const o=null===(r=this.prevStats)||void 0===r?void 0:r.get(n);e+=uP(t,o)})),this._currentBitrate=e}this.prevStats=t},this.senderLock=new FP}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!PP())return;const n=null===(t=this.sender)||void 0===t?void 0:t.getParameters();n&&(this.encodings=n.encodings),this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),lP))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach((e=>{e.mediaStreamTrack.stop()})),super.stop()}async mute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Camera||this.isUserProvided||(pg.debug("stopping camera track"),this._mediaStreamTrack.stop()),await super.mute(),this}finally{e()}}async unmute(){const e=await this.muteLock.lock();try{return this.source!==cE.Source.Camera||this.isUserProvided||(pg.debug("reacquiring camera track"),await this.restartTrack()),await super.unmute(),this}finally{e()}}async getSenderStats(){var e;if(!(null===(e=this.sender)||void 0===e?void 0:e.getStats))return[];const t=[],n=await this.sender.getStats();return n.forEach((e=>{var r;if("outbound-rtp"===e.type){const o={type:"video",streamId:e.id,frameHeight:e.frameHeight,frameWidth:e.frameWidth,firCount:e.firCount,pliCount:e.pliCount,nackCount:e.nackCount,packetsSent:e.packetsSent,bytesSent:e.bytesSent,framesSent:e.framesSent,timestamp:e.timestamp,rid:null!==(r=e.rid)&&void 0!==r?r:e.id,retransmittedPacketsSent:e.retransmittedPacketsSent,qualityLimitationReason:e.qualityLimitationReason,qualityLimitationResolutionChanges:e.qualityLimitationResolutionChanges},i=n.get(e.remoteId);i&&(o.jitter=i.jitter,o.packetsLost=i.packetsLost,o.roundTripTime=i.roundTripTime),t.push(o)}})),t}setPublishingQuality(e){const t=[];for(let n=YS.LOW;n<=YS.HIGH;n+=1)t.push({quality:n,enabled:n<=e});pg.debug("setting publishing quality. max quality ".concat(e)),this.setPublishingLayers(t)}async setDeviceId(e){this.constraints.deviceId!==e&&(this.constraints.deviceId=e,this.isMuted||await this.restartTrack())}async restartTrack(e){let t;if(e){const n=hP({video:e});"boolean"!=typeof n.video&&(t=n.video)}await this.restart(t)}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e))throw new Error("".concat(e," already added"));const n={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,n),n}setSimulcastTrackSender(e,t){const n=this.simulcastCodecs.get(e);n&&(n.sender=t,setTimeout((()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)}),5e3))}async setPublishingCodecs(e){if(pg.debug("setting publishing codecs",{codecs:e,currentCodec:this.codec}),!this.codec&&e.length>0)return await this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const t=[];var n,r=!1,o=!1;try{for(var i,a=Jw(e);r=!(i=await a.next()).done;r=!1){const e=i.value;if(this.codec&&this.codec!==e.codec){const n=this.simulcastCodecs.get(e.codec);if(pg.debug("try setPublishingCodec for ".concat(e.codec),n),n&&n.sender)n.encodings&&(pg.debug("try setPublishingLayersForSender ".concat(e.codec)),await hE(n.sender,n.encodings,e.qualities,this.senderLock));else for(const n of e.qualities)if(n.enabled){t.push(e.codec);break}}else await this.setPublishingLayers(e.qualities)}}catch(e){o=!0,n=e}finally{try{r&&null!=a.return&&await a.return()}finally{if(o)throw n}}return t}async setPublishingLayers(e){pg.debug("setting publishing layers",e),this.sender&&this.encodings&&await hE(this.sender,this.encodings,e,this.senderLock)}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),OP()&&this.isInBackground&&this.source===cE.Source.Camera&&(this._mediaStreamTrack.enabled=!1)}}async function hE(e,t,n,r){const o=await r.lock();pg.debug("setPublishingLayersForSender",{sender:e,qualities:n,senderEncodings:t});try{const r=e.getParameters(),{encodings:o}=r;if(!o)return;if(o.length!==t.length)return void pg.warn("cannot set publishing layers, encodings mismatch");let i=!1;o.forEach(((e,r)=>{var o;let a=null!==(o=e.rid)&&void 0!==o?o:"";""===a&&(a="q");const s=mE(a),c=n.find((e=>e.quality===s));c&&e.active!==c.enabled&&(i=!0,e.active=c.enabled,pg.debug("setting layer ".concat(c.quality," to ").concat(e.active?"enabled":"disabled")),wP()&&(c.enabled?(e.scaleResolutionDownBy=t[r].scaleResolutionDownBy,e.maxBitrate=t[r].maxBitrate,e.maxFrameRate=t[r].maxFrameRate):(e.scaleResolutionDownBy=4,e.maxBitrate=10,e.maxFrameRate=2)))})),i&&(r.encodings=o,await e.setParameters(r))}finally{o()}}function mE(e){switch(e){case"f":return YS.HIGH;case"h":return YS.MEDIUM;case"q":return YS.LOW;default:return YS.UNRECOGNIZED}}function yE(e,t,n){return n?n.map((r=>{var o,i,a;const s=null!==(o=r.scaleResolutionDownBy)&&void 0!==o?o:1;let c=mE(null!==(i=r.rid)&&void 0!==i?i:"");return c===YS.UNRECOGNIZED&&1===n.length&&(c=YS.HIGH),{quality:c,width:e/s,height:t/s,bitrate:null!==(a=r.maxBitrate)&&void 0!==a?a:0,ssrc:0}})):[{quality:YS.HIGH,width:e,height:t,bitrate:0,ssrc:0}]}class vE extends cE{constructor(e,t,n,r){super(e,n),this.sid=t,this.receiver=r}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?YO.Muted:YO.Unmuted,this))}setMediaStream(e){this.mediaStream=e,e.onremovetrack=()=>{this.receiver=void 0,this._currentBitrate=0,this.emit(YO.Ended,this)}}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval((()=>this.monitorReceiver()),lP))}}class bE extends vE{constructor(e,t,n,r,o){super(e,t,cE.Kind.Audio,n),this.monitorReceiver=async()=>{if(!this.receiver)return void(this._currentBitrate=0);const e=await this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.audioContext=r,this.webAudioPluginNodes=[],o&&(this.sinkId=o.deviceId)}setVolume(e){var t;for(const n of this.attachedElements)this.audioContext?null===(t=this.gainNode)||void 0===t||t.gain.setTargetAtTime(e,0,.1):n.volume=e;this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;let e=0;return this.attachedElements.forEach((t=>{t.volume>e&&(e=t.volume)})),e}async setSinkId(e){this.sinkId=e,await Promise.all(this.attachedElements.map((t=>{if(gP(t))return t.setSinkId(e)})))}attach(e){const t=0===this.attachedElements.length;return e?super.attach(e):e=super.attach(),this.elementVolume&&(e.volume=this.elementVolume),this.sinkId&&gP(e)&&e.setSinkId(this.sinkId),this.audioContext&&t&&(pg.debug("using audio context mapping"),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let n=this.sourceNode;this.webAudioPluginNodes.forEach((e=>{n.connect(e),n=e})),this.gainNode=e.createGain(),n.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),"running"!==e.state&&e.resume().then((()=>{"running"!==e.state&&this.emit(YO.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))})).catch((e=>{this.emit(YO.AudioPlaybackFailed,e)}))}disconnectWebAudio(){var e,t;null===(e=this.gainNode)||void 0===e||e.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}async getReceiverStats(){if(!this.receiver||!this.receiver.getStats)return;let e;return(await this.receiver.getStats()).forEach((t=>{"inbound-rtp"===t.type&&(e={type:"audio",timestamp:t.timestamp,jitter:t.jitter,bytesReceived:t.bytesReceived,concealedSamples:t.concealedSamples,concealmentEvents:t.concealmentEvents,silentConcealedSamples:t.silentConcealedSamples,silentConcealmentEvents:t.silentConcealmentEvents,totalAudioEnergy:t.totalAudioEnergy,totalSamplesDuration:t.totalSamplesDuration})})),e}}function gE(e,t,n){var r,o,i;void 0===t&&(t=50),void 0===n&&(n={});var a=null!=(r=n.isImmediate)&&r,s=null!=(o=n.callback)&&o,c=n.maxWait,l=Date.now(),u=[];function d(){if(void 0!==c){var e=Date.now()-l;if(e+t>=c)return c-e}return t}var p=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(r,o){var c=a&&void 0===i;if(void 0!==i&&clearTimeout(i),i=setTimeout((function(){if(i=void 0,l=Date.now(),!a){var r=e.apply(n,t);s&&s(r),u.forEach((function(e){return(0,e.resolve)(r)})),u=[]}}),d()),c){var p=e.apply(n,t);return s&&s(p),r(p)}u.push({resolve:r,reject:o})}))};return p.cancel=function(e){void 0!==i&&clearTimeout(i),u.forEach((function(t){return(0,t.reject)(e)})),u=[]},p}class SE{}SE.setTimeout=function(){return setTimeout(...arguments)},SE.setInterval=function(){return setInterval(...arguments)},SE.clearTimeout=function(){return clearTimeout(...arguments)},SE.clearInterval=function(){return clearInterval(...arguments)};class wE extends vE{constructor(e,t,n,r){super(e,t,cE.Kind.Video,n),this.elementInfos=[],this.isObserved=!1,this.monitorReceiver=async()=>{if(!this.receiver)return void(this._currentBitrate=0);const e=await this.getReceiverStats();e&&this.prevStats&&this.receiver&&(this._currentBitrate=uP(e,this.prevStats)),this.prevStats=e},this.debouncedHandleResize=gE((()=>{this.updateDimensions()}),100),this.adaptiveStreamSettings=r}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}get mediaStreamTrack(){return this.isAdaptiveStream&&!this.isObserved&&pg.warn("When using adaptiveStream, you need to use remoteVideoTrack.attach() to add the track to a HTMLVideoElement, otherwise your video tracks might never start"),this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach((t=>{e?uE(this._mediaStreamTrack,t):lE(this._mediaStreamTrack,t)}))}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t.element===e))){const t=new kE(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t===e))?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility(),this.isObserved=!0):pg.warn("visibility resize observer not triggered")}stopObservingElementInfo(e){if(!this.isAdaptiveStream)return void pg.warn("stopObservingElementInfo ignored");const t=this.elementInfos.filter((t=>t===e));for(const e of t)e.stopObserving();this.elementInfos=this.elementInfos.filter((t=>t!==e)),this.updateVisibility()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const e of t)this.stopObservingElement(e);return t}getDecoderImplementation(){var e;return null===(e=this.prevStats)||void 0===e?void 0:e.decoderImplementation}async getReceiverStats(){if(!this.receiver||!this.receiver.getStats)return;let e;return(await this.receiver.getStats()).forEach((t=>{"inbound-rtp"===t.type&&(e={type:"video",framesDecoded:t.framesDecoded,framesDropped:t.framesDropped,framesReceived:t.framesReceived,packetsReceived:t.packetsReceived,packetsLost:t.packetsLost,frameWidth:t.frameWidth,frameHeight:t.frameHeight,pliCount:t.pliCount,firCount:t.firCount,nackCount:t.nackCount,jitter:t.jitter,timestamp:t.timestamp,bytesReceived:t.bytesReceived,decoderImplementation:t.decoderImplementation})})),e}stopObservingElement(e){const t=this.elementInfos.filter((t=>t.element===e));for(const e of t)e.stopObserving();this.elementInfos=this.elementInfos.filter((t=>t.element!==e))}async handleAppVisibilityChanged(){await super.handleAppVisibilityChanged(),this.isAdaptiveStream&&this.updateVisibility()}updateVisibility(){var e,t;const n=this.elementInfos.reduce(((e,t)=>Math.max(e,t.visibilityChangedAt||0)),0),r=!(null!==(t=null===(e=this.adaptiveStreamSettings)||void 0===e?void 0:e.pauseVideoInBackground)&&void 0!==t&&!t)&&this.isInBackground,o=this.elementInfos.some((e=>e.pictureInPicture)),i=this.elementInfos.some((e=>e.visible))&&!r||o;this.lastVisible!==i&&(!i&&Date.now()-n<100?SE.setTimeout((()=>{this.updateVisibility()}),100):(this.lastVisible=i,this.emit(YO.VisibilityChanged,i,this)))}updateDimensions(){var e,t,n,r;let o=0,i=0;for(const n of this.elementInfos){const r=null!==(t=null===(e=this.adaptiveStreamSettings)||void 0===e?void 0:e.pixelDensity)&&void 0!==t?t:1,a="screen"===r?xP():r,s=n.width()*a,c=n.height()*a;s+c>o+i&&(o=s,i=c)}(null===(n=this.lastDimensions)||void 0===n?void 0:n.width)===o&&(null===(r=this.lastDimensions)||void 0===r?void 0:r.height)===i||(this.lastDimensions={width:o,height:i},this.emit(YO.VideoDimensionsChanged,this.lastDimensions,this))}}class kE{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=e=>{var t;const{target:n,isIntersecting:r}=e;n===this.element&&(this.isIntersecting=r,this.visibilityChangedAt=Date.now(),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this))},this.onEnterPiP=()=>{var e;this.isPiP=!0,null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.onLeavePiP=()=>{var e;this.isPiP=!1,null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.element=e,this.isIntersecting=null!=t?t:OE(e),this.isPiP=PP()&&document.pictureInPictureElement===e,this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){this.isIntersecting=OE(this.element),this.isPiP=document.pictureInPictureElement===this.element,this.element.handleResize=()=>{var e;null===(e=this.handleResize)||void 0===e||e.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,MP().observe(this.element),_P().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP)}stopObserving(){var e,t;null===(e=MP())||void 0===e||e.unobserve(this.element),null===(t=_P())||void 0===t||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP)}}function OE(e){let t=e.offsetTop,n=e.offsetLeft;const r=e.offsetWidth,o=e.offsetHeight,{hidden:i}=e,{opacity:a,display:s}=getComputedStyle(e);for(;e.offsetParent;)t+=(e=e.offsetParent).offsetTop,n+=e.offsetLeft;return twindow.pageYOffset&&n+r>window.pageXOffset&&!i&&(""===a||parseFloat(a)>0)&&"none"!==s}class PE extends iE.EventEmitter{constructor(e,t,n){super(),this.metadataMuted=!1,this.handleMuted=()=>{this.emit(YO.Muted)},this.handleUnmuted=()=>{this.emit(YO.Unmuted)},this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=n,this.source=cE.Source.Unknown}setTrack(e){this.track&&(this.track.off(YO.Muted,this.handleMuted),this.track.off(YO.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(YO.Muted,this.handleMuted),e.on(YO.Unmuted,this.handleUnmuted))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get audioTrack(){if(this.track instanceof pE||this.track instanceof bE)return this.track}get videoTrack(){if(this.track instanceof fE||this.track instanceof wE)return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=cE.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===cE.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.trackInfo=e,pg.trace("update publication info",{info:e})}}!function(e){var t,n;(t=e.SubscriptionStatus||(e.SubscriptionStatus={})).Desired="desired",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",(n=e.PermissionStatus||(e.PermissionStatus={})).Allowed="allowed",n.NotAllowed="not_allowed"}(PE||(PE={}));class EE extends PE{get isUpstreamPaused(){var e;return null===(e=this.track)||void 0===e?void 0:e.isUpstreamPaused}constructor(e,t,n){super(e,t.sid,t.name),this.track=void 0,this.handleTrackEnded=()=>{this.emit(YO.Ended)},this.updateInfo(t),this.setTrack(n)}setTrack(e){this.track&&this.track.off(YO.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(YO.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}async mute(){var e;return null===(e=this.track)||void 0===e?void 0:e.mute()}async unmute(){var e;return null===(e=this.track)||void 0===e?void 0:e.unmute()}async pauseUpstream(){var e;await(null===(e=this.track)||void 0===e?void 0:e.pauseUpstream())}async resumeUpstream(){var e;await(null===(e=this.track)||void 0===e?void 0:e.resumeUpstream())}}class CE{constructor(e,t,n,r){this.width=e,this.height=t,this.encoding={maxBitrate:n,maxFramerate:r}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.width/this.height}}}const TE=["vp8","h264"];function xE(e){return!!TE.find((t=>t===e))}var RE;!function(e){e.telephone={maxBitrate:12e3},e.speech={maxBitrate:2e4},e.music={maxBitrate:32e3},e.musicStereo={maxBitrate:48e3},e.musicHighQuality={maxBitrate:64e3},e.musicHighQualityStereo={maxBitrate:96e3}}(RE||(RE={}));const jE={h90:new CE(160,90,6e4,15),h180:new CE(320,180,12e4,15),h216:new CE(384,216,18e4,15),h360:new CE(640,360,3e5,20),h540:new CE(960,540,6e5,25),h720:new CE(1280,720,17e5,30),h1080:new CE(1920,1080,3e6,30),h1440:new CE(2560,1440,5e6,30),h2160:new CE(3840,2160,8e6,30)},IE={h120:new CE(160,120,8e4,15),h180:new CE(240,180,1e5,15),h240:new CE(320,240,15e4,15),h360:new CE(480,360,225e3,20),h480:new CE(640,480,3e5,20),h540:new CE(720,540,45e4,25),h720:new CE(960,720,15e5,30),h1080:new CE(1440,1080,25e5,30),h1440:new CE(1920,1440,35e5,30)},_E={h360fps3:new CE(640,360,2e5,3),h720fps5:new CE(1280,720,4e5,5),h720fps15:new CE(1280,720,1e6,15),h1080fps15:new CE(1920,1080,15e5,15),h1080fps30:new CE(1920,1080,3e6,30)};var AE;!function(e){e.Excellent="excellent",e.Good="good",e.Poor="poor",e.Unknown="unknown"}(AE||(AE={}));class ME extends iE.EventEmitter{constructor(e,t,n,r){super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=AE.Unknown,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=n,this.metadata=r,this.audioTracks=new Map,this.videoTracks=new Map,this.tracks=new Map}getTracks(){return Array.from(this.tracks.values())}getTrack(e){for(const[,t]of this.tracks)if(t.source===e)return t}getTrackByName(e){for(const[,t]of this.tracks)if(t.trackName===e)return t}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrack(cE.Source.Camera);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isMicrophoneEnabled(){var e;const t=this.getTrack(cE.Source.Microphone);return!(null===(e=null==t?void 0:t.isMuted)||void 0===e||e)}get isScreenShareEnabled(){return!!this.getTrack(cE.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(1e3*this.participantInfo.joinedAt):new Date}updateInfo(e){this.identity=e.identity,this.sid=e.sid,this.name=e.name,this.setMetadata(e.metadata),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,pg.trace("update participant info",{info:e})}setMetadata(e){const t=this.metadata!==e,n=this.metadata;this.metadata=e,t&&this.emit(JO.ParticipantMetadataChanged,n)}setPermissions(e){var t,n,r,o,i;const a=this.permissions,s=e.canPublish!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublish)||e.canSubscribe!==(null===(n=this.permissions)||void 0===n?void 0:n.canSubscribe)||e.canPublishData!==(null===(r=this.permissions)||void 0===r?void 0:r.canPublishData)||e.hidden!==(null===(o=this.permissions)||void 0===o?void 0:o.hidden)||e.recorder!==(null===(i=this.permissions)||void 0===i?void 0:i.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some(((e,t)=>{var n;return e!==(null===(n=this.permissions)||void 0===n?void 0:n.canPublishSources[t])}));return this.permissions=e,s&&this.emit(JO.ParticipantPermissionsChanged,a),s}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(JO.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=function(e){switch(e){case QS.EXCELLENT:return AE.Excellent;case QS.GOOD:return AE.Good;case QS.POOR:return AE.Poor;default:return AE.Unknown}}(e),t!==this._connectionQuality&&this.emit(JO.ConnectionQualityChanged,this._connectionQuality)}addTrackPublication(e){e.on(YO.Muted,(()=>{this.emit(JO.TrackMuted,e)})),e.on(YO.Unmuted,(()=>{this.emit(JO.TrackUnmuted,e)}));const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.tracks.set(e.trackSid,e),e.kind){case cE.Kind.Audio:this.audioTracks.set(e.trackSid,e);break;case cE.Kind.Video:this.videoTracks.set(e.trackSid,e)}}}const NE=Object.values(jE),DE=Object.values(IE),LE=Object.values(_E),UE=[jE.h180,jE.h360],BE=[IE.h180,IE.h360],FE=e=>[{scaleResolutionDownBy:2,fps:3}].map((t=>{var n;return new CE(Math.floor(e.width/t.scaleResolutionDownBy),Math.floor(e.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(e.encoding.maxBitrate/(t.scaleResolutionDownBy**2*((null!==(n=e.encoding.maxFramerate)&&void 0!==n?n:30)/t.fps)))),t.fps)})),zE=["q","h","f"];function WE(e,t,n,r){var o,i;let a=null==r?void 0:r.videoEncoding;e&&(a=null==r?void 0:r.screenShareEncoding);const s=null==r?void 0:r.simulcast,c=null==r?void 0:r.scalabilityMode,l=null==r?void 0:r.videoCodec;if(!a&&!s&&!c||!t||!n)return[{}];a||(a=function(e,t,n,r){const o=function(e,t,n){if(e)return LE;const r=t>n?t/n:n/t;return Math.abs(r-16/9)=a)break}return r&&"av1"===r&&(i.maxBitrate=.7*i.maxBitrate),i}(e,t,n,l),pg.debug("using video encoding",a));const u=new CE(t,n,a.maxBitrate,a.maxFramerate);if(c&&"av1"===l){pg.debug("using svc with scalabilityMode ".concat(c));const e=[];if("L3T3"===c){for(let t=0;t<3;t+=1)e.push({rid:zE[2-t],scaleResolutionDownBy:2**t,maxBitrate:a.maxBitrate/3**t,maxFramerate:u.encoding.maxFramerate,scalabilityMode:"L3T3"});return pg.debug("encodings",e),e}throw new Error("unsupported scalabilityMode: ".concat(c))}if(!s)return[a];let d,p=[];if(p=e?null!==(o=$E(null==r?void 0:r.screenShareSimulcastLayers))&&void 0!==o?o:HE(e,u):null!==(i=$E(null==r?void 0:r.videoSimulcastLayers))&&void 0!==i?i:HE(e,u),p.length>0){const e=p[0];p.length>1&&([,d]=p);const r=Math.max(t,n);if(r>=960&&d)return qE(t,n,[e,d,u]);if(r>=480)return qE(t,n,[e,u])}return qE(t,n,[u])}function ZE(e,t,n){var r,o,i,a;if(!n.backupCodec||n.backupCodec.codec===n.videoCodec)return;t!==n.backupCodec.codec&&pg.warn("requested a different codec than specified as backup",{serverRequested:t,backup:n.backupCodec.codec}),n.videoCodec=t,n.videoEncoding=n.backupCodec.encoding;const s=e.mediaStreamTrack.getSettings(),c=null!==(r=s.width)&&void 0!==r?r:null===(o=e.dimensions)||void 0===o?void 0:o.width,l=null!==(i=s.height)&&void 0!==i?i:null===(a=e.dimensions)||void 0===a?void 0:a.height;return WE(e.source===cE.Source.ScreenShare,c,l,n)}function HE(e,t){if(e)return FE(t);const{width:n,height:r}=t,o=n>r?n/r:r/n;return Math.abs(o-16/9){if(o>=zE.length)return;const i=Math.min(e,t),a=zE[o];r.push({rid:a,scaleResolutionDownBy:Math.max(1,i/Math.min(n.width,n.height)),maxBitrate:n.encoding.maxBitrate,maxFramerate:n.encoding.maxFramerate})})),r}function $E(e){if(e)return e.sort(((e,t)=>{const{encoding:n}=e,{encoding:r}=t;return n.maxBitrate>r.maxBitrate?1:n.maxBitrater.maxFramerate?1:-1:0}))}class VE extends PE{constructor(e,t,n){super(e,t.sid,t.name),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=YS.HIGH,this.handleEnded=e=>{this.setTrack(void 0),this.emit(YO.Ended,e)},this.handleVisibilityChange=e=>{pg.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(e),{trackSid:this.trackSid}),this.disabled=!e,this.emitTrackUpdate()},this.handleVideoDimensionsChange=e=>{pg.debug("adaptivestream video dimensions ".concat(e.width,"x").concat(e.height),{trackSid:this.trackSid}),this.videoDimensions=e,this.emitTrackUpdate()},this.subscribed=n,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const r={trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[{participantSid:"",trackSids:[this.trackSid]}]};this.emit(YO.UpdateSubscription,r),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(n)}get subscriptionStatus(){return!1===this.subscribed?PE.SubscriptionStatus.Unsubscribed:super.isSubscribed?PE.SubscriptionStatus.Subscribed:PE.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?PE.PermissionStatus.Allowed:PE.PermissionStatus.NotAllowed}get isSubscribed(){return!1!==this.subscribed&&super.isSubscribed}get isDesired(){return!1!==this.subscribed}get isEnabled(){return!this.disabled}setEnabled(e){this.isManualOperationAllowed()&&this.disabled!==!e&&(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){this.isManualOperationAllowed()&&this.currentVideoQuality!==e&&(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,n;this.isManualOperationAllowed()&&((null===(t=this.videoDimensions)||void 0===t?void 0:t.width)===e.width&&(null===(n=this.videoDimensions)||void 0===n?void 0:n.height)===e.height||(this.track instanceof wE&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&this.track instanceof wE&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,n=this.permissionStatus,r=this.track;r!==e&&(r&&(r.off(YO.VideoDimensionsChanged,this.handleVideoDimensionsChange),r.off(YO.VisibilityChanged,this.handleVisibilityChange),r.off(YO.Ended,this.handleEnded),r.detach(),r.stopMonitor(),this.emit(YO.Unsubscribed,r)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(YO.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(YO.VisibilityChanged,this.handleVisibilityChange),e.on(YO.Ended,this.handleEnded),this.emit(YO.Subscribed,e)),this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,n=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(t)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?YO.Muted:YO.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(YO.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(YO.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===cE.Kind.Video&&this.isAdaptiveStream?(pg.warn("adaptive stream is enabled, cannot change video track settings",{trackSid:this.trackSid}),!1):!!this.isDesired||(pg.warn("cannot update track settings when not subscribed",{trackSid:this.trackSid}),!1)}get isAdaptiveStream(){return this.track instanceof wE&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=EO.fromPartial({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=this.videoDimensions.width,e.height=this.videoDimensions.height):void 0!==this.currentVideoQuality?e.quality=this.currentVideoQuality:e.quality=YS.HIGH,this.emit(YO.UpdateSettings,e)}}class GE extends ME{static fromParticipantInfo(e,t){return new GE(e,t.sid,t.identity,t.name,t.metadata)}constructor(e,t,n,r,o){super(t,n||"",r,o),this.signalClient=e,this.tracks=new Map,this.audioTracks=new Map,this.videoTracks=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(YO.UpdateSettings,(e=>{pg.debug("send update settings",e),this.signalClient.sendUpdateTrackSettings(e)})),e.on(YO.UpdateSubscription,(e=>{e.participantTracks.forEach((e=>{e.participantSid=this.sid})),this.signalClient.sendUpdateSubscription(e)})),e.on(YO.SubscriptionPermissionChanged,(t=>{this.emit(JO.TrackSubscriptionPermissionChanged,e,t)})),e.on(YO.SubscriptionStatusChanged,(t=>{this.emit(JO.TrackSubscriptionStatusChanged,e,t)})),e.on(YO.Subscribed,(t=>{this.emit(JO.TrackSubscribed,t,e)})),e.on(YO.Unsubscribed,(t=>{this.emit(JO.TrackUnsubscribed,t,e)}))}getTrack(e){const t=super.getTrack(e);if(t)return t}getTrackByName(e){const t=super.getTrackByName(e);if(t)return t}setVolume(e){this.volume=e;const t=this.getTrack(cE.Source.Microphone);t&&t.track&&t.track.setVolume(e)}getVolume(){const e=this.getTrack(cE.Source.Microphone);return e&&e.track?e.track.getVolume():this.volume}addSubscribedMediaTrack(e,t,n,r,o,i){let a,s=this.getTrackPublication(t);return s||t.startsWith("TR")||this.tracks.forEach((t=>{s||e.kind!==t.kind.toString()||(s=t)})),s?"ended"===e.readyState?(pg.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",{participant:this.sid,trackSid:t}),void this.emit(JO.TrackSubscriptionFailed,t)):(a="video"===e.kind?new wE(e,t,r,o):new bE(e,t,r,this.audioContext,this.audioOutput),a.source=s.source,a.isMuted=s.isMuted,a.setMediaStream(n),a.start(),s.setTrack(a),void 0!==this.volume&&a instanceof bE&&a.source===cE.Source.Microphone&&a.setVolume(this.volume),s):0===i?(pg.error("could not find published track",{participant:this.sid,trackSid:t}),void this.emit(JO.TrackSubscriptionFailed,t)):(void 0===i&&(i=20),void setTimeout((()=>{this.addSubscribedMediaTrack(e,t,n,r,o,i-1)}),150))}get hasMetadata(){return!!this.participantInfo}getTrackPublication(e){return this.tracks.get(e)}updateInfo(e){super.updateInfo(e);const t=new Map,n=new Map;e.tracks.forEach((r=>{var o;let i=this.getTrackPublication(r.sid);if(i)i.updateInfo(r);else{const t=cE.kindFromProto(r.type);if(!t)return;i=new VE(t,r,null===(o=this.signalClient.connectOptions)||void 0===o?void 0:o.autoSubscribe),i.updateInfo(r),n.set(r.sid,i);const a=Array.from(this.tracks.values()).find((e=>e.source===(null==i?void 0:i.source)));a&&i.source!==cE.Source.Unknown&&pg.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(i.source),{oldTrack:a,newTrack:i,participant:this,participantInfo:e}),this.addTrackPublication(i)}t.set(r.sid,i)})),this.tracks.forEach((e=>{t.has(e.trackSid)||(pg.trace("detected removed track on remote participant, unpublishing",{publication:e,participantSid:this.sid}),this.unpublishTrack(e.trackSid,!0))})),n.forEach((e=>{this.emit(JO.TrackPublished,e)}))}unpublishTrack(e,t){const n=this.tracks.get(e);if(!n)return;switch(this.tracks.delete(e),n.kind){case cE.Kind.Audio:this.audioTracks.delete(e);break;case cE.Kind.Video:this.videoTracks.delete(e)}const{track:r}=n;r&&(r.stop(),n.setTrack(void 0)),t&&this.emit(JO.TrackUnpublished,n)}setAudioContext(e){this.audioContext=e,this.audioTracks.forEach((t=>t.track instanceof bE&&t.track.setAudioContext(e)))}async setAudioOutput(e){this.audioOutput=e;const t=[];this.audioTracks.forEach((n=>{var r;n.track instanceof bE&&t.push(n.track.setSinkId(null!==(r=e.deviceId)&&void 0!==r?r:"default"))})),await Promise.all(t)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{this.reconnectFuture||(this.reconnectFuture=new BP)},this.handleReconnected=()=>{var e,t;null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.resolve)||void 0===t||t.call(e),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var e,t;null===(t=null===(e=this.reconnectFuture)||void 0===e?void 0:e.reject)||void 0===t||t.call(e,"Got disconnected during publishing attempt"),this.reconnectFuture=void 0},this.updateTrackSubscriptionPermissions=()=>{pg.debug("updating track subscription permissions",{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions}),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map((e=>function(e){var t,n,r;if(!e.participantSid&&!e.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return{participantIdentity:null!==(t=e.participantIdentity)&&void 0!==t?t:"",participantSid:null!==(n=e.participantSid)&&void 0!==n?n:"",allTracks:null!==(r=e.allowAll)&&void 0!==r&&r,trackSids:e.allowedTrackSids||[]}}(e))))},this.onTrackUnmuted=e=>{this.onTrackMuted(e,e.isUpstreamPaused)},this.onTrackMuted=(e,t)=>{void 0===t&&(t=!0),e.sid?this.engine.updateMuteStatus(e.sid,t):pg.error("could not update mute status for unpublished track",e)},this.onTrackUpstreamPaused=e=>{pg.debug("upstream paused"),this.onTrackMuted(e,!0)},this.onTrackUpstreamResumed=e=>{pg.debug("upstream resumed"),this.onTrackMuted(e,e.isMuted)},this.handleSubscribedQualityUpdate=async e=>{var t,n;if(!(null===(t=this.roomOptions)||void 0===t?void 0:t.dynacast))return;const r=this.videoTracks.get(e.trackSid);if(r)if(e.subscribedCodecs.length>0){if(!r.videoTrack)return;const t=await r.videoTrack.setPublishingCodecs(e.subscribedCodecs);var o,i=!1,a=!1;try{for(var s,c=Jw(t);i=!(s=await c.next()).done;i=!1){const e=s.value;xE(e)&&(pg.debug("publish ".concat(e," for ").concat(r.videoTrack.sid)),await this.publishAdditionalCodecForTrack(r.videoTrack,e,r.options))}}catch(e){a=!0,o=e}finally{try{i&&null!=c.return&&await c.return()}finally{if(a)throw o}}}else e.subscribedQualities.length>0&&await(null===(n=r.videoTrack)||void 0===n?void 0:n.setPublishingLayers(e.subscribedQualities));else pg.warn("received subscribed quality update for unknown track",{method:"handleSubscribedQualityUpdate",sid:e.trackSid})},this.handleLocalTrackUnpublished=e=>{const t=this.tracks.get(e.trackSid);t?this.unpublishTrack(t.track):pg.warn("received unpublished event for unknown track",{method:"handleLocalTrackUnpublished",trackSid:e.trackSid})},this.handleTrackEnded=async e=>{if(e.source===cE.Source.ScreenShare||e.source===cE.Source.ScreenShareAudio)pg.debug("unpublishing local track due to TrackEnded",{track:e.sid}),this.unpublishTrack(e);else if(e.isUserProvided)await e.mute();else if(e instanceof pE||e instanceof fE)try{if(PP())try{const t=await(null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:e.source===cE.Source.Camera?"camera":"microphone"}));if(t&&"denied"===t.state)throw pg.warn("user has revoked access to ".concat(e.source)),t.onchange=()=>{"denied"!==t.state&&(e.isMuted||e.restartTrack(),t.onchange=null)},new Error("GetUserMedia Permission denied")}catch(e){}e.isMuted||(pg.debug("track ended, attempting to use a different device"),await e.restartTrack())}catch(t){pg.warn("could not restart track, muting instead"),await e.mute()}},this.audioTracks=new Map,this.videoTracks=new Map,this.tracks=new Map,this.engine=n,this.roomOptions=r,this.setupEngine(n)}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}getTrack(e){const t=super.getTrack(e);if(t)return t}getTrackByName(e){const t=super.getTrackByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.client.onRemoteMuteChanged=(e,t)=>{const n=this.tracks.get(e);n&&n.track&&(t?n.mute():n.unmute())},this.engine.client.onSubscribedQualityUpdate=this.handleSubscribedQualityUpdate,this.engine.client.onLocalTrackUnpublished=this.handleLocalTrackUnpublished,this.engine.on(KO.Connected,this.handleReconnected).on(KO.Restarted,this.handleReconnected).on(KO.Resumed,this.handleReconnected).on(KO.Restarting,this.handleReconnecting).on(KO.Resuming,this.handleReconnecting).on(KO.Disconnected,this.handleDisconnected)}setCameraEnabled(e,t,n){return this.setTrackEnabled(cE.Source.Camera,e,t,n)}setMicrophoneEnabled(e,t,n){return this.setTrackEnabled(cE.Source.Microphone,e,t,n)}setScreenShareEnabled(e,t,n){return this.setTrackEnabled(cE.Source.ScreenShare,e,t,n)}async setTrackEnabled(e,t,n,r){var o,i;pg.debug("setTrackEnabled",{source:e,enabled:t});let a=this.getTrack(e);if(t)if(a)await a.unmute();else{let t;if(this.pendingPublishing.has(e))return void pg.info("skipping duplicate published source",{source:e});this.pendingPublishing.add(e);try{switch(e){case cE.Source.Camera:t=await this.createTracks({video:null===(o=n)||void 0===o||o});break;case cE.Source.Microphone:t=await this.createTracks({audio:null===(i=n)||void 0===i||i});break;case cE.Source.ScreenShare:t=await this.createScreenTracks(Qw({},n));break;default:throw new iP(e)}const s=[];for(const e of t)pg.info("publishing track",{localTrack:e}),s.push(this.publishTrack(e,r));const c=await Promise.all(s);[a]=c}catch(e){throw e instanceof Error&&!(e instanceof iP)&&this.emit(JO.MediaDevicesError,e),e}finally{this.pendingPublishing.delete(e)}}else if(a&&a.track)if(e===cE.Source.ScreenShare){a=await this.unpublishTrack(a.track);const e=this.getTrack(cE.Source.ScreenShareAudio);e&&e.track&&this.unpublishTrack(e.track)}else await a.mute();return a}async enableCameraAndMicrophone(){if(!this.pendingPublishing.has(cE.Source.Camera)&&!this.pendingPublishing.has(cE.Source.Microphone)){this.pendingPublishing.add(cE.Source.Camera),this.pendingPublishing.add(cE.Source.Microphone);try{const e=await this.createTracks({audio:!0,video:!0});await Promise.all(e.map((e=>this.publishTrack(e))))}finally{this.pendingPublishing.delete(cE.Source.Camera),this.pendingPublishing.delete(cE.Source.Microphone)}}}async createTracks(e){var t,n;const r=hP(function(e,t,n){const r=Qw({},e);return!0===r.audio&&(r.audio={}),!0===r.video&&(r.video={}),r.audio&&fP(r.audio,t),r.video&&fP(r.video,n),r}(e,null===(t=this.roomOptions)||void 0===t?void 0:t.audioCaptureDefaults,null===(n=this.roomOptions)||void 0===n?void 0:n.videoCaptureDefaults));let o;try{o=await navigator.mediaDevices.getUserMedia(r)}catch(e){throw e instanceof Error&&(r.audio&&(this.microphoneError=e),r.video&&(this.cameraError=e)),e}return r.audio&&(this.microphoneError=void 0),r.video&&(this.cameraError=void 0),o.getTracks().map((t=>{const n="audio"===t.kind;let i;n?e.audio:e.video;const a=n?r.audio:r.video;"boolean"!=typeof a&&(i=a);const s=function(e,t){switch(e.kind){case"audio":return new pE(e,t,!1);case"video":return new fE(e,t,!1);default:throw new iP("unsupported track type: ".concat(e.kind))}}(t,i);return s.kind===cE.Kind.Video?s.source=cE.Source.Camera:s.kind===cE.Kind.Audio&&(s.source=cE.Source.Microphone),s.mediaStream=o,s}))}async createScreenTracks(e){var t;void 0===e&&(e={}),void 0===e.resolution&&(e.resolution=_E.h1080fps15.resolution);let n=!0;if(e.resolution&&(n=kP()?{width:{max:e.resolution.width},height:{max:e.resolution.height},frameRate:e.resolution.frameRate}:{width:{ideal:e.resolution.width},height:{ideal:e.resolution.height},frameRate:e.resolution.frameRate}),void 0===navigator.mediaDevices.getDisplayMedia)throw new oP("getDisplayMedia not supported");const r=await navigator.mediaDevices.getDisplayMedia({audio:null!==(t=e.audio)&&void 0!==t&&t,video:n,controller:e.controller,selfBrowserSurface:e.selfBrowserSurface,surfaceSwitching:e.surfaceSwitching,systemAudio:e.systemAudio}),o=r.getVideoTracks();if(0===o.length)throw new iP("no video track found");const i=new fE(o[0],void 0,!1);i.source=cE.Source.ScreenShare;const a=[i];if(r.getAudioTracks().length>0){const e=new pE(r.getAudioTracks()[0],void 0,!1);e.source=cE.Source.ScreenShareAudio,a.push(e)}return a}async publishTrack(e,t){var n,r,o;if(await(null===(n=this.reconnectFuture)||void 0===n?void 0:n.promise),e instanceof dE&&this.pendingPublishPromises.has(e)&&await this.pendingPublishPromises.get(e),e instanceof MediaStreamTrack)switch(e.kind){case"audio":e=new pE(e,void 0,!0);break;case"video":e=new fE(e,void 0,!0);break;default:throw new iP("unsupported MediaStreamTrack kind ".concat(e.kind))}let i;if(this.tracks.forEach((t=>{t.track&&t.track===e&&(i=t)})),i)return pg.warn("track has already been published, skipping"),i;const a=(null==t?void 0:t.forceStereo)||"channelCount"in e.mediaStreamTrack.getSettings()&&2===e.mediaStreamTrack.getSettings().channelCount||2===e.mediaStreamTrack.getConstraints().channelCount;a&&(t||(t={}),void 0===t.dtx&&pg.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work."),void 0===t.red&&pg.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(r=t.dtx)&&void 0!==r||(t.dtx=!1),null!==(o=t.red)&&void 0!==o||(t.red=!1));const s=Qw(Qw({},this.roomOptions.publishDefaults),t);s.source&&(e.source=s.source);const c=this.publish(e,s,t,a);this.pendingPublishPromises.set(e,c);try{return await c}catch(e){throw e}finally{this.pendingPublishPromises.delete(e)}}async publish(e,t,n,r){var o,i,a,s;const c=Array.from(this.tracks.values()).find((t=>e instanceof dE&&t.source===e.source));if(c&&e.source!==cE.Source.Unknown)try{throw Error("publishing a second track with the same source: ".concat(e.source))}catch(t){t instanceof Error&&pg.warn(t.message,{oldTrack:c,newTrack:e,trace:t.stack})}t.stopMicTrackOnMute&&e instanceof pE&&(e.stopOnMute=!0),e.source===cE.Source.ScreenShare&&wP()&&(t.simulcast=!1),"av1"!==t.videoCodec||function(){const e=RTCRtpReceiver.getCapabilities("video");let t=!1,n=!1;if(e){for(const n of e.codecs)if("video/AV1"===n.mimeType){t=!0;break}for(const t of e.headerExtensions)if("https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"===t.uri){n=!0;break}}return t&&n}()||(t.videoCodec=void 0),e.on(YO.Muted,this.onTrackMuted),e.on(YO.Unmuted,this.onTrackUnmuted),e.on(YO.Ended,this.handleTrackEnded),e.on(YO.UpstreamPaused,this.onTrackUpstreamPaused),e.on(YO.UpstreamResumed,this.onTrackUpstreamResumed);const l=mO.fromPartial({cid:e.mediaStreamTrack.id,name:null==n?void 0:n.name,type:cE.kindToProto(e.kind),muted:e.isMuted,source:cE.sourceToProto(e.source),disableDtx:!(null===(o=t.dtx)||void 0===o||o),stereo:r,disableRed:!(null===(i=t.red)||void 0===i||i)});let u,d;if(e.kind===cE.Kind.Video){let n={width:0,height:0};try{n=await e.waitForDimensions()}catch(e){pg.error("could not determine track dimensions")}if(l.width=n.width,l.height=n.height,e instanceof fE&&("av1"===(null==t?void 0:t.videoCodec)&&(t.scalabilityMode=null!==(a=t.scalabilityMode)&&void 0!==a?a:"L3T3"),t.videoCodec&&t.backupCodec&&t.videoCodec!==t.backupCodec.codec)){const n=Qw({},t);n.simulcast=!0,d=ZE(e,t.backupCodec.codec,n),l.simulcastCodecs=[{codec:t.videoCodec,cid:e.mediaStreamTrack.id,enableSimulcastLayers:!0},{codec:t.backupCodec.codec,cid:"",enableSimulcastLayers:!0}]}u=WE(e.source===cE.Source.ScreenShare,n.width,n.height,t),l.layers=yE(l.width,l.height,null!=d?d:u)}else e.kind===cE.Kind.Audio&&t.audioBitrate&&(u=[{maxBitrate:t.audioBitrate}]);if(!this.engine||this.engine.isClosed)throw new sP("cannot publish track when not connected");const p=await this.engine.addTrack(l),f=new EE(e.kind,p,e);if(f.options=t,e.sid=p.sid,!this.engine.publisher)throw new sP("publisher is closed");return pg.debug("publishing ".concat(e.kind," with encodings"),{encodings:u,trackInfo:p}),e.sender=await this.engine.createSender(e,t,u),"av1"===e.codec&&u&&(null===(s=u[0])||void 0===s?void 0:s.maxBitrate)&&this.engine.publisher.setTrackCodecBitrate(l.cid,e.codec,u[0].maxBitrate/1e3),this.engine.negotiate(),e instanceof fE?e.startMonitor(this.engine.client):e instanceof pE&&e.startMonitor(),this.addTrackPublication(f),this.emit(JO.LocalTrackPublished,f),f}get isLocal(){return!0}async publishAdditionalCodecForTrack(e,t,n){var r;let o;if(this.tracks.forEach((t=>{t.track&&t.track===e&&(o=t)})),!o)throw new iP("track is not published");if(!(e instanceof fE))throw new iP("track is not a video track");const i=Qw(Qw({},null===(r=this.roomOptions)||void 0===r?void 0:r.publishDefaults),n),a=ZE(e,t,i);if(!a)return void pg.info("backup codec has been disabled, ignoring request to add additional codec for track");const s=e.addSimulcastTrack(t,a),c=mO.fromPartial({cid:s.mediaStreamTrack.id,type:cE.kindToProto(e.kind),muted:e.isMuted,source:cE.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:i.videoCodec,cid:s.mediaStreamTrack.id,enableSimulcastLayers:i.simulcast}]});if(c.layers=yE(c.width,c.height,a),!this.engine||this.engine.isClosed)throw new sP("cannot publish track when not connected");const l=await this.engine.addTrack(c);await this.engine.createSimulcastSender(e,s,i,a),this.engine.negotiate(),pg.debug("published ".concat(t," for track ").concat(e.sid),{encodings:a,trackInfo:l})}async unpublishTrack(e,t){var n,r;const o=this.getPublicationForTrack(e);if(pg.debug("unpublishing track",{track:e,method:"unpublishTrack"}),!o||!o.track)return void pg.warn("track was not unpublished because no publication was found",{track:e,method:"unpublishTrack"});(e=o.track).off(YO.Muted,this.onTrackMuted),e.off(YO.Unmuted,this.onTrackUnmuted),e.off(YO.Ended,this.handleTrackEnded),e.off(YO.UpstreamPaused,this.onTrackUpstreamPaused),e.off(YO.UpstreamResumed,this.onTrackUpstreamResumed),void 0===t&&(t=null===(r=null===(n=this.roomOptions)||void 0===n?void 0:n.stopLocalTrackOnUnpublish)||void 0===r||r),t&&e.stop();let i=!1;const a=e.sender;if(e.sender=void 0,this.engine.publisher&&"closed"!==this.engine.publisher.pc.connectionState&&a)try{if(this.engine.removeTrack(a)&&(i=!0),e instanceof fE){for(const[,t]of e.simulcastCodecs)t.sender&&(this.engine.removeTrack(t.sender)&&(i=!0),t.sender=void 0);e.simulcastCodecs.clear()}}catch(e){pg.warn("failed to unpublish track",{error:e,method:"unpublishTrack"})}switch(this.tracks.delete(o.trackSid),o.kind){case cE.Kind.Audio:this.audioTracks.delete(o.trackSid);break;case cE.Kind.Video:this.videoTracks.delete(o.trackSid)}return this.emit(JO.LocalTrackUnpublished,o),o.setTrack(void 0),i&&await this.engine.negotiate(),o}async unpublishTracks(e){return(await Promise.all(e.map((e=>this.unpublishTrack(e))))).filter((e=>e instanceof EE))}async republishAllTracks(e){const t=[];this.tracks.forEach((n=>{n.track&&(e&&(n.options=Qw(Qw({},n.options),e)),t.push(n))})),await Promise.all(t.map((async e=>{const t=e.track;await this.unpublishTrack(t,!1),await this.publishTrack(t,e.options)})))}async publishData(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Array.isArray(n)?n:null==n?void 0:n.destination,o=[],i=Array.isArray(n)?void 0:n.topic;void 0!==r&&r.forEach((e=>{e instanceof GE?o.push(e.sid):o.push(e)}));const a={kind:t,value:{$case:"user",user:{participantSid:this.sid,payload:e,destinationSids:o,topic:i}}};await this.engine.sendDataPacket(a,t)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isConnected&&this.updateTrackSubscriptionPermissions()}updateInfo(e){e.sid===this.sid&&(super.updateInfo(e),e.tracks.forEach((e=>{var t,n;const r=this.tracks.get(e.sid);if(r){const o=r.isMuted||null!==(n=null===(t=r.track)||void 0===t?void 0:t.isUpstreamPaused)&&void 0!==n&&n;o!==e.muted&&(pg.debug("updating server mute state after reconcile",{sid:e.sid,muted:o}),this.engine.client.sendMuteTrack(e.sid,o))}})))}getPublicationForTrack(e){let t;return this.tracks.forEach((n=>{const r=n.track;r&&(e instanceof MediaStreamTrack?(r instanceof pE||r instanceof fE)&&r.mediaStreamTrack===e&&(t=n):e===r&&(t=n))})),t}publishedTracksInfo(){const e=[];return this.tracks.forEach((t=>{void 0!==t.track&&e.push({cid:t.track.mediaStreamID,track:t.trackInfo})})),e}dataChannelsInfo(){const e=[],t=(t,n)=>{void 0!==(null==t?void 0:t.id)&&null!==t.id&&e.push({label:t.label,id:t.id,target:n})};return t(this.engine.dataChannelForKind(ow.LOSSY),oO.PUBLISHER),t(this.engine.dataChannelForKind(ow.RELIABLE),oO.PUBLISHER),t(this.engine.dataChannelForKind(ow.LOSSY,!0),oO.SUBSCRIBER),t(this.engine.dataChannelForKind(ow.RELIABLE,!0),oO.SUBSCRIBER),e}}class KE{constructor(e,t){this.maxConcurrent=e||1,this.minCycle=t||0,this.queueRunning=[],this.queueWaiting={},this.lastRun=0}dequeue(e){const t=this.queueRunning,n=t.findIndex((t=>t.hash===e));if(-1==n)throw"queue desync";const r=t[n];return t.splice(n,1),r}getFirstWaiting(){for(let e of Object.keys(this.queueWaiting).sort(((e,t)=>e-t)))if(void 0!==this.queueWaiting[e]&&this.queueWaiting[e].length>0)return this.queueWaiting[e]}end(e){this.dequeue(e).resolve();const t=this.getFirstWaiting();void 0!==t&&t.shift().resolve()}async wait(e,t){const n=void 0===t?0:t;let r={hash:e,priority:n};for(null==this.queueWaiting[n]&&(this.queueWaiting[n]=[]),this.queueRunning.length>=this.maxConcurrent&&(r.promise=new Promise((e=>{r.resolve=e})),this.queueWaiting[n].push(r),await r.promise),this.queueRunning.push(r),r.promise=new Promise((e=>{r.resolve=e}));Date.now()-this.lastRunsetTimeout(e,this.minCycle-Date.now()+this.lastRun)));this.lastRun=Date.now()}run(e,t){const n=void 0===t?0:t,r=Symbol();return this.wait(r,n).then((()=>e())).finally((()=>{this.end(r)}))}stat(){return{running:this.queueRunning.length,waiting:Object.keys(this.queueWaiting).reduce(((e,t)=>e+this.queueWaiting[t].length),0),last:this.lastRun}}async flush(){for(;this.stat().waiting>0;)for(let e of Object.keys(this.queueWaiting).sort(((e,t)=>t-e))){const t=this.queueWaiting[e];void 0!==t&&t.length>0&&await t[t.length-1].promise}for(;this.queueRunning.length>0;)await Promise.allSettled(this.queueRunning.map((e=>e.promise)))}}const YE=["syncState","trickle","offer","answer","simulate","leave"];class QE{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.rtt=0,this.isConnected=!1,this.isReconnecting=!1,this.useJSON=e,this.requestQueue=new KE,this.queuedRequests=[],this.closingLock=new FP}async join(e,t,n,r){return this.isConnected=!1,this.options=n,await this.connect(e,t,n,r)}async reconnect(e,t,n,r){if(this.options)return this.isReconnecting=!0,this.clearPingInterval(),await this.connect(e,t,Qw(Qw({},this.options),{},{reconnect:!0,sid:n,reconnectReason:r}));pg.warn("attempted to reconnect without signal options being set, ignoring")}connect(e,t,n,r){this.connectOptions=n,e.startsWith("http")&&(e=e.replace("http","ws")),e=e.replace(/\/$/,""),e+="/rtc";const o=function(e,t,n){var r;const o=new URLSearchParams;return o.set("access_token",e),n.reconnect&&(o.set("reconnect","1"),n.sid&&o.set("sid",n.sid)),o.set("auto_subscribe",n.autoSubscribe?"1":"0"),o.set("sdk",EP()?"reactnative":"js"),o.set("version",t.version),o.set("protocol",t.protocol.toString()),t.deviceModel&&o.set("device_model",t.deviceModel),t.os&&o.set("os",t.os),t.osVersion&&o.set("os_version",t.osVersion),t.browser&&o.set("browser",t.browser),t.browserVersion&&o.set("browser_version",t.browserVersion),void 0!==n.publishOnly&&o.set("publish",n.publishOnly),n.adaptiveStream&&o.set("adaptive_stream","1"),n.reconnectReason&&o.set("reconnect_reason",n.reconnectReason.toString()),(null===(r=navigator.connection)||void 0===r?void 0:r.type)&&o.set("network",navigator.connection.type),"?".concat(o.toString())}(t,function(){var e;const t=Bw.fromPartial({sdk:aw.JS,protocol:9,version:"1.8.0"});return EP()&&(t.os=null!==(e=function(){if(!EP())return;let e=TP();return e?e.platform:void 0}())&&void 0!==e?e:""),t}(),n);return new Promise((async(t,i)=>{const a=async()=>{await this.close(),i(new rP("room connection has been cancelled (signal)"))};(null==r?void 0:r.aborted)&&a(),null==r||r.addEventListener("abort",a),pg.debug("connecting to ".concat(e+o)),this.ws&&await this.close(),this.ws=new WebSocket(e+o),this.ws.binaryType="arraybuffer",this.ws.onerror=async t=>{if(this.isConnected)this.handleWSError(t);else try{const t=await fetch("http".concat(e.substring(2),"/validate").concat(o));if(t.status.toFixed(0).startsWith("4")){const e=await t.text();i(new rP(e,0,t.status))}else i(new rP("Internal error",2,t.status))}catch(e){i(new rP("server was not reachable",1))}},this.ws.onmessage=async e=>{var o,s,c,l;let u;if("string"==typeof e.data){const t=JSON.parse(e.data);u=fO.fromJSON(t)}else{if(!(e.data instanceof ArrayBuffer))return void pg.error("could not decode websocket message: ".concat(typeof e.data));u=fO.decode(new Uint8Array(e.data))}if(!this.isConnected){let e=!1;if("join"===(null===(o=u.message)||void 0===o?void 0:o.$case)?(this.isConnected=!0,null==r||r.removeEventListener("abort",a),this.pingTimeoutDuration=u.message.join.pingTimeout,this.pingIntervalDuration=u.message.join.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(pg.debug("ping config",{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration}),this.startPingInterval()),t(u.message.join)):n.reconnect?(this.isConnected=!0,null==r||r.removeEventListener("abort",a),this.startPingInterval(),"reconnect"===(null===(s=u.message)||void 0===s?void 0:s.$case)?t(null===(c=u.message)||void 0===c?void 0:c.reconnect):(t(),e=!0)):n.reconnect||i(new rP("did not receive join response, got ".concat(null===(l=u.message)||void 0===l?void 0:l.$case," instead"))),!e)return}this.signalLatency&&await yP(this.signalLatency),this.handleSignalResponse(u)},this.ws.onclose=e=>{this.isConnected&&(pg.debug("websocket connection closed: ".concat(e.reason)),this.isConnected=!1,this.onClose&&this.onClose(e.reason),this.ws=void 0)}}))}async close(){const e=await this.closingLock.lock();try{if(this.isConnected=!1,this.ws){this.ws.onclose=null,this.ws.onmessage=null,this.ws.onopen=null;const e=new Promise((e=>{this.ws?this.ws.onclose=e:e(!0)}));this.ws.close(),await Promise.race([e,yP(250)])}this.ws=void 0,this.clearPingInterval()}finally{e()}}sendOffer(e){pg.debug("sending offer",e),this.sendRequest({$case:"offer",offer:eC(e)})}sendAnswer(e){pg.debug("sending answer"),this.sendRequest({$case:"answer",answer:eC(e)})}sendIceCandidate(e,t){pg.trace("sending ice candidate",e),this.sendRequest({$case:"trickle",trickle:{candidateInit:JSON.stringify(e),target:t}})}sendMuteTrack(e,t){this.sendRequest({$case:"mute",mute:{sid:e,muted:t}})}sendAddTrack(e){this.sendRequest({$case:"addTrack",addTrack:mO.fromPartial(e)})}sendUpdateTrackSettings(e){this.sendRequest({$case:"trackSetting",trackSetting:e})}sendUpdateSubscription(e){this.sendRequest({$case:"subscription",subscription:e})}sendSyncState(e){this.sendRequest({$case:"syncState",syncState:e})}sendUpdateVideoLayers(e,t){this.sendRequest({$case:"updateLayers",updateLayers:{trackSid:e,layers:t}})}sendUpdateSubscriptionPermissions(e,t){this.sendRequest({$case:"subscriptionPermission",subscriptionPermission:{allParticipants:e,trackPermissions:t}})}sendSimulateScenario(e){this.sendRequest({$case:"simulate",simulate:e})}sendPing(){this.sendRequest({$case:"ping",ping:Date.now()}),this.sendRequest({$case:"pingReq",pingReq:{timestamp:Date.now(),rtt:this.rtt}})}async sendLeave(){await this.sendRequest({$case:"leave",leave:{canReconnect:!1,reason:ew.CLIENT_INITIATED}})}async sendRequest(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=!t&&!function(e){const t=YE.includes(e.$case);return pg.trace("request allowed to bypass queue:",{canPass:t,req:e}),t}(e);if(n&&this.isReconnecting)return void this.queuedRequests.push((async()=>{await this.sendRequest(e,!0)}));if(t||await this.requestQueue.flush(),this.signalLatency&&await yP(this.signalLatency),!this.ws||this.ws.readyState!==this.ws.OPEN)return void pg.error("cannot send signal request before connected, type: ".concat(null==e?void 0:e.$case));const r={message:e};try{this.useJSON?this.ws.send(JSON.stringify(pO.toJSON(r))):this.ws.send(pO.encode(r).finish())}catch(e){pg.error("error sending signal message",{error:e})}}handleSignalResponse(e){var t,n;const r=e.message;if(null!=r)if("answer"===r.$case){const e=XE(r.answer);this.onAnswer&&this.onAnswer(e)}else if("offer"===r.$case){const e=XE(r.offer);this.onOffer&&this.onOffer(e)}else if("trickle"===r.$case){const e=JSON.parse(r.trickle.candidateInit);this.onTrickle&&this.onTrickle(e,r.trickle.target)}else"update"===r.$case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(t=r.update.participants)&&void 0!==t?t:[]):"trackPublished"===r.$case?this.onLocalTrackPublished&&this.onLocalTrackPublished(r.trackPublished):"speakersChanged"===r.$case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(n=r.speakersChanged.speakers)&&void 0!==n?n:[]):"leave"===r.$case?this.onLeave&&this.onLeave(r.leave):"mute"===r.$case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(r.mute.sid,r.mute.muted):"roomUpdate"===r.$case?this.onRoomUpdate&&r.roomUpdate.room&&this.onRoomUpdate(r.roomUpdate.room):"connectionQuality"===r.$case?this.onConnectionQuality&&this.onConnectionQuality(r.connectionQuality):"streamStateUpdate"===r.$case?this.onStreamStateUpdate&&this.onStreamStateUpdate(r.streamStateUpdate):"subscribedQualityUpdate"===r.$case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(r.subscribedQualityUpdate):"subscriptionPermissionUpdate"===r.$case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(r.subscriptionPermissionUpdate):"refreshToken"===r.$case?this.onTokenRefresh&&this.onTokenRefresh(r.refreshToken):"trackUnpublished"===r.$case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(r.trackUnpublished):"pong"===r.$case?this.resetPingTimeout():"pongResp"===r.$case?(this.rtt=Date.now()-r.pongResp.lastPingTimestamp,this.resetPingTimeout()):pg.debug("unsupported message",r);else pg.debug("received unsupported message")}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}this.isReconnecting=!1}handleWSError(e){pg.error("websocket error",e)}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=SE.setTimeout((()=>{pg.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*this.pingTimeoutDuration).toUTCString())),this.onClose&&this.onClose("ping timeout")}),1e3*this.pingTimeoutDuration):pg.warn("ping timeout duration not set")}clearPingTimeout(){this.pingTimeout&&SE.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(pg.debug("start ping interval"),this.pingInterval=SE.setInterval((()=>{this.sendPing()}),1e3*this.pingIntervalDuration)):pg.warn("ping interval duration not set")}clearPingInterval(){pg.debug("clearing ping interval"),this.clearPingTimeout(),this.pingInterval&&SE.clearInterval(this.pingInterval)}}function XE(e){const t={type:"offer",sdp:e.sdp};switch(e.type){case"answer":case"offer":case"pranswer":case"rollback":t.type=e.type}return t}function eC(e){return{sdp:e.sdp,type:e.type}}const tC={audioBitrate:RE.music.maxBitrate,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:_E.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:"vp8",backupCodec:{codec:"vp8",encoding:jE.h540.encoding}},nC={autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0},rC={resolution:jE.h720.resolution},oC={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(e){this._retryDelays=void 0!==e?[...e]:Gw}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+1e3*Math.random()}},disconnectOnPageLeave:!0,expWebAudioMix:!1},iC={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3};var aC={},sC={exports:{}},cC=sC.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),(t+=null!=e["network-id"]?" network-id %d":"%v")+(null!=e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",(t+=null!=e.rateNumerator?" rate=%s":"")+(null!=e.rateDenominator?"/%s":"")}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(cC).forEach((function(e){cC[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}));var lC=sC.exports;!function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r){var o=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:o&&!n[e.name]&&(n[e.name]={});var i=e.push?{}:o?n[e.name]:n;!function(e,n,r,o){if(o&&!r)n[o]=t(e[1]);else for(var i=0;i1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(i,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(" ").map(t),o=0;o=r)return e;var o=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(o);case"%d":return Number(o);case"%v":return""}}))},fC=function(e,t,n){var r=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var o=0;o{this.emit(bC);try{this.createAndSendOffer()}catch(t){if(!e)throw t;e(t)}}),100),this.pc=new RTCPeerConnection(e)}get isICEConnected(){return"connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState}async addIceCandidate(e){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)}async setRemoteDescription(e){if("offer"===e.type){let{stereoMids:t,nackMids:n}=function(e){var t;const n=[],r=[],o=vC(null!==(t=e.sdp)&&void 0!==t?t:"");let i=0;return o.media.forEach((e=>{var t;"audio"===e.type&&(e.rtp.some((e=>"opus"===e.codec&&(i=e.payload,!0))),(null===(t=e.rtcpFb)||void 0===t?void 0:t.some((e=>e.payload===i&&"nack"===e.type)))&&r.push(e.mid),e.fmtp.some((t=>t.payload===i&&(t.config.includes("sprop-stereo=1")&&n.push(e.mid),!0))))})),{stereoMids:n,nackMids:r}}(e);this.remoteStereoMids=t,this.remoteNackMids=n}await this.pc.setRemoteDescription(e),this.pendingCandidates.forEach((e=>{this.pc.addIceCandidate(e)})),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,this.createAndSendOffer()):"answer"===e.type&&this.emit(gC)}async createAndSendOffer(e){var t;if(void 0===this.onOffer)return;if((null==e?void 0:e.iceRestart)&&(pg.debug("restarting ICE"),this.restartingIce=!0),"have-local-offer"===this.pc.signalingState){const t=this.pc.remoteDescription;if(!(null==e?void 0:e.iceRestart)||!t)return void(this.renegotiate=!0);await this.pc.setRemoteDescription(t)}else if("closed"===this.pc.signalingState)return void pg.warn("could not createOffer with closed peer connection");pg.debug("starting to negotiate");const n=await this.pc.createOffer(e),r=vC(null!==(t=n.sdp)&&void 0!==t?t:"");r.media.forEach((e=>{"audio"===e.type?wC(e,[],[]):"video"===e.type&&this.trackBitrates.some((t=>{if(!e.msid||!e.msid.includes(t.sid))return!1;let n=0;return e.rtp.some((e=>e.codec.toUpperCase()===t.codec.toUpperCase()&&(n=e.payload,!0))),n>0&&(e.fmtp.some((e=>e.payload===n&&(e.config.includes("x-google-max-bitrate")||(e.config+=";x-google-max-bitrate=".concat(t.maxbr)),!0)))||e.fmtp.push({payload:n,config:"x-google-max-bitrate=".concat(t.maxbr)})),!0}))})),this.trackBitrates=[],await this.setMungedLocalDescription(n,yC(r)),this.onOffer(n)}async createAndSetAnswer(){var e;const t=await this.pc.createAnswer(),n=vC(null!==(e=t.sdp)&&void 0!==e?e:"");return n.media.forEach((e=>{"audio"===e.type&&wC(e,this.remoteStereoMids,this.remoteNackMids)})),await this.setMungedLocalDescription(t,yC(n)),t}setTrackCodecBitrate(e,t,n){this.trackBitrates.push({sid:e,codec:t,maxbr:n})}close(){this.pc.onconnectionstatechange=null,this.pc.oniceconnectionstatechange=null,this.pc.close()}async setMungedLocalDescription(e,t){const n=e.sdp;e.sdp=t;try{return pg.debug("setting munged local description"),void await this.pc.setLocalDescription(e)}catch(t){pg.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),{error:t}),e.sdp=n}try{await this.pc.setLocalDescription(e)}catch(e){let t="unknown error";throw e instanceof Error?t=e.message:"string"==typeof e&&(t=e),new cP(t)}}}function wC(e,t,n){let r=0;e.rtp.some((e=>"opus"===e.codec&&(r=e.payload,!0))),r>0&&(e.rtcpFb||(e.rtcpFb=[]),n.includes(e.mid)&&!e.rtcpFb.some((e=>e.payload===r&&"nack"===e.type))&&e.rtcpFb.push({payload:r,type:"nack"}),t.includes(e.mid)&&e.fmtp.some((e=>e.payload===r&&(e.config.includes("stereo=1")||(e.config+=";stereo=1"),!0))))}class kC{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}isCloud(){return CP(this.serverUrl)}async getNextBestRegionUrl(e){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=await this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter((e=>!this.attemptedRegions.find((t=>t.url===e.url))));if(t.length>0){const e=t[0];return this.attemptedRegions.push(e),pg.debug("next region: ".concat(e.region)),e.url}return null}resetAttempts(){this.attemptedRegions=[]}async fetchRegionSettings(e){const t=await fetch("".concat((n=this.serverUrl,"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});var n;if(t.ok){const e=await t.json();return this.lastUpdateAt=Date.now(),e}throw new rP("Could not fetch region settings: ".concat(t.statusText),401===t.status?0:void 0,t.status)}}const OC="_lossy",PC="_reliable",EC="leave-reconnect";var CC,TC,xC;!function(e){e[e.New=0]="New",e[e.Connected=1]="Connected",e[e.Disconnected=2]="Disconnected",e[e.Reconnecting=3]="Reconnecting",e[e.Closed=4]="Closed"}(CC||(CC={}));class RC extends iE.EventEmitter{get isClosed(){return this._isClosed}constructor(e){super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=iC.peerConnectionTimeout,this.subscriberPrimary=!1,this.pcState=CC.New,this._isClosed=!0,this.pendingTrackResolvers={},this.hasPublished=!1,this.reconnectAttempts=0,this.reconnectStart=0,this.fullReconnectOnNext=!1,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.handleDataChannel=async e=>{let{channel:t}=e;if(t){if(t.label===PC)this.reliableDCSub=t;else{if(t.label!==OC)return;this.lossyDCSub=t}pg.debug("on data channel ".concat(t.id,", ").concat(t.label)),t.onmessage=this.handleDataMessage}},this.handleDataMessage=async e=>{var t,n;const r=await this.dataProcessLock.lock();try{let r;if(e.data instanceof ArrayBuffer)r=e.data;else{if(!(e.data instanceof Blob))return void pg.error("unsupported data type",e.data);r=await e.data.arrayBuffer()}const o=_w.decode(new Uint8Array(r));"speaker"===(null===(t=o.value)||void 0===t?void 0:t.$case)?this.emit(KO.ActiveSpeakersUpdate,o.value.speaker.speakers):"user"===(null===(n=o.value)||void 0===n?void 0:n.$case)&&this.emit(KO.DataPacketReceived,o.value.user,o.kind)}finally{r()}},this.handleDataError=e=>{const t=0===e.currentTarget.maxRetransmits?"lossy":"reliable";if(e instanceof ErrorEvent){const{error:n}=e.error;pg.error("DataChannel error on ".concat(t,": ").concat(e.message),n)}else pg.error("Unknown DataChannel Error on ".concat(t),e)},this.handleBufferedAmountLow=e=>{const t=0===e.currentTarget.maxRetransmits?ow.LOSSY:ow.RELIABLE;this.updateAndEmitDCBufferStatus(t)},this.handleDisconnect=(e,t)=>{if(this._isClosed)return;pg.warn("".concat(e," disconnected")),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const n=Date.now()-this.reconnectStart;let r=this.getNextRetryDelay({elapsedMs:n,retryCount:this.reconnectAttempts});null!==r?(e===EC&&(r=0),pg.debug("reconnecting in ".concat(r,"ms")),this.clearReconnectTimeout(),this.url&&this.token&&CP(new URL(this.url))&&(this.regionUrlProvider=new kC(this.url,this.token)),this.reconnectTimeout=SE.setTimeout((()=>this.attemptReconnect(t)),r)):(e=>{pg.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(e,"ms. giving up")),this.emit(KO.Disconnected),this.close()})(n)},this.updateAndEmitDCBufferStatus=e=>{const t=this.isBufferStatusLow(e);void 0!==t&&t!==this.dcBufferStatus.get(e)&&(this.dcBufferStatus.set(e,t),this.emit(KO.DCBufferStatusChanged,t,e))},this.isBufferStatusLow=e=>{const t=this.dataChannelForKind(e);if(t)return t.bufferedAmount<=t.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.isReconnecting&&(this.clearReconnectTimeout(),this.attemptReconnect(tw.RR_SIGNAL_DISCONNECTED))},this.client=new QE,this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new FP,this.dataProcessLock=new FP,this.dcBufferStatus=new Map([[ow.LOSSY,!0],[ow.RELIABLE,!0]])}async join(e,t,n,r){this.url=e,this.token=t,this.signalOpts=n;try{this.joinAttempts+=1;const o=await this.client.join(e,t,n,r);return this._isClosed=!1,this.subscriberPrimary=o.subscriberPrimary,this.publisher||this.configure(o),this.subscriberPrimary||this.negotiate(),this.clientConfiguration=o.clientConfiguration,o}catch(o){if(o instanceof rP&&1===o.reason&&(pg.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts)),this.joinAttempts{var t,n;try{(null===(t=this.publisher)||void 0===t?void 0:t.pc.removeTrack)&&(null===(n=this.publisher)||void 0===n||n.pc.removeTrack(e))}catch(e){pg.warn("could not removeTrack",{error:e})}})),this.publisher.close(),this.publisher=void 0),this.subscriber&&(this.subscriber.close(),this.subscriber=void 0),await this.client.close()}finally{e()}}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new iP("a track with the same ID has already been published");return new Promise(((t,n)=>{const r=setTimeout((()=>{delete this.pendingTrackResolvers[e.cid],n(new rP("publication of local track timed out, no response from server"))}),1e4);this.pendingTrackResolvers[e.cid]={resolve:e=>{clearTimeout(r),t(e)},reject:()=>{clearTimeout(r),n(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)}))}removeTrack(e){var t;if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return null===(t=this.publisher)||void 0===t||t.pc.removeTrack(e),!0}catch(e){pg.warn("failed to remove track",{error:e,method:"removeTrack"})}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return null===(e=this.reliableDCSub)||void 0===e?void 0:e.readyState}async getConnectedServerAddress(){if(void 0!==this.primaryPC)return async function(e){var t;let n="";const r=new Map,o=new Map;if((await e.getStats()).forEach((e=>{switch(e.type){case"transport":n=e.selectedCandidatePairId;break;case"candidate-pair":""===n&&e.selected&&(n=e.id),r.set(e.id,e);break;case"remote-candidate":o.set(e.id,"".concat(e.address,":").concat(e.port))}})),""===n)return;const i=null===(t=r.get(n))||void 0===t?void 0:t.remoteCandidateId;return void 0!==i?o.get(i):void 0}(this.primaryPC)}configure(e){var t;if(this.publisher||this.subscriber)return;this.participantSid=null===(t=e.participant)||void 0===t?void 0:t.sid;const n=this.makeRTCConfiguration(e);this.publisher=new SC(n),this.subscriber=new SC(n),this.emit(KO.TransportsCreated,this.publisher,this.subscriber),this.publisher.pc.onicecandidate=e=>{e.candidate&&(pg.trace("adding ICE candidate for peer",e.candidate),this.client.sendIceCandidate(e.candidate,oO.PUBLISHER))},this.subscriber.pc.onicecandidate=e=>{e.candidate&&this.client.sendIceCandidate(e.candidate,oO.SUBSCRIBER)},this.publisher.onOffer=e=>{this.client.sendOffer(e)};let r=this.publisher.pc,o=this.subscriber.pc,i=e.subscriberPrimary;i&&(r=this.subscriber.pc,o=this.publisher.pc,this.subscriber.pc.ondatachannel=this.handleDataChannel),this.primaryPC=r,r.onconnectionstatechange=async()=>{if(pg.debug("primary PC state changed ".concat(r.connectionState)),"connected"===r.connectionState){const t=this.pcState===CC.New;this.pcState=CC.Connected,t&&this.emit(KO.Connected,e)}else"failed"===r.connectionState&&this.pcState===CC.Connected&&(this.pcState=CC.Disconnected,this.handleDisconnect("primary peerconnection",i?tw.RR_SUBSCRIBER_FAILED:tw.RR_PUBLISHER_FAILED))},o.onconnectionstatechange=async()=>{pg.debug("secondary PC state changed ".concat(o.connectionState)),"failed"===o.connectionState&&this.handleDisconnect("secondary peerconnection",i?tw.RR_PUBLISHER_FAILED:tw.RR_SUBSCRIBER_FAILED)},this.subscriber.pc.ontrack=e=>{this.emit(KO.MediaTrackAdded,e.track,e.streams[0],e.receiver)},this.createDataChannels(),this.client.onAnswer=async e=>{this.publisher&&(pg.debug("received server answer",{RTCSdpType:e.type,signalingState:this.publisher.pc.signalingState}),await this.publisher.setRemoteDescription(e))},this.client.onTrickle=(e,t)=>{this.publisher&&this.subscriber&&(pg.trace("got ICE candidate from peer",{candidate:e,target:t}),t===oO.PUBLISHER?this.publisher.addIceCandidate(e):this.subscriber.addIceCandidate(e))},this.client.onOffer=async e=>{if(!this.subscriber)return;pg.debug("received server offer",{RTCSdpType:e.type,signalingState:this.subscriber.pc.signalingState}),await this.subscriber.setRemoteDescription(e);const t=await this.subscriber.createAndSetAnswer();this.client.sendAnswer(t)},this.client.onLocalTrackPublished=e=>{pg.debug("received trackPublishedResponse",e);const{resolve:t}=this.pendingTrackResolvers[e.cid];t?(delete this.pendingTrackResolvers[e.cid],t(e.track)):pg.error("missing track resolver for ".concat(e.cid))},this.client.onTokenRefresh=e=>{this.token=e},this.client.onClose=()=>{this.handleDisconnect("signal",tw.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{(null==e?void 0:e.canReconnect)?(this.fullReconnectOnNext=!0,this.primaryPC=void 0,this.handleDisconnect(EC)):(this.emit(KO.Disconnected,null==e?void 0:e.reason),this.close()),pg.trace("leave request",{leave:e})}}makeRTCConfiguration(e){const t=Qw({},this.rtcConfig);if(e.iceServers&&!t.iceServers){const n=[];e.iceServers.forEach((e=>{const t={urls:e.urls};e.username&&(t.username=e.username),e.credential&&(t.credential=e.credential),n.push(t)})),t.iceServers=n}return e.clientConfiguration&&e.clientConfiguration.forceRelay===XS.ENABLED&&(t.iceTransportPolicy="relay"),t.sdpSemantics="unified-plan",t.continualGatheringPolicy="gather_continually",t}createDataChannels(){this.publisher&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.publisher.pc.createDataChannel(OC,{ordered:!0,maxRetransmits:0}),this.reliableDC=this.publisher.pc.createDataChannel(PC,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}setPreferredCodec(e,t,n){if(!("getCapabilities"in RTCRtpSender))return;const r=RTCRtpSender.getCapabilities(t);if(!r)return;pg.debug("get capabilities",r);const o=[],i=[],a=[];r.codecs.forEach((e=>{const t=e.mimeType.toLowerCase();"audio/opus"!==t?t==="video/".concat(n)?"h264"!==n||e.sdpFmtpLine&&e.sdpFmtpLine.includes("profile-level-id=42e01f")?o.push(e):i.push(e):a.push(e):o.push(e)})),function(e){if(!PP())return!1;if(!("setCodecPreferences"in e))return!1;const t=pP();if(!t.browser.name||!t.browser.version)return!1;const n=SP[t.browser.name];return!!n&&function(e,t){const n=e.split("."),r=t.split("."),o=Math.min(e.length,t.length);for(let e=0;eo)return 1;if(t=0}(e)&&e.setCodecPreferences(o.concat(i,a))}async createSender(e,t,n){if(vP())return this.createTransceiverRTCRtpSender(e,t,n);if(bP())return pg.debug("using add-track fallback"),this.createRTCRtpSender(e.mediaStreamTrack);throw new sP("Required webRTC APIs not supported on this device")}async createSimulcastSender(e,t,n,r){if(vP())return this.createSimulcastTransceiverSender(e,t,n,r);if(bP())return pg.debug("using add-track fallback"),this.createRTCRtpSender(e.mediaStreamTrack);throw new sP("Cannot stream on this device")}async createTransceiverRTCRtpSender(e,t,n){if(!this.publisher)throw new sP("publisher is closed");const r={direction:"sendonly"};n&&(r.sendEncodings=n);const o=await this.publisher.pc.addTransceiver(e.mediaStreamTrack,r);return e.kind===cE.Kind.Video&&t.videoCodec&&(this.setPreferredCodec(o,e.kind,t.videoCodec),e.codec=t.videoCodec),o.sender}async createSimulcastTransceiverSender(e,t,n,r){if(!this.publisher)throw new sP("publisher is closed");const o={direction:"sendonly"};r&&(o.sendEncodings=r);const i=await this.publisher.pc.addTransceiver(t.mediaStreamTrack,o);if(n.videoCodec)return this.setPreferredCodec(i,e.kind,n.videoCodec),e.setSimulcastTrackSender(n.videoCodec,i.sender),i.sender}async createRTCRtpSender(e){if(!this.publisher)throw new sP("publisher is closed");return this.publisher.pc.addTrack(e)}async attemptReconnect(e){var t,n,r;if(!this._isClosed&&!this.attemptingReconnect){(null===(t=this.clientConfiguration)||void 0===t?void 0:t.resumeConnection)!==XS.DISABLED&&"closed"!==(null!==(r=null===(n=this.primaryPC)||void 0===n?void 0:n.signalingState)&&void 0!==r?r:"closed")||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?await this.restartConnection():await this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(e){this.reconnectAttempts+=1;let t=!0;e instanceof sP?(pg.debug("received unrecoverable error",{error:e}),t=!1):e instanceof jC||(this.fullReconnectOnNext=!0),t?this.handleDisconnect("reconnect",tw.RR_UNKOWN):(pg.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up")),this.emit(KO.Disconnected),this.close())}finally{this.attemptingReconnect=!1}}}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(e){pg.warn("encountered error in reconnect policy",{error:e})}return null}async restartConnection(e){var t,n,r,o,i;try{if(!this.url||!this.token)throw new sP("could not reconnect, url or token not saved");let o;pg.info("reconnecting, attempt: ".concat(this.reconnectAttempts)),this.emit(KO.Restarting),this.client.isConnected&&await this.client.sendLeave(),await this.client.close(),this.primaryPC=void 0,null===(t=this.publisher)||void 0===t||t.close(),this.publisher=void 0,null===(n=this.subscriber)||void 0===n||n.close(),this.subscriber=void 0;try{if(!this.signalOpts)throw pg.warn("attempted connection restart, without signal options present"),new jC;o=await this.join(null!=e?e:this.url,this.token,this.signalOpts)}catch(e){if(e instanceof rP&&0===e.reason)throw new sP("could not reconnect, token might be expired");throw new jC}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");await this.waitForPCReconnected(),this.client.setReconnected(),null===(r=this.regionUrlProvider)||void 0===r||r.resetAttempts(),this.emit(KO.Restarted,o)}catch(e){const t=await(null===(o=this.regionUrlProvider)||void 0===o?void 0:o.getNextBestRegionUrl());if(t)return void await this.restartConnection(t);throw null===(i=this.regionUrlProvider)||void 0===i||i.resetAttempts(),e}}async resumeConnection(e){var t;if(!this.url||!this.token)throw new sP("could not reconnect, url or token not saved");if(!this.publisher||!this.subscriber)throw new sP("publisher and subscriber connections unset");pg.info("resuming signal connection, attempt ".concat(this.reconnectAttempts)),this.emit(KO.Resuming);try{const t=await this.client.reconnect(this.url,this.token,this.participantSid,e);if(t){const e=this.makeRTCConfiguration(t);this.publisher.pc.setConfiguration(e),this.subscriber.pc.setConfiguration(e)}}catch(e){let t="";if(e instanceof Error&&(t=e.message),e instanceof rP&&0===e.reason)throw new sP("could not reconnect, token might be expired");throw new jC(t)}if(this.emit(KO.SignalResumed),this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");this.subscriber.restartingIce=!0,this.hasPublished&&await this.publisher.createAndSendOffer({iceRestart:!0}),await this.waitForPCReconnected(),this.client.setReconnected(),"open"===(null===(t=this.reliableDC)||void 0===t?void 0:t.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),this.emit(KO.Resumed)}async waitForPCInitialConnection(e,t){if(this.pcState!==CC.Connected){if(this.pcState!==CC.New)throw new sP("Expected peer connection to be new on initial connection");return new Promise(((n,r)=>{const o=()=>{pg.warn("closing engine"),SE.clearTimeout(a),r(new rP("room connection has been cancelled",3))};(null==t?void 0:t.signal.aborted)&&o(),null==t||t.signal.addEventListener("abort",o);const i=()=>{SE.clearTimeout(a),null==t||t.signal.removeEventListener("abort",o),n()},a=SE.setTimeout((()=>{this.off(KO.Connected,i),r(new rP("could not establish pc connection"))}),null!=e?e:this.peerConnectionTimeout);this.once(KO.Connected,i)}))}}async waitForPCReconnected(){var e;const t=Date.now();let n=t;for(this.pcState=CC.Reconnecting,pg.debug("waiting for peer connection to reconnect");n-t2e3&&"connected"===(null===(e=this.primaryPC)||void 0===e?void 0:e.connectionState)&&(this.pcState=CC.Connected),this.pcState===CC.Connected)return;await yP(100),n=Date.now()}throw new rP("could not establish PC connection")}async sendDataPacket(e,t){const n=_w.encode(e).finish();await this.ensurePublisherConnected(t);const r=this.dataChannelForKind(t);r&&r.send(n),this.updateAndEmitDCBufferStatus(t)}async ensureDataTransportConnected(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;var n,r,o;const i=t?this.subscriber:this.publisher,a=t?"Subscriber":"Publisher";if(!i)throw new rP("".concat(a," connection not set"));t||(null===(n=this.publisher)||void 0===n?void 0:n.isICEConnected)||"checking"===(null===(r=this.publisher)||void 0===r?void 0:r.pc.iceConnectionState)||this.negotiate();const s=this.dataChannelForKind(e,t);if("open"===(null==s?void 0:s.readyState))return;const c=(new Date).getTime()+this.peerConnectionTimeout;for(;(new Date).getTime(){if(!this.publisher)return void t(new cP("publisher is not defined"));this.hasPublished=!0;const n=()=>{pg.debug("engine disconnected while negotiation was ongoing"),o(),e()};this.on(KO.Closing,n);const r=setTimeout((()=>{t("negotiation timed out"),this.handleDisconnect("negotiation",tw.RR_SIGNAL_DISCONNECTED)}),this.peerConnectionTimeout),o=()=>{clearTimeout(r),this.off(KO.Closing,n)};this.publisher.once(bC,(()=>{var t;null===(t=this.publisher)||void 0===t||t.once(gC,(()=>{o(),e()}))})),this.publisher.negotiate((e=>{o(),t(e),e instanceof cP&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",tw.RR_UNKOWN)}))}))}dataChannelForKind(e,t){if(t){if(e===ow.LOSSY)return this.lossyDCSub;if(e===ow.RELIABLE)return this.reliableDCSub}else{if(e===ow.LOSSY)return this.lossyDC;if(e===ow.RELIABLE)return this.reliableDC}}failNext(){this.shouldFailNext=!0}clearReconnectTimeout(){this.reconnectTimeout&&SE.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){PP()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){PP()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class jC extends Error{}!function(e){e.Disconnected="disconnected",e.Connecting="connecting",e.Connected="connected",e.Reconnecting="reconnecting"}(TC||(TC={}));class IC extends iE.EventEmitter{constructor(e){var t;super(),t=this,this.state=TC.Disconnected,this.activeSpeakers=[],this.sid="",this.name="",this.metadata=void 0,this._isRecording=!1,this.audioEnabled=!0,this.connect=async(e,t,n)=>{const r=await this.disconnectLock.lock();if(this.state===TC.Connected)return pg.info("already connected to room ".concat(this.name)),r(),Promise.resolve();if(this.connectFuture)return r(),this.connectFuture.promise;this.setAndEmitConnectionState(TC.Connecting);const o=new kC(e,t),i=async(a,s,c)=>{var l;this.abortController&&this.abortController.abort(),this.abortController=new AbortController,null==r||r();try{await this.attemptConnection(null!=c?c:e,t,n,this.abortController),this.abortController=void 0,a()}catch(t){if(CP(new URL(e))&&t instanceof rP&&3!==t.reason){let e=null;try{e=await o.getNextBestRegionUrl(null===(l=this.abortController)||void 0===l?void 0:l.signal)}catch(e){if(e instanceof rP&&(401===e.status||3===e.reason))return void s(e)}e?(pg.debug("initial connection failed, retrying with another region"),await i(a,s,e)):s(t)}else s(t)}};return this.connectFuture=new BP(i,(()=>{this.clearConnectionFutures()})),this.connectFuture.promise},this.connectSignal=async(e,t,n,r,o,i)=>{const a=await n.join(e,t,{autoSubscribe:r.autoSubscribe,publishOnly:r.publishOnly,adaptiveStream:"object"==typeof o.adaptiveStream||o.adaptiveStream,maxRetries:r.maxRetries},i.signal);let s=a.serverInfo;if(s||(s={version:a.serverVersion,region:a.serverRegion}),pg.debug("connected to Livekit Server ".concat(Object.entries(s).map((e=>{let[t,n]=e;return"".concat(t,": ").concat(n)})).join(", "))),!a.serverVersion)throw new aP("unknown server version");return"0.15.1"===a.serverVersion&&this.options.dynacast&&(pg.debug("disabling dynacast due to server version"),o.dynacast=!1),a},this.applyJoinResponse=e=>{const t=e.participant;this.localParticipant.sid=t.sid,this.localParticipant.identity=t.identity,this.localParticipant.updateInfo(t),this.setupLocalParticipantEvents(),e.otherParticipants.forEach((e=>{e.sid!==this.localParticipant.sid&&e.identity!==this.localParticipant.identity?this.getOrCreateParticipant(e.sid,e):pg.warn("received info to create local participant as remote participant",{info:e,localParticipant:this.localParticipant})})),this.name=e.room.name,this.sid=e.room.sid,this.metadata=e.room.metadata,this._isRecording!==e.room.activeRecording&&(this._isRecording=e.room.activeRecording,this.emit(GO.RecordingStatusChanged,e.room.activeRecording))},this.attemptConnection=async(e,t,n,r)=>{var o;this.state===TC.Reconnecting?(pg.info("Reconnection attempt replaced by new connection attempt"),this.recreateEngine()):this.maybeCreateEngine(),this.acquireAudioContext(),this.connOptions=Qw(Qw({},iC),n),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const n=await this.connectSignal(e,t,this.engine,this.connOptions,this.options,r);this.applyJoinResponse(n),this.emit(GO.SignalConnected)}catch(e){this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish);const t=new rP("could not establish signal connection");throw e instanceof Error&&(t.message="".concat(t.message,": ").concat(e.message)),e instanceof rP&&(t.reason=e.reason,t.status=e.status),pg.debug("error trying to establish signal connection",{error:e}),t}if(r.signal.aborted)throw this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),new rP("Connection attempt aborted");try{await this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,r)}catch(e){throw this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),e}PP()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave),null===(o=navigator.mediaDevices)||void 0===o||o.addEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Connected)},this.disconnect=async function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var n,r,o,i;const a=await t.disconnectLock.lock();try{if(t.state===TC.Disconnected)return void pg.debug("already disconnected");pg.info("disconnect from room",{identity:t.localParticipant.identity}),t.state!==TC.Connecting&&t.state!==TC.Reconnecting||(pg.warn("abort connection attempt"),null===(n=t.abortController)||void 0===n||n.abort(),null===(o=null===(r=t.connectFuture)||void 0===r?void 0:r.reject)||void 0===o||o.call(r,new rP("Client initiated disconnect")),t.connectFuture=void 0),(null===(i=t.engine)||void 0===i?void 0:i.client.isConnected)&&await t.engine.client.sendLeave(),t.engine&&await t.engine.close(),t.handleDisconnect(e,ew.CLIENT_INITIATED),t.engine=void 0}finally{a()}},this.onPageLeave=async()=>{await this.disconnect()},this.handleRestarting=()=>{for(const e of this.participants.values())this.handleParticipantDisconnected(e.sid,e);this.setAndEmitConnectionState(TC.Reconnecting)&&this.emit(GO.Reconnecting)},this.handleRestarted=async e=>{pg.debug("reconnected to server",{region:e.serverRegion});try{e.participant&&(this.localParticipant.sid=e.participant.sid,this.handleParticipantUpdates([e.participant])),this.handleParticipantUpdates(e.otherParticipants);const t=[];this.localParticipant.tracks.forEach((e=>{e.track&&t.push(e)})),await Promise.all(t.map((async e=>{const t=e.track;this.localParticipant.unpublishTrack(t,!1),t.isMuted||((t instanceof pE||t instanceof fE)&&!t.isUserProvided&&(pg.debug("restarting existing track",{track:e.trackSid}),await t.restartTrack()),pg.debug("publishing new track",{track:e.trackSid}),await this.localParticipant.publishTrack(t,e.options))})))}catch(e){pg.error("error trying to re-publish tracks after reconnection",{error:e})}finally{this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Reconnected)}},this.handleParticipantUpdates=e=>{e.forEach((e=>{if(e.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(e);const t=this.identityToSid.get(e.identity);t&&t!==e.sid&&this.handleParticipantDisconnected(t,this.participants.get(t));let n=this.participants.get(e.sid);const r=!n;e.state===nw.DISCONNECTED?this.handleParticipantDisconnected(e.sid,n):(n=this.getOrCreateParticipant(e.sid,e),r||n.updateInfo(e))}))},this.handleActiveSpeakersUpdate=e=>{const t=[],n={};e.forEach((e=>{if(n[e.sid]=!0,e.sid===this.localParticipant.sid)this.localParticipant.audioLevel=e.level,this.localParticipant.setIsSpeaking(!0),t.push(this.localParticipant);else{const n=this.participants.get(e.sid);n&&(n.audioLevel=e.level,n.setIsSpeaking(!0),t.push(n))}})),n[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.participants.forEach((e=>{n[e.sid]||(e.audioLevel=0,e.setIsSpeaking(!1))})),this.activeSpeakers=t,this.emitWhenConnected(GO.ActiveSpeakersChanged,t)},this.handleSpeakersChanged=e=>{const t=new Map;this.activeSpeakers.forEach((e=>{t.set(e.sid,e)})),e.forEach((e=>{let n=this.participants.get(e.sid);e.sid===this.localParticipant.sid&&(n=this.localParticipant),n&&(n.audioLevel=e.level,n.setIsSpeaking(e.active),e.active?t.set(e.sid,n):t.delete(e.sid))}));const n=Array.from(t.values());n.sort(((e,t)=>t.audioLevel-e.audioLevel)),this.activeSpeakers=n,this.emitWhenConnected(GO.ActiveSpeakersChanged,n)},this.handleStreamStateUpdate=e=>{e.streamStates.forEach((e=>{const t=this.participants.get(e.participantSid);if(!t)return;const n=t.getTrackPublication(e.trackSid);n&&n.track&&(n.track.streamState=cE.streamStateFromProto(e.state),t.emit(JO.TrackStreamStateChanged,n,n.track.streamState),this.emitWhenConnected(GO.TrackStreamStateChanged,n,n.track.streamState,t))}))},this.handleSubscriptionPermissionUpdate=e=>{const t=this.participants.get(e.participantSid);if(!t)return;const n=t.getTrackPublication(e.trackSid);n&&n.setAllowed(e.allowed)},this.handleDataPacket=(e,t)=>{const n=this.participants.get(e.participantSid);this.emit(GO.DataReceived,e.payload,n,t,e.topic),null==n||n.emit(JO.DataReceived,e.payload,t)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(GO.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=e=>{pg.warn("could not playback audio",e),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(GO.AudioPlaybackStatusChanged,!1))},this.handleDeviceChange=async()=>{this.emit(GO.MediaDevicesChanged)},this.handleRoomUpdate=e=>{this._isRecording!==e.activeRecording&&(this._isRecording=e.activeRecording,this.emit(GO.RecordingStatusChanged,e.activeRecording)),this.metadata!==e.metadata&&(this.metadata=e.metadata,this.emitWhenConnected(GO.RoomMetadataChanged,e.metadata))},this.handleConnectionQualityUpdate=e=>{e.updates.forEach((e=>{if(e.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(e.quality);const t=this.participants.get(e.participantSid);t&&t.setConnectionQuality(e.quality)}))},this.onLocalParticipantMetadataChanged=e=>{this.emit(GO.ParticipantMetadataChanged,e,this.localParticipant)},this.onLocalTrackMuted=e=>{this.emit(GO.TrackMuted,e,this.localParticipant)},this.onLocalTrackUnmuted=e=>{this.emit(GO.TrackUnmuted,e,this.localParticipant)},this.onLocalTrackPublished=async e=>{this.emit(GO.LocalTrackPublished,e,this.localParticipant),e.track instanceof pE&&await e.track.checkForSilence()&&this.emit(GO.LocalAudioSilenceDetected,e)},this.onLocalTrackUnpublished=e=>{this.emit(GO.LocalTrackUnpublished,e,this.localParticipant)},this.onLocalConnectionQualityChanged=e=>{this.emit(GO.ConnectionQualityChanged,e,this.localParticipant)},this.onMediaDevicesError=e=>{this.emit(GO.MediaDevicesError,e)},this.onLocalParticipantPermissionsChanged=e=>{this.emit(GO.ParticipantPermissionsChanged,e,this.localParticipant)},this.setMaxListeners(100),this.participants=new Map,this.identityToSid=new Map,this.options=Qw(Qw({},oC),e),this.options.audioCaptureDefaults=Qw(Qw({},nC),null==e?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Qw(Qw({},rC),null==e?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Qw(Qw({},tC),null==e?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new FP,this.localParticipant=new JE("","",this.engine,this.options)}maybeCreateEngine(){this.engine||(this.engine=new RC(this.options),this.engine.client.onParticipantUpdate=this.handleParticipantUpdates,this.engine.client.onRoomUpdate=this.handleRoomUpdate,this.engine.client.onSpeakersChanged=this.handleSpeakersChanged,this.engine.client.onStreamStateUpdate=this.handleStreamStateUpdate,this.engine.client.onSubscriptionPermissionUpdate=this.handleSubscriptionPermissionUpdate,this.engine.client.onConnectionQuality=this.handleConnectionQualityUpdate,this.engine.on(KO.MediaTrackAdded,((e,t,n)=>{this.onTrackAdded(e,t,n)})).on(KO.Disconnected,(e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)})).on(KO.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(KO.DataPacketReceived,this.handleDataPacket).on(KO.Resuming,(()=>{this.setAndEmitConnectionState(TC.Reconnecting)&&this.emit(GO.Reconnecting)})).on(KO.Resumed,(()=>{this.setAndEmitConnectionState(TC.Connected),this.emit(GO.Reconnected),this.updateSubscriptions()})).on(KO.SignalResumed,(()=>{this.state===TC.Reconnecting&&this.sendSyncState()})).on(KO.Restarting,this.handleRestarting).on(KO.Restarted,this.handleRestarted).on(KO.DCBufferStatusChanged,((e,t)=>{this.emit(GO.DCBufferStatusChanged,e,t)})),this.localParticipant&&this.localParticipant.setupEngine(this.engine))}static getLocalDevices(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return WP.getInstance().getDevices(e,t)}async prepareConnection(e){await fetch("http".concat(e.substring(2)),{method:"HEAD"})}getParticipantByIdentity(e){if(this.localParticipant.identity===e)return this.localParticipant;const t=this.identityToSid.get(e);return t?this.participants.get(t):void 0}clearConnectionFutures(){this.connectFuture=void 0}get isRecording(){return this._isRecording}async simulateScenario(e){let t,n=()=>{};switch(e){case"signal-reconnect":await this.engine.client.close(),this.engine.client.onClose&&this.engine.client.onClose("simulate disconnect");break;case"speaker":t=HO.fromPartial({scenario:{$case:"speakerUpdate",speakerUpdate:3}});break;case"node-failure":t=HO.fromPartial({scenario:{$case:"nodeFailure",nodeFailure:!0}});break;case"server-leave":t=HO.fromPartial({scenario:{$case:"serverLeave",serverLeave:!0}});break;case"migration":t=HO.fromPartial({scenario:{$case:"migration",migration:!0}});break;case"resume-reconnect":this.engine.failNext(),await this.engine.client.close(),this.engine.client.onClose&&this.engine.client.onClose("simulate resume-reconnect");break;case"force-tcp":case"force-tls":t=HO.fromPartial({scenario:{$case:"switchCandidateProtocol",switchCandidateProtocol:"force-tls"===e?2:1}}),n=async()=>{const e=this.engine.client.onLeave;e&&e({reason:ew.CLIENT_INITIATED,canReconnect:!0})}}t&&(this.engine.client.sendSimulateScenario(t),n())}async startAudio(){await this.acquireAudioContext();const e=[];this.participants.forEach((t=>{t.audioTracks.forEach((t=>{t.track&&t.track.attachedElements.forEach((t=>{e.push(t)}))}))}));try{await Promise.all(e.map((e=>(e.muted=!1,e.play())))),this.handleAudioPlaybackStarted()}catch(e){throw this.handleAudioPlaybackFailed(e),e}}get canPlaybackAudio(){return this.audioEnabled}getActiveAudioOutputDevice(){var e,t;return null!==(t=null===(e=this.options.audioOutput)||void 0===e?void 0:e.deviceId)&&void 0!==t?t:""}async switchActiveDevice(e,t){var n,r;const o=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?{exact:t}:t;if("audioinput"===e){const e=this.options.audioCaptureDefaults.deviceId;this.options.audioCaptureDefaults.deviceId=o;const t=Array.from(this.localParticipant.audioTracks.values()).filter((e=>e.source===cE.Source.Microphone));try{await Promise.all(t.map((e=>{var t;return null===(t=e.audioTrack)||void 0===t?void 0:t.setDeviceId(o)})))}catch(t){throw this.options.audioCaptureDefaults.deviceId=e,t}}else if("videoinput"===e){const e=this.options.videoCaptureDefaults.deviceId;this.options.videoCaptureDefaults.deviceId=o;const t=Array.from(this.localParticipant.videoTracks.values()).filter((e=>e.source===cE.Source.Camera));try{await Promise.all(t.map((e=>{var t;return null===(t=e.videoTrack)||void 0===t?void 0:t.setDeviceId(o)})))}catch(t){throw this.options.videoCaptureDefaults.deviceId=e,t}}else if("audiooutput"===e){if(!gP())throw new Error("cannot switch audio output, setSinkId not supported");null!==(n=(r=this.options).audioOutput)&&void 0!==n||(r.audioOutput={});const e=this.options.audioOutput.deviceId;this.options.audioOutput.deviceId=t;try{await Promise.all(Array.from(this.participants.values()).map((e=>e.setAudioOutput({deviceId:t}))))}catch(t){throw this.options.audioOutput.deviceId=e,t}}}setupLocalParticipantEvents(){this.localParticipant.on(JO.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(JO.TrackMuted,this.onLocalTrackMuted).on(JO.TrackUnmuted,this.onLocalTrackUnmuted).on(JO.LocalTrackPublished,this.onLocalTrackPublished).on(JO.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(JO.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(JO.MediaDevicesError,this.onMediaDevicesError).on(JO.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;null===(e=this.engine)||void 0===e||e.close(),this.engine=void 0,this.participants.clear(),this.maybeCreateEngine()}onTrackAdded(e,t,n){if(this.state===TC.Connecting||this.state===TC.Reconnecting){const r=()=>{this.onTrackAdded(e,t,n),o()},o=()=>{this.off(GO.Reconnected,r),this.off(GO.Connected,r),this.off(GO.Disconnected,o)};return this.once(GO.Reconnected,r),this.once(GO.Connected,r),void this.once(GO.Disconnected,o)}if(this.state===TC.Disconnected)return void pg.warn("skipping incoming track after Room disconnected");const r=function(e){const t=e.split("|");return t.length>1?[t[0],e.substr(t[0].length+1)]:[e,""]}(t.id),o=r[0];let i=r[1];if(i&&""!==i||(i=e.id),o===this.localParticipant.sid)return void pg.warn("tried to create RemoteParticipant for local participant");const a=this.getOrCreateParticipant(o);let s;this.options.adaptiveStream&&(s="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{}),a.addSubscribedMediaTrack(e,i,t,n,s)}handleDisconnect(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var n;this.state!==TC.Disconnected&&(this.participants.forEach((e=>{e.tracks.forEach((t=>{e.unpublishTrack(t.trackSid)}))})),this.localParticipant.tracks.forEach((t=>{var n,r;t.track&&this.localParticipant.unpublishTrack(t.track,e),e&&(null===(n=t.track)||void 0===n||n.detach(),null===(r=t.track)||void 0===r||r.stop())})),this.localParticipant.off(JO.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(JO.TrackMuted,this.onLocalTrackMuted).off(JO.TrackUnmuted,this.onLocalTrackUnmuted).off(JO.LocalTrackPublished,this.onLocalTrackPublished).off(JO.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(JO.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(JO.MediaDevicesError,this.onMediaDevicesError).off(JO.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.tracks.clear(),this.localParticipant.videoTracks.clear(),this.localParticipant.audioTracks.clear(),this.participants.clear(),this.activeSpeakers=[],this.audioContext&&"boolean"==typeof this.options.expWebAudioMix&&(this.audioContext.close(),this.audioContext=void 0),PP()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),null===(n=navigator.mediaDevices)||void 0===n||n.removeEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(TC.Disconnected),this.emit(GO.Disconnected,t))}handleParticipantDisconnected(e,t){this.participants.delete(e),t&&(this.identityToSid.delete(t.identity),t.tracks.forEach((e=>{t.unpublishTrack(e.trackSid,!0)})),this.emit(GO.ParticipantDisconnected,t))}async acquireAudioContext(){var e,t;"boolean"!=typeof this.options.expWebAudioMix&&this.options.expWebAudioMix.audioContext?(this.audioContext=this.options.expWebAudioMix.audioContext,await this.audioContext.resume()):this.audioContext=null!==(e=mP())&&void 0!==e?e:void 0,this.options.expWebAudioMix&&this.participants.forEach((e=>e.setAudioContext(this.audioContext)));const n="running"===(null===(t=this.audioContext)||void 0===t?void 0:t.state);n!==this.canPlaybackAudio&&(this.audioEnabled=n,this.emit(GO.AudioPlaybackStatusChanged,n))}createParticipant(e,t){let n;return n=t?GE.fromParticipantInfo(this.engine.client,t):new GE(this.engine.client,e,"",void 0,void 0),this.options.expWebAudioMix&&n.setAudioContext(this.audioContext),n}getOrCreateParticipant(e,t){if(this.participants.has(e))return this.participants.get(e);const n=this.createParticipant(e,t);return this.participants.set(e,n),t&&(this.identityToSid.set(t.identity,t.sid),this.emitWhenConnected(GO.ParticipantConnected,n)),n.on(JO.TrackPublished,(e=>{this.emitWhenConnected(GO.TrackPublished,e,n)})).on(JO.TrackSubscribed,((e,t)=>{e.kind===cE.Kind.Audio&&(e.on(YO.AudioPlaybackStarted,this.handleAudioPlaybackStarted),e.on(YO.AudioPlaybackFailed,this.handleAudioPlaybackFailed)),this.emit(GO.TrackSubscribed,e,t,n)})).on(JO.TrackUnpublished,(e=>{this.emit(GO.TrackUnpublished,e,n)})).on(JO.TrackUnsubscribed,((e,t)=>{this.emit(GO.TrackUnsubscribed,e,t,n)})).on(JO.TrackSubscriptionFailed,(e=>{this.emit(GO.TrackSubscriptionFailed,e,n)})).on(JO.TrackMuted,(e=>{this.emitWhenConnected(GO.TrackMuted,e,n)})).on(JO.TrackUnmuted,(e=>{this.emitWhenConnected(GO.TrackUnmuted,e,n)})).on(JO.ParticipantMetadataChanged,(e=>{this.emitWhenConnected(GO.ParticipantMetadataChanged,e,n)})).on(JO.ConnectionQualityChanged,(e=>{this.emitWhenConnected(GO.ConnectionQualityChanged,e,n)})).on(JO.ParticipantPermissionsChanged,(e=>{this.emitWhenConnected(GO.ParticipantPermissionsChanged,e,n)})).on(JO.TrackSubscriptionStatusChanged,((e,t)=>{this.emitWhenConnected(GO.TrackSubscriptionStatusChanged,e,t,n)})).on(JO.TrackSubscriptionPermissionChanged,((e,t)=>{this.emitWhenConnected(GO.TrackSubscriptionPermissionChanged,e,t,n)})),t&&n.updateInfo(t),n}sendSyncState(){var e,t;if(void 0===this.engine.subscriber||null===this.engine.subscriber.pc.localDescription)return;const n=this.engine.subscriber.pc.localDescription,r=this.engine.subscriber.pc.remoteDescription,o=null===(t=null===(e=this.connOptions)||void 0===e?void 0:e.autoSubscribe)||void 0===t||t,i=new Array;this.participants.forEach((e=>{e.tracks.forEach((e=>{e.isDesired!==o&&i.push(e.trackSid)}))})),this.engine.client.sendSyncState({answer:eC({sdp:n.sdp,type:n.type}),offer:r?eC({sdp:r.sdp,type:r.type}):void 0,subscription:{trackSids:i,subscribe:!o,participantTracks:[]},publishTracks:this.localParticipant.publishedTracksInfo(),dataChannels:this.localParticipant.dataChannelsInfo()})}updateSubscriptions(){for(const e of this.participants.values())for(const t of e.videoTracks.values())t.isSubscribed&&t instanceof VE&&t.emitTrackUpdate()}setAndEmitConnectionState(e){return e!==this.state&&(this.state=e,this.emit(GO.ConnectionStateChanged,this.state),!0)}emitWhenConnected(e){if(this.state===TC.Connected){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=DC(l,r,c),p=r,f={},h=0;for(let n=0;ne.concat(t,t+"-start",t+"-end")),[]),{left:"right",right:"left",bottom:"top",top:"bottom"});function HC(e){return e.replace(/left|right|bottom|top/g,(e=>ZC[e]))}function qC(e,t,n){void 0===n&&(n=!1);const r=_C(e),o=NC(e),i=AC(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=HC(a)),{main:a,cross:HC(a)}}const $C={start:"end",end:"start"};function VC(e){return e.replace(/start|end/g,(e=>$C[e]))}const GC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:h=!0,...m}=e,y=MC(r),v=MC(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),g=d||(v||!h?[HC(a)]:function(e){const t=HC(e);return[VC(e),t,VC(t)]}(a));d||"none"===f||g.push(...function(e,t,n,r){const o=_C(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(MC(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(VC)))),i}(a,h,f,b));const S=[a,...g],w=await BC(t,m),k=[];let O=(null==(n=o.flip)?void 0:n.overflows)||[];if(l&&k.push(w[y]),u){const{main:e,cross:t}=qC(r,i,b);k.push(w[e],w[t])}if(O=[...O,{placement:r,overflows:k}],!k.every((e=>e<=0))){var P,E;const e=((null==(P=o.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(E=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(p){case"bestFit":{var C;const e=null==(C=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:C[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},JC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=MC(n),s=_C(n),c="x"===NC(n),l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const KC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=e,l={x:n,y:r},u=await BC(t,c),d=NC(MC(o)),p=function(e){return"x"===e?"y":"x"}(d);let f=l[d],h=l[p];if(i){const e="y"===d?"bottom":"right";f=WC(f+u["y"===d?"top":"left"],f,f-u[e])}if(a){const e="y"===p?"bottom":"right";h=WC(h+u["y"===p?"top":"left"],h,h-u[e])}const m=s.fn({...t,[d]:f,[p]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function YC(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function QC(e){return YC(e).getComputedStyle(e)}function XC(e){return e instanceof YC(e).Node}function eT(e){return XC(e)?(e.nodeName||"").toLowerCase():""}let tT;function nT(){if(tT)return tT;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(tT=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),tT):navigator.userAgent}function rT(e){return e instanceof YC(e).HTMLElement}function oT(e){return e instanceof YC(e).Element}function iT(e){return"undefined"!=typeof ShadowRoot&&(e instanceof YC(e).ShadowRoot||e instanceof ShadowRoot)}function aT(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=QC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function sT(e){return["table","td","th"].includes(eT(e))}function cT(e){const t=/firefox/i.test(nT()),n=QC(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function lT(){return/^((?!chrome|android).)*safari/i.test(nT())}function uT(e){return["html","body","#document"].includes(eT(e))}const dT=Math.min,pT=Math.max,fT=Math.round;function hT(e){const t=QC(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=rT(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=fT(n)!==i||fT(r)!==a;return s&&(n=i,r=a),{width:n,height:r,fallback:s}}function mT(e){return oT(e)?e:e.contextElement}const yT={x:1,y:1};function vT(e){const t=mT(e);if(!rT(t))return yT;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=hT(t);let a=(i?fT(n.width):n.width)/r,s=(i?fT(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function bT(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),s=mT(e);let c=yT;t&&(r?oT(r)&&(c=vT(r)):c=vT(e));const l=s?YC(s):window,u=lT()&&n;let d=(a.left+(u&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(a.top+(u&&(null==(i=l.visualViewport)?void 0:i.offsetTop)||0))/c.y,f=a.width/c.x,h=a.height/c.y;if(s){const e=YC(s),t=r&&oT(r)?YC(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=vT(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,p*=e.y,f*=e.x,h*=e.y,d+=t.x,p+=t.y,n=YC(n).frameElement}}return UC({width:f,height:h,x:d,y:p})}function gT(e){return((XC(e)?e.ownerDocument:e.document)||window.document).documentElement}function ST(e){return oT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function wT(e){return bT(gT(e)).left+ST(e).scrollLeft}function kT(e){if("html"===eT(e))return e;const t=e.assignedSlot||e.parentNode||iT(e)&&e.host||gT(e);return iT(t)?t.host:t}function OT(e){const t=kT(e);return uT(t)?t.ownerDocument.body:rT(t)&&aT(t)?t:OT(t)}function PT(e,t){var n;void 0===t&&(t=[]);const r=OT(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=YC(r);return o?t.concat(i,i.visualViewport||[],aT(r)?r:[]):t.concat(r,PT(r))}function ET(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=YC(e),r=gT(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=lT();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=gT(e),n=ST(e),r=e.ownerDocument.body,o=pT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+wT(e);const s=-n.scrollTop;return"rtl"===QC(r).direction&&(a+=pT(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(gT(e));else if(oT(t))r=function(e,t){const n=bT(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=rT(e)?vT(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n={...t};if(lT()){var o,i;const t=YC(e);n.x-=(null==(o=t.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(i=t.visualViewport)?void 0:i.offsetTop)||0}r=n}return UC(r)}function CT(e,t){return rT(e)&&"fixed"!==QC(e).position?t?t(e):e.offsetParent:null}function TT(e,t){const n=YC(e);if(!rT(e))return n;let r=CT(e,t);for(;r&&sT(r)&&"static"===QC(r).position;)r=CT(r,t);return r&&("html"===eT(r)||"body"===eT(r)&&"static"===QC(r).position&&!cT(r))?n:r||function(e){let t=kT(e);for(;rT(t)&&!uT(t);){if(cT(t))return t;t=kT(t)}return null}(e)||n}function xT(e,t,n){const r=rT(t),o=gT(t),i=bT(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==eT(t)||aT(o))&&(a=ST(t)),rT(t)){const e=bT(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=wT(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}const RT={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=PT(e).filter((e=>oT(e)&&"body"!==eT(e))),o=null;const i="fixed"===QC(e).position;let a=i?kT(e):e;for(;oT(a)&&!uT(a);){const e=QC(a),t=cT(a);"fixed"===e.position&&(o=null),(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==a)),a=kT(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],c=a.reduce(((e,n)=>{const r=ET(t,n,o);return e.top=pT(r.top,e.top),e.right=dT(r.right,e.right),e.bottom=dT(r.bottom,e.bottom),e.left=pT(r.left,e.left),e}),ET(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=rT(n),i=gT(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==eT(n)||aT(i))&&(a=ST(n)),rT(n))){const e=bT(n);s=vT(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+c.x,y:t.y*s.y-a.scrollTop*s.y+c.y}},isElement:oT,getDimensions:function(e){return hT(e)},getOffsetParent:TT,getDocumentElement:gT,getScale:vT,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||TT,i=this.getDimensions;return{reference:xT(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===QC(e).direction};var jT=a(8804);function IT(e){return"function"==typeof e}function _T(e){return function(t){if(function(e){return IT(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var AT=function(e,t){return AT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},AT(e,t)};function MT(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}AT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function NT(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function LT(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function UT(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof BT?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(o[e](t))}catch(e){u(i[0][3],e)}}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}(this,arguments,(function(){var t,n,r;return NT(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,BT(t.read())];case 3:return n=o.sent(),r=n.value,n.done?[4,BT(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,BT(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Ex(e){return IT(null==e?void 0:e.getReader)}function Cx(e){if(e instanceof yx)return e;if(null!=e){if(bx(e))return function(e){return new yx((function(t){var n=e[hx]();if(IT(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}(e);if(px(e))return r=e,new yx((function(e){for(var t=0;t0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?HT:(this.currentObservers=null,i.push(e),new ZT((function(){t.currentObservers=null,WT(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,o=t.isStopped;n?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new yx;return e.source=this,e},t.create=function(e,t){return new zx(e,t)},t}(yx),zx=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return MT(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:HT},t}(Fx),Wx=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return MT(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Fx),Zx=Array.isArray;function Hx(){for(var e=[],t=0;tnew Promise(((r,o)=>{var i=e=>{try{s(n.next(e))}catch(e){o(e)}},a=e=>{try{s(n.throw(e))}catch(e){o(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())})),lR="lk";var uR=[GO.ConnectionStateChanged,GO.RoomMetadataChanged,GO.ActiveSpeakersChanged,GO.ConnectionQualityChanged,GO.ParticipantConnected,GO.ParticipantDisconnected,GO.ParticipantPermissionsChanged,GO.ParticipantMetadataChanged,GO.TrackMuted,GO.TrackUnmuted,GO.TrackPublished,GO.TrackUnpublished,GO.TrackStreamStateChanged,GO.TrackSubscriptionFailed,GO.TrackSubscriptionPermissionChanged,GO.TrackSubscriptionStatusChanged,GO.LocalTrackPublished,GO.LocalTrackUnpublished],dR=(JO.ConnectionQualityChanged,JO.IsSpeakingChanged,JO.ParticipantMetadataChanged,JO.ParticipantPermissionsChanged,JO.TrackMuted,JO.TrackUnmuted,JO.TrackPublished,JO.TrackUnpublished,JO.TrackStreamStateChanged,JO.TrackSubscriptionFailed,JO.TrackSubscriptionPermissionChanged,JO.TrackSubscriptionStatusChanged,JO.LocalTrackPublished,JO.LocalTrackUnpublished,jT.getLogger("lk-components-js"));dR.setDefaultLevel("WARN");var pR=dR,fR=[{columns:1,rows:1,name:"1x1",minTiles:1,maxTiles:1,minWidth:0,minHeight:0},{columns:1,rows:2,name:"1x2",minTiles:2,maxTiles:2,minWidth:0,minHeight:0},{columns:2,rows:1,name:"2x1",minTiles:2,maxTiles:2,minWidth:800,minHeight:0},{columns:2,rows:2,name:"2x2",minTiles:3,maxTiles:4,minWidth:560,minHeight:0},{columns:3,rows:3,name:"3x3",minTiles:5,maxTiles:9,minWidth:700,minHeight:0},{columns:4,rows:4,name:"4x4",minTiles:10,maxTiles:16,minWidth:960,minHeight:0},{columns:5,rows:5,name:"5x5",minTiles:17,maxTiles:25,minWidth:1100,minHeight:0}];function hR(e,t,n,r){let o=0,i=e.find(((e,n,r)=>{o=n;const i=-1!==r.findIndex(((t,r)=>{const o=r>n,i=t.maxTiles===e.maxTiles;return o&&i}));return e.maxTiles>=t&&!i}));if(void 0===i){if(i=e[e.length-1],!i)throw new Error("No layout or fallback layout found.");pR.warn(`No layout found for: participantCount: ${t}, width/height: ${n}/${r} fallback to biggest available layout (${i.name}).`)}if((n0){const t=e[o-1];i=hR(e.slice(0,o),t.maxTiles,n,r)}return i}function mR(e){return"object"==typeof e}function yR(e){return Array.isArray(e)&&e.filter(mR).length>0}function vR(e){return void 0!==e&&(function(e){var t;return!!e&&(e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&e.hasOwnProperty("track")&&void 0!==(null==(t=e.publication)?void 0:t.track))}(e)||function(e){return!!e&&(e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&e.hasOwnProperty("publication")&&void 0!==e.publication)}(e))}function bR(e){return!!e&&e.hasOwnProperty("participant")&&e.hasOwnProperty("source")&&void 0===e.publication}function gR(e){return"string"==typeof e||"number"==typeof e?`${e}`:vR(e)?`${e.participant.identity}_${e.publication.source}`:`${e.participant.identity}_${e.source}`}function SR(e,t){var n,r,o,i;return(null!=(r=null==(n=e.joinedAt)?void 0:n.getTime())?r:0)-(null!=(i=null==(o=t.joinedAt)?void 0:o.getTime())?i:0)}function wR(e,t){const n=Math.max(e.length,t.length);return new Array(n).fill([]).map(((n,r)=>[e[r],t[r]]))}function kR(e,t,n){return e.filter((e=>!t.map((e=>n(e))).includes(n(e))))}function OR(e){return e.map((e=>"string"==typeof e||"number"==typeof e?`${e}`:gR(e)))}function PR(e,t){const n=t.findIndex((t=>gR(t)===gR(e)));if(-1===n)throw new Error(`Element not part of the array: ${gR(e)} not in ${OR(t)}`);return n}function ER(e,t){var n;return n=t,e.reduce(((e,t,r)=>r%n==0?[...e,[t]]:[...e.slice(0,-1),[...e.slice(-1)[0],t]]),[])}function CR(e,...t){return new yx((n=>{const r=()=>{n.next(e)};return t.forEach((t=>{e.on(t,r)})),()=>{t.forEach((t=>{e.off(t,r)}))}})).pipe(Ux(e))}function TR(e){return`${lR}-${e}`}function xR(e){if(vR(e))return e.publication;{const{source:t,name:n,participant:r}=e;if(t&&n)return r.getTracks().find((e=>e.source===t&&e.trackName===n));if(n)return r.getTrackByName(n);if(t)return r.getTrack(t);throw new Error("At least one of source and name needs to be defined")}}function RR(e,...t){return new yx((n=>{const r=()=>{n.next(e)};return t.forEach((t=>{e.on(t,r)})),()=>{t.forEach((t=>{e.off(t,r)}))}})).pipe(Ux(e))}function jR(e){const t=RR(e,JO.TrackMuted,JO.TrackUnmuted,JO.ParticipantPermissionsChanged,JO.TrackPublished,JO.TrackUnpublished,JO.TrackSubscribed,JO.TrackUnsubscribed,JO.LocalTrackPublished,JO.LocalTrackUnpublished).pipe(dx((e=>{const{isMicrophoneEnabled:t,isCameraEnabled:n,isScreenShareEnabled:r}=e,o=e.getTrack(cE.Source.Microphone);return{isCameraEnabled:n,isMicrophoneEnabled:t,isScreenShareEnabled:r,cameraTrack:e.getTrack(cE.Source.Camera),microphoneTrack:o,participant:e}})));return t}function IR(e,t){return new yx((n=>{const r=(...e)=>{n.next(e)};return e.on(t,r),()=>{e.off(t,r)}}))}function _R(e,t){var n,r;return RR(e,JO.TrackMuted,JO.TrackUnmuted,JO.TrackSubscribed,JO.TrackUnsubscribed,JO.LocalTrackPublished,JO.LocalTrackUnpublished).pipe(dx((e=>{var n;const r=e.getTrack(t);return null==(n=null==r?void 0:r.isMuted)||n})),Ux(null==(r=null==(n=e.getTrack(t))?void 0:n.isMuted)||r))}function AR(e,t){const n=new Wx(void 0),r=t?jR(t.localParticipant).pipe(dx((t=>{var n,r,o;let i;switch(e){case"videoinput":i=null==(n=t.cameraTrack)?void 0:n.track;break;case"audioinput":i=null==(r=t.microphoneTrack)?void 0:r.track;break;default:i=void 0}return null==(o=null==i?void 0:i.mediaStreamTrack.getSettings())?void 0:o.deviceId})),function(){for(var e=[],t=0;tcR(this,null,(function*(){var o,i,a,s;if(t){pR.debug(`Switching active device of kind "${e}" with id ${r}.`),yield t.switchActiveDevice(e,r);let c=r;"videoinput"===e?c=yield null==(i=null==(o=t.localParticipant.getTrack(cE.Source.Camera))?void 0:o.track)?void 0:i.getDeviceId():"audioinput"===e&&(c=yield null==(s=null==(a=t.localParticipant.getTrack(cE.Source.Microphone))?void 0:a.track)?void 0:s.getDeviceId()),c!==r&&"default"!==r&&pR.warn(`Failed to select the desired device. Desired: ${r}. Actual: ${c}`),n.next("default"===r?r:c)}else pR.debug("Skip the device switch because the room object is not available. "),n.next(r)}))}}function MR(e){return CR(e,GO.AudioPlaybackStatusChanged).pipe(dx((e=>({canPlayAudio:e.canPlaybackAudio}))))}function NR(){return{className:TR("start-audio-button"),roomAudioPlaybackAllowedObservable:MR,handleStartAudioPlayback:e=>cR(this,null,(function*(){pR.info("Start Audio for room: ",e),yield e.startAudio()}))}}function DR(e,t,n=!0){const r=[e.localParticipant,...Array.from(e.participants.values())],o=[];return r.forEach((e=>{t.forEach((t=>{const r=Array.from(e.tracks.values()).filter((e=>e.source===t&&(!n||e.track))).map((t=>({participant:e,publication:t,track:t.track,source:t.source})));o.push(...r)}))})),{trackReferences:o,participants:r}}function LR(e,t=1e3){if(null===e)return qx(!1);const n=Kx(e,"mousemove").pipe(dx((()=>!0))),r=n.pipe(function(e,t){var n=function(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,o=n.each,i=n.with,a=void 0===i?aR:i,s=n.scheduler,c=void 0===s?null!=t?t:oR:s,l=n.meta,u=void 0===l?null:l;if(null==r&&null==o)throw new TypeError("No timeout provided.");return _T((function(e,t){var n,i,s=null,l=0,d=function(e){i=xx(t,c,(function(){try{n.unsubscribe(),Cx(a({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe(lx(t,(function(e){null==i||i.unsubscribe(),l++,t.next(s=e),o>0&&d(o)}),void 0,void 0,(function(){(null==i?void 0:i.closed)||null==i||i.unsubscribe(),s=null}))),!l&&d(null!=r?"number"==typeof r?r:+r-c.now():o)}))}({each:t,with:()=>{return Lx(qx(!1),r.pipe((e=n,_T((function(t,n){var r=!1,o=lx(n,(function(){null==o||o.unsubscribe(),r=!0}),KT);Cx(e).subscribe(o),t.subscribe(lx(n,(function(e){return r&&n.next(e)})))})))));var e}}),(void 0===i&&(i=mx),o=null!=o?o:sR,_T((function(e,t){var n,r=!0;e.subscribe(lx(t,(function(e){var a=i(e);!r&&o(n,a)||(r=!1,n=a,t.next(e))})))}))));var o,i;return r}new TextEncoder,new TextDecoder;var UR=pR,BR=Object.defineProperty,FR=Object.defineProperties,zR=Object.getOwnPropertyDescriptors,WR=Object.getOwnPropertySymbols,ZR=Object.prototype.hasOwnProperty,HR=Object.prototype.propertyIsEnumerable,qR=(e,t,n)=>t in e?BR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$R=(e,t)=>{for(var n in t||(t={}))ZR.call(t,n)&&qR(e,n,t[n]);if(WR)for(var n of WR(t))HR.call(t,n)&&qR(e,n,t[n]);return e},VR=(e,t)=>FR(e,zR(t)),GR=(e,t)=>{var n={};for(var r in e)ZR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&WR)for(var r of WR(e))t.indexOf(r)<0&&HR.call(e,r)&&(n[r]=e[r]);return n};function JR(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function KR(...e){const t=$R({},e[0]);for(let n=1;n=65&&e.charCodeAt(2)<=90?t[e]=JR(n,o):t[e]="className"!==e&&"UNSAFE_className"!==e||"string"!=typeof n||"string"!=typeof o?void 0!==o?o:n:(0,Zt.Z)(n,o)}}return t}function YR(e){return void 0!==e}function QR(...e){return KR(...e.filter(YR))}var XR=e.createContext(void 0);function ej(){return e.useContext(XR)}var tj=e.createContext(void 0);var nj=e.createContext(void 0);function rj(){return e.useContext(nj)}function oj(t){var n;const r=rj(),o=e.useContext(tj),i=null!=(n=null!=t?t:r)?n:null==o?void 0:o.participant;if(!i)throw new Error("No participant provided, make sure you are inside a participant context or pass the participant explicitly");return i}var ij=e.createContext(void 0);function aj(){const t=e.useContext(ij);if(!t)throw Error("tried to access room context outside of livekit room component");return t}function sj(){return e.useContext(ij)}function cj(e){const t=sj(),n=null!=e?e:t;if(!n)throw new Error("No room provided, make sure you are inside a Room context or pass the room explicitly");return n}function lj(t,n){const[r,o]=e.useState(n);return e.useEffect((()=>{if("undefined"==typeof window||!t)return;const e=t.subscribe(o);return()=>e.unsubscribe()}),[t]),r}function uj(t){const n=cj(t),r=e.useMemo((()=>function(e){return function(e,t){return new yx((n=>{const r=(...e)=>{n.next(e)};return e.on(t,r),()=>{e.off(t,r)}}))}(e,GO.ConnectionStateChanged).pipe(dx((([e])=>e)),Ux(e.state))}(n)),[n]);return lj(r,n.state)}function dj(t){var n=t,{room:r}=n,o=GR(n,["room"]);const i=uj(r);return e.createElement("div",$R({},o),i)}function pj({props:t}){const{dispatch:n}=function(){const t=e.useContext(XR);if(!t)throw Error("Tried to access LayoutContext context outside a LayoutContextProvider provider.");return t}().widget,{className:r}=e.useMemo((()=>({className:[TR("button"),TR("chat-toggle")].join(" ")})),[]);return{mergedProps:e.useMemo((()=>QR(t,{className:r,onClick:()=>{n&&n({msg:"toggle_chat"})}})),[t,r,n])}}function fj(t){const{mergedProps:n}=pj({props:t});return e.createElement("button",$R({},n),t.children)}function hj(t){const{buttonProps:n}=function(t){const n=aj(),r=uj(n),o=e.useMemo((()=>{const{className:e,disconnect:o}=function(e){return{className:TR("disconnect-button"),disconnect:t=>{e.disconnect(t)}}}(n);return QR(t,{className:e,onClick:()=>{var e;return o(null==(e=t.stopTracks)||e)},disabled:r===TC.Disconnected})}),[n,t,r]);return{buttonProps:o}}(t);return e.createElement("button",$R({},n),t.children)}var mj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708L11 10.293V4.5A1.5 1.5 0 0 0 9.5 3H3.707zM0 4.5a1.5 1.5 0 0 1 .943-1.393l9.532 9.533c-.262.224-.603.36-.975.36h-8A1.5 1.5 0 0 1 0 11.5z"}),e.createElement("path",{d:"m15.2 3.6-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),yj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M0 4.5A1.5 1.5 0 0 1 1.5 3h8A1.5 1.5 0 0 1 11 4.5v7A1.5 1.5 0 0 1 9.5 13h-8A1.5 1.5 0 0 1 0 11.5zM15.2 3.6l-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),vj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 2.75A2.75 2.75 0 0 1 2.75 0h10.5A2.75 2.75 0 0 1 16 2.75v13.594a.75.75 0 0 1-1.234.572l-3.691-3.12a1.25 1.25 0 0 0-.807-.296H2.75A2.75 2.75 0 0 1 0 10.75v-8ZM2.75 1.5c-.69 0-1.25.56-1.25 1.25v8c0 .69.56 1.25 1.25 1.25h7.518c.65 0 1.279.23 1.775.65l2.457 2.077V2.75c0-.69-.56-1.25-1.25-1.25H2.75Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 4.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Z",clipRule:"evenodd"})),bj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("path",{fill:"currentcolor",fillRule:"evenodd",d:"M5.293 2.293a1 1 0 0 1 1.414 0l4.823 4.823a1.25 1.25 0 0 1 0 1.768l-4.823 4.823a1 1 0 0 1-1.414-1.414L9.586 8 5.293 3.707a1 1 0 0 1 0-1.414z",clipRule:"evenodd"})),gj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5},e.createElement("path",{d:"M10 1.75h4.25m0 0V6m0-4.25L9 7M6 14.25H1.75m0 0V10m0 4.25L7 9"}))),Sj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 2.75A2.75 2.75 0 0 1 4.75 0h6.5A2.75 2.75 0 0 1 14 2.75v10.5A2.75 2.75 0 0 1 11.25 16h-6.5A2.75 2.75 0 0 1 2 13.25v-.5a.75.75 0 0 1 1.5 0v.5c0 .69.56 1.25 1.25 1.25h6.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25h-6.5c-.69 0-1.25.56-1.25 1.25v.5a.75.75 0 0 1-1.5 0v-.5Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8.78 7.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06l.97-.97H1.75a.75.75 0 0 1 0-1.5h4.69l-.97-.97a.75.75 0 0 1 1.06-1.06l2.25 2.25Z",clipRule:"evenodd"})),wj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{d:"M12.227 11.52a5.477 5.477 0 0 0 1.246-2.97.5.5 0 0 0-.995-.1 4.478 4.478 0 0 1-.962 2.359l-1.07-1.07C10.794 9.247 11 8.647 11 8V3a3 3 0 0 0-6 0v1.293L1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708zM8 12.5c.683 0 1.33-.152 1.911-.425l.743.743c-.649.359-1.378.59-2.154.66V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .995-.098A4.5 4.5 0 0 0 8 12.5z"}),e.createElement("path",{d:"M8.743 10.907 5 7.164V8a3 3 0 0 0 3.743 2.907z"})),kj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("path",{fillRule:"evenodd",d:"M2.975 8.002a.5.5 0 0 1 .547.449 4.5 4.5 0 0 0 8.956 0 .5.5 0 1 1 .995.098A5.502 5.502 0 0 1 8.5 13.478V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .448-.547z",clipRule:"evenodd"}),e.createElement("path",{d:"M5 3a3 3 0 1 1 6 0v5a3 3 0 0 1-6 0z"})),Oj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"})),Pj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}))),Ej=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentcolor"},t),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M6 6.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}),e.createElement("path",{d:"M12 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5z"}))),Cj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},t),e.createElement("g",{opacity:.25},e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4Zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-9Zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V.5Z"}),e.createElement("path",{d:"M0 11.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4Zm6-5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-9Zm6-6a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V.5Z"}))),Tj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none"},t),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 2.75A2.75 2.75 0 0 1 2.75 0h14.5A2.75 2.75 0 0 1 20 2.75v10.5A2.75 2.75 0 0 1 17.25 16H2.75A2.75 2.75 0 0 1 0 13.25V2.75ZM2.75 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h14.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25H2.75Z",clipRule:"evenodd"}),e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.47 4.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v4.69a.75.75 0 0 1-1.5 0V6.56l-.97.97a.75.75 0 0 1-1.06-1.06l2.25-2.25Z",clipRule:"evenodd"})),xj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none"},t),e.createElement("g",{fill:"currentColor"},e.createElement("path",{d:"M7.28 4.22a.75.75 0 0 0-1.06 1.06L8.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L10 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L10 6.94z"}),e.createElement("path",{fillRule:"evenodd",d:"M2.75 0A2.75 2.75 0 0 0 0 2.75v10.5A2.75 2.75 0 0 0 2.75 16h14.5A2.75 2.75 0 0 0 20 13.25V2.75A2.75 2.75 0 0 0 17.25 0zM1.5 2.75c0-.69.56-1.25 1.25-1.25h14.5c.69 0 1.25.56 1.25 1.25v10.5c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25z",clipRule:"evenodd"}))),Rj=t=>e.createElement("svg",$R({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},t),e.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5},e.createElement("path",{d:"M13.25 7H9m0 0V2.75M9 7l5.25-5.25M2.75 9H7m0 0v4.25M7 9l-5.25 5.25"})));function jj(t){var n=t,{trackSource:r,participant:o}=n,i=GR(n,["trackSource","participant"]);const{mergedProps:a,inFocus:s}=function({trackSource:t,participant:n,props:r}){const o=oj(n),i=ej(),{className:a}=e.useMemo((()=>({className:[TR("button"),TR("focus-toggle-button")].join(" ")})),[]),s=e.useMemo((()=>{const e=o.getTrack(t);return!(!(null==i?void 0:i.pin.state)||!e)&&(n={participant:o,source:t,publication:e},void 0!==(r=i.pin.state)&&(vR(n)?r.some((e=>e.participant.identity===n.participant.identity&&vR(e)&&e.publication.trackSid===n.publication.trackSid)):!!bR(n)&&r.some((e=>e.participant.identity===n.participant.identity&&bR(e)&&e.source===n.source))));var n,r}),[o,t,i]);return{mergedProps:e.useMemo((()=>QR(r,{className:a,onClick:e=>{var n;null==(n=r.onClick)||n.call(r,e);const a=o.getTrack(t);(null==i?void 0:i.pin.dispatch)&&a&&(s?i.pin.dispatch({msg:"clear_pin"}):i.pin.dispatch({msg:"set_pin",trackReference:{participant:o,publication:a,source:a.source}}))}})),[r,a,o,t,s,i]),inFocus:s}}({trackSource:r,participant:o,props:i});return e.createElement(XR.Consumer,null,(t=>void 0!==t&&e.createElement("button",$R({},a),i.children?i.children:s?e.createElement(Rj,null):e.createElement(gj,null))))}function Ij(t){var n=t,{kind:r,initialSelection:o,onActiveDeviceChange:i,onDeviceListChange:a}=n,s=GR(n,["kind","initialSelection","onActiveDeviceChange","onDeviceListChange"]);const c=sj(),{devices:l,activeDeviceId:u,setActiveMediaDevice:d,className:p}=function({kind:t,room:n}){const r=sj(),o=lj(e.useMemo((()=>function(e,t=!0){var n;const r=()=>cR(this,null,(function*(){const n=yield IC.getLocalDevices(e,t);o.next(n)})),o=new Fx,i=o.pipe((a=()=>{var e;null==(e=null==navigator?void 0:navigator.mediaDevices)||e.removeEventListener("devicechange",r)},_T((function(e,t){try{e.subscribe(t)}finally{t.add(a)}}))));var a;if("undefined"!=typeof window){if(!window.isSecureContext)throw new Error("Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices");null==(n=null==navigator?void 0:navigator.mediaDevices)||n.addEventListener("devicechange",r),r()}return i}(t)),[t]),[]),[i,a]=e.useState(""),{className:s,activeDeviceObservable:c,setActiveMediaDevice:l}=e.useMemo((()=>AR(t,null!=n?n:r)),[t,n,r]);return e.useEffect((()=>{const e=c.subscribe((e=>{e&&a(e)}));return()=>{null==e||e.unsubscribe()}}),[c]),{devices:o,className:s,activeDeviceId:i,setActiveMediaDevice:l}}({kind:r,room:c});e.useEffect((()=>{o&&d(o)})),e.useEffect((()=>{"function"==typeof a&&a(l)}),[a,l]);const f=e=>{return t=this,n=null,r=function*(){d(e),null==i||i(e)},new Promise(((e,o)=>{var i=e=>{try{s(r.next(e))}catch(e){o(e)}},a=e=>{try{s(r.throw(e))}catch(e){o(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,n)).next())}));var t,n,r},h=e.useMemo((()=>QR(s,{className:p},{className:"lk-list"})),[p,s]);return e.createElement("ul",$R({},h),l.map((t=>e.createElement("li",{key:t.deviceId,id:t.deviceId,"data-lk-active":t.deviceId===u,"aria-selected":t.deviceId===u,role:"option"},e.createElement("button",{className:"lk-button",onClick:()=>f(t.deviceId)},t.label)))))}function _j(t){var n=t,{label:r="Allow Audio"}=n,o=GR(n,["label"]);const i=aj(),{mergedProps:a}=function({room:t,props:n}){const{className:r,roomAudioPlaybackAllowedObservable:o,handleStartAudioPlayback:i}=e.useMemo((()=>NR()),[]),a=e.useMemo((()=>o(t)),[t,o]),{canPlayAudio:s}=lj(a,{canPlayAudio:!1});return{mergedProps:e.useMemo((()=>QR(n,{className:r,onClick:()=>{i(t)},style:{display:s?"none":"block"}})),[n,r,s,i,t]),canPlayAudio:s}}({room:i,props:o});return e.createElement("button",$R({},a),r)}function Aj(t,n){switch(t){case cE.Source.Microphone:return n?e.createElement(kj,null):e.createElement(wj,null);case cE.Source.Camera:return n?e.createElement(yj,null):e.createElement(mj,null);case cE.Source.ScreenShare:return n?e.createElement(xj,null):e.createElement(Tj,null);default:return}}function Mj(t){var n=t,{showIcon:r}=n,o=GR(n,["showIcon"]);const{buttonProps:i,enabled:a}=function(t){var n,r=t,{source:o,onChange:i,initialState:a,captureOptions:s}=r,c=GR(r,["source","onChange","initialState","captureOptions"]);const l=sj(),u=null==(n=null==l?void 0:l.localParticipant)?void 0:n.getTrack(o),{toggle:d,className:p,pendingObserver:f,enabledObserver:h}=e.useMemo((()=>l?function(e,t,n){const{localParticipant:r}=t,o=(e,t)=>{let n=!1;switch(e){case cE.Source.Camera:n=t.isCameraEnabled;break;case cE.Source.Microphone:n=t.isMicrophoneEnabled;break;case cE.Source.ScreenShare:n=t.isScreenShareEnabled}return n},i=jR(r).pipe(dx((t=>o(e,t.participant))),Ux(o(e,r))),a=new Fx;return{className:TR("button"),toggle:(t,o)=>cR(this,null,(function*(){try{switch(null!=o||(o=n),a.next(!0),e){case cE.Source.Camera:yield r.setCameraEnabled(null!=t?t:!r.isCameraEnabled,o);break;case cE.Source.Microphone:yield r.setMicrophoneEnabled(null!=t?t:!r.isMicrophoneEnabled,o);break;case cE.Source.ScreenShare:yield r.setScreenShareEnabled(null!=t?t:!r.isScreenShareEnabled,o)}}finally{a.next(!1)}})),enabledObserver:i,pendingObserver:a.asObservable()}}(o,l,s):function(){let e=!1;const t=new Fx,n=new Fx;return{className:TR("button"),toggle:r=>{n.next(!0),e=null!=r?r:!e,t.next(e),n.next(!1)},enabledObserver:t.asObservable(),pendingObserver:n.asObservable()}}()),[l,o,JSON.stringify(s)]),m=lj(f,!1),y=lj(h,null!=a?a:!!(null==u?void 0:u.isEnabled));e.useEffect((()=>{null==i||i(y)}),[y,i]),e.useEffect((()=>{void 0!==a&&(UR.debug("forcing initial toggle state",o,a),d(a))}),[]);const v=e.useMemo((()=>KR(c,{className:p})),[c,p]),b=e.useCallback((e=>{var t;d(),null==(t=c.onClick)||t.call(c,e)}),[c,d]);return{toggle:d,enabled:y,pending:m,track:u,buttonProps:VR($R({},v),{"aria-pressed":y,"data-lk-source":o,"data-lk-enabled":y,disabled:m,onClick:b})}}(o);return e.createElement("button",$R({},i),(null==r||r)&&Aj(o.source,a),o.children)}function Nj(t){var n;const{className:r,quality:o}=function(t={}){const n=oj(t.participant),{className:r,connectionQualityObserver:o}=e.useMemo((()=>function(e){const t=TR("connection-quality"),n=function(e){return IR(e,JO.ConnectionQualityChanged).pipe(dx((([e])=>e)),Ux(e.connectionQuality))}(e);return{className:t,connectionQualityObserver:n}}(n)),[n]);return{className:r,quality:lj(o,AE.Unknown)}}(t),i=e.useMemo((()=>VR($R({},QR(t,{className:r})),{"data-lk-quality":o})),[o,t,r]);return e.createElement("div",$R({},i),null!=(n=t.children)?n:function(t){switch(t){case AE.Excellent:return e.createElement(Oj,null);case AE.Good:return e.createElement(Pj,null);case AE.Poor:return e.createElement(Ej,null);default:return e.createElement(Cj,null)}}(o))}function Dj(t){var n=t,{participant:r}=n,o=GR(n,["participant"]);const i=oj(r),{className:a,infoObserver:s}=e.useMemo((()=>function(e){const t=function(e){const t=RR(e,JO.ParticipantMetadataChanged).pipe(dx((({name:e,identity:t,metadata:n})=>({name:e,identity:t,metadata:n}))),Ux({name:e.name,identity:e.identity,metadata:e.metadata}));return t}(e);return{className:"lk-participant-name",infoObserver:t}}(i)),[i]),{identity:c,name:l}=lj(s,{name:i.name,identity:i.identity,metadata:i.metadata}),u=e.useMemo((()=>QR(o,{className:a,"data-lk-participant-name":l})),[o,a,l]);return e.createElement("span",$R({},u),""!==l?l:c,o.children)}var Lj,Uj=t=>{var n,r=t,{source:o,participant:i,show:a="always"}=r,s=GR(r,["source","participant","show"]);const{className:c,isMuted:l}=((t,n={})=>{var r;const o=oj(n.participant),{className:i,mediaMutedObserver:a}=e.useMemo((()=>function(e,t){let n="track-muted-indicator-camera";switch(t){case cE.Source.Camera:n="track-muted-indicator-camera";break;case cE.Source.Microphone:n="track-muted-indicator-microphone"}return{className:TR(n),mediaMutedObserver:_R(e,t)}}(o,t)),[o,t]);return{isMuted:lj(a,!!(null==(r=o.getTrack(t))?void 0:r.isMuted)),className:i}})(o,{participant:i}),u="always"===a||"muted"===a&&l||"unmuted"===a&&!l,d=e.useMemo((()=>QR(s,{className:c})),[c,s]);return u?e.createElement("div",VR($R({},d),{"data-lk-muted":l}),null!=(n=s.children)?n:Aj(o,!l)):null},Bj=t=>{const[n,r]=e.useState({width:0,height:0});e.useLayoutEffect((()=>{if(t.current){const{width:e,height:n}=t.current.getBoundingClientRect();r({width:e,height:n})}}),[t.current]);const o=e.useCallback((e=>r(e.contentRect)),[]);return function(t,n){const r=Lj||(Lj=function(){let e=!1,t=[];const n=new Map;if("undefined"==typeof window)return;const r=new ResizeObserver(((r,o)=>{t=t.concat(r),e||window.requestAnimationFrame((()=>{const r=new Set;for(let e=0;en(t[e],o)))}t=[],e=!1})),e=!0}));return{observer:r,subscribe(e,t){var o;r.observe(e);const i=null!=(o=n.get(e))?o:[];i.push(t),n.set(e,i)},unsubscribe(e,t){var o;const i=null!=(o=n.get(e))?o:[];if(1===i.length)return r.unobserve(e),void n.delete(e);const a=i.indexOf(t);-1!==a&&i.splice(a,1),n.set(e,i)}}}()),o=gi(n);e.useLayoutEffect((()=>{let e=!1;const n=t.current;if(n)return null==r||r.subscribe(n,i),()=>{e=!0,null==r||r.unsubscribe(n,i)};function i(t,n){e||o.current(t,n)}}),[t.current,r,o]),null==r||r.observer}(t,o),n};function Fj(t,n){const{width:r,height:o}=Bj(t),i=r>0&&o>0?hR(fR,n,r,o):fR[0];return e.useEffect((()=>{t.current&&i&&(t.current.style.setProperty("--lk-col-count",null==i?void 0:i.columns.toString()),t.current.style.setProperty("--lk-row-count",null==i?void 0:i.rows.toString()))}),[t,i]),{layout:i}}function zj(t,n={}){var r;const o=oj(n.participant),[i,a]=e.useState(!!(null==(r=o.getTrack(t))?void 0:r.isMuted));return e.useEffect((()=>{const e=_R(o,t).subscribe(a);return()=>e.unsubscribe()}),[o,t]),i}function Wj(t,n={}){const[r,o]=e.useState(xR(t)),[i,a]=e.useState(null==r?void 0:r.isMuted),[s,c]=e.useState(null==r?void 0:r.isSubscribed),[l,u]=e.useState(null==r?void 0:r.track),[d,p]=e.useState("landscape"),f=e.useRef(),{className:h,trackObserver:m}=e.useMemo((()=>function(e){const t=xR(e),n=jR(e.participant).pipe(dx((()=>xR(e))),Ux(t));return{className:TR(e.source===cE.Source.Camera||e.source===cE.Source.ScreenShare?"participant-media-video":"participant-media-audio"),trackObserver:n}}(t)),[t.participant.identity,t.source,vR(t)&&t.publication.trackSid]);return e.useEffect((()=>{const e=m.subscribe((e=>{UR.debug("update track",e),o(e),a(null==e?void 0:e.isMuted),c(null==e?void 0:e.isSubscribed),u(null==e?void 0:e.track)}));return()=>null==e?void 0:e.unsubscribe()}),[m]),e.useEffect((()=>{var e,r;return l&&(f.current&&l.detach(f.current),!(null==(e=n.element)?void 0:e.current)||function(e){return e instanceof JE}(t.participant)&&"audio"===(null==l?void 0:l.kind)||l.attach(n.element.current)),f.current=null==(r=n.element)?void 0:r.current,()=>{f.current&&(null==l||l.detach(f.current))}}),[l,n.element]),e.useEffect((()=>{var e,t;if("number"==typeof(null==(e=null==r?void 0:r.dimensions)?void 0:e.width)&&"number"==typeof(null==(t=null==r?void 0:r.dimensions)?void 0:t.height)){const e=r.dimensions.width>r.dimensions.height?"landscape":"portrait";p(e)}}),[r]),{publication:r,isMuted:i,isSubscribed:s,track:l,elementProps:QR(n.props,$R({className:h,"data-lk-local-participant":t.participant.isLocal,"data-lk-source":null==r?void 0:r.source},(null==r?void 0:r.source)===cE.Source.Camera||(null==r?void 0:r.source)===cE.Source.ScreenShare?{"data-lk-orientation":d}:{}))}}function Zj(t,n,r={}){const o=e.useRef([]),i=e.useRef(-1),a=n!==i.current,s="function"==typeof r.customSortFunction?r.customSortFunction(t):function(e){const t=[],n=[],r=[],o=[];e.forEach((e=>{e.participant.isLocal&&e.source===cE.Source.Camera?t.push(e):e.source===cE.Source.ScreenShare?n.push(e):e.source===cE.Source.Camera?r.push(e):o.push(e)}));const i=function(e){const t=[],n=[];return e.forEach((e=>{e.participant.isLocal?t.push(e):n.push(e)})),t.sort(((e,t)=>SR(e.participant,t.participant))),n.sort(((e,t)=>SR(e.participant,t.participant))),[...n,...t]}(n),a=function(e){const t=[],n=[];return e.forEach((e=>{e.participant.isLocal?t.push(e):n.push(e)})),n.sort(((e,t)=>e.participant.isSpeaking&&t.participant.isSpeaking?function(e,t){return t.audioLevel-e.audioLevel}(e.participant,t.participant):e.participant.isSpeaking!==t.participant.isSpeaking?function(e,t){return e.isSpeaking===t.isSpeaking?0:e.isSpeaking?-1:1}(e.participant,t.participant):e.participant.lastSpokeAt!==t.participant.lastSpokeAt?function(e,t){var n,r,o,i;return void 0!==e.lastSpokeAt||void 0!==t.lastSpokeAt?(null!=(r=null==(n=t.lastSpokeAt)?void 0:n.getTime())?r:0)-(null!=(i=null==(o=e.lastSpokeAt)?void 0:o.getTime())?i:0):0}(e.participant,t.participant):vR(e)!==vR(t)?function(e,t){return vR(e)?vR(t)?0:-1:vR(t)?1:0}(e,t):e.participant.isCameraEnabled!==t.participant.isCameraEnabled?function(e,t){const n=e.participant.isCameraEnabled;return n!==t.participant.isCameraEnabled?n?-1:1:0}(e,t):SR(e.participant,t.participant))),[...t,...n]}(r);return[...t,...i,...a,...o]}(t);let c=[...s];if(!1===a)try{c=function(e,t,n){let r=[...e];if(e.length{if(e&&t){const s={dropped:kR(i=ER(r,n)[o],a=t,gR),added:kR(a,i,gR)};(function(e){return 0!==e.added.length||0!==e.dropped.length})(s)&&(pR.debug(`Detected visual changes on page: ${o}, current: ${OR(e)}, next: ${OR(t)}`,{changes:s}),s.added.length===s.dropped.length&&wR(s.added,s.dropped).forEach((([e,t])=>{if(!e||!t)throw new Error(`For a swap action we need a addition and a removal one is missing: ${e}, ${t}`);r=function(e,t,n){const r=PR(e,n),o=PR(t,n);return n.splice(r,1,t),n.splice(o,1,e),n}(e,t,r)})),0===s.added.length&&s.dropped.length>0&&s.dropped.forEach((e=>{r=function(e,t){const n=PR(e,t);return t.splice(n,1),t}(e,r)})),s.added.length>0&&0===s.dropped.length&&s.added.forEach((e=>{var t,n;t=e,n=r,r=[...n,t]})))}var i,a})),r.length>t.length){const n=kR(e,t,gR);r=r.filter((e=>!n.map(gR).includes(gR(e))))}return r}(o.current,s,n)}catch(e){UR.error("Error while running updatePages(): ",e)}return o.current=a?s:c,i.current=n,c}function Hj(t=[cE.Source.Camera,cE.Source.Microphone,cE.Source.ScreenShare,cE.Source.ScreenShareAudio,cE.Source.Unknown],n={}){const r=cj(n.room),[o,i]=e.useState([]),[a,s]=e.useState([]),c=e.useMemo((()=>t.map((e=>mR(e)?e.source:e))),[JSON.stringify(t)]);e.useEffect((()=>{const e=function(e,t,n){var r,o;const i=null!=(r=n.additionalRoomEvents)?r:uR,a=null==(o=n.onlySubscribed)||o;return CR(e,...Array.from(new Set([GO.ParticipantConnected,GO.ConnectionStateChanged,GO.LocalTrackPublished,GO.LocalTrackUnpublished,GO.TrackPublished,GO.TrackUnpublished,GO.TrackSubscriptionStatusChanged,...i]).values())).pipe(dx((e=>{const n=DR(e,t,a);return pR.debug(`TrackReference[] was updated. (length ${n.trackReferences.length})`,n),n})),Ux(DR(e,t,a)))}(r,c,{additionalRoomEvents:n.updateOnlyOn,onlySubscribed:n.onlySubscribed}).subscribe((({trackReferences:e,participants:t})=>{UR.debug("setting track bundles",e,t),i(e),s(t)}));return()=>e.unsubscribe()}),[r,JSON.stringify(n.updateOnlyOn),JSON.stringify(t)]);const l=e.useMemo((()=>{if(yR(t)){const e=function(e,t){const n=new Map;if(yR(e)){const r=e.filter((e=>e.withPlaceholder)).map((e=>e.source));t.forEach((e=>{const t=e.getTracks().map((e=>{var t;return null==(t=e.track)?void 0:t.source})).filter((e=>void 0!==e)),o=Array.from(function(e,t){const n=new Set(e);for(const e of t)n.delete(e);return n}(new Set(r),new Set(t)));o.length>0&&n.set(e.identity,o)}))}return n}(t,a),n=Array.from(o);return a.forEach((t=>{var r;e.has(t.identity)&&(null!=(r=e.get(t.identity))?r:[]).forEach((e=>{if(o.find((({participant:n,publication:r})=>t.identity===n.identity&&r.source===e)))return;UR.debug(`Add ${e} placeholder for participant ${t.identity}.`);const r={participant:t,source:e};n.push(r)}))})),n}return o}),[o,a,t]);return l}var qj=t=>e.createElement("svg",$R({width:320,height:320,viewBox:"0 0 320 320",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),e.createElement("path",{d:"M160 180C204.182 180 240 144.183 240 100C240 55.8172 204.182 20 160 20C115.817 20 79.9997 55.8172 79.9997 100C79.9997 144.183 115.817 180 160 180Z",fill:"white",fillOpacity:.25}),e.createElement("path",{d:"M97.6542 194.614C103.267 191.818 109.841 192.481 115.519 195.141C129.025 201.466 144.1 205 159.999 205C175.899 205 190.973 201.466 204.48 195.141C210.158 192.481 216.732 191.818 222.345 194.614C262.703 214.719 291.985 253.736 298.591 300.062C300.15 310.997 291.045 320 280 320H39.9997C28.954 320 19.8495 310.997 21.4087 300.062C28.014 253.736 57.2966 214.72 97.6542 194.614Z",fill:"white",fillOpacity:.25}));function $j(t){var n=t,{onTrackClick:r,onClick:o,onSubscriptionStatusChanged:i,name:a,publication:s,source:c}=n,l=GR(n,["onTrackClick","onClick","onSubscriptionStatusChanged","name","publication","source"]);const u=e.useRef(null),d=oj(l.participant),{elementProps:p,publication:f,isSubscribed:h}=Wj({participant:d,name:a,source:c,publication:s},{element:u,props:l});return e.useEffect((()=>{null==i||i(!!h)}),[h,i]),e.createElement("video",VR($R({ref:u},p),{muted:!0,onClick:e=>{null==o||o(e),null==r||r({participant:d,track:f})}}))}function Vj(t){var n=t,{onSubscriptionStatusChanged:r,volume:o}=n,i=GR(n,["onSubscriptionStatusChanged","volume"]);const{source:a,name:s,publication:c}=i,l=e.useRef(null),u=oj(i.participant),{elementProps:d,isSubscribed:p,track:f}=Wj({source:a,name:s,participant:u,publication:c},{element:l,props:i});return e.useEffect((()=>{null==r||r(!!p)}),[p,r]),e.useEffect((()=>{o&&f instanceof bE?f.setVolume(o):UR.warn("volume can only be set on remote audio tracks")}),[o,f]),e.createElement("audio",$R({ref:l},d))}function Gj({participant:t,source:n,publication:r,onParticipantClick:o,disableSpeakingIndicator:i,htmlProps:a}){const s=oj(t),c=e.useMemo((()=>{const{className:e}={className:TR("participant-tile")};return QR(a,{className:e,onClick:e=>{var t;if(null==(t=a.onClick)||t.call(a,e),"function"==typeof o){const e=null!=r?r:s.getTrack(n);o({participant:s,track:e})}}})}),[a,n,o,s,r]),l=zj(cE.Source.Camera,{participant:t}),u=zj(cE.Source.Microphone,{participant:t}),d=function(t){const n=oj(t),r=e.useMemo((()=>function(e){return IR(e,JO.IsSpeakingChanged).pipe(dx((([e])=>e)))}(n)),[n]);return lj(r,n.isSpeaking)}(t);return{elementProps:$R({"data-lk-audio-muted":u,"data-lk-video-muted":l,"data-lk-speaking":!0!==i&&d,"data-lk-local-participant":t.isLocal,"data-lk-source":n},c)}}function Jj(t){const n=!!rj();return t.participant&&!n?e.createElement(nj.Provider,{value:t.participant},t.children):e.createElement(e.Fragment,null,t.children)}var Kj=t=>{var n=t,{participant:r,children:o,source:i=cE.Source.Camera,onParticipantClick:a,publication:s,disableSpeakingIndicator:c}=n,l=GR(n,["participant","children","source","onParticipantClick","publication","disableSpeakingIndicator"]);const u=oj(r),{elementProps:d}=Gj({participant:u,htmlProps:l,source:i,publication:s,disableSpeakingIndicator:c,onParticipantClick:a}),p=ej(),f=e.useCallback((e=>{i&&!e&&p&&p.pin.dispatch&&function(e,t,n){return void 0!==n&&n.some((({source:n,participant:r})=>n===t&&r.identity===e.identity))}(u,i,p.pin.state)&&p.pin.dispatch({msg:"clear_pin"})}),[u,p,i]);return e.createElement("div",$R({style:{position:"relative"}},d),e.createElement(Jj,{participant:u},null!=o?o:e.createElement(e.Fragment,null,"video"===(null==s?void 0:s.kind)||i===cE.Source.Camera||i===cE.Source.ScreenShare?e.createElement($j,{participant:u,source:i,publication:s,onSubscriptionStatusChanged:f}):e.createElement(Vj,{participant:u,source:i,publication:s,onSubscriptionStatusChanged:f}),e.createElement("div",{className:"lk-participant-placeholder"},e.createElement(qj,null)),e.createElement("div",{className:"lk-participant-metadata"},e.createElement("div",{className:"lk-participant-metadata-item"},i===cE.Source.Camera?e.createElement(e.Fragment,null,e.createElement(Uj,{source:cE.Source.Microphone,show:"muted"}),e.createElement(Dj,null)):e.createElement(e.Fragment,null,e.createElement(Tj,{style:{marginRight:"0.25rem"}}),e.createElement(Dj,null,"'s screen"))),e.createElement(Nj,{className:"lk-participant-metadata-item"}))),e.createElement(jj,{trackSource:i})))},Yj=t=>{var n=t,{tracks:r}=n,o=GR(n,["tracks"]);return e.createElement(e.Fragment,null,r.map((t=>{const n=vR(t)?t.publication.source:t.source;return e.createElement(tj.Provider,{value:t,key:`${t.participant.identity}_${n}`},function(t,n,r){return e.Children.map(t,(o=>e.isValidElement(o)&&e.Children.only(t)?e.cloneElement(o,VR($R({},n),{key:r})):o))}(o.children))})))};function Qj({totalPageCount:t,nextPage:n,prevPage:r,currentPage:o,pagesContainer:i}){const[a,s]=e.useState(!1);return e.useEffect((()=>{let e;return i&&(e=LR(i.current,2e3).subscribe(s)),()=>{e&&e.unsubscribe()}}),[i]),e.createElement("div",{className:"lk-pagination-control","data-lk-user-interaction":a},e.createElement("button",{className:"lk-button",onClick:r},e.createElement(bj,null)),e.createElement("span",{className:"lk-pagination-count"},`${o} of ${t}`),e.createElement("button",{className:"lk-button",onClick:n},e.createElement(bj,null)))}function Xj({totalPageCount:t,currentPage:n}){const r=new Array(t).fill("").map(((t,r)=>r+1===n?e.createElement("span",{"data-lk-active":!0,key:r}):e.createElement("span",{key:r})));return e.createElement("div",{className:"lk-pagination-indicator"},r)}function eI(t){var n=t,{tracks:r}=n,o=GR(n,["tracks"]);const i=e.createRef(),a=e.useMemo((()=>QR(o,{className:"lk-grid-layout"})),[o]),{layout:s}=Fj(i,r.length),c=function(t,n){const[r,o]=e.useState(1),i=Math.max(Math.ceil(n.length/t),1);r>i&&o(i);const a=r*t,s=a-t,c=e=>{o((t=>"next"===e?t===i?t:t+1:1===t?t:t-1))},l=Zj(n,t);return{totalPageCount:i,nextPage:()=>c("next"),prevPage:()=>c("previous"),setPage:e=>{o(e>i?i:e<1?1:e)},firstItemIndex:s,lastItemIndex:a,tracks:l.slice(s,a),currentPage:r}}(s.maxTiles,r);return function(t,n={}){var r;const o=e.useRef(null),i=e.useRef(null),a=null!=(r=n.minSwipeDistance)?r:50,s=e=>{i.current=null,o.current=e.targetTouches[0].clientX},c=e=>{i.current=e.targetTouches[0].clientX},l=e.useCallback((()=>{if(!o.current||!i.current)return;const e=o.current-i.current,t=e<-a;e>a&&n.onLeftSwipe&&n.onLeftSwipe(),t&&n.onRightSwipe&&n.onRightSwipe()}),[a,n]);e.useEffect((()=>{const e=t.current;return e&&(e.addEventListener("touchstart",s),e.addEventListener("touchmove",c),e.addEventListener("touchend",l)),()=>{e&&(e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",c),e.removeEventListener("touchend",l))}}),[t,l])}(i,{onLeftSwipe:c.nextPage,onRightSwipe:c.prevPage}),e.createElement("div",$R({ref:i,"data-lk-pagination":c.totalPageCount>1},a),e.createElement(Yj,{tracks:c.tracks},o.children),r.length>s.maxTiles&&e.createElement(e.Fragment,null,e.createElement(Xj,{totalPageCount:c.totalPageCount,currentPage:c.currentPage}),e.createElement(Qj,$R({pagesContainer:i},c))))}var tI={connect:!0,audio:!1,video:!1};function nI(t){const{room:n,htmlProps:r}=function(t){const n=$R($R({},tI),t),{token:r,serverUrl:o,options:i,room:a,connectOptions:s,connect:c,audio:l,video:u,screen:d,onConnected:p,onDisconnected:f,onError:h,onMediaDeviceFailure:m,simulateParticipants:y}=n,v=GR(n,["token","serverUrl","options","room","connectOptions","connect","audio","video","screen","onConnected","onDisconnected","onError","onMediaDeviceFailure","simulateParticipants"]);i&&a&&UR.warn("when using a manually created room, the options object will be ignored. set the desired options directly when creating the room instead.");const[b,g]=e.useState();e.useEffect((()=>{g(null!=a?a:new IC(i))}),[i,a]);const S=e.useMemo((()=>QR(v,{className:"lk-room-container"})),[v]);return e.useEffect((()=>{if(!b)return;const e=()=>{const e=b.localParticipant;try{UR.debug("trying to publish local tracks"),e.setMicrophoneEnabled(!!l,"boolean"!=typeof l?l:void 0),e.setCameraEnabled(!!u,"boolean"!=typeof u?u:void 0),e.setScreenShareEnabled(!!d,"boolean"!=typeof d?d:void 0)}catch(e){UR.warn(e),null==h||h(e)}},t=e=>{const t=VO.getFailure(e);null==m||m(t)};return b.on(GO.SignalConnected,e),b.on(GO.MediaDevicesError,t),()=>{b.off(GO.SignalConnected,e),b.off(GO.MediaDevicesError,t)}}),[b,l,u,d,h]),e.useEffect((()=>{if(b)if(y)b.simulateParticipants({participants:{count:y},publish:{audio:!0,useRealTracks:!0}});else{if(r)return o?void(c?(UR.debug("connecting"),b.connect(o,r,s).catch((e=>{UR.warn(e),null==h||h(e)}))):(UR.debug("disconnecting because connect is false"),b.disconnect())):(UR.warn("no livekit url provided"),void(null==h||h(Error("no livekit url provided"))));UR.debug("no token yet")}}),[c,r,s,b,h,o,y]),e.useEffect((()=>{if(!b)return;const e=e=>{switch(e){case TC.Disconnected:f&&f();break;case TC.Connected:p&&p()}};return b.on(GO.ConnectionStateChanged,e),()=>{b.off(GO.ConnectionStateChanged,e)}}),[r,p,f,b]),e.useEffect((()=>{if(b)return()=>{UR.info("disconnecting on onmount"),b.disconnect()}}),[b]),{room:b,htmlProps:S}}(t);return e.createElement("div",$R({},r),n&&e.createElement(ij.Provider,{value:n},t.children))}var rI=t=>{var n=t,{childrenPosition:r="before",children:o}=n,i=GR(n,["childrenPosition","children"]);const{name:a}=function(t={}){const n=cj(t.room),r=e.useMemo((()=>function(e){const t=CR(e,GO.RoomMetadataChanged,GO.ConnectionStateChanged).pipe(dx((e=>({name:e.name,metadata:e.metadata}))));return t}(n)),[n]),{name:o,metadata:i}=lj(r,{name:n.name,metadata:n.metadata});return{name:o,metadata:i}}();return e.createElement("span",$R({},i),"before"===r&&o,a,"after"===r&&o)},oI=t=>{var n=t,{kind:r,initialSelection:o,onActiveDeviceChange:i}=n,a=GR(n,["kind","initialSelection","onActiveDeviceChange"]);const[s,c]=e.useState(!1),[l,u]=e.useState([]),[d,p]=e.useState(!0),f=(e,t)=>{UR.debug("handle device change"),c(!1),null==i||i(e,t)},h=e.useRef(null),m=e.useRef(null);e.useLayoutEffect((()=>{h.current&&m.current&&(l||d)&&function(e,t){return cR(this,null,(function*(){const{x:n,y:r}=yield((e,t,n)=>{const r=new Map,o={platform:RT,...n},i={...o.platform,_c:r};return LC(e,t,{...o,platform:i})})(e,t,{placement:"top",middleware:[JC(6),GC(),KC({padding:5})]});return{x:n,y:r}}))}(h.current,m.current).then((({x:e,y:t})=>{m.current&&Object.assign(m.current.style,{left:`${e}px`,top:`${t}px`})})),p(!1)}),[h,m,l,d]);const y=e.useCallback((e=>{m.current&&e.target!==h.current&&s&&function(e,t){return!e.contains(t.target)}(m.current,e)&&c(!1)}),[s,m,h]);return e.useEffect((()=>(document.addEventListener("click",y),window.addEventListener("resize",(()=>p(!0))),()=>{document.removeEventListener("click",y),window.removeEventListener("resize",(()=>p(!0)))})),[y,p]),e.createElement(e.Fragment,null,e.createElement("button",VR($R({className:"lk-button lk-button-menu","aria-pressed":s},a),{onClick:()=>c(!s),ref:h}),a.children),e.createElement("div",{className:"lk-device-menu",ref:m,style:{visibility:s?"visible":"hidden"}},r?e.createElement(Ij,{initialSelection:o,onActiveDeviceChange:e=>f(r,e),onDeviceListChange:u,kind:r}):e.createElement(e.Fragment,null,e.createElement("div",{className:"lk-device-menu-heading"},"Audio inputs"),e.createElement(Ij,{kind:"audioinput",onActiveDeviceChange:e=>f("audioinput",e),onDeviceListChange:u}),e.createElement("div",{className:"lk-device-menu-heading"},"Video inputs"),e.createElement(Ij,{kind:"videoinput",onActiveDeviceChange:e=>f("videoinput",e),onDeviceListChange:u}))))};function iI(t){var n,r=t,{variation:o,controls:i}=r,a=GR(r,["variation","controls"]);const[s,c]=e.useState(!1),l=ej();e.useEffect((()=>{var e,t;void 0!==(null==(e=null==l?void 0:l.widget.state)?void 0:e.showChat)&&c(null==(t=null==l?void 0:l.widget.state)?void 0:t.showChat)}),[null==(n=null==l?void 0:l.widget.state)?void 0:n.showChat]);const u=function(t){const n=e=>"undefined"!=typeof window&&window.matchMedia(e).matches,[r,o]=e.useState(n(t));function i(){o(n(t))}return e.useEffect((()=>{const e=window.matchMedia(t);return i(),e.addListener?e.addListener(i):e.addEventListener("change",i),()=>{e.removeListener?e.removeListener(i):e.removeEventListener("change",i)}}),[t]),r}(`(max-width: ${s?1e3:760}px)`);null!=o||(o=u?"minimal":"verbose");const d=$R({leave:!0},i),p=function(){const t=aj();return lj(e.useMemo((()=>{return IR(e=t.localParticipant,JO.ParticipantPermissionsChanged).pipe(dx((()=>e.permissions)),Ux(e.permissions));var e}),[t]),t.localParticipant.permissions)}();p?(null!=d.camera||(d.camera=p.canPublish),null!=d.microphone||(d.microphone=p.canPublish),null!=d.screenShare||(d.screenShare=p.canPublish),null!=d.chat||(d.chat=p.canPublishData&&(null==i?void 0:i.chat))):(d.camera=!1,d.chat=!1,d.microphone=!1,d.screenShare=!1);const f=e.useMemo((()=>"minimal"===o||"verbose"===o),[o]),h=e.useMemo((()=>"textOnly"===o||"verbose"===o),[o]),m=e.useMemo((()=>"undefined"!=typeof document&&/Mobi/i.test(window.navigator.userAgent)),[]),[y,v]=e.useState(!1);return e.createElement("div",$R({className:"lk-control-bar"},a),d.microphone&&e.createElement("div",{className:"lk-button-group"},e.createElement(Mj,{source:cE.Source.Microphone,showIcon:f},h&&"Microphone"),e.createElement("div",{className:"lk-button-group-menu"},e.createElement(oI,{kind:"audioinput"}))),d.camera&&e.createElement("div",{className:"lk-button-group"},e.createElement(Mj,{source:cE.Source.Camera,showIcon:f},h&&"Camera"),e.createElement("div",{className:"lk-button-group-menu"},e.createElement(oI,{kind:"videoinput"}))),d.screenShare&&!m&&e.createElement(Mj,{source:cE.Source.ScreenShare,captureOptions:{audio:!0,selfBrowserSurface:"include"},showIcon:f,onChange:e=>{v(e)}},h&&(y?"Stop screen share":"Share screen")),d.chat&&e.createElement(fj,null,f&&e.createElement(vj,null),h&&"Chat"),d.leave&&e.createElement(hj,null,f&&e.createElement(Sj,null),h&&"Leave"),e.createElement(_j,{label:"Start Audio"}))}function aI(e){return aI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aI(e)}function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cI(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?parseFloat(t.messages[t.messages.length-1].Timestamp):0;(this.state.messages.length>0?parseFloat(this.state.messages[this.state.messages.length-1].Timestamp):0)>n&&this.commentPane.current&&(this.commentPane.current.scrollTop=1e5)}}},{key:"componentWillReceiveProps",value:function(e){var t=e.roomType,n=e.roomObjectId;t===this.props.roomType&&n===this.props.roomObjectId||(this.client&&this.client.leaveRoom(this.props.roomType,this.props.roomObjectId,this._newMessageListener),this.setState({messages:[],room:null,value:""}),t&&n&&this.join(t,n))}},{key:"onRoomMessage",value:function(e){if(!this.state.firstUpdateReceived){var t=this.props,n=t.roomType,r=t.roomObjectId;this.client.loadHistory(n,r,0,40),this.setState({firstUpdateReceived:!0})}e&&this.setState({room:e.Room})}},{key:"onNewMessage",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e){if(this.setState({firstUpdateReceived:!0}),"VIDEO_CALL"===e["@type"])return console.log("Video Enabled!",e),void this.setState({videoData:e});if(n)this.setState({messages:this.state.messages.filter((function(t){return t.Uuid!==e.Uuid}))});else{if(0===e.Message.indexOf("TOKENS:")){var r,o=function(e){if(Array.isArray(e))return e}(t=e.Message.split(":"))||jI(t)||xI(t)||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.")}(),i=(o[0],o[1]),a=o[2],s=o.slice(3),c=this.state.messages.find((function(e){return e.TokenId===i}));if("FINAL"===a)return r=TI(this.state.messages),c&&(r=r.filter((function(e){return e!==c}))),r.push(EI(EI({},e),{},{Message:s.join(":")})),r.sort((function(e,t){return e.Timestamp-t.Timestamp})),void this.setState({messages:r});var l={position:parseInt(a),token:s.join(":")};return c?(c.Tokens.push(l),c.Tokens.sort((function(e,t){return e.position-t.position})),0===c.Tokens[0].position&&(c.Message=c.Tokens.map((function(e){return e.token})).join("")),r=this.state.messages.filter((function(e){return e!==c})),r.push(EI({},c))):(e=EI(EI({},e),{},{Message:"",Tokens:[l],TokenId:i}),0===l.position&&(e.Message=l.token),r=[].concat(TI(this.state.messages),[e])),void this.setState({messages:r})}var u=[].concat(TI(this.state.messages.filter((function(t){return t.Uuid!==e.Uuid}))),[e]).filter((function(e){return!!e.Message}));u.sort((function(e,t){return e.Timestamp-t.Timestamp})),this.setState({messages:u})}}}},{key:"join",value:function(e,t){var n=this;if(t){var r=this.props.pydio;this.client=Fb.getInstance(r),this.setState({firstUpdateReceived:!1},(function(){var r=n.client.joinRoom(e,t,n._newMessageListener,n.onRoomMessage.bind(n));null!==r&&n.setState({room:r})})),this.client.loadHistory(e,t,0,40)}}},{key:"more",value:function(){var e=this.props,t=e.roomType,n=e.roomObjectId,r=this.state.messages;this.client&&this.client.loadHistory(t,n,r.length-1,40)}},{key:"stop",value:function(){var e=this.props,t=e.roomType,n=e.roomObjectId;this.client&&this.client.leaveRoom(t,n,this._newMessageListener)}},{key:"postMessage",value:function(){if(this.state.value){var e=this.state.room;if(e&&e.Uuid){var t={"@type":"POST",Message:{RoomUuid:e.Uuid,Message:this.state.value}};this.client.send(JSON.stringify(t)),this.setState({value:""})}else console.error("Cannot find cell info")}}},{key:"deleteMessage",value:function(e){var t=this.state.room;if(t&&t.Uuid){var n={"@type":"DELETE_MSG",Message:e};this.client.send(JSON.stringify(n))}else console.error("Cannot find cell info")}},{key:"keyDown",value:function(e){var t=this.state.value;if("Enter"===e.key)if(e.metaKey||e.ctrlKey){var n,r,o=e.currentTarget;o.selectionEnd=40;O.forEach((function(r){var o=UI(1e3*parseFloat(r.Timestamp)).fromNow(),i=e&&e===o,s=n&&n===r.Author&&i;T.push(t().createElement(ng,{key:r.Uuid,message:r,hideDate:i,sameAuthor:s,onDeleteMessage:function(){a.deleteMessage(r)},moreLoader:x?function(){a.more()}:null,muiTheme:S})),x=!1,e=o,n=r.Author})),y&&(r={display:"flex",flexDirection:"column"},T&&T.length&&(o=t().createElement("span",{style:{flex:1}}))),!h||T&&T.length||(i=t().createElement(po,OI({pydio:m},h)));var R=!P,j={color:Q()(S.palette.mui3["on-surface-variant"]).fade(.5).toString(),whiteSpace:"nowrap"};f&&f.hintStyle&&(j=EI(EI({},j),f.hintStyle)),R&&(j=EI(EI({},j),{},{fontStyle:"italic"}));var I=EI({backgroundColor:S.palette.mui3[w?"surface-variant":"surface"]||"white",position:"relative",paddingLeft:16,paddingRight:16},d);return t().createElement("div",{style:EI({padding:0},c)},void 0!==v&&t().createElement("div",{style:u},t().createElement(pv,{acls:v,max:12,onlines:P?P.Users:[]})),t().createElement("div",{ref:this.commentPane,className:"comments_feed",style:EI(EI({maxHeight:300,overflowY:"auto"},r),l)},o,T,i),t().createElement("div",{style:I},t().createElement(g.TextField,OI({hintText:R?m.MessageHash[466]:p,value:this.state.value,onChange:function(e,t){a.setState({value:t})},multiLine:!0,onKeyDown:this.keyDown.bind(this),fullWidth:!0,underlineShow:!1,disabled:b||R},f,{hintStyle:j})),E&&t().createElement("div",{style:{position:"absolute",top:0,right:0}},t().createElement(g.IconButton,{iconStyle:{color:C?"#F44336":"#4CAF4F"},iconClassName:"mdi mdi-video"+(C?"-off":""),onClick:function(){return a.setState({joinVideo:!C})}}))),E&&C&&t().createElement(wI,{url:E.Url,token:E.Token}),t().createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n.chat-message-md *, .comments_feed .user-label, .comments_feed .date-from{\n user-select: text;\n}\n.chat-message-md p{\n padding-top: 0; \n margin-bottom: 0;\n}\n.chat-message-md strong {\n font-weight: 500;\n}\n.chat-message-md a {\n text-decoration: underline;\n color:#2196f3;\n}\n.chat-message-md ul {\n padding-left: 20px;\n}\n"}}))}}],o&&II(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);function FI(e){return FI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FI(e)}function zI(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1]?this.setState({newMessages:Math.max(0,this.state.newMessages-1)}):this.setState({newMessages:this.state.newMessages+1})}},{key:"listenToRoom",value:function(e,t){Fb.getInstance(this.props.pydio).joinRoom(e,t,this._messageListener,null)}},{key:"leaveRoom",value:function(e,t){Fb.getInstance(this.props.pydio).leaveRoom(e,t,this._messageListener)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.roomType,n=e.objectId;this.listenToRoom(t,n)}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.roomType,n=e.objectId;this.leaveRoom(t,n)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.roomType,o=n.objectId;e.roomType===r&&e.objectId===o||(this.leaveRoom(r,o),this.setState({newMessages:0},(function(){t.listenToRoom(e.roomType,e.objectId)})))}},{key:"onClick",value:function(){this.props.pydio.Controller.fireAction("toggle_chat_panel"),this.setState({newMessages:0})}},{key:"render",value:function(){var e=this.state.newMessages;if(0===e)return null;return t().createElement("span",{onClick:this.onClick.bind(this),className:"mdi mdi-comment",style:{display:"inline-block",padding:"0 5px",fontSize:15,textAlign:"center",color:"#8BC34A",fontWeight:500,position:"relative"}},t().createElement("span",{style:{fontSize:13,display:"inline-block",position:"absolute",top:-1,marginLeft:2}},e))}}],r&&zI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);function VI(e){return VI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VI(e)}function GI(){return GI=Object.assign?Object.assign.bind():function(e){for(var t=1;t70&&(r=t().createElement("span",{title:r},r.substr(0,70)+"..."));var o=t().createElement(t().Fragment,null,n.tag&&t().createElement("div",{className:"stepper-tag"},n.tag),n.onDelete&&t().createElement("div",e.stProps("action","deleteButton"),t().createElement(g.IconButton,GI({iconClassName:"mdi mdi-close",tooltip:"Remove",onClick:function(e){e.stopPropagation(),n.onDelete()}},r_.deleteIconProps))),t().createElement("div",e.stProps("action","icon"),t().createElement(g.FontIcon,{color:n.tint||"#03A9F4",className:n.icon})),t().createElement("div",e.stProps("action","title"),n.title),t().createElement("div",e.stProps("action","description"),r));return n.dropProps?t().createElement(n_,GI({},e.stProps("action","container"),n.dropProps),o):t().createElement(g.Paper,GI({zDepth:0},e.stProps("action","container"),{onClick:function(){i(n.value)}}),o)}))))})),t().createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:"\n.react-mui-context .bbpanel .stepper-section-actions {\n display: flex;\n flex-wrap: wrap;\n}\n\n.react-mui-context .bbpanel .stepper-section-container {\n margin-bottom: 30px;\n}\n\n.react-mui-context .bbpanel .stepper-section-title {\n font-size: 13px;\n font-weight: 500;\n color: #455a64;\n padding-bottom: 20px; \n}\n\n.react-mui-context .bbpanel .stepper-action-container {\n margin: 10px;\n width: 230px;\n height: 210px;\n display: flex;\n flex-direction: column;\n font-size: 15px;\n padding: 10px 20px;\n border-radius: 6px !important;\n box-shadow: 1px 10px 20px 0 rgba(40,60,75,.15);\n cursor: pointer;\n position:relative;\n}\n\n.react-mui-context .bbpanel .stepper-action-container:hover {\n box-shadow: 1px 10px 20px 0 rgba(40,60,75,.3)\n}\n\n.react-mui-context .bbpanel .stepper-action-icon {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.react-mui-context .bbpanel .stepper-tag {\n position: absolute;\n top: 15px;\n left: 16px;\n background-color: #B0BEC5;\n color: white;\n padding: 1px 5px;\n font-size: 12px;\n height: 19px;\n line-height: 16px;\n border-radius: 4px;\n font-weight: 500;\n}\n\n.react-mui-context .bbpanel .stepper-action-icon > span {\n font-size: 50px !important;\n}\n\n.react-mui-context .bbpanel .stepper-action-title {\n padding-bottom: 20px;\n font-weight: 500;\n text-align: center;\n font-size: 16px;\n}\n\n.react-mui-context .bbpanel .stepper-action-description {\n text-align: center;\n font-weight: 300;\n font-size: 13px;\n padding-bottom: 10px; \n}\n"}}))}}],r&&QI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);const i_=o_;function a_(e){return a_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a_(e)}function s_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c_(e){for(var t=1;t div{border-radius: 6px !important;}"}}))}}],r&&u_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component),y_={SortableList:L,SimpleList:Mo,NodeListCustomProvider:Wo,ListEntry:de,ListPaginator:Sr,MaterialTable:oi,Masonry:za,Timeline:Xa,TreeView:Ss,DNDTreeView:gs,FoldersTree:ws,ClipboardTextField:Gs,LabelWithTip:js,EmptyStateView:po,SimpleFigureBadge:Us,ModalAppBar:function(e){var n=e.style,r=e.titleStyle,o=e.iconStyleRight,i=e.iconStyleLeft,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,kc),s={style:Ec({flexShrink:0},n),titleStyle:Ec({lineHeight:"56px",height:56,marginLeft:-8},r),iconStyleRight:Ec({marginTop:4},o),iconStyleLeft:Ec({marginTop:4},i)};return t().createElement(g.AppBar,Oc({},a,s))},GenericCard:hc,GenericLine:fc,Mui3CardLine:pc,QuotaUsageLine:Sc,ReactEditorOpener:Mc,DynamicGrid:bl,DynamicGridItemMixin:Ol,asGridItem:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{gridWidth:4,gridHeight:12},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=e.displayName||e.name;e=Nl()(e);var i=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jl(e,t)}(s,t);var n,r,o,i,a=(o=s,i=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}}(),function(){var e,t=Il(o);if(i){var n=Il(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,e,t)).state={focus:!1,showCloseAction:!1},n}return n=s,r=[{key:"focusItem",value:function(){this.setState({focus:!0})}},{key:"blurItem",value:function(){this.setState({focus:!1})}},{key:"mergeStyleWithFocus",value:function(){return Cl(Cl({},this.props.style),{},{zIndex:this.state.focus?1:null})}},{key:"toggleEditMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e?this.setState({showCloseAction:!(this.state&&this.state.showCloseAction)}):this.setState({showCloseAction:e})}},{key:"getCloseButton",value:function(){var e=function(){};return this.props.onCloseAction&&(e=this.props.onCloseAction),React.createElement("div",{style:{position:"absolute",backgroundColor:"rgba(0,0,0,0.53)",zIndex:10,top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center"}},React.createElement(Ml,{label:this.props.pydio.MessageHash["ajxp_admin.home.48"],className:"card-close-button",onClick:e,style:{color:"white"}}))}},{key:"render",value:function(){var t=Cl(Cl({},this.props),{},{style:this.mergeStyleWithFocus(),closeButton:this.state.showCloseAction?this.getCloseButton():null,onFocusItem:this.focusItem.bind(this),onBlurItem:this.blurItem.bind(this)});return React.createElement(e,t)}}],r&&xl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(Al);return i.propTypes={onCloseAction:_l.func},i.displayName=o,i.builderDisplayName=t,i.getGridLayout=function(e,t){return{x:e||0,y:t||0,w:n.gridWidth||4,h:n.gridHeight||12,isResizable:!1}},i.hasBuilderFields=function(){return void 0!==r},i.getBuilderFields=function(){return r},i},DynamicGridStore:Hc,DND:{Types:p,collect:f,collectDrop:h,nodeDragSource:v,nodeDropTarget:b,DNDActionParameter:m},DNDActionParameter:m,UserAvatar:Hd,SharedAvatar:sv,UsersCompleter:tv,TeamCreationForm:Kf,AddressBook:zy,DirectoryLayout:Py,ListStylesCompact:mu,SharedUsersStack:pv,ContextMenu:Jv,Toolbar:xb,ButtonMenu:Ev,IconButtonMenu:ir,MenuItemsConsumer:Gn,MenuUtils:Un,Chat:BI,ChatIcon:$I,ChatClient:Fb,ResourcePoliciesPanel:cp,CellActionsRenderer:hu,Stepper:{PanelBigButtons:i_,Dialog:m_}}})(),window.PydioComponents=s})(); \ No newline at end of file diff --git a/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js.gz b/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js.gz index 1093d2fa87..cdf13b3cd8 100644 Binary files a/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js.gz and b/frontend/front-srv/assets/gui.ajax/res/dist/libs/PydioComponents.min.js.gz differ diff --git a/frontend/front-srv/assets/gui.ajax/res/js/ui/Components/users/addressbook/Toolbar.js b/frontend/front-srv/assets/gui.ajax/res/js/ui/Components/users/addressbook/Toolbar.js index 2baaf90259..d567d40272 100644 --- a/frontend/front-srv/assets/gui.ajax/res/js/ui/Components/users/addressbook/Toolbar.js +++ b/frontend/front-srv/assets/gui.ajax/res/js/ui/Components/users/addressbook/Toolbar.js @@ -99,12 +99,7 @@ class Toolbar extends React.Component { searchLabel, onSearch, searchTerm, setSearchTerm, style:{flex:1, minWidth: 110}, }; - if (mode === 'selector'){ - searchProps.inputStyle={color:'white'}; - searchProps.hintStyle={color:'rgba(255,255,255,.5)'}; - searchProps.underlineStyle={borderColor:'rgba(255,255,255,.5)'}; - searchProps.underlineFocusStyle={borderColor:'white'}; - } else { + if (mode !== 'selector'){ searchProps.underlineShow=false searchProps.style = { ...searchProps.style,