(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{668:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NavigationImage",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["href"]);return t?n.default.createElement(o.Link,{href:t},n.default.createElement(o.Image,i({alt:"navigation logotype",height:"2rem"},r))):n.default.createElement(o.Image,i({alt:"navigation logotype",height:"2rem"},r))}},855:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getChatToken",{enumerable:!0,get:function(){return i}});var n=r(84527);function o(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,o)}var i=function(){var e,t=(e=function(e,t){return function(e,t){var r,n,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(i){return function(s){var l=[i,s];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(56264),t),n(r(31008),t)},3906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"mediaBlockVariants",{enumerable:!0,get:function(){return r}});var r=["vertical","horizontal"]},3943:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(26788),t),n(r(21518),t)},4234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"CookieBanner",{enumerable:!0,get:function(){return p}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(79403),i=r(37477);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d=u((0,o.createContext)({name:"CookieBannerContext"}),2),f=d[0],h=d[1],p=function(e){var t=e.children,r=e.cookieKey,o=void 0===r?"cmpsr-cookies-policy":r,a=e.cookieVersion,s=void 0===a?"1.0.0":a,d=c(e,["children","cookieKey","cookieVersion"]),h=u((0,n.useState)(!1),2),b=h[0],y=h[1],g=u((0,n.useState)(void 0),2),v=g[0],S=g[1];(0,n.useEffect)(function(){var e=localStorage.getItem(o);e?S(e):S("")},[]),(0,n.useEffect)(function(){if(void 0!==v){if(""===v)return void y(!0);if(JSON.parse(v).cookieVersion===s)return void y(!1);y(!0)}},[v]);var O=function(e){var t=JSON.stringify({cookieVersion:s,allow:e});localStorage.setItem(o,t),S(t)},w=n.default.Children.map(t,function(e){return(0,n.isValidElement)(e)&&e.type===m}).some(Boolean);return n.default.createElement(f,{value:{allowAllCookies:function(){return O("all")},allowRequiredOnly:function(){return O("required")},cookiePolicy:v}},b?n.default.createElement(i.Flex,l({direction:{base:"column",lg:"row"},alignItems:"center",bg:"background-inform",pr:"1rem",py:"1.5rem"},d),t,!w&&n.default.createElement(p.Actions,null,n.default.createElement(p.Actions.AcceptRequired,null),n.default.createElement(p.Actions.AcceptAll,null))):null)};p.Content=function(e){var t=e.children,r=c(e,["children"]);return n.default.createElement(i.Alert,l({variant:"subtle",pt:"0",pr:{base:"0",lg:"2rem"},pb:{base:"2rem",lg:"0"}},r),n.default.createElement(i.Alert.Icon,null),"string"==typeof t?n.default.createElement(i.Text,{color:"text-secondary"},t):t)};var m=function(e){return n.default.createElement(i.Flex,l({justifyContent:"center",alignItems:"center",direction:{base:"column",lg:"row"},gap:"1.5rem"},e))};m.AcceptAll=function(e){var t=e.onClick,r=e.children,o=c(e,["onClick","children"]),a=h().allowAllCookies;return n.default.createElement(i.Button,l({variant:"primary",onClick:function(e){a(),null==t||t(e)}},o),void 0===r?"Allow all Cookies":r)},m.AcceptRequired=function(e){var t=e.onClick,r=e.children,o=c(e,["onClick","children"]),a=h().allowRequiredOnly;return n.default.createElement(i.Button,l({variant:"link",onClick:function(e){a(),null==t||t(e)}},o),void 0===r?"Allow functional only":r)},p.Actions=m},4921:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(30613),t),n(r(66398),t),n(r(74666),t),n(r(30347),t),n(r(91929),t),n(r(28954),t)},6005:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ButtonBack:()=>ea,ButtonFirst:()=>ec,ButtonLast:()=>em,ButtonNext:()=>ef,ButtonPlay:()=>eg,CarouselContext:()=>K,CarouselProvider:()=>$,Dot:()=>eO,DotGroup:()=>eP,Image:()=>eI,ImageWithZoom:()=>eF,Slide:()=>eq,Slider:()=>eJ,Spinner:()=>eL,Store:()=>Y,WithStore:()=>M});var n=r(14232);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function m(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=f(e);r=t?Reflect.construct(n,arguments,f(this).constructor):n.apply(this,arguments);if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw TypeError("Derived constructors may only return object or undefined");return m(this)}}function y(e){return function(e){if(Array.isArray(e))return g(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 g(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:function(){return{}},r=function(r){function o(e,r){var n;return a(this,o),(n=s.call(this,e,r)).state=t(i({},r.state)),n.updateStateProps=n.updateStateProps.bind(m(n)),n}d(o,r);var s=b(o);return l(o,[{key:"componentDidMount",value:function(){this.context.subscribe(this.updateStateProps)}},{key:"shouldComponentUpdate",value:function(e,t){return!q(t,this.state)||!q(e,this.props)}},{key:"componentWillUnmount",value:function(){this.context.unsubscribe(this.updateStateProps)}},{key:"updateStateProps",value:function(){this.setState(t(i({},this.context.state)))}},{key:"render",value:function(){var t=this,r=G(this.state,this.props);return n.createElement(e,u({ref:function(e){t.instance=e}},r,{carouselStore:{getStoreState:this.context.getStoreState,masterSpinnerError:this.context.masterSpinnerError,masterSpinnerSuccess:this.context.masterSpinnerSuccess,setStoreState:this.context.setStoreState,subscribeMasterSpinner:this.context.subscribeMasterSpinner,unsubscribeAllMasterSpinner:this.context.unsubscribeAllMasterSpinner,unsubscribeMasterSpinner:this.context.unsubscribeMasterSpinner}}),this.props.children)}}]),o}(n.Component);return c(r,"contextType",K),c(r,"propTypes",{children:N.children}),c(r,"defaultProps",{children:null}),r}O.resetWarningCache=S;var C=function(){function e(e,t,r,n,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:O,resetWarningCache:S};return r.PropTypes=r,r},A=v(function(e){e.exports=C()}),R="loading",I="success",D="error",N={children:A.oneOfType([A.arrayOf(A.node),A.node]),direction:A.oneOf(["forward","backward"]),height:function(e,t){var r=e[t];return"vertical"!==e.orientation||null!==r&&"number"==typeof r?null:Error("Missing required property '".concat(t,"' when orientation is vertical. You must supply a number representing the height in pixels"))},orientation:A.oneOf(["horizontal","vertical"]),isBgImage:function(e,t){return!0===e[t]&&"img"===e.tag?Error("HTML img elements should not have a backgroundImage. Please use ".concat(t," for other block-level HTML tags, like div, a, section, etc...")):null}},L=function(e){var t=e.min;return Math.min(e.max,Math.max(t,e.x))},U={buttonBack:"buttonBack___1mlaL"},W=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],F=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).handleOnClick=n.handleOnClick.bind(m(n)),n}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props,r=t.carouselStore,n=t.currentSlide,o=t.onClick,i=t.step,a=t.infinite,s=t.visibleSlides,l=t.totalSlides-s,c=Math.max(n-i,0);a&&(c=0===n?l:c),r.setStoreState({currentSlide:c,isPlaying:!1},null!==o&&o.call(this,e))}},{key:"render",value:function(){var e=this.props,r=(e.carouselStore,e.className),o=(e.currentSlide,e.disabled,e.onClick,e.step,e.totalSlides,e.visibleSlides,e.infinite),i=p(e,W),a=w([U.buttonBack,"carousel__back-button",r]),s=t.setDisabled(this.props.disabled,this.props.currentSlide,o);return n.createElement("button",u({type:"button","aria-label":"previous",className:a,onClick:this.handleOnClick,disabled:s},i),this.props.children)}}],[{key:"setDisabled",value:function(e,t,r){return null!==e?e:0===t&&!r}}]),t}(n.Component);c(F,"propTypes",{carouselStore:A.object.isRequired,children:N.children.isRequired,className:A.string,currentSlide:A.number.isRequired,disabled:A.bool,onClick:A.func,step:A.number.isRequired,totalSlides:A.number.isRequired,visibleSlides:A.number.isRequired,infinite:A.bool}),c(F,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1});var B=v(function(e,t){var r={}.toString,n="undefined"!=typeof window?window.Node:Function;e.exports=t=function(e){var t=typeof e;if("object"!=t)return t;if("object"==(t=o[r.call(e)]))return e instanceof Map?"map":e instanceof Set?"set":"object";if(t)return t;if(e instanceof n)switch(e.nodeType){case 1:return"element";case 3:return"text-node";case 9:return"document";case 11:return"document-fragment";default:return"dom-node"}};var o=t.types={"[object Function]":"function","[object Date]":"date","[object RegExp]":"regexp","[object Arguments]":"arguments","[object Array]":"array","[object Set]":"set","[object String]":"string","[object Null]":"null","[object Undefined]":"undefined","[object Number]":"number","[object Boolean]":"boolean","[object Object]":"object","[object Map]":"map","[object Text]":"text-node","[object Uint8Array]":"bit-array","[object Uint16Array]":"bit-array","[object Uint32Array]":"bit-array","[object Uint8ClampedArray]":"bit-array","[object Error]":"error","[object FormData]":"form-data","[object File]":"file","[object Blob]":"blob"}}),z=(B.types,{});z.number=function(e,t){return e!=e&&t!=t},z.function=function(e,t,r){return e.toString()===t.toString()&&z.object(e,t,r)&&E(e.prototype,t.prototype)},z.date=function(e,t){return+e==+t},z.regexp=function(e,t){return e.toString()===t.toString()},z.element=function(e,t){return e.outerHTML===t.outerHTML},z.textnode=function(e,t){return e.textContent===t.textContent},z.arguments=z["bit-array"]=z.array=P(function(e,t,r){var n=e.length;if(n!==t.length)return!1;for(r.push([e,t]);n--;)if(!E(e[n],t[n],r))return!1;return!0}),z.object=P(function(e,t,r){if("function"==typeof e.equal)return r.push([e,t]),e.equal(t,r);var n=j(e),o=j(t),i=n.length;if(i!==o.length)return!1;for(n.sort(),o.sort();i--;)if(n[i]!==o[i])return!1;for(r.push([e,t]),i=n.length;i--;){var a=n[i];if(!E(e[a],t[a],r))return!1}return!0});var q=E,H=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==V},V="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;_.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return _(e,r,t)},{})};var X,G=_,K=n.createContext(),J=function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(r){!t.hasOwnProperty(r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||Object.isFrozen(t[r])||e(t[r])}),t},Z={masterSpinnerFinished:!1},Y=function(){function e(t){a(this,e),this.state=J(G(Z,t)),this.subscriptions=[],this.masterSpinnerSubscriptions={},this.setStoreState=this.setStoreState.bind(this),this.getStoreState=this.getStoreState.bind(this),this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.updateSubscribers=this.updateSubscribers.bind(this),this.subscribeMasterSpinner=this.subscribeMasterSpinner.bind(this),this.unsubscribeMasterSpinner=this.unsubscribeMasterSpinner.bind(this),this.unsubscribeAllMasterSpinner=this.unsubscribeAllMasterSpinner.bind(this),this.masterSpinnerSuccess=this.masterSpinnerSuccess.bind(this),this.masterSpinnerError=this.masterSpinnerError.bind(this)}return l(e,[{key:"setStoreState",value:function(e,t){this.state=J(G(this.state,e)),this.updateSubscribers(t)}},{key:"getStoreState",value:function(){return G({},this.state)}},{key:"subscribe",value:function(e){this.subscriptions.push(e)}},{key:"unsubscribe",value:function(e){var t=this.subscriptions.indexOf(e);-1!==t&&this.subscriptions.splice(t,1)}},{key:"updateSubscribers",value:function(e){this.subscriptions.forEach(function(e){return e()}),"function"==typeof e&&e(this.getStoreState())}},{key:"subscribeMasterSpinner",value:function(e){-1===Object.keys(this.masterSpinnerSubscriptions).indexOf(e)&&(this.masterSpinnerSubscriptions[e]={success:!1,error:!1,complete:!1})}},{key:"unsubscribeMasterSpinner",value:function(e){return -1!==Object.keys(this.masterSpinnerSubscriptions).indexOf(e)&&(this.setMasterSpinnerFinished(),delete this.masterSpinnerSubscriptions[e])}},{key:"unsubscribeAllMasterSpinner",value:function(){this.masterSpinnerSubscriptions={},this.setMasterSpinnerFinished()}},{key:"masterSpinnerSuccess",value:function(e){this.masterSpinnerSubscriptions[e].success=!0,this.masterSpinnerSubscriptions[e].complete=!0,this.setMasterSpinnerFinished()}},{key:"masterSpinnerError",value:function(e){this.masterSpinnerSubscriptions[e].error=!0,this.masterSpinnerSubscriptions[e].complete=!0,this.setMasterSpinnerFinished()}},{key:"setMasterSpinnerFinished",value:function(){this.setStoreState({masterSpinnerFinished:this.isMasterSpinnerFinished()})}},{key:"isMasterSpinnerFinished",value:function(){var e=this;return 0===Object.keys(this.masterSpinnerSubscriptions).filter(function(t){return!0!==e.masterSpinnerSubscriptions[t].complete}).length}}]),e}(),Q=["children","className","currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPageScrollLocked","isPlaying","lockOnWindowScroll","naturalSlideHeight","naturalSlideWidth","orientation","playDirection","step","dragStep","tag","totalSlides","touchEnabled","dragEnabled","visibleSlides","infinite","isIntrinsicHeight"],$=(c(X=function(e){function t(e){var n,o;if(a(this,t),o=r.call(this,e),e.isIntrinsicHeight&&"horizontal"!==e.orientation)throw Error('isIntrinsicHeight can only be used in "horizontal" orientation. See Readme for more information.');return o.carouselStore=new Y({currentSlide:e.currentSlide,disableAnimation:e.disableAnimation,disableKeyboard:e.disableKeyboard,hasMasterSpinner:e.hasMasterSpinner,imageErrorCount:0,imageSuccessCount:0,interval:e.interval,isPageScrollLocked:e.isPageScrollLocked,isPlaying:e.isPlaying,lockOnWindowScroll:e.lockOnWindowScroll,masterSpinnerThreshold:0,naturalSlideHeight:e.naturalSlideHeight,naturalSlideWidth:e.naturalSlideWidth,orientation:e.orientation,playDirection:e.playDirection,privateUnDisableAnimation:!1,slideSize:100/e.totalSlides*(n=e.visibleSlides)/n,slideTraySize:100*e.totalSlides/e.visibleSlides,step:e.step,dragStep:e.dragStep,totalSlides:e.totalSlides,touchEnabled:e.touchEnabled,dragEnabled:e.dragEnabled,visibleSlides:e.visibleSlides,infinite:e.infinite,isIntrinsicHeight:e.isIntrinsicHeight}),o}d(t,e);var r=b(t);return l(t,[{key:"componentDidUpdate",value:function(e){var t,r=this,n={};["currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPlaying","naturalSlideHeight","naturalSlideWidth","lockOnWindowScroll","orientation","playDirection","step","dragStep","totalSlides","touchEnabled","dragEnabled","visibleSlides"].forEach(function(t){e[t]!==r.props[t]&&(n[t]=r.props[t])}),this.props.currentSlide===e.currentSlide||this.props.disableAnimation||(n.disableAnimation=!0,n.privateUnDisableAnimation=!0),this.props.totalSlides===e.totalSlides&&this.props.visibleSlides===e.visibleSlides||(n.slideSize=100/this.props.totalSlides*(t=this.props.visibleSlides)/t,n.slideTraySize=100*this.props.totalSlides/this.props.visibleSlides),this.carouselStore.state.currentSlide>=this.props.totalSlides&&(n.currentSlide=Math.max(this.props.totalSlides-1,0)),Object.keys(n).length>0&&this.carouselStore.setStoreState(n)}},{key:"componentWillUnmount",value:function(){this.carouselStore.unsubscribeAllMasterSpinner()}},{key:"getStore",value:function(){return this.carouselStore}},{key:"render",value:function(){var e=this.props,t=(e.children,e.className,e.currentSlide,e.disableAnimation,e.disableKeyboard,e.hasMasterSpinner,e.interval,e.isPageScrollLocked,e.isPlaying,e.lockOnWindowScroll,e.naturalSlideHeight,e.naturalSlideWidth,e.orientation,e.playDirection,e.step,e.dragStep,e.tag),r=(e.totalSlides,e.touchEnabled,e.dragEnabled,e.visibleSlides,e.infinite,e.isIntrinsicHeight,p(e,Q)),o=w(["carousel",this.props.className]);return n.createElement(t,u({className:o},r),n.createElement(K.Provider,{value:this.carouselStore},this.props.children))}}]),t}(n.Component),"propTypes",{children:N.children.isRequired,className:A.string,currentSlide:A.number,disableAnimation:A.bool,disableKeyboard:A.bool,hasMasterSpinner:A.bool,interval:A.number,isPageScrollLocked:A.bool,isPlaying:A.bool,lockOnWindowScroll:A.bool,naturalSlideHeight:A.number.isRequired,naturalSlideWidth:A.number.isRequired,orientation:N.orientation,playDirection:N.direction,step:A.number,dragStep:A.number,tag:A.string,totalSlides:A.number.isRequired,touchEnabled:A.bool,dragEnabled:A.bool,visibleSlides:A.number,infinite:A.bool,isIntrinsicHeight:A.bool}),c(X,"defaultProps",{className:null,currentSlide:0,disableAnimation:!1,disableKeyboard:!1,hasMasterSpinner:!1,interval:5e3,isPageScrollLocked:!1,isPlaying:!1,lockOnWindowScroll:!1,orientation:"horizontal",playDirection:"forward",step:1,dragStep:1,tag:"div",touchEnabled:!0,dragEnabled:!0,visibleSlides:1,infinite:!1,isIntrinsicHeight:!1}),X);K.Consumer;var ee,et,er,en,eo,ei,ea=M(F,function(e){return{currentSlide:e.currentSlide,step:e.step,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides,infinite:e.infinite}}),es={buttonFirst:"buttonFirst___2rhFr"},el=["carouselStore","className","currentSlide","disabled","onClick","totalSlides"],ec=M((c(ee=function(e){function t(){var e;return a(this,t),(e=r.call(this)).handleOnClick=e.handleOnClick.bind(m(e)),e}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props,r=t.carouselStore,n=t.onClick;r.setStoreState({currentSlide:0,isPlaying:!1},null!==n&&n.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.className),r=e.currentSlide,o=e.disabled,i=(e.onClick,e.totalSlides,p(e,el)),a=w([es.buttonFirst,"carousel__first-button",t]);return n.createElement("button",u({type:"button","aria-label":"first",className:a,onClick:this.handleOnClick,disabled:null!==o?o:0===r},i),this.props.children)}}]),t}(n.Component),"propTypes",{carouselStore:A.object.isRequired,children:N.children.isRequired,className:A.string,currentSlide:A.number.isRequired,disabled:A.bool,onClick:A.func,totalSlides:A.number.isRequired}),c(ee,"defaultProps",{className:null,disabled:null,onClick:null}),ee),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides}}),eu={buttonNext:"buttonNext___2mOCa"},ed=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],ef=M((c(et=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).handleOnClick=n.handleOnClick.bind(m(n)),n}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props,r=t.currentSlide,n=t.onClick,o=t.step,i=t.carouselStore,a=t.infinite,s=t.totalSlides-t.visibleSlides,l=Math.min(o+r,s);a&&(l=s===r?0:l),i.setStoreState({currentSlide:l,isPlaying:!1},null!==n&&n.call(this,e))}},{key:"render",value:function(){var e=this.props,r=(e.carouselStore,e.className),o=e.currentSlide,i=e.disabled,a=(e.onClick,e.step,e.totalSlides),s=e.visibleSlides,l=e.infinite,c=p(e,ed),d=w([eu.buttonNext,"carousel__next-button",r]),f=t.setDisabled(i,o,s,a,l);return n.createElement("button",u({type:"button","aria-label":"next",className:d,onClick:this.handleOnClick,disabled:f},c),this.props.children)}}],[{key:"setDisabled",value:function(e,t,r,n,o){return null!==e?e:t>=n-r&&!o}}]),t}(n.PureComponent),"propTypes",{carouselStore:A.object.isRequired,children:N.children.isRequired,className:A.string,currentSlide:A.number.isRequired,disabled:A.bool,onClick:A.func,step:A.number.isRequired,totalSlides:A.number.isRequired,visibleSlides:A.number.isRequired,infinite:A.bool}),c(et,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1}),et),function(e){return{currentSlide:e.currentSlide,step:e.step,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides,infinite:e.infinite}}),eh={buttonLast:"buttonLast___2yuh0"},ep=["carouselStore","className","currentSlide","disabled","onClick","totalSlides","visibleSlides"],em=M((c(er=function(e){function t(){var e;return a(this,t),(e=r.call(this)).handleOnClick=e.handleOnClick.bind(m(e)),e}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props,r=t.carouselStore,n=t.onClick,o=t.totalSlides,i=t.visibleSlides;r.setStoreState({currentSlide:o-i,isPlaying:!1},null!==n&&n.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.className),r=e.currentSlide,o=e.disabled,i=(e.onClick,e.totalSlides),a=e.visibleSlides,s=p(e,ep),l=w([eh.buttonLast,"carousel__last-button",t]);return n.createElement("button",u({type:"button","aria-label":"last",className:l,onClick:this.handleOnClick,disabled:null!==o?o:r>=i-a},s),this.props.children)}}]),t}(n.Component),"propTypes",{carouselStore:A.object.isRequired,children:N.children.isRequired,className:A.string,currentSlide:A.number.isRequired,disabled:A.bool,onClick:A.func,totalSlides:A.number.isRequired,visibleSlides:A.number.isRequired}),c(er,"defaultProps",{className:null,disabled:null,onClick:null}),er),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides}}),eb={buttonNext:"buttonNext___3Lm3s"},ey=["carouselStore","children","childrenPaused","childrenPlaying","className","isPlaying","onClick"],eg=M((c(en=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).handleOnClick=n.handleOnClick.bind(m(n)),n}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props.onClick;this.props.carouselStore.setStoreState({isPlaying:!this.props.isPlaying},null!==t&&t.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.childrenPaused),r=e.childrenPlaying,o=e.className,i=e.isPlaying,a=(e.onClick,p(e,ey)),s=w([eb.buttonNext,"carousel__play-button",o]);return n.createElement("button",u({type:"button","aria-label":"play",className:s,onClick:this.handleOnClick},a),i&&r,!i&&t,this.props.children)}}]),t}(n.PureComponent),"propTypes",{carouselStore:A.object.isRequired,children:A.node,childrenPaused:A.node,childrenPlaying:A.node,className:A.string,isPlaying:A.bool.isRequired,onClick:A.func}),c(en,"defaultProps",{children:null,childrenPaused:null,childrenPlaying:null,className:null,onClick:null}),en),function(e){return{isPlaying:e.isPlaying}}),ev={dot:"dot___3c3SI"},eS=["carouselStore","children","className","currentSlide","disabled","onClick","selected","slide","totalSlides","visibleSlides"],eO=M((c(eo=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).handleOnClick=n.handleOnClick.bind(m(n)),n}d(t,e);var r=b(t);return l(t,[{key:"handleOnClick",value:function(e){var t=this.props,r=t.carouselStore,n=t.onClick,o=t.slide,i=t.totalSlides,a=t.visibleSlides;r.setStoreState({currentSlide:o>=i-a?i-a:o,isPlaying:!1},null!==n&&n.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.className),r=e.currentSlide,o=e.disabled,i=(e.onClick,e.selected),a=e.slide,s=(e.totalSlides,e.visibleSlides),l=p(e,eS),c=a>=r&&a=t&&u=r-o?r-o:u;c.push(n.createElement(eO,{key:u,slide:m,selected:h,disabled:!!i&&h},n.createElement("span",{className:w["carousel__dot-group-dot"]},this.props.dotNumbers&&u+1)))}return c}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children),r=e.className,o=(e.currentSlide,e.dotNumbers,e.totalSlides,e.visibleSlides,e.disableActiveDots,e.showAsSelectedForCurrentSlideOnly,e.renderDots,p(e,eE)),i=w([ew.DotGroup,"carousel__dot-group",r]);return n.createElement("div",u({className:i},o),this.renderDots(),t)}}]),t}(n.Component),"propTypes",{children:N.children,className:A.string,currentSlide:A.number.isRequired,carouselStore:A.object.isRequired,totalSlides:A.number.isRequired,visibleSlides:A.number.isRequired,dotNumbers:A.bool,disableActiveDots:A.bool,showAsSelectedForCurrentSlideOnly:A.bool,renderDots:A.func}),c(ei,"defaultProps",{children:null,className:null,dotNumbers:!1,disableActiveDots:!0,showAsSelectedForCurrentSlideOnly:!1,renderDots:null}),ei),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides}}),ej={image:"image___xtQGH"},ex=["src","alt"],eT=["carouselStore","children","className","hasMasterSpinner","isBgImage","onError","onLoad","renderError","renderLoading","style","tag"],e_=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).state={imageStatus:R},n.handleImageLoad=n.handleImageLoad.bind(m(n)),n.handleImageError=n.handleImageError.bind(m(n)),n.image=null,n}d(t,e);var r=b(t);return l(t,[{key:"componentDidMount",value:function(){t.subscribeMasterSpinner(this.props),this.initImage()}},{key:"componentDidUpdate",value:function(e){e.src!==this.props.src&&(t.unsubscribeMasterSpinner(e),t.subscribeMasterSpinner(this.props),this.initImage())}},{key:"componentWillUnmount",value:function(){t.unsubscribeMasterSpinner(this.props),this.image.removeEventListener("load",this.handleImageLoad),this.image.removeEventListener("error",this.handleImageError),this.image=null}},{key:"initImage",value:function(){if(this.setState({imageStatus:R}),this.image=document.createElement("img"),this.image.addEventListener("load",this.handleImageLoad,!1),this.image.addEventListener("error",this.handleImageError,!1),this.image.src=this.props.src,this.image.readyState||this.image.complete){var e=this.image.src;this.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.image.src=e}}},{key:"handleImageLoad",value:function(e){this.setState({imageStatus:I}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerSuccess(this.props.src),this.props.onLoad&&this.props.onLoad(e)}},{key:"handleImageError",value:function(e){this.setState({imageStatus:D}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerError(this.props.src),this.props.onError&&this.props.onError(e)}},{key:"tempTag",value:function(){return"img"===this.props.tag?"div":this.props.tag}},{key:"customRender",value:function(e){return"function"==typeof this.props[e]?this.props[e]():this.props.children}},{key:"renderLoading",value:function(e){var t=this.tempTag(),r=w([ej.image,ej.imageLoading,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--loading",this.props.className]);return n.createElement(t,u({className:r},e),this.customRender("renderLoading"))}},{key:"renderError",value:function(e){var t=this.tempTag(),r=w([ej.image,ej.imageError,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--error",this.props.className]);return n.createElement(t,u({className:r},e),this.customRender("renderError"))}},{key:"renderSuccess",value:function(e){var t=this.props,r=t.style,o=t.tag,i=w([ej.image,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--success",this.props.className]),a=u({},r),s=e;if("img"!==o){var l=e.src;e.alt,s=p(e,ex),a=u({},r,{backgroundImage:'url("'.concat(l,'")'),backgroundSize:"cover"})}return n.createElement(o,u({className:i,style:a},s),this.props.children)}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.className,e.hasMasterSpinner,e.isBgImage,e.onError,e.onLoad,e.renderError,e.renderLoading,e.style,e.tag,p(e,eT));switch(this.state.imageStatus){case R:return this.renderLoading(t);case I:return this.renderSuccess(t);case D:return this.renderError(t);default:throw Error("unknown value for this.state.imageStatus")}}}],[{key:"subscribeMasterSpinner",value:function(e){e.hasMasterSpinner&&e.carouselStore.subscribeMasterSpinner(e.src)}},{key:"unsubscribeMasterSpinner",value:function(e){e.hasMasterSpinner&&e.carouselStore.unsubscribeMasterSpinner(e.src)}}]),t}(n.Component);c(e_,"propTypes",{alt:A.string,carouselStore:A.object.isRequired,children:N.children,className:A.string,hasMasterSpinner:A.bool.isRequired,isBgImage:N.isBgImage,onError:A.func,onLoad:A.func,renderError:A.func,renderLoading:A.func,src:A.string.isRequired,style:A.object,tag:A.string}),c(e_,"defaultProps",{alt:"",children:null,className:null,isBgImage:!1,onError:null,onLoad:null,renderError:null,renderLoading:null,style:null,tag:"img"});var eM,eC,eA,eR,eI=M(e_,function(e){return{hasMasterSpinner:e.hasMasterSpinner,orientation:e.orientation}}),eD={spinner:"spinner___27VUp"},eN=["className"],eL=(c(eM=function(e){function t(){return a(this,t),r.apply(this,arguments)}d(t,e);var r=b(t);return l(t,[{key:"render",value:function(){var e=this.props,t=e.className,r=p(e,eN),o=w([eD.spinner,"carousel__spinner",t]);return n.createElement("div",u({className:o},r))}}]),t}(n.PureComponent),"propTypes",{className:A.string}),c(eM,"defaultProps",{className:null}),eM),eU={container:"container___2O72F",overlay:"overlay___IV4qY",hover:"hover___MYy31",zoom:"zoom___3kqYk",loading:"loading___1pvNI",imageLoadingSpinnerContainer:"imageLoadingSpinnerContainer___3UIPD"},eW=["alt","bgImageProps","bgImageTag","carouselStore","className","imageClassName","overlayClassName","isPinchZoomEnabled","spinner","src","srcZoomed","tag"],eF=M((c(eC=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).state={isImageLoading:!0,isHovering:!1,isZooming:!1,x:null,y:null,scale:1},n.tpCache={},n.handleImageComplete=n.handleImageComplete.bind(m(n)),n.handleOnMouseMove=n.handleOnMouseMove.bind(m(n)),n.handleOnMouseOut=n.handleOnMouseOut.bind(m(n)),n.handleOnMouseOver=n.handleOnMouseOver.bind(m(n)),n.handleOnTouchEnd=n.handleOnTouchEnd.bind(m(n)),n.handleOnTouchMove=n.handleOnTouchMove.bind(m(n)),n.handleOnTouchStart=n.handleOnTouchStart.bind(m(n)),n}d(t,e);var r=b(t);return l(t,[{key:"componentDidUpdate",value:function(e,t){!1===t.isZooming&&!0===this.state.isZooming&&this.props.carouselStore.setStoreState({isPageScrollLocked:!0}),!0===t.isZooming&&!1===this.state.isZooming&&this.props.carouselStore.setStoreState({isPageScrollLocked:!1})}},{key:"handleImageComplete",value:function(){this.setState({isImageLoading:!1})}},{key:"handleOnMouseOver",value:function(){this.state.isZooming||this.setState({isHovering:!0,scale:2})}},{key:"handleOnMouseOut",value:function(){this.state.isZooming||this.setState({isHovering:!1,scale:1})}},{key:"handleOnMouseMove",value:function(e){if(!this.state.isZooming){var t=k(e.nativeEvent.offsetX/e.target.offsetWidth*100),r=k(e.nativeEvent.offsetY/e.target.offsetHeight*100);this.setState({x:t,y:r})}}},{key:"handleOnTouchStart",value:function(e){var t=this;this.props.isPinchZoomEnabled&&(y(e.targetTouches).forEach(function(e){t.tpCache[e.identifier]={clientX:e.clientX,clientY:e.clientY}}),this.setState(function(e){return{isZooming:e.isZooming||Object.keys(t.tpCache).length>1}}))}},{key:"handleOnTouchMove",value:function(e){var r=this;if(this.state.isZooming){e.persist();var n=y(e.targetTouches).filter(function(e){return r.tpCache[e.identifier]}).slice(0,2);if(2===n.length){e.stopPropagation();var o=e.target.getBoundingClientRect(),a=n[0].identifier,s=n[1].identifier,l={x1:this.tpCache[a].clientX,y1:this.tpCache[a].clientY,x2:this.tpCache[s].clientX,y2:this.tpCache[s].clientY};l.distance=t.distanceBetweenTwoTouches(i({},l));var c=t.midpointBetweenTwoTouches(i({},l));l.cx=c.x,l.cy=c.y;var u={x1:n[0].clientX,y1:n[0].clientY,x2:n[1].clientX,y2:n[1].clientY};u.distance=t.distanceBetweenTwoTouches(i({},u));var d=t.midpointBetweenTwoTouches(i({},u));u.cx=d.x,u.cy=d.y;var f=k(L({min:0,max:100,x:(u.cx-o.left)/o.width*100})),h=k(L({min:0,max:100,x:(u.cy-o.top)/o.height*100})),p=function(e){return L({min:1,max:3,x:e.scale+(u.distance-l.distance)/100})};this.setState(function(e){return{isZooming:1!==p(e),scale:p(e),x:f,y:h}})}}}},{key:"handleOnTouchEnd",value:function(e){var t=this;this.props.isPinchZoomEnabled&&(y(e.changedTouches).forEach(function(e){delete t.tpCache[e.identifier]}),0===Object.keys(this.tpCache).length&&this.setState({isZooming:!1}))}},{key:"renderLoading",value:function(){if(this.state.isImageLoading){var e=this.props.spinner;return n.createElement("div",{className:w([eU.imageLoadingSpinnerContainer,"carousel__image-loading-spinner-container"])},e&&e(),!e&&n.createElement(eL,null))}return null}},{key:"render",value:function(){var e=this.props,t=e.alt,r=e.bgImageProps,o=e.bgImageTag,i=(e.carouselStore,e.className),a=e.imageClassName,s=e.overlayClassName,l=(e.isPinchZoomEnabled,e.spinner,e.src),c=e.srcZoomed,d=e.tag,f=p(e,eW),h=w([eU.container,i]),m=w([eU.image,"carousel__zoom-image",a]),b=w([eU.overlay,"carousel__zoom-image-overlay",this.state.isHovering&&eU.hover,this.state.isZooming&&eU.zoom,this.state.isHovering&&"carousel__zoom-image-overlay--hovering",this.state.isZooming&&"carousel__zoom-image-overlay--zooming",s]),y={};return(this.state.isHovering||this.state.isZooming)&&(y.transformOrigin="".concat(this.state.x," ").concat(this.state.y),y.transform="scale(".concat(this.state.scale,")")),n.createElement(d,u({className:h},f),n.createElement(eI,u({alt:t,className:m,tag:o,src:l,onLoad:this.handleImageComplete,onError:this.handleImageComplete},r)),n.createElement(eI,{className:b,tag:"div",src:c||l,style:y,isBgImage:!0,onFocus:this.handleOnMouseOver,onMouseOver:this.handleOnMouseOver,onBlur:this.handleOnMouseOut,onMouseOut:this.handleOnMouseOut,onMouseMove:this.handleOnMouseMove,onTouchStart:this.handleOnTouchStart,onTouchEnd:this.handleOnTouchEnd,onTouchMove:this.handleOnTouchMove}),this.renderLoading())}}],[{key:"midpointBetweenTwoTouches",value:function(e){var t=e.x1,r=e.y1;return{x:(t+e.x2)/2,y:(r+e.y2)/2}}},{key:"distanceBetweenTwoTouches",value:function(e){var t=e.x1,r=e.y1;return Math.sqrt(Math.pow(e.x2-t,2)+Math.pow(e.y2-r,2))}}]),t}(n.Component),"propTypes",{alt:A.string,bgImageProps:A.object,bgImageTag:A.string,carouselStore:A.object.isRequired,className:A.string,imageClassName:A.string,overlayClassName:A.string,spinner:A.func,src:A.string.isRequired,srcZoomed:A.string,tag:A.string,isPinchZoomEnabled:A.bool}),c(eC,"defaultProps",{alt:void 0,bgImageProps:{},bgImageTag:"div",className:null,imageClassName:null,overlayClassName:null,isPinchZoomEnabled:!0,spinner:null,srcZoomed:null,tag:"div"}),eC),function(){return{}}),eB={slide:"slide___3-Nqo",slideHorizontal:"slideHorizontal___1NzNV",slideInner:"slideInner___2mfX9",focusRing:"focusRing___1airF"},ez=["ariaLabel","carouselStore","children","className","classNameHidden","classNameVisible","currentSlide","index","innerClassName","innerTag","naturalSlideHeight","naturalSlideWidth","onBlur","onFocus","orientation","slideSize","style","tabIndex","tag","totalSlides","visibleSlides","isIntrinsicHeight"],eq=M((c(eA=function(e){function t(e){var n;return a(this,t),(n=r.call(this,e)).handleOnFocus=n.handleOnFocus.bind(m(n)),n.handleOnBlur=n.handleOnBlur.bind(m(n)),n.state={focused:!1},n}d(t,e);var r=b(t);return l(t,[{key:"isVisible",value:function(){var e=this.props,t=e.currentSlide,r=e.index,n=e.visibleSlides;return r>=t&&r=r.props.horizontalPixelThreshold}})})}},{key:"fakeOnDragEnd",value:function(){window.cancelAnimationFrame.call(window,this.moveTimer),this.computeCurrentSlide(),"vertical"===this.props.orientation&&this.props.carouselStore.setStoreState({isPageScrollLocked:!1}),this.setState({deltaX:0,deltaY:0,isBeingTouchDragged:!1,isBeingMouseDragged:!1}),this.isDocumentScrolling=!this.props.lockOnWindowScroll&&null}},{key:"callCallback",value:function(e,t){var r=this.props.trayProps;r&&"function"==typeof r[e]&&(t.persist(),r[e](t))}},{key:"handleOnMouseDown",value:function(e){if(!this.props.dragEnabled)return void this.callCallback("onMouseDown",e);e.preventDefault(),this.fakeOnDragStart({screenX:e.screenX,screenY:e.screenY,mouseDrag:!0}),this.callCallback("onMouseDown",e)}},{key:"handleOnMouseMove",value:function(e){this.state.isBeingMouseDragged&&(this.setState({cancelNextClick:!0}),e.preventDefault(),this.fakeOnDragMove(e.screenX,e.screenY))}},{key:"handleOnMouseUp",value:function(e){this.state.isBeingMouseDragged&&(e.preventDefault(),this.fakeOnDragEnd())}},{key:"handleOnClickCapture",value:function(e){if(!this.state.cancelNextClick)return void this.callCallback("onClickCapture",e);e.preventDefault(),this.setState({cancelNextClick:!1}),this.callCallback("onClickCapture",e)}},{key:"handleOnTouchStart",value:function(e){if(!this.props.touchEnabled)return void this.callCallback("onTouchStart",e);"vertical"===this.props.orientation&&e.preventDefault();var t=e.targetTouches[0];this.fakeOnDragStart({screenX:t.screenX,screenY:t.screenY,touchDrag:!0}),this.callCallback("onTouchStart",e)}},{key:"handleDocumentScroll",value:function(){var e=this;this.props.touchEnabled&&(this.isDocumentScrolling=!0,window.clearTimeout(this.scrollStopTimer),this.scrollStopTimer=window.setTimeout(function(){e.isDocumentScrolling=!1},66))}},{key:"handleOnTouchMove",value:function(e){if(!this.props.touchEnabled||this.props.lockOnWindowScroll&&this.isDocumentScrolling)return void this.callCallback("onTouchMove",e);window.cancelAnimationFrame.call(window,this.moveTimer);var t=e.targetTouches[0];t&&(this.fakeOnDragMove(t.screenX,t.screenY),this.callCallback("onTouchMove",e))}},{key:"forward",value:function(){var e=this.props;return Math.min(e.currentSlide+e.step,e.totalSlides-e.visibleSlides)}},{key:"backward",value:function(){var e=this.props;return Math.max(e.currentSlide-e.step,0)}},{key:"handleOnKeyDown",value:function(e){var t=e.keyCode,r=this.props,n=r.carouselStore,o=r.currentSlide,i=r.disableKeyboard,a=r.totalSlides,s=r.visibleSlides,l={};!0===i||a<=s||(37===t&&(e.preventDefault(),this.focus(),l.currentSlide=Math.max(0,o-1),l.isPlaying=!1),39===t&&(e.preventDefault(),this.focus(),l.currentSlide=Math.min(a-s,o+1),l.isPlaying=!1),n.setStoreState(l))}},{key:"playForward",value:function(){var e=this.props,t=e.carouselStore,r=e.currentSlide;t.setStoreState({currentSlide:this.forward()===r?0:this.forward()})}},{key:"playBackward",value:function(){var e=this.props,t=e.carouselStore,r=e.currentSlide,n=e.totalSlides,o=e.visibleSlides;t.setStoreState({currentSlide:this.backward()===r?n-o:this.backward()})}},{key:"play",value:function(){var e=this.props.playDirection;this.interval=setInterval("forward"===e?this.playForward:this.playBackward,this.props.interval)}},{key:"stop",value:function(){window.clearInterval(this.interval),this.interval=null}},{key:"lockScroll",value:function(){var e=new eH;this.scrollParent=e.getScrollParent(this.sliderTrayElement),this.scrollParent&&(this.originalOverflow=this.originalOverflow||this.scrollParent.style.overflow,this.scrollParent.style.overflow="hidden")}},{key:"unlockScroll",value:function(){this.scrollParent&&(this.scrollParent.style.overflow=this.originalOverflow,this.originalOverflow=null,this.scrollParent=null)}},{key:"blockWindowScroll",value:function(e){this.state.preventingVerticalScroll&&(e.preventDefault(),e.stopImmediatePropagation())}},{key:"computeCurrentSlide",value:function(){var e=t.slideSizeInPx(this.props.orientation,this.sliderTrayElement.clientWidth,this.sliderTrayElement.clientHeight,this.props.totalSlides),r=t.slidesMoved(this.props.moveThreshold,this.props.orientation,this.state.deltaX,this.state.deltaY,e,this.props.dragStep),n=this.props.totalSlides-Math.min(this.props.totalSlides,this.props.visibleSlides),o=L({min:0,max:n,x:this.props.currentSlide+r});this.props.infinite&&(this.props.currentSlide>=n&&r>0&&(o=0),0===this.props.currentSlide&&r<0&&(o=n)),this.props.carouselStore.setStoreState({currentSlide:o})}},{key:"focus",value:function(){this.sliderElement.focus()}},{key:"handleOnTouchEnd",value:function(e){this.endTouchMove(),this.callCallback("onTouchEnd",e)}},{key:"handleOnTouchCancel",value:function(e){this.endTouchMove(),this.callCallback("onTouchCancel",e)}},{key:"endTouchMove",value:function(){this.props.touchEnabled&&this.fakeOnDragEnd()}},{key:"renderMasterSpinner",value:function(){var e=this.props,t=e.hasMasterSpinner,r=e.masterSpinnerFinished,o=e.spinner;return t&&!r?("function"==typeof this.props.onMasterSpinner&&this.props.onMasterSpinner(),n.createElement("div",{className:w([eV.masterSpinnerContainer,"carousel__master-spinner-container"])},o&&o(),!o&&n.createElement(eL,null))):null}},{key:"render",value:function(){var e=this,t=this.props,r=t.ariaLabel,o=(t.carouselStore,t.children),i=t.className,a=t.classNameAnimation,s=t.classNameTray,l=t.classNameTrayWrap,c=t.currentSlide,d=t.disableAnimation,f=(t.disableKeyboard,t.dragEnabled,t.hasMasterSpinner,t.interval,t.isPageScrollLocked,t.isPlaying,t.lockOnWindowScroll,t.masterSpinnerFinished,t.moveThreshold,t.naturalSlideHeight),h=t.naturalSlideWidth,m=(t.onMasterSpinner,t.orientation),b=(t.playDirection,t.privateUnDisableAnimation,t.slideSize),y=t.slideTraySize,g=(t.spinner,t.style),v=t.tabIndex,S=(t.totalSlides,t.touchEnabled,t.trayProps),O=t.trayTag,E=t.visibleSlides,P=t.isIntrinsicHeight,j=p(t,eX),x=u({},g),T={};"vertical"===m&&(T.height=0,T.paddingBottom=k(100*f*E/h),T.width=k(100));var _={},M=k(-(b*c*1));(this.state.isBeingTouchDragged||this.state.isBeingMouseDragged||d)&&(_.transition="none"),P&&(_.display="flex",_.alignItems="stretch"),"vertical"===m?(_.transform="translateY(".concat(M,") translateY(").concat(this.state.deltaY,"px)"),_.width=k(100),_.flexDirection="column"):(_.width=k(y),_.transform="translateX(".concat(M,") translateX(").concat(this.state.deltaX,"px)"),_.flexDirection="row");var C=w(["vertical"===m?eV.verticalSlider:eV.horizontalSlider,"carousel__slider","vertical"===m?"carousel__slider--vertical":"carousel__slider--horizontal",i]),A=w([eV.sliderTrayWrap,"carousel__slider-tray-wrapper","vertical"===m?eV.verticalSlideTrayWrap:eV.horizontalTrayWrap,"vertical"===m?"carousel__slider-tray-wrap--vertical":"carousel__slider-tray-wrap--horizontal",l]),R=w([eV.sliderTray,a||eV.sliderAnimation,"carousel__slider-tray","vertical"===m?eV.verticalTray:eV.horizontalTray,"vertical"===m?"carousel__slider-tray--vertical":"carousel__slider-tray--horizontal",s]),I=(j.dragStep,j.step,j.infinite,j.preventVerticalScrollOnTouch,j.preventingVerticalScroll,j.horizontalPixelThreshold,j.verticalPixelThreshold,p(j,eG)),D=(S.className,S.onClickCapture,S.onMouseDown,S.onTouchCancel,S.onTouchEnd,S.onTouchMove,S.onTouchStart,S.ref,S.style,p(S,eK));return n.createElement("div",u({ref:function(t){e.sliderElement=t},className:C,"aria-live":"polite","aria-label":r,style:x,tabIndex:null!==v?v:0,onKeyDown:this.handleOnKeyDown,role:"listbox"},I),n.createElement("div",{className:A,style:T},n.createElement(O,u({ref:this.getSliderRef,className:R,style:_,onTouchStart:this.handleOnTouchStart,onTouchMove:this.handleOnTouchMove,onTouchEnd:this.handleOnTouchEnd,onTouchCancel:this.handleOnTouchCancel,onMouseDown:this.handleOnMouseDown,onClickCapture:this.handleOnClickCapture},D),o),this.renderMasterSpinner()))}}],[{key:"slideSizeInPx",value:function(e,t,r,n){return("horizontal"===e?t:r)/n}},{key:"slidesMoved",value:function(e,t,r,n,o,i){var a="horizontal"===t?r:n,s=Math.abs(Math.round(a/o)),l=Math.max(Math.abs(a)>=o*e?i:0,s);if(a<0)return l;var c=-l;return 0===c?0:c}}]),t}(n.Component),"propTypes",{ariaLabel:A.string,carouselStore:A.object.isRequired,children:A.node.isRequired,className:A.string,classNameAnimation:A.string,classNameTray:A.string,classNameTrayWrap:A.string,currentSlide:A.number.isRequired,disableAnimation:A.bool,disableKeyboard:A.bool,dragEnabled:A.bool.isRequired,dragStep:A.number,hasMasterSpinner:A.bool.isRequired,infinite:A.bool,interval:A.number.isRequired,isPageScrollLocked:A.bool.isRequired,isPlaying:A.bool.isRequired,lockOnWindowScroll:A.bool.isRequired,preventVerticalScrollOnTouch:A.bool,horizontalPixelThreshold:A.number,verticalPixelThreshold:A.number,masterSpinnerFinished:A.bool.isRequired,moveThreshold:A.number,naturalSlideHeight:A.number.isRequired,naturalSlideWidth:A.number.isRequired,onMasterSpinner:A.func,orientation:N.orientation.isRequired,playDirection:N.direction.isRequired,privateUnDisableAnimation:A.bool,slideSize:A.number.isRequired,slideTraySize:A.number.isRequired,spinner:A.func,step:A.number.isRequired,style:A.object,tabIndex:A.number,totalSlides:A.number.isRequired,touchEnabled:A.bool.isRequired,trayProps:A.shape({className:A.string,onClickCapture:A.func,onMouseDown:A.func,onTouchCancel:A.func,onTouchEnd:A.func,onTouchMove:A.func,onTouchStart:A.func,ref:A.shape({}),style:A.string}),trayTag:A.string,visibleSlides:A.number,isIntrinsicHeight:A.bool}),c(eR,"defaultProps",{ariaLabel:"slider",className:null,classNameAnimation:null,classNameTray:null,classNameTrayWrap:null,disableAnimation:!1,disableKeyboard:!1,dragStep:1,infinite:!1,preventVerticalScrollOnTouch:!0,horizontalPixelThreshold:15,verticalPixelThreshold:10,moveThreshold:.1,onMasterSpinner:null,privateUnDisableAnimation:!1,spinner:null,style:{},tabIndex:null,trayProps:{},trayTag:"div",visibleSlides:1,isIntrinsicHeight:!1}),eR),function(e){return{currentSlide:e.currentSlide,disableAnimation:e.disableAnimation,privateUnDisableAnimation:e.privateUnDisableAnimation,disableKeyboard:e.disableKeyboard,dragEnabled:e.dragEnabled,hasMasterSpinner:e.hasMasterSpinner,infinite:e.infinite,interval:e.interval,isPageScrollLocked:e.isPageScrollLocked,isPlaying:e.isPlaying,lockOnWindowScroll:e.lockOnWindowScroll,preventingVerticalScroll:e.preventingVerticalScroll,masterSpinnerFinished:e.masterSpinnerFinished,naturalSlideHeight:e.naturalSlideHeight,naturalSlideWidth:e.naturalSlideWidth,orientation:e.orientation,playDirection:e.playDirection,slideSize:e.slideSize,slideTraySize:e.slideTraySize,step:e.step,dragStep:e.dragStep,totalSlides:e.totalSlides,touchEnabled:e.touchEnabled,visibleSlides:e.visibleSlides,isIntrinsicHeight:e.isIntrinsicHeight}})},8169:(e,t,r)=>{e.exports=r(17066)},8830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ColumnLayout",{enumerable:!0,get:function(){return s}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477),i=r(19619);function a(e){for(var t=1;t{"use strict";r.r(t),r.d(t,{Chat:()=>aT,PubSub:()=>sf,Video:()=>sb,WebRTC:()=>sE});var n,o,i={};r.r(i),r.d(i,{__DO_NOT_USE__ActionTypes:()=>m,applyMiddleware:()=>w,bindActionCreators:()=>S,combineReducers:()=>g,compose:()=>O,createStore:()=>b,legacy_createStore:()=>y});var a=r(61373),s=r.n(a),l=r(740),c=r(89921);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e){for(var t=1;t=0&&e.splice(r,1)}function ee(e){var t=!1;return function(){t||(t=!0,e())}}var et=function(e){throw e},er=function(e){return{value:e,done:!0}};function en(e,t,r){void 0===t&&(t=et),void 0===r&&(r="iterator");var n={meta:{name:r},next:e,throw:t,return:er,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(n[Symbol.iterator]=function(){return n}),n}function eo(e,t){var r=t.sagaStack;console.error(e),console.error(r)}var ei=function(e){return Array.apply(null,Array(e))},ea=function(e){return e===R},es=function(e){return e===A},el=function(e){return ea(e)||es(e)};function ec(e,t){var r,n=Object.keys(e),o=n.length,i=0,a=B(e)?ei(o):{},s={};return n.forEach(function(e){var n=function(n,s){r||(s||el(n)?(t.cancel(),t(n,s)):(a[e]=n,++i===o&&(r=!0,t(a))))};n.cancel=J,s[e]=n}),t.cancel=function(){r||(r=!0,n.forEach(function(e){return s[e].cancel()}))},s}function eu(e){return{name:e.name||"anonymous",location:e[I]}}var ed={isEmpty:K,put:J,take:J};function ef(e,t){void 0===e&&(e=10);var r=Array(e),n=0,o=0,i=0,a=function(t){r[o]=t,o=(o+1)%e,n++},s=function(){if(0!=n){var t=r[i];return r[i]=null,n--,i=(i+1)%e,t}},l=function(){for(var e=[];n;)e.push(s());return e};return{isEmpty:function(){return 0==n},put:function(s){if(n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n2?f-2:0),p=2;pt in e?to(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,th=(e,t)=>{for(var r in t||(t={}))tu.call(t,r)&&tf(e,r,t[r]);if(tc)for(var r of tc(t))td.call(t,r)&&tf(e,r,t[r]);return e},tp=(e,t)=>ti(e,ts(t)),tm=(e,t)=>{var r={};for(var n in e)tu.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&tc)for(var n of tc(e))0>t.indexOf(n)&&td.call(e,n)&&(r[n]=e[n]);return r},tb=(e,t)=>{for(var r in t)to(e,r,{get:t[r],enumerable:!0})},ty=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of tl(t))tu.call(e,o)||o===r||to(e,o,{get:()=>t[o],enumerable:!(n=ta(t,o))||n.enumerable});return e},tg=(e,t,r)=>(ty(e,t,"default"),r&&ty(r,t,"default")),tv=(e,t,r)=>(tf(e,"symbol"!=typeof t?t+"":t,r),r),tS="__local__",tO="__synthetic__",tw="video",tk="chat",tE="chat",tP=["room.started","room.ended"].map(e=>`${tw}.${e}`),tj=()=>new Date().toISOString(),tx=s().getLogger("signalwire"),tT=tx.methodFactory;tx.methodFactory=(e,t,r)=>{let n=tT(e,t,r);return function(...e){e.unshift(tj(),"-"),n.apply(void 0,e)}};var t_=tx.getLevel();tx.setLevel(t_);var tM=e=>{o=e},tC={},tA=e=>{if(null==e){tC={};return}Object.assign(tC,e)},tR=()=>null!=o?o:tx,tI=e=>!("method"in e)||"signalwire.ping"!==e.method,tD=({type:e,payload:t})=>{let r=tR(),{logWsTraffic:n}=tC||{};if(!n)return;let o=tI(t)?JSON.stringify(t,null,2):t;return r.info(`${e.toUpperCase()}: `,o,"\n")},tN=()=>new Proxy(tR(),{get:(e,t,r)=>"wsTraffic"===t?tD:Reflect.get(e,t,r)}),tL=({response:e,request:t})=>{let{result:r={},error:n}=e;return n?{error:n}:"signalwire.connect"===t.method?{result:r}:tU(e)},tU=(e,t)=>{let{result:r={},error:n}=e;if(n)return{error:n};let{code:o,node_id:i,result:a=null}=r;return o&&"200"!==o?{error:r}:null===a?(t&&(r.node_id=t),{result:r}):a?a.jsonrpc?tU(a,i):{result:a}:{result:r}},tW=e=>{if(void 0===e)return e;let t=new Date(1e3*e);return isNaN(t.getTime())?e:t},tF={propsToUpdateValue:["updated","layers","members","recordings","playbacks"]},tB=e=>e.endsWith("At"),tz=(e,t=tF)=>(null==e?void 0:e.__sw_symbol)||(null==e?void 0:e.__sw_proxy)?e:Object.entries(e).reduce((e,[r,n])=>{let o=tq(r);return"object"==typeof n&&n?Array.isArray(n)?t.propsToUpdateValue.includes(r)?e[o]=n.map(e=>"string"==typeof e?tq(e):tz(e)):e[o]=n:e[o]=tz(n):tB(o)?e[o]=tW(n):e[o]=n,e},{}),tq=e=>e.includes("_")?e.split("_").reduce((e,t,r)=>{let n=t.trim().charAt(0),o=t.substr(1).toLowerCase();return`${e}${0===r?n.toLowerCase():n.toUpperCase()}${o}`},""):e,tH=/[A-Z]/g,tV=e=>e.replace(tH,e=>`_${e.toLowerCase()}`),tX=({event:e,namespace:t})=>("string"==typeof e&&(e=tV(e=tG({event:e,namespace:t}))),e),tG=({namespace:e,event:t})=>!e||t.startsWith(e)?t:`${e}:${t}`,tK=e=>{let{event_type:t,params:r,node_id:n}=e;return"queuing.relay.tasks"===t?{type:t,payload:e}:("webrtc.message"===t&&(null==r?void 0:r.jsonrpc)&&r.params&&(r.params.nodeId=n),{type:t,payload:r})},tJ=(e,t)=>(Object.keys(t).forEach(t=>{if(e.prototype.hasOwnProperty(t))throw Error(`[extendComponent] Duplicated method name: ${t}`)}),Object.defineProperties(e.prototype,t),e),tZ=({property:e,payload:t})=>"function"==typeof e?()=>JSON.stringify(t):e,tY=e=>{let t={},r=e,n=!0;for(;n;)Object.getOwnPropertyNames(r).forEach(r=>{"function"!=typeof e[r]||"string"!=typeof r||r in t||(t[r]=e[r])}),r&&r.__sw_symbol?r=Object.getPrototypeOf(r):n=!1;return t},tQ=({instance:e,proxiedObj:t,payload:r,transformedPayload:n,transform:o})=>Object.defineProperties(t,Object.entries(th(tp(th({},n),{_eventsNamespace:o.getInstanceEventNamespace?o.getInstanceEventNamespace(r):void 0,eventChannel:o.getInstanceEventChannel?o.getInstanceEventChannel(r):void 0}),tY(e))).reduce((e,[t,r])=>(void 0===r||(e[t]={value:r,enumerable:!0,configurable:!0,writable:!0}),e),{})),t$=({instance:e,transform:t,payload:r,transformedPayload:n})=>{let o=new Proxy(e,{get:(e,o,i)=>"__sw_proxy"===o||("toString"===o?tZ({property:e[o],payload:n}):"_eventsNamespace"===o&&t.getInstanceEventNamespace?t.getInstanceEventNamespace(r):"eventChannel"===o&&t.getInstanceEventChannel?t.getInstanceEventChannel(r):o in n?n[o]:Reflect.get(e,o,i))});return tQ({instance:e,proxiedObj:o,payload:r,transformedPayload:n,transform:t})},t0=new Map,t1=({transform:e,payload:t})=>{if(!t0.has(e.type)){let r=e.instanceFactory(t);return t0.set(e.type,r),r}return t0.get(e.type)},t2=({transform:e,payload:t})=>{let r=t1({transform:e,payload:t}),n=e.payloadTransform(t);return t$({transform:e,payload:t,instance:r,transformedPayload:n})},t4=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},t3=/^(ws|wss):\/\//,t5=e=>{let t=t3.test(e)?"":"wss://";return`${t}${e}`},t7=(e,t,r)=>{let n=null;return Promise.race([e,new Promise((e,o)=>n=setTimeout(o,t,r))]).finally(()=>clearTimeout(n))},t8=e=>tP.includes(e),t6=e=>e.includes(tO),t9=e=>e.includes("session."),re=e=>{let t=e.split(":");return t[t.length-1]},rt=["video.member.updated","video.member.talking"],rr=["video.room.joined","video.track","video.active","video.answering","video.destroy","video.early","video.hangup","video.held","video.new","video.purge","video.recovering","video.requesting","video.ringing","video.trying"],rn=e=>Array.from(new Set(e.map(e=>{if("string"==typeof e){let t=re(e);return rr.includes(t)||t6(t)||ro(t)||t9(t)?null:rt.find(e=>t.startsWith(e))||t}return e}))).filter(Boolean),ro=e=>e.includes(tS),ri=e=>{let t=e.split(".")[0];return e.split(".").reduce((e,r)=>(e.push(r),r===t&&e.push(tS),e),[]).join(".")},ra=e=>!!e.method,rs=e=>!ra(e),rl=e=>{var t;return th({jsonrpc:"2.0",id:null!=(t=e.id)?t:(0,l.A)()},e)},rc=e=>th({jsonrpc:"2.0"},e),ru={major:3,minor:0,revision:0},rd=e=>rl({method:"signalwire.connect",params:th({version:ru},e)}),rf=e=>rl({method:"signalwire.reauthenticate",params:{authentication:e}}),rh=(e,t)=>rc({id:e,result:{timestamp:t||Date.now()/1e3}}),rp=({method:e,params:t})=>rl({method:e,params:t}),rm=e=>rc({id:e,result:{}}),rb={id:"callID",destinationNumber:"destination_number",remoteCallerName:"remote_caller_id_name",remoteCallerNumber:"remote_caller_id_number",callerName:"caller_id_name",callerNumber:"caller_id_number"},ry=e=>{if(e.hasOwnProperty("dialogParams")){let t=e.dialogParams,{remoteSdp:r,localStream:n,remoteStream:o}=t,i=tm(t,["remoteSdp","localStream","remoteStream"]);for(let e in rb)e&&i.hasOwnProperty(e)&&(i[rb[e]]=i[e],delete i[e]);e.dialogParams=i}return e},rg=e=>(t={})=>rl({method:e,params:ry(t)}),rv=rg("verto.invite"),rS=rg("verto.bye");rg("verto.attach");var rO=rg("verto.modify"),rw=rg("verto.info");rg("verto.answer");var rk=rg("verto.pong"),rE=(e,t)=>rc({id:e,result:{method:t}}),rP={};tb(rP,{authErrorAction:()=>rI,authExpiringAction:()=>rN,authSuccessAction:()=>rD,compoundEventAttachAction:()=>rX,createAction:()=>rx,destroyAction:()=>rC,executeAction:()=>rR,getCustomSagaActionType:()=>rV,initAction:()=>rM,makeCustomSagaAction:()=>rH,reauthAction:()=>rA,sessionAuthErrorAction:()=>rB,sessionConnectedAction:()=>rU,sessionDisconnectedAction:()=>rW,sessionExpiringAction:()=>rz,sessionReconnectingAction:()=>rF,socketMessageAction:()=>rL});var rj={};function rx(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error("prepareAction did not return an object");return th(th({type:e,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>t.type===e,r}tb(rj,{configureStore:()=>r_,createAction:()=>rx}),tg(rj,i);var rT="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?O:O.apply(null,arguments)};function r_(e){let t,r=function(){return[]},{reducer:n,middleware:o=r(),devTools:i=!0,preloadedState:a,enhancers:s}=e||{};if("function"==typeof n)t=n;else if(function(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);if(null===t)return!0;let r=t;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return t===r}(n))t=g(n);else throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');let l=o;"function"==typeof l&&(l=l(r));let c=w(...l),u=O;i&&(u=rT(th({trace:!1},"object"==typeof i&&i)));let d=[c];return Array.isArray(s)?d=[c,...s]:"function"==typeof s&&(d=s(d)),b(t,a,u(...d))}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var rM=rx("swSdk/init"),rC=rx("swSdk/destroy"),rA=rx("swSdk/reauth"),rR=rx("swSdk/executeRequest"),rI=rx("auth/error"),rD=rx("auth/success"),rN=rx("auth/expiring"),rL=rx("socket/message"),rU=rx("session.connected"),rW=rx("session.disconnected"),rF=rx("session.reconnecting"),rB=rx("session.auth_error"),rz=rx("session.expiring"),rq=(e,t)=>`${t.type}/${e}`,rH=(e,t)=>tp(th({},t),{type:rq(e,t)}),rV=(e,t)=>rq(e,t),rX=rx("compound_event:attach");function rG(e){let t,r={},n=[],o={addCase(e,t){let n="string"==typeof e?e:e.type;if(n in r)throw Error("addCase cannot be called with two reducers for the same action type");return r[n]=t,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(t=e,o)};return e(o),[r,n,t]}var rK=({name:e="",initialState:t,reducers:r,extraReducers:n})=>(function(e){let t,{name:r}=e;if(!r)throw Error("`name` is a required option for createSlice");let n=e.initialState,o=e.reducers||{},i=Object.keys(o),a={},s={},l={};function c(){let[t={},r=[],o]="function"==typeof e.extraReducers?rG(e.extraReducers):[e.extraReducers];return function(e,t,r=[],n){let o,[i,a,s]="function"==typeof t?rG(t):[t,r,n];function l(e=o(),t){let r=[i[t.type],...a.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[s]),r.reduce((e,r)=>r?r(e,t):e,e)}return l.getInitialState=o="function"==typeof e?()=>e():()=>e,l}(n,th(th({},t),s),r,o)}return i.forEach(e=>{let t,n,i=o[e],c=`${r}/${e}`;"reducer"in i?(t=i.reducer,n=i.prepare):t=i,a[e]=t,s[c]=t,l[e]=n?rx(c,n):rx(c)}),{name:r,reducer:(e,r)=>(t||(t=c()),t(e,r)),actions:l,caseReducers:a,getInitialState:()=>(t||(t=c()),t.getInitialState())}})({name:e,initialState:t,reducers:r,extraReducers:e=>{e.addCase(rC.type,()=>t),"function"==typeof n&&n(e)}});function rJ(e){return[rM.type,rA.type].includes(e.type)}var{actions:rZ,reducer:rY}=rK({name:"session",initialState:{protocol:"",iceServers:[],authStatus:"unknown",authState:void 0,authError:void 0,authCount:0},reducers:{connected:(e,{payload:t})=>{var r,n;return tp(th({},e),{authStatus:"authorized",authState:null==t?void 0:t.authorization,authCount:e.authCount+1,protocol:null!=(r=null==t?void 0:t.protocol)?r:"",iceServers:null!=(n=null==t?void 0:t.ice_servers)?n:[]})},authStatus:(e,{payload:t})=>tp(th({},e),{authStatus:t}),updateAuthState:(e,{payload:t})=>tp(th({},e),{authState:t})},extraReducers:e=>{e.addCase(rI.type,(e,{payload:t})=>tp(th({},e),{authStatus:"unauthorized",authError:t.error})),e.addMatcher(rJ,e=>tp(th({},e),{authStatus:"authorizing"}))}}),rQ=Symbol("BaseSession"),r$=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),r0=()=>1e3*r$(1,4),r1=class{constructor(e){var t,r;this.options=e,tv(this,"__sw_symbol",rQ),tv(this,"uuid",(0,l.A)()),tv(this,"WebSocketConstructor"),tv(this,"agent"),tv(this,"connectVersion",ru),tv(this,"_rpcConnectResult"),tv(this,"_requests",new Map),tv(this,"_socket",null),tv(this,"_host","wss://relay.signalwire.com"),tv(this,"_executeTimeoutMs",1e4),tv(this,"_executeTimeoutError",Symbol.for("sw-execute-timeout")),tv(this,"_executeQueue",new Set),tv(this,"_checkPingDelay",15e3),tv(this,"_checkPingTimer",null),tv(this,"_reconnectTimer"),tv(this,"_status","unknown"),tv(this,"wsOpenHandler"),tv(this,"wsCloseHandler"),tv(this,"wsErrorHandler");let{host:n,logLevel:o="info"}=e;n&&(this._host=t5(n)),o&&(null==(r=(t=this.logger).setLevel)||r.call(t,o)),this._onSocketOpen=this._onSocketOpen.bind(this),this._onSocketError=this._onSocketError.bind(this),this._onSocketClose=this._onSocketClose.bind(this),this._onSocketMessage=this._onSocketMessage.bind(this),this.execute=this.execute.bind(this),this.connect=this.connect.bind(this),this.wsOpenHandler=e=>{var t;null==(t=this._socket)||t.removeEventListener("open",this.wsOpenHandler),this._onSocketOpen(e)},this.wsCloseHandler=e=>{var t;null==(t=this._socket)||t.removeEventListener("close",this.wsCloseHandler),this._onSocketClose(e)},this.wsErrorHandler=e=>{var t;null==(t=this._socket)||t.removeEventListener("error",this.wsErrorHandler),this._onSocketError(e)}}get host(){return this._host}get rpcConnectResult(){return this._rpcConnectResult}get relayProtocol(){var e,t;return null!=(t=null==(e=this._rpcConnectResult)?void 0:e.protocol)?t:""}get signature(){var e,t;return null==(t=null==(e=this._rpcConnectResult)?void 0:e.authorization)?void 0:t.signature}get logger(){return tN()}get connecting(){var e;return(null==(e=this._socket)?void 0:e.readyState)===0}get connected(){var e;return(null==(e=this._socket)?void 0:e.readyState)===1}get closing(){var e;return(null==(e=this._socket)?void 0:e.readyState)===2}get closed(){return!this._socket||3===this._socket.readyState}get status(){return this._status}get idle(){return"idle"===this._status}get ready(){return!(this.idle||!this.connected)}set token(e){this.options.token=e}connect(){if(!(this==null?void 0:this.WebSocketConstructor))throw Error("Missing WebSocketConstructor");if(this._clearTimers(),this.connecting||this.connected)return void this.logger.warn("Session already connected.");this._removeSocketListeners(),this.destroySocket(),this._clearCheckPingTimer(),this._socket=this._createSocket(),this._addSocketListeners()}_createSocket(){return new this.WebSocketConstructor(this._host)}destroySocket(){this._socket&&(this._socket.close(),this._socket=null)}_addSocketListeners(){if(!this._socket)return this.logger.debug("Invalid socket instance to add listeners");this._removeSocketListeners(),this._socket.addEventListener("open",this.wsOpenHandler),this._socket.addEventListener("close",this.wsCloseHandler),this._socket.addEventListener("error",this.wsErrorHandler),this._socket.addEventListener("message",this._onSocketMessage)}_removeSocketListeners(){if(!this._socket)return this.logger.debug("Invalid socket instance to remove listeners");this._socket.removeEventListener("open",this.wsOpenHandler),this._socket.removeEventListener("close",this.wsCloseHandler),this._socket.removeEventListener("error",this.wsErrorHandler),this._socket.removeEventListener("message",this._onSocketMessage)}async disconnect(){if(!this._socket||this.closing)return void this.logger.debug("Session not connected or already in closing state.");this._clearCheckPingTimer(),this._requests.clear(),this._closeConnection("disconnected"),this.dispatch(rW())}execute(e){let t=Promise.resolve();return("params"in e&&(t=new Promise((t,r)=>{this._requests.set(e.id,{rpcRequest:e,resolve:t,reject:r})})),this.ready)?(this._send(e),t7(t,this._executeTimeoutMs,this._executeTimeoutError).catch(t=>{if(t===this._executeTimeoutError){if(this.logger.error("Request Timeout",e),"disconnected"===this.status)return this.logger.debug("Request failed because the session is disconnected",this.status,this._socket);this._closeConnection("reconnecting")}else throw t})):(this._addToExecuteQueue(e),this.connect(),t)}async authenticate(){var e;let t={agent:this.agent,version:this.connectVersion,authentication:{project:this.options.project,token:this.options.token}};this._relayProtocolIsValid()&&(t.protocol=this.relayProtocol),(null==(e=this.options.contexts)?void 0:e.length)&&(t.contexts=this.options.contexts),this._rpcConnectResult=await this.execute(rd(t))}authError(e){this._removeSocketListeners(),this.dispatch(rI({error:e}))}async _onSocketOpen(e){this.logger.debug("_onSocketOpen",e.type);try{this._clearTimers(),await this.authenticate(),this._status="connected",this._flushExecuteQueue(),this.dispatch(rD())}catch(e){this.logger.error("Auth Error",e),this.authError(e)}}_onSocketError(e){this.logger.debug("_onSocketError",e)}_onSocketClose(e){this.logger.debug("_onSocketClose",e.type,e.code,e.reason),"disconnected"!==this._status&&(this._status="reconnecting",this.dispatch(rF()),this._clearTimers(),this._reconnectTimer=setTimeout(()=>{this.connect()},r0())),this._socket=null}_clearTimers(){clearTimeout(this._reconnectTimer)}_onSocketMessage(e){let t=this.decode(e.data);if(this.logger.wsTraffic({type:"recv",payload:t}),rs(t)){let e=this._requests.get(t.id);if(e){let{rpcRequest:r,resolve:n,reject:o}=e;this._requests.delete(t.id);let{result:i,error:a}=tL({response:t,request:r});return a?o(a):n(i)}return this.logger.warn("Unknown request for",t)}switch(t.method){case"signalwire.ping":return this._pingHandler(t);case"signalwire.disconnect":this.execute(rm(t.id)).catch(e=>{this.logger.error("SwDisconnect Error",e)}).finally(()=>{this._status="idle"});break;default:this.dispatch(rL(t)),this._handleWebSocketMessage(t)}}_handleWebSocketMessage(e){}dispatch(e){throw Error("Method not implemented")}_relayProtocolIsValid(){var e;return this.signature&&(null==(e=this==null?void 0:this.relayProtocol)?void 0:e.split("_")[1])===this.signature}encode(e){return JSON.stringify(e)}decode(e){return t4(e)}_send(e){this.logger.wsTraffic({type:"send",payload:e}),this._socket.send(this.encode(e))}_addToExecuteQueue(e){this.logger.warn("Request queued waiting for session to reconnect",e),this._executeQueue.add(e)}_flushExecuteQueue(){if(this._executeQueue.size){if(!this.ready){this.logger.warn("Session not ready to flush the queue."),this._closeConnection("reconnecting");return}this.logger.debug(`${this._executeQueue.size} messages to flush`),this._executeQueue.forEach(e=>{this._send(e),this._executeQueue.delete(e)}),this._executeQueue.clear()}}_clearCheckPingTimer(){clearTimeout(this._checkPingTimer)}async _pingHandler(e){var t;this._clearCheckPingTimer(),this._checkPingTimer=setTimeout(()=>{this.logger.debug("Timeout waiting for ping"),this._closeConnection("reconnecting")},this._checkPingDelay),await this.execute(rh(e.id,null==(t=null==e?void 0:e.params)?void 0:t.timestamp))}_closeConnection(e){this._clearCheckPingTimer(),this.logger.debug("Close Connection"),this._status=e,this.dispatch(rZ.authStatus("disconnected"===e?"unauthorized":"unknown")),this.destroySocket()}},r2=class extends r1{constructor(e){super(e),this.options=e,tv(this,"_expiredDiffSeconds",0),tv(this,"_refreshTokenNotificationDiff",120),tv(this,"_checkTokenExpirationDelay",2e4),tv(this,"_checkTokenExpirationTimer",null),this._checkTokenExpiration=this._checkTokenExpiration.bind(this),this.reauthenticate=this.reauthenticate.bind(this)}get expiresAt(){var e,t,r;let n=null!=(r=null==(t=null==(e=this==null?void 0:this._rpcConnectResult)?void 0:e.authorization)?void 0:t.expires_at)?r:0;if("string"==typeof n){let e=Date.parse(n);if(!isNaN(e))return Math.floor(e/1e3)}return n}get expiresIn(){let e=Math.floor(Date.now()/1e3);return this.expiresAt-e}get expired(){return this.expiresAt>0&&this.expiresIn<=this._expiredDiffSeconds}async authenticate(){let e={agent:this.agent,version:this.connectVersion,authentication:{jwt_token:this.options.token}};if(this._relayProtocolIsValid())e.protocol=this.relayProtocol;else{let t=await this.retrieveRelayProtocol();t&&(e.protocol=t)}this._rpcConnectResult=await this.execute(rd(e)),await this.persistRelayProtocol(),this._checkTokenExpiration()}async retrieveRelayProtocol(){return""}async persistRelayProtocol(){}async reauthenticate(){if(this.logger.debug("Session Reauthenticate",{ready:this.ready,expired:this.expired}),!this.ready||this.expired)return this.connect();let e={project:this._rpcConnectResult.authorization.project,jwt_token:this.options.token};try{this._rpcConnectResult=await this.execute(rf(e))}catch(e){throw clearTimeout(this._checkTokenExpirationTimer),e}}_onSocketClose(e){clearTimeout(this._checkTokenExpirationTimer),super._onSocketClose(e)}_checkTokenExpiration(){this.expiresAt&&(this.expiresIn<=this._refreshTokenNotificationDiff&&(this.dispatch(rN()),this.options._onRefreshToken?this.options._onRefreshToken():this.logger.warn("The token is going to expire!")),clearTimeout(this._checkTokenExpirationTimer),this.expired||(this._checkTokenExpirationTimer=setTimeout(this._checkTokenExpiration,this._checkTokenExpirationDelay)))}},r4={};tb(r4,{authErrorAction:()=>rI,authExpiringAction:()=>rN,authSuccessAction:()=>rD,compoundEventAttachAction:()=>rX,configureStore:()=>nL,connect:()=>nN,createAction:()=>rx,createCatchableSaga:()=>nn,createRestartableSaga:()=>nt,destroyAction:()=>rC,eventChannel:()=>eH,executeAction:()=>rR,getCustomSagaActionType:()=>rV,initAction:()=>rM,makeCustomSagaAction:()=>rH,reauthAction:()=>rA,sessionAuthErrorAction:()=>rB,sessionConnectedAction:()=>rU,sessionDisconnectedAction:()=>rW,sessionExpiringAction:()=>rz,sessionReconnectingAction:()=>rF,socketMessageAction:()=>rL});var r3=({state:e,payload:t,componentId:r,key:n,requestId:o})=>r in e.byId?tp(th({},e),{byId:tp(th({},e.byId),{[r]:tp(th({},e.byId[r]),{[n]:tp(th({},e.byId[r][n]),{[o]:t})})})}):tp(th({},e),{byId:tp(th({},e.byId),{[r]:{id:r,[n]:{[o]:t}}})}),{actions:r5,reducer:r7}=rK({name:"components",initialState:{byId:{}},reducers:{upsert:(e,{payload:t})=>t.id in e.byId?tp(th({},e),{byId:tp(th({},e.byId),{[t.id]:th(th({},e.byId[t.id]),t)})}):tp(th({},e),{byId:tp(th({},e.byId),{[t.id]:t})}),executeSuccess:(e,{payload:t})=>{let{componentId:r,requestId:n,response:o}=t;return r3({componentId:r,requestId:n,state:e,key:"responses",payload:o})},executeFailure:(e,{payload:t})=>{let{componentId:r,requestId:n,error:o,action:i}=t;return r3({componentId:r,requestId:n,state:e,key:"errors",payload:{action:i,jsonrpc:o}})},cleanup:(e,{payload:t})=>tp(th({},e),{byId:Object.entries(e.byId).reduce((e,[r,n])=>(t.ids.includes(r)||(e[r]=n),e),{})})}}),r8={queue:[]},{actions:r6,reducer:r9}=rK({name:"executeQueue",initialState:r8,reducers:{add:(e,{payload:t})=>tp(th({},e),{queue:e.queue.concat(t)}),clean:()=>r8}}),ne=(0,rj.combineReducers)({components:r7,session:rY,executeQueue:r9});tb({},{createCatchableSaga:()=>nn,createRestartableSaga:()=>nt,eventChannel:()=>eH});var nt=e=>function*(){!function(e){for(var t,r=arguments.length,n=Array(r>1?r-1:0),o=1;otN().error("Catchable Saga Error",e),nn=(e,t=nr)=>function*(...r){try{yield eP(e,...r)}catch(e){t(e)}},no=e=>(null==e?void 0:e.event_type)==="webrtc.message",ni=e=>{var t;return!!(null==(t=null==e?void 0:e.event_type)?void 0:t.startsWith("video."))};function*na(e){function*t(t){let{componentId:r,requestId:n,method:o,params:i}=t.payload;try{let t=rp({id:n,method:o,params:i}),a=yield eP(e.execute,t);r&&n&&(yield ek(r5.executeSuccess({componentId:r,requestId:n,response:a})))}catch(e){tN().warn("Execute error:",e),r&&n&&(yield ek(r5.executeFailure({componentId:r,requestId:n,action:t,error:e})))}finally{if((yield eT())&&r&&n){let e={jsonrpc:"2.0",id:n,error:{code:-32600,message:"Cancelled task"}};tN().debug("executeActionWorker cancelled",{requestId:n,componentId:r,error:e}),yield ek(r5.executeFailure({componentId:r,requestId:n,action:t,error:e}))}}}for(;;){let e=yield ew(rR.type);yield ej(t,e)}}function*ns({sessionChannel:e,pubSubChannel:t,swEventChannel:r}){function*n(e){switch(e.event_type){case"video.room.audience_count":return void(yield ek(t,{type:"video.room.audienceCount",payload:e.params}));case"video.member.updated":return;case"video.member.talking":{let{member:r}=e.params;if("talking"in r){let n=r.talking?"started":"ended";yield ek(t,{type:`video.member.talking.${n}`,payload:e.params});let o=r.talking?"start":"stop";yield ek(t,{type:`video.member.talking.${o}`,payload:e.params})}}}yield ek(t,{type:e.event_type,payload:e.params})}function*o(e){if(yield ek(r,tK(e)),!no(e)){if(ni(e))return void(yield ej(n,e));yield ek({type:e.event_type,payload:e})}}let i=nn(function*(e){if(e.type!==rL.type)return void(yield ek(e));let{method:t,params:r}=e.payload;if("signalwire.event"!==t)return tN().debug(`Unknown message: ${t}`,e);yield ej(o,r)},e=>{tN().error("Channel Error",e)});for(;;)try{for(;;){let t=yield ew(e);yield ej(i,t)}}catch(e){tN().error("sessionChannelWorker error:",e)}finally{tN().debug("sessionChannelWorker finally")}}function nl(e){return eH(t=>(e.dispatch=e=>{t(e)},()=>{tN().debug("sessionChannel unsubscribe"),e.disconnect()}))}var nc=e=>e.type.startsWith("video.member.")||e.type.startsWith("video.__synthetic__.member"),nu=e=>e.type.startsWith("video.room."),nd=e=>"video.room.audience_count"===e.type||"video.room.audienceCount"===e.type,nf=e=>e.type.startsWith("video.layout."),nh=e=>e.type.startsWith("video.recording."),np=e=>e.type.startsWith("video.playback."),nm=e=>e.type.startsWith("video.stream."),nb=e=>e.type.startsWith("chat."),ny=e=>e.type.startsWith("calling."),ng=e=>{var t;if(void 0===e.payload)return"";if(nc(e)||nf(e)||nh(e)||np(e)||nm(e)||nd(e))return e.payload.room_session_id;if(nu(e))return e.payload.room_session.id;if(nb(e));else if(ny(e))return null!=(t=e.payload.tag)?t:"";return""};function*nv({pubSubChannel:e,emitter:t}){tN().debug("pubSubSaga [started]");try{for(;;){let r=yield ew(e,"*"),{type:n,payload:o}=r;try{let e=ng(r);t8(n)&&t.emit(n,o),tN().trace("Emit:",tX({namespace:e,event:n})),t.emit(tX({namespace:e,event:n}),o)}catch(e){tN().error(e)}}}finally{(yield eT())&&tN().debug("pubSubSaga [cancelled]")}}var nS=class extends Error{constructor(e,t){super(t),this.code=e,this.message=t,tv(this,"name","AuthError"),Object.setPrototypeOf(this,nS.prototype)}};function*nO({SessionConstructor:e,userOptions:t,channels:r}){var n,o;let i=new e(t),a=yield eP(nl,i),s=r.pubSubChannel,l=r.swEventChannel,c=[];if(null==(n=t.workers)?void 0:n.length)try{let e=t.workers.map(e=>eP(nt(e)));c=yield((o=eO("ALL",e)).combinator=!0,o)}catch(e){tN().error("Error running custom workers",e)}yield ej(ns,{sessionChannel:a,pubSubChannel:s,swEventChannel:l});let u=yield ej(nv,{pubSubChannel:s,emitter:t.emitter}),d=yield ej(nk,{session:i,sessionChannel:a,pubSubChannel:s,userOptions:t}),f=yield ej(na,i);i.connect(),yield ew(rC.type),u.cancel(),d.cancel(),f.cancel(),a.close(),c.forEach(e=>e.cancel())}function*nw({session:e,token:t,pubSubChannel:r}){try{e.reauthenticate&&(e.token=t,yield eP(e.reauthenticate),yield ek(rZ.connected(e.rpcConnectResult)),yield ek(r,rU()))}catch(t){tN().error("Reauthenticate Error",t),e.authError(t)}}function*nk(e){tN().debug("sessionStatusWatcher [started]");try{for(;;){let t=yield ew([rD.type,rI.type,rN.type,rA.type,rF.type,rW.type]);switch(tN().debug("sessionStatusWatcher",t.type,t.payload),t.type){case rD.type:{let{session:t,pubSubChannel:r}=e;yield ek(rZ.connected(t.rpcConnectResult)),yield ek(r,rU());break}case rI.type:yield ej(nE,tp(th({},e),{action:t}));break;case rN.type:yield ek(e.pubSubChannel,rz());break;case rA.type:yield ej(nw,{session:e.session,token:t.payload.token,pubSubChannel:e.pubSubChannel});break;case rF.type:yield ek(e.pubSubChannel,rF());break;case rW.type:yield ek(e.pubSubChannel,rW()),yield ek(rC())}}}finally{(yield eT())&&tN().debug("sessionStatusWatcher [cancelled]")}}function*nE(e){tN().debug("sessionAuthErrorSaga [started]");try{let{pubSubChannel:t,action:r}=e,{error:n}=r.payload,o=n?new nS(n.code,n.message):Error("Unauthorized");yield ek(t,rB(o))}finally{(yield eT())&&tN().debug("sessionAuthErrorSaga [cancelled]")}}var nP=e=>function*({userOptions:t,channels:r}){var n;for(t.logger&&tM(t.logger),t.debug&&tA(t.debug);;){let o=yield ew([rM.type,rA.type]);(null==(n=null==o?void 0:o.payload)?void 0:n.token)&&(t.token=o.payload.token);try{yield eP(nO,tp(th({},e),{userOptions:t,channels:r}))}catch(e){tN().error("RootSaga Error:",e)}finally{(yield eT())&&tN().debug("rootSaga [cancelled]"),tN().debug("Reboot rootSaga")}}},nj={};tb(nj,{getComponent:()=>nx,getComponentsById:()=>nT,getComponentsToCleanup:()=>n_});var nx=({components:e},t)=>{var r;return null==(r=e.byId)?void 0:r[t]},nT=({components:e})=>e.byId,n_=e=>{let t=nT(e),r=[];return Object.keys(t).forEach(e=>{(t[e].responses||t[e].errors)&&r.push(e)}),r},nM={};tb(nM,{getAuthError:()=>nI,getAuthState:()=>nD,getAuthStatus:()=>nR,getIceServers:()=>nC,getSession:()=>nA});var nC=({session:e})=>{var t;return null!=(t=null==e?void 0:e.iceServers)?t:[]},nA=e=>e.session,nR=({session:e})=>e.authStatus,nI=({session:e})=>e.authError,nD=({session:e})=>e.authState,nN=e=>{let{componentListeners:t={},sessionListeners:r={},store:n,Component:o,customSagas:i=[]}=e,a=Object.keys(t),s=Object.keys(r);return e=>{let l=new o(tp(th({},e),{store:n})),c=new Map,u=!0,d=n.subscribe(()=>{let e=n.getState(),o=nx(e,l.__uuid)||{};for(let e of a){if(!1===u)return;let r=`${l.__uuid}.${e}`,n=c.get(r),i=o[e];if(void 0!==i&&n!==i){c.set(r,i);let n=t[e];"string"==typeof n?l[n](o):n(o)}}let i=nA(e);for(let e of s){if(!1===u)return;let t=`session.${e}`,n=c.get(t),o=i[e];if(void 0!==o&&n!==o){c.set(t,o);let n=r[e];"string"==typeof n?l[n](i):"function"==typeof n&&n(i)}}}),f=null==i?void 0:i.map(e=>n.runSaga(e,{instance:l,runSaga:n.runSaga}));return l.destroyer=()=>{u=!1,d(),c.clear(),(null==f?void 0:f.length)&&f.forEach(e=>e.cancel())},l}};tg(r4,rj);var nL=e=>{var t;let{userOptions:r,SessionConstructor:n,preloadedState:o={},runSagaMiddleware:i=!0}=e,a=e8(),s={pubSubChannel:eV(),swEventChannel:eV()},l=r_({devTools:null==(t=null==r?void 0:r.devTools)||t,reducer:ne,preloadedState:o,middleware:e=>e().concat(a)});if(i){let e=nP({SessionConstructor:n});a.run(e,{userOptions:r,channels:s})}return tp(th({},l),{runSaga:(e,t)=>a.run(e,tp(th({},t),{channels:s}))})},nU=e=>e,nW=Symbol("BaseComponent"),nF=class{constructor(e){this.options=e,tv(this,"__sw_symbol",nW),tv(this,"uuid",(0,l.A)()),tv(this,"_eventsPrefix",""),tv(this,"_eventsRegisterQueue",new Set),tv(this,"_eventsEmitQueue",new Set),tv(this,"_eventsNamespace"),tv(this,"_eventsTransformsCache",new Map),tv(this,"_requests",new Map),tv(this,"_customSagaTriggers",new Map),tv(this,"_destroyer"),tv(this,"_emitterTransforms",new Map),tv(this,"_emitterListenersCache",new Map),tv(this,"_trackedEvents",[]),tv(this,"_runningWorkers",[]),tv(this,"_workers",new Map)}get __uuid(){return this.uuid}_handleCompoundEvents(e){let t,r=this._getInternalEvent(e);for(let e of this.getCompoundEvents().keys())if(this._getInternalEvent(e)===r){t=this.getCompoundEvents().get(e);break}t&&0!==t.length&&(this.store.dispatch(rX({compoundEvents:t,event:r,namespace:this._eventsNamespace})),t.forEach(e=>{"string"==typeof e&&this._trackEvent(e)}))}_getNamespacedEvent(e){let t=this._eventsNamespace;return"string"==typeof e&&ro(e)&&(t=this.__uuid),tX({event:e,namespace:t})}_getPrefixedEvent(e){return!this._eventsPrefix||"string"!=typeof e||e.includes(`${this._eventsPrefix}.`)||t9(e)?e:`${this._eventsPrefix}.${e}`}_getInternalEvent(e){return this._getNamespacedEvent(this._getPrefixedEvent(e))}get logger(){return tN()}set destroyer(e){this._destroyer=e}get store(){return this.options.store}get emitter(){return this.options.emitter}addEventToRegisterQueue(e){let[t,r]=e.params;return this.logger.trace("Adding event to the register queue",{event:t,fn:r}),this._eventsRegisterQueue.add({type:e.type,params:e.params}),this.emitter}_addEventToEmitQueue(e,t){this.logger.trace("Adding to the emit queue",e),this._eventsEmitQueue.add({event:e,args:t})}shouldAddToQueue(){return void 0===this._eventsNamespace}runAndCacheEventHandlerTransform({internalEvent:e,transform:t,payload:r}){if("no-cache"===t.mode)return t.instanceFactory(r);if(!this._eventsTransformsCache.has(e)){let n=t.instanceFactory(r);return this._eventsTransformsCache.set(e,n),n}return this._eventsTransformsCache.get(e)}cleanupEventHandlerTransformCache({internalEvent:e,force:t}){let r=this._eventsTransformsCache.get(e),n=this.listenerCount(e);return r&&(t||n<=1)?(r.__uuid!==this.__uuid&&"function"==typeof r.destroy&&r.destroy(),this._eventsTransformsCache.delete(e)):(this.logger.trace("[cleanupEventHandlerTransformCache] Key wasn't cached",e),!1)}getEmitterListenersMapByInternalEventName(e){var t;return null!=(t=this._emitterListenersCache.get(e))?t:new Map}getAndRemoveStableEventHandler(e,t){let r=this.getEmitterListenersMapByInternalEventName(e);if(t&&r.has(t)){let n=r.get(t);return r.delete(t),this._emitterListenersCache.set(e,r),n}return t}_createStableEventHandler(e,t){return r=>{let n=this._emitterTransforms.get(e);if(this.logger.trace("Got emitterTransform for",e,n),!n)return t(r);let o=this.runAndCacheEventHandlerTransform({internalEvent:e,transform:n,payload:r}),i=this._parseNestedFields(r,n);return t(t$({instance:o,payload:r,transformedPayload:i,transform:n}))}}_parseNestedFields(e,t,r=e=>e,n){if(!t.nestedFieldsToProcess)return t.payloadTransform(e);if(e.__sw_proxy)return e;if(!n){let n=t.payloadTransform(e);return this._parseNestedFields(n,t,r,n)}return Array.isArray(e)?n=e.map((n,o)=>this._parseNestedFields(r(n),t,r,e[o])):e&&"object"==typeof e&&Object.entries(e).forEach(([e,o])=>{var i;let a=null==(i=t.nestedFieldsToProcess)?void 0:i[e],s=a?this._emitterTransforms.get(a.eventTransformType):void 0;o&&"object"==typeof o?n[e]=this._parseNestedFields(o,t,e=>a&&s&&e&&"object"==typeof e?t2({transform:s,payload:r(a.processInstancePayload(e))}):e,n[e]):n[e]=r(o)}),n}getOrCreateStableEventHandler(e,t){let r=this.getEmitterListenersMapByInternalEventName(e),n=r.get(t);return n||(n=this._createStableEventHandler(e,t),r.set(t,n),this._emitterListenersCache.set(e,r)),n}_trackEvent(e){this._trackedEvents=Array.from(new Set(this._trackedEvents.concat(e)))}_untrackEvent(e){this._trackedEvents=this._trackedEvents.filter(t=>t!==e)}_addListener(e,t,r){this._handleCompoundEvents(e);let n=this._getInternalEvent(e);this._trackEvent(n);let o=r?"once":"on";if(this.shouldAddToQueue())return this.addEventToRegisterQueue({type:o,params:[e,t]}),this.emitter;let i=this.getOrCreateStableEventHandler(n,t);return this.logger.trace("Registering event",n),this.emitter[o](n,i)}on(e,t){return this._addListener(e,t)}once(e,t){return this._addListener(e,t,!0)}off(e,t){if(this.shouldAddToQueue())return this.addEventToRegisterQueue({type:"off",params:[e,t]}),this.emitter;let r=this._getInternalEvent(e),n=this.getAndRemoveStableEventHandler(r,t);return this.cleanupEventHandlerTransformCache({internalEvent:r,force:!n}),this.logger.trace("Removing event listener",r),this._untrackEvent(r),this.emitter.off(r,n)}removeAllListeners(e){return this.shouldAddToQueue()?(this.addEventToRegisterQueue({type:"removeAllListeners",params:[e]}),this.emitter):e?this.off(e):(this.eventNames().forEach(e=>{this.off(e)}),this.emitter)}eventNames(){return this._trackedEvents}getSubscriptions(){return rn(this.eventNames())}emit(e,...t){if(this.shouldAddToQueue())return this._addEventToEmitQueue(e,t),!1;let r=this._getInternalEvent(e);return this.logger.trace("Emit on event:",r),this.emitter.emit(r,...t)}listenerCount(e){return this.emitter.listenerCount(e)}destroy(){var e;null==(e=this._destroyer)||e.call(this),this.removeAllListeners(),this.detachWorkers()}execute({method:e,params:t},{transformParams:r=nU,transformResolve:n=nU,transformReject:o=nU}={transformParams:nU,transformResolve:nU,transformReject:nU}){return new Promise((i,a)=>{let s=(0,l.A)();this._requests.set(s,{resolve:i,reject:a,transformResolve:n,transformReject:o}),this.store.dispatch(rR({requestId:s,componentId:this.__uuid,method:e,params:r(t)}))})}triggerCustomSaga(e){return new Promise((t,r)=>{let n=(0,l.A)();this._customSagaTriggers.set(n,{resolve:t,reject:r}),this.store.dispatch(th({dispatchId:n},rH(this.__uuid,e)))})}settleCustomSagaTrigger({dispatchId:e,payload:t,kind:r}){let n=this._customSagaTriggers.get(e);n&&(n[r](t),this._customSagaTriggers.delete(e))}select(e){return e(this.store.getState())}onError(e){this._requests.forEach((t,r)=>{(null==e?void 0:e.errors[r])!==void 0&&(t.reject(t.transformReject(e.errors[r])),this._requests.delete(r))})}onSuccess(e){this._requests.forEach((t,r)=>{(null==e?void 0:e.responses[r])!==void 0&&(t.resolve(t.transformResolve(e.responses[r])),this._requests.delete(r))})}getStateProperty(e){return this[e]}flushEventsRegisterQueue(){this._eventsRegisterQueue.forEach(e=>{this[e.type](...e.params),this._eventsRegisterQueue.delete(e)})}flushEventsEmitQueue(){this._eventsEmitQueue.forEach(e=>{let{event:t,args:r}=e;this.emit(t,...r),this._eventsEmitQueue.delete(e)})}flushEventsQueue(){this.flushEventsRegisterQueue(),this.flushEventsEmitQueue()}_attachListeners(e){"string"==typeof e&&(this._eventsNamespace=e),this.flushEventsQueue()}getCompoundEvents(){return new Map}getEmitterTransforms(){return new Map}get _sessionAuthStatus(){return nR(this.store.getState())}get _sessionAuthState(){return nD(this.store.getState())}_waitUntilSessionAuthorized(){switch(nR(this.store.getState())){case"authorized":return Promise.resolve(this);case"unknown":case"authorizing":return new Promise((e,t)=>{let r=this.store.subscribe(()=>{let n=nR(this.store.getState()),o=nI(this.store.getState());"authorized"===n?(e(this),r()):"unauthorized"===n&&(t(o?new nS(o.code,o.message):Error("Unauthorized")),r())})});case"unauthorized":return Promise.reject(Error("Unauthorized"))}}_setEmitterTransform({event:e,handler:t,local:r}){let n=this._getInternalEvent(e);(r?ro(e):!ro(e)&&this.eventNames().includes(n))&&this._emitterTransforms.set(n,t)}applyEmitterTransforms({local:e=!1}={local:!1}){this.getEmitterTransforms().forEach((t,r)=>{Array.isArray(r)?r.forEach(r=>{this._setEmitterTransform({event:r,handler:t,local:e})}):this._setEmitterTransform({event:r,handler:t,local:e}),this._emitterTransforms.set(t.type,t)})}runWorker(e,t){this._workers.has(e)?tN().warn(`[runWorker] Worker with name ${e} has already been registerd.`):this._setWorker(e,t),this._attachWorker(e,t)}_setWorker(e,t){this._workers.set(e,t)}_attachWorker(e,t){var{worker:r}=t,n=tm(t,["worker"]);let o=this.store.runSaga(r,th({instance:this,runSaga:this.store.runSaga},n));this._runningWorkers.push(o),this._workers.delete(e)}detachWorkers(){this._runningWorkers.forEach(e=>{e.cancel()}),this._runningWorkers=[]}},nB=class extends nF{constructor(e){super(e),this.options=e,this._attachListeners("")}connect(){let e=nR(this.store.getState());return("unknown"===e||"unauthorized"===e)&&this.store.dispatch(rM()),this._waitUntilSessionAuthorized()}disconnect(){this.store.dispatch(rC())}},nz=class extends nF{constructor(e){super(e),this.options=e,tv(this,"subscribeMethod","signalwire.subscribe"),tv(this,"subscribeParams",{}),tv(this,"_latestExecuteParams"),this.applyEmitterTransforms({local:!0});let t=()=>{this._latestExecuteParams=void 0};super.on("session.connected",t),super.on("session.disconnected",t),super.on("session.reconnecting",t)}shouldExecuteSubscribe(e){return!this._latestExecuteParams||JSON.stringify(e)!==JSON.stringify(this._latestExecuteParams)}async subscribe(){await this._waitUntilSessionAuthorized();let e=this.getSubscriptions();if(0===e.length)return void this.logger.debug("`subscribe()` was called without any listeners attached.");let t={method:this.subscribeMethod,params:tp(th({},this.subscribeParams),{event_channel:this.getStateProperty("eventChannel"),events:e})};return this.shouldExecuteSubscribe(t)?(this._latestExecuteParams=t,new Promise(async(e,r)=>{try{return this.applyEmitterTransforms(),await this.execute(t),e(void 0)}catch(e){return r(e)}})):void this.logger.debug("BaseConsumer.subscribe() - Skipped .execute() since the execParams are exactly the same as last time")}},nq=()=>new(tn()),nH={audio_muted:!0,video_muted:!0,deaf:!0,visible:!0,input_volume:1,output_volume:1,input_sensitivity:1};Object.keys(nH).map(e=>`${tw}.member.updated.${e}`),Object.keys(tz(nH)).map(e=>`member.updated.${e}`);var nV={};tb(nV,{RoomSessionPlaybackAPI:()=>oE,RoomSessionRecordingAPI:()=>ow,RoomSessionStreamAPI:()=>oj,audioMuteMember:()=>on,audioUnmuteMember:()=>oo,createRoomSessionPlaybackObject:()=>oP,createRoomSessionRecordingObject:()=>ok,createRoomSessionStreamObject:()=>ox,deafMember:()=>os,deleteMemberMeta:()=>oO,deleteMeta:()=>oe,demote:()=>op,getLayouts:()=>nJ,getMemberMeta:()=>og,getMembers:()=>nZ,getMeta:()=>n8,getPlaybacks:()=>n3,getRecordings:()=>n2,getStreams:()=>ot,hideVideoMuted:()=>n$,play:()=>n5,promote:()=>oh,removeAllMembers:()=>oy,removeMember:()=>ob,setDeaf:()=>oc,setHideVideoMuted:()=>n1,setInputSensitivityMember:()=>of,setInputVolumeMember:()=>ou,setLayout:()=>nY,setMemberMeta:()=>ov,setMemberPosition:()=>om,setMeta:()=>n6,setOutputVolumeMember:()=>od,setPositions:()=>nQ,showVideoMuted:()=>n0,startRecording:()=>n4,startStream:()=>or,undeafMember:()=>ol,updateMemberMeta:()=>oS,updateMeta:()=>n9,videoMuteMember:()=>oi,videoUnmuteMember:()=>oa});var nX=()=>{},nG=(e,t={})=>({value:function(r={}){return this.execute({method:e,params:th({room_session_id:this.roomSessionId},r)},t)}}),nK=(e,t={})=>({value:function(r={}){var{memberId:n}=r,o=tm(r,["memberId"]);return this.execute({method:e,params:th({room_session_id:this.roomSessionId,member_id:n||this.memberId},o)},t)}}),nJ=nG("video.list_available_layouts",{transformResolve:e=>({layouts:e.layouts})}),nZ=nG("video.members.get",{transformResolve:e=>({members:e.members})}),nY=nG("video.set_layout",{transformResolve:nX}),nQ=nG("video.set_position",{transformResolve:nX}),n$=nG("video.hide_video_muted",{transformResolve:nX}),n0=nG("video.show_video_muted",{transformResolve:nX}),n1={value:function(e){return this.execute({method:e?"video.hide_video_muted":"video.show_video_muted",params:{room_session_id:this.roomSessionId}},{transformResolve:nX})}},n2={value:function(){return new Promise(async e=>{let t=t=>{e(t)};this.on(ri("video.recording.list"),t);try{let e=await this.execute({method:"video.recording.list",params:{room_session_id:this.roomSessionId}});this.emit(ri("video.recording.list"),tp(th({},e),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.recording.list"),t),e}})}},n4={value:function(){return new Promise(async e=>{let t=t=>{e(t)};this.on(ri("video.recording.start"),t);try{let e=await this.execute({method:"video.recording.start",params:{room_session_id:this.roomSessionId}});this.emit(ri("video.recording.start"),tp(th({},e),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.recording.start"),t),e}})}},n3={value:function(){return new Promise(async e=>{let t=t=>{e(t)};this.on(ri("video.playback.list"),t);try{let e=await this.execute({method:"video.playback.list",params:{room_session_id:this.roomSessionId}});this.emit(ri("video.playback.list"),tp(th({},e),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.playback.list"),t),e}})}},n5={value:function(e){return new Promise(async t=>{let r=e=>{t(e)};this.on(ri("video.playback.start"),r);try{let t=await this.execute({method:"video.playback.start",params:th({room_session_id:this.roomSessionId},e)});this.emit(ri("video.playback.start"),tp(th({},t),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.playback.start"),r),e}})}},n7=e=>nG(e,{transformResolve:nX,transformParams:e=>{let{room_session_id:t}=e;return{room_session_id:t,meta:tm(e,["room_session_id"])}}}),n8=nG("video.get_meta",{transformResolve:({meta:e})=>({meta:e})}),n6=n7("video.set_meta"),n9=n7("video.update_meta"),oe={value:function(e){return this.execute({method:"video.delete_meta",params:{room_session_id:this.roomSessionId,keys:e}})}},ot={value:function(){return new Promise(async e=>{let t=t=>{e(t)};this.on(ri("video.stream.list"),t);try{let e=await this.execute({method:"video.stream.list",params:{room_session_id:this.roomSessionId}});this.emit(ri("video.stream.list"),tp(th({},e),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.stream.list"),t),e}})}},or={value:function(e){return new Promise(async t=>{let r=e=>{t(e)};this.on(ri("video.stream.start"),r);try{let t=await this.execute({method:"video.stream.start",params:th({room_session_id:this.roomSessionId},e)});this.emit(ri("video.stream.start"),tp(th({},t),{room_session_id:this.roomSessionId}))}catch(e){throw this.off(ri("video.stream.start"),r),e}})}},on=nK("video.member.audio_mute",{transformResolve:nX}),oo=nK("video.member.audio_unmute",{transformResolve:nX}),oi=nK("video.member.video_mute",{transformResolve:nX}),oa=nK("video.member.video_unmute",{transformResolve:nX}),os=nK("video.member.deaf",{transformResolve:nX}),ol=nK("video.member.undeaf",{transformResolve:nX}),oc={value:function(e){return this.execute({method:e?"video.member.deaf":"video.member.undeaf",params:{room_session_id:this.roomSessionId,member_id:this.memberId}},{transformResolve:nX})}},ou=nK("video.member.set_input_volume",{transformResolve:nX}),od=nK("video.member.set_output_volume",{transformResolve:nX}),of=nK("video.member.set_input_sensitivity",{transformResolve:nX}),oh={value:function(e){var{memberId:t,mediaAllowed:r,joinAudioMuted:n,joinVideoMuted:o}=e,i=tm(e,["memberId","mediaAllowed","joinAudioMuted","joinVideoMuted"]);return this.execute({method:"video.member.promote",params:th({room_session_id:this.roomSessionId,member_id:t,media_allowed:r,join_audio_muted:n,join_video_muted:o},i)},{transformResolve:nX})}},op={value:function({memberId:e,mediaAllowed:t}){return this.execute({method:"video.member.demote",params:{room_session_id:this.roomSessionId,member_id:e,media_allowed:t}},{transformResolve:nX})}},om=nK("video.member.set_position",{transformResolve:nX}),ob={value:function(e){var{memberId:t}=e,r=tm(e,["memberId"]);if(!t)throw TypeError('Invalid or missing "memberId" argument');return this.execute({method:"video.member.remove",params:th({room_session_id:this.roomSessionId,member_id:t},r)},{transformResolve:nX})}},oy={value:function(){return this.execute({method:"video.member.remove",params:{room_session_id:this.roomSessionId,member_id:"all"}},{transformResolve:nX})}},og=nK("video.member.get_meta",{transformResolve:({meta:e})=>({meta:e})}),ov=nK("video.member.set_meta",{transformResolve:nX}),oS=nK("video.member.update_meta",{transformResolve:nX}),oO=nK("video.member.delete_meta",{transformResolve:nX}),ow=class extends nF{async pause(){await this.execute({method:"video.recording.pause",params:{room_session_id:this.getStateProperty("roomSessionId"),recording_id:this.getStateProperty("id")}})}async resume(){await this.execute({method:"video.recording.resume",params:{room_session_id:this.getStateProperty("roomSessionId"),recording_id:this.getStateProperty("id")}})}async stop(){await this.execute({method:"video.recording.stop",params:{room_session_id:this.getStateProperty("roomSessionId"),recording_id:this.getStateProperty("id")}})}},ok=e=>nN({store:e.store,Component:ow,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),oE=class extends nF{async pause(){await this.execute({method:"video.playback.pause",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id")}})}async resume(){await this.execute({method:"video.playback.resume",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id")}})}async stop(){await this.execute({method:"video.playback.stop",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id")}})}async setVolume(e){await this.execute({method:"video.playback.set_volume",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),volume:e}})}async seek(e){await this.execute({method:"video.playback.seek_absolute",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:Math.abs(e)}})}async forward(e=5e3){await this.execute({method:"video.playback.seek_relative",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:Math.abs(e)}})}async rewind(e=5e3){await this.execute({method:"video.playback.seek_relative",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:-Math.abs(e)}})}},oP=e=>nN({store:e.store,Component:oE,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),oj=class extends nF{async stop(){await this.execute({method:"video.stream.stop",params:{room_session_id:this.getStateProperty("roomSessionId"),stream_id:this.getStateProperty("id")}})}},ox=e=>nN({store:e.store,Component:oj,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),oT={};tb(oT,{BaseChatAPI:()=>oZ,BaseChatConsumer:()=>oJ,ChatMember:()=>oX,ChatMessage:()=>oG,createBaseChatObject:()=>oY,getMemberState:()=>oW,getMembers:()=>oN,getMessages:()=>oD,publish:()=>oI,setMemberState:()=>oU});var o_=e=>{let t=!e||Array.isArray(e)?e:[e];return Array.isArray(t)?t.map(e=>({name:e})):[]},oM=e=>Array.isArray(e)||"string"==typeof e,oC=()=>{},oA=(e,t={})=>({value:function(r={}){return this.execute({method:e,params:r},t)}}),oR=(e,t={})=>({value:function(r={}){var{memberId:n}=r,o=tm(r,["memberId"]);return this.execute({method:e,params:th({member_id:n},o)},t)}}),oI=oA("chat.publish",{transformResolve:oC}),oD=oA("chat.messages.get",{transformResolve:e=>({messages:e.messages.map(e=>tz(e)),cursor:e.cursor})}),oN=oA("chat.members.get",{transformResolve:e=>({members:e.members.map(e=>tz(e))})}),oL=e=>{let t=oM(null==e?void 0:e.channels)?o_(e.channels):void 0;return tp(th({},e),{channels:t})},oU=oR("chat.member.set_state",{transformResolve:oC,transformParams:oL}),oW=oR("chat.member.get_state",{transformResolve:e=>({channels:e.channels}),transformParams:oL}),oF={};tb(oF,{BasePubSubConsumer:()=>oH,PubSubMessage:()=>oB,createBasePubSubObject:()=>oV});var oB=class{constructor(e){this.payload=e}get id(){return this.payload.id}get channel(){return this.payload.channel}get content(){return this.payload.content}get meta(){return this.payload.meta}get publishedAt(){return this.payload.publishedAt}},oz=function*({channels:{pubSubChannel:e}}){for(;;){let t=yield ew(e=>e.type.startsWith(`${tE}.`));t.type===`${tE}.channel.message`?yield ek(e,{type:`${tE}.message`,payload:t.payload}):tN().debug("[pubSubWorker] Unrecognized Action",t)}},oq=e=>e.map(e=>({name:e})),oH=class extends nz{constructor(e){super(e),tv(this,"_eventsPrefix",tE),tv(this,"subscribeMethod",`${tE}.subscribe`),this._attachListeners(""),this.runWorker("pubSub",{worker:oz})}getEmitterTransforms(){return new Map([[["message"],{type:"pubSubMessage",instanceFactory:()=>new oB({}),payloadTransform:e=>{let{channel:t,message:r}=e.params,{member:n}=r;return tz(tp(th({},tm(r,["member"])),{channel:t}))}}]])}_getChannelsParam(e,t){let r=!e||Array.isArray(e)?e:[e];if(!Array.isArray(r)||0===r.length)throw Error(`Please specify one or more channels when calling .${t}()`);return{channels:oq(r)}}_setSubscribeParams(e){this.subscribeParams=th(th({},this.subscribeParams),e)}_getSubscribeParams({channels:e}){return th({},this._getChannelsParam(e,"subscribe"))}_getUnsubscribeParams({channels:e}){return th({},this._getChannelsParam(e,"unsubscribe"))}_checkMissingSubscriptions(){0===this.getSubscriptions().length&&(this.logger.info("Subscribe was called before any listeners were attached. Move `.subscribe()` right after your event listeners to suppress this message."),this.once("message",()=>{}))}async subscribe(e){this._checkMissingSubscriptions();let t=this._getSubscribeParams({channels:e});return this._setSubscribeParams(t),super.subscribe()}async unsubscribe(e){if("unknown"===this._sessionAuthStatus||"unauthorized"===this._sessionAuthStatus)throw Error("You must be authenticated to unsubscribe from a channel");let t=this._getUnsubscribeParams({channels:e});return new Promise(async(e,r)=>{let n=this.getSubscriptions();if(n.length>0){let e={method:`${tE}.unsubscribe`,params:tp(th({},t),{events:n})};try{await this.execute(e)}catch(e){return r(e)}}else this.logger.warn("`unsubscribe()` was called without any listeners attached.");return e()})}updateToken(e){return new Promise((t,r)=>{this.once("session.auth_error",e=>{r(e)}),this.once("session.connected",()=>{t()}),this.store.dispatch(rP.reauthAction({token:e}))})}publish(e){return this.execute({method:`${tE}.publish`,params:e})}async getAllowedChannels(){await this._waitUntilSessionAuthorized();let e=this.select(nD);return e&&"channels"in e&&e.channels?e.channels:{}}},oV=e=>nN({store:e.store,Component:oH,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),oX=class{constructor(e){this.payload=e}get id(){return this.payload.id}get channel(){return this.payload.channel}get state(){var e;return null!=(e=this.payload.state)?e:{}}},oG=class extends oB{get member(){return this.payload.member}},oK=function*({channels:{pubSubChannel:e}}){for(;;){let t=yield ew(e=>e.type.startsWith("chat."));switch(t.type){case"chat.channel.message":if(tk===tE)break;yield ek(e,{type:"chat.message",payload:t.payload});break;case"chat.member.joined":case"chat.member.updated":case"chat.member.left":yield ek(e,t);break;default:tN().debug("[chatWorker] Unrecognized Action",t)}}},oJ=class extends oH{constructor(e){super(e),tv(this,"_eventsPrefix",tk),tv(this,"subscribeMethod",`${tk}.subscribe`),this.runWorker("chat",{worker:oK})}getEmitterTransforms(){return new Map([[["message"],{type:"chatMessage",instanceFactory:()=>new oG({}),payloadTransform:e=>{let{channel:t,message:r}=e.params;return tz(tp(th({},r),{channel:t}))}}],[["member.joined","member.left","member.updated"],{type:"chatMember",instanceFactory:e=>{let{member:t}=e.params;return new oX(tz(t))},payloadTransform:e=>{let{member:t}=e.params;return tz(t)}}]])}},oZ=tJ(oJ,{publish:oI,getMembers:oN,getMessages:oD,setMemberState:oU,getMemberState:oW}),oY=e=>nN({store:e.store,Component:oZ,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),oQ={};function*o$(e){let{action:t,memberList:r,channels:{pubSubChannel:n}}=e,o=t.payload.layout.layers,i={};for(let[e,t]of(o.forEach(e=>{var t;let n=e.member_id;if(!n)return;let o=r.get(n);o&&e.position!==(null==(t=o.member)?void 0:t.current_position)?(o4({memberList:r,memberId:n,currentPosition:e.position}),i[n]=!0):i[n]=!1}),r))if(i[e])yield ek(n,{type:"video.member.updated",payload:t});else if(void 0===i[e]){let t=o4({memberList:r,memberId:e,currentPosition:"off-canvas"});if(!t)return;yield ek(n,{type:"video.member.updated",payload:t})}}function*o0({action:e,channels:t,memberList:r}){var n,o;let i=e.payload.member.id,a=o4({memberList:r,memberId:i,currentPosition:null==(o=null==(n=r.get(i))?void 0:n.member)?void 0:o.current_position});if(!a)return;let{member:{updated:s=[]}}=e.payload,l=tp(th({},a),{member:th(th({},a.member),e.payload.member)});for(let n of(r.set(i,l),s)){let r=`${e.type}.${n}`;yield ek(t.pubSubChannel,{type:r,payload:l})}yield ek(t.pubSubChannel,{type:e.type,payload:l})}tb(oQ,{MEMBER_POSITION_COMPOUND_EVENTS:()=>o1,memberPositionWorker:()=>o2,memberUpdatedWorker:()=>o0});var o1=new Map([["video.member.updated",["video.layout.changed","video.member.joined","video.member.left"]]]),o2=function*({instance:e,channels:t,initialState:r}){if(!r)return;let{swEventChannel:n}=t,o=o3(r),i=e=>{o.has(e.member.id)||o.set(e.member.id,e)};for(;;){let r=yield ew(n,t=>("video.member.updated"===t.type||"video.layout.changed"===t.type||"video.member.joined"===t.type||"video.member.left"===t.type)&&ng(t)===e._eventsNamespace);switch(r.type){case"video.member.updated":i(r.payload),yield ej(o0,{action:r,channels:t,memberList:o,instance:e});break;case"video.member.joined":i(r.payload);break;case"video.member.left":{let e=r.payload.member;o.delete(e.id);break}case"video.layout.changed":yield ej(o$,{action:r,channels:t,memberList:o,instance:e})}}},o4=({memberList:e,memberId:t,currentPosition:r})=>{let n=e.get(t);if(!n)return;if(!r)return n;let o=tp(th({},n),{member:tp(th({},null==n?void 0:n.member),{current_position:r})});return e.set(t,o),o},o3=e=>{let t=e.room_session.members,r=new Map;return t.forEach(t=>{r.set(t.id,{room_id:e.room_session.room_id,room_session_id:e.room_session.id,member:t})}),r};tb({},{configureFullStack:()=>o9,configureJestStore:()=>o6,createMockedLogger:()=>o8,createPubSubChannel:()=>ir,createSwEventChannel:()=>io,rpcConnectResultVRT:()=>it,wait:()=>ie});var o5="8f0a119a-cda7-4497-a47d-c81493b824d4",o7="",o8=()=>({fatal:jest.fn(),error:jest.fn(),warn:jest.fn(),info:jest.fn(),debug:jest.fn(),trace:jest.fn(),wsTraffic:jest.fn()}),o6=e=>nL(th({userOptions:{project:o5,token:o7,devTools:!1,emitter:new(tn())},SessionConstructor:r1,runSagaMiddleware:!1},e)),o9=()=>{let e={dispatch:console.log,connect:jest.fn(),disconnect:jest.fn(),execute:jest.fn()},t=new(tn()),r=nL({userOptions:{project:o5,token:o7,devTools:!1,emitter:t},SessionConstructor:jest.fn().mockImplementation(()=>e)});return r.dispatch(rP.initAction()),r.dispatch(rP.authSuccessAction()),{store:r,session:e,emitter:t,destroy:()=>r.dispatch(rP.destroyAction())}},ie=e=>new Promise(t=>{setTimeout(t,e)}),it={identity:"f3bc99df-2c3d-4fa4-b1dc-e8a8ffc579e6@e3fefa44-1bad-4be9-ad9b-1cbb9abd60c7.west-us",authorization:{type:"video",project:"8f0a119a-cda7-4497-a47d-c81493b824d4",scopes:["video"],scope_id:"26675883-8499-4ee9-85eb-691c4aa209f8",resource:"9c80f1e8-9430-4070-a043-937eb3a96b38",join_as:"member",user_name:"Joe",room:{name:"lobby",display_name:"Lobby",scopes:["room.self.audio_mute","room.self.audio_unmute"],meta:{}},signature:"SGZtkRD9fvuBAOUp1UF56zESxdEvGT6qSGZtkRD9fvuBAOUp1UF56zESxdEvGT6q",media_allowed:"all",audio_allowed:"both",video_allowed:"both",meta:{}},protocol:"signalwire_SGZtkRD9fvuBAOUp1UF56zESxdEvGT6qSGZtkRD9fvuBAOUp1UF56zESxdEvGT6q_03e8c927-8ea3-4661-86d5-778c3e03296a_8f0a119a-cda7-4497-a47d-c81493b824d4",ice_servers:[{urls:"turn.swire.io:443",credential:"sFTwvi8ShXcYNOcyYjFy3ATIUpQ=",credentialType:"password",username:"1619521908:8f0a119a-cda7-4497-a47d-c81493b824d4"}]},ir=()=>eV(),io=()=>eV(),ii=th({},nM);let ia=e=>new window.RTCPeerConnection(e),is=()=>"undefined"!=typeof navigator&&!!navigator.mediaDevices,il=()=>{if(!is())throw Error("The media devices API isn't supported in this environment");return navigator.mediaDevices},ic=()=>"function"==typeof il().getUserMedia,iu=()=>"function"==typeof il().getDisplayMedia,id=()=>il().getSupportedConstraints(),ih=e=>e&&e instanceof MediaStream,ip=()=>"sinkId"in HTMLMediaElement.prototype,im=async(e,t)=>{if(null===e)return void tN().warn("No HTMLMediaElement to attach the speakerId");if("string"!=typeof t)return void tN().warn(`Invalid speaker deviceId: '${t}'`);if(!ip())return void tN().warn("Browser does not support output device selection.");try{return await e.setSinkId(t)}catch(e){throw"SecurityError"===e.name?tN().error(`You need to use HTTPS for selecting audio output device: ${e}`):tN().error(`Error: ${e}`),e}},ib=e=>e,iy=e=>{var t;ih(e)&&(null==(t=null==e?void 0:e.getTracks())||t.forEach(ig))},ig=e=>{e&&"live"===e.readyState&&(e.stop(),e.dispatchEvent(new Event("ended")))},iv={camera:"videoinput",microphone:"audioinput",speaker:"audiooutput"},iS=e=>{if(e)return iv[e]},iO=()=>il().enumerateDevices(),iw=async e=>{let t=await iO().catch(e=>[]);return e&&(t=t.filter(({kind:t})=>t===e)),t},ik=async e=>{let t=await iw(e);return t.length?t.every(({deviceId:e,label:t})=>!!(e&&t)):(tN().warn(`No ${e} devices to check for permissions!`),null)},iE=async e=>{if("permissions"in navigator&&"function"==typeof navigator.permissions.query&&e)try{let t=await navigator.permissions.query({name:e});return"granted"===t.state}catch(e){}return ik(iS(e))},iP=()=>iE("camera"),ij=()=>iE("microphone"),ix=()=>iE("speaker"),iT=async e=>{let t=[];return(null==e?void 0:e.audio)&&t.push(ij()),(null==e?void 0:e.video)&&t.push(iP()),!!t.length&&(await Promise.all(t)).every(Boolean)},i_=async(e={audio:!0,video:!0})=>{var t;try{let t=il().getUserMedia(e);if(await iT(e)){let e=Error("Timeout reading from your devices");return await t7(t,5e3,e)}return await t}catch(r){switch(r.name){case"Error":tN().error(null!=(t=null==r?void 0:r.message)?t:"navigator.mediaDevices.getUserMedia doesn't seem to be supported.");break;case"NotFoundError":tN().error("No media tracks of the type specified were found that satisfy the given constraints.");break;case"NotReadableError":tN().error("Hardware error occurred at the operating system, browser, or Web page level which prevented access to the device. This could have been caused by having the Camera or Mic being user by another application.");break;case"OverconstrainedError":tN().error(`The constraint: ${r.constraint} cannot be met by the selected device.`),tN().info("List of available constraints:",id());break;case"NotAllowedError":tN().error("The user has mostly likely denied access to the device. This could also happen if the browsing context is insecure (using HTTP rather than HTTPS)");break;case"TypeError":0===Object.keys(e).length?tN().error('Constraints can\'t be empty nor have "video" and "audio" set to false.'):tN().error("Please check that you are calling this method from a secure context (using HTTPS rather than HTTP).");break;case"SecurityError":tN().error("User media support is disabled on the Document on which getUserMedia() was called. The mechanism by which user media support is enabled and disabled is left up to the individual user agent.")}throw r}},iM=e=>il().getDisplayMedia(e),iC=async e=>{try{let t=await i_(e);iy(t)}catch(e){throw e}},iA=e=>({audio:!e||"all"===e||"microphone"===e||"speaker"===e,video:!e||"all"===e||"camera"===e}),iR=async(e,t=!1)=>iU(e,t),iI=()=>iR("camera"),iD=()=>iR("microphone"),iN=()=>iR("speaker"),iL=(e,t={})=>{let r=[];return e.filter(({deviceId:e,kind:n,groupId:o})=>{var i;if(!e||t.targets&&!(null==(i=t.targets)?void 0:i.includes(n)))return!1;if(!o)return!0;let a=`${n}-${o}`,s=null==t||!t.excludeDefault||"default"!==e;return!r.includes(a)&&!!s&&(r.push(a),!0)})},iU=async(e,t=!1)=>{let r;if(!1===await iE(e)){let t=iA(e);r=await i_(t)}let n=await iw(iS(e));return(r&&iy(r),!0===t)?n:iL(n)},iW=()=>iU("camera"),iF=()=>iU("microphone"),iB=()=>iU("speaker"),iz=async(e,t,r)=>{let n=await iU(r,!0);for(let r=0;r{let t=new Map;return e.forEach(e=>{e.deviceId&&t.set(e.deviceId,e)}),t},iH=(e,t)=>{let r=iq(e),n=iq(e),o=[];tN().debug("[_getDeviceListDiff] <- oldDevices",e),tN().debug("[_getDeviceListDiff] -> newDevices",t);let i=t.filter(e=>{let t=e.deviceId,i=r.get(t);return i&&(n.delete(t),e.label!==i.label&&o.push(e)),void 0===i});return{updated:o.map(e=>({type:"updated",payload:e})),removed:Array.from(n,([e,t])=>t).map(e=>({type:"removed",payload:e})),added:i.map(e=>({type:"added",payload:e}))}},iV={camera:iP,microphone:ij,speaker:ix},iX=["camera","microphone","speaker"],iG=`Allowed targets are: '${iX.join("', '")}'`,iK={speaker:ip},iJ=async e=>{let t=e.targets;return(await Promise.all(t.map(e=>iV[e]()))).reduce((e,r,n)=>{var o;let i=t[n];return e[!(i in iK)||(null==(o=iK[i])?void 0:o.call(iK))?"supported":"unsupported"].push([i,!!r]),e},{supported:[],unsupported:[]})},iZ=async e=>{var t;let r=(null!=(t=e.targets)?t:iX).filter(e=>!!iX.includes(e)||(tN().warn(`We'll ignore the "${e}" target as it is not allowed. ${iG}.`),!1));if(!r.length)throw Error(`At least one "target" is required for createDeviceWatcher(). ${iG}.`);let n=await iJ({targets:r});if(n.unsupported.length>0&&r.length===n.unsupported.length)throw Error(`The platform doesn't support "${r.join(", ")}" as target/s, which means it's not possible to watch for changes on those devices.`);if(n.supported.every(([e,t])=>!t))throw Error("You must ask the user for permissions before being able to listen for device changes. Try calling getUserMedia() before calling `createDeviceWatcher()`.");let o=[],i=n.supported.reduce((e,[t,r])=>(r?e.push(t):o.push(t),e),[]);if(i.length!==r.length){let e=n.unsupported.length>0?`The platform doesn't support "${n.unsupported.map(([e])=>e).join(", ")}" as target/s, which means it's not possible to watch for changes on those devices. `:"",t=o.length>0?`The user hasn't granted permissions for the following targets: ${o.join(", ")}. `:"";tN().warn(`${e}${t}We'll be watching for the following targets instead: "${i.join(", ")}"`)}return tN().debug(`Watching these targets: "${i.join(", ")}"`),i},iY=async(e={})=>{let t=await iZ({targets:e.targets}),r=new(tn()),n=await iO(),o=null==t?void 0:t.reduce((e,t)=>{let r=iS(t);return r&&e.push(r),e},[]),i=iL(n,{excludeDefault:!0,targets:o}),a=async()=>{let e=await iO(),t=i,n=iL(e,{excludeDefault:!0,targets:o});i=n;let a=iH(t,n),s=a.added.length>0,l=a.removed.length>0,c=a.updated.length>0;(s||l||c)&&r.emit("changed",{changes:a,devices:n}),s&&r.emit("added",{changes:a.added,devices:n}),l&&r.emit("removed",{changes:a.removed,devices:n}),c&&r.emit("updated",{changes:a.updated,devices:n})};return il().addEventListener("devicechange",a),r},iQ=()=>iY({targets:["microphone"]}),i$=()=>iY({targets:["speaker"]}),i0=()=>iY({targets:["camera"]}),i1=e=>"function"==typeof(null==e?void 0:e.getTracks),i2=async e=>{let t;return i1(e)?e:i_("string"==typeof e?{audio:{deviceId:e}}:{audio:e})},i4=e=>{let t=e.createAnalyser();return t.fftSize=64,t.minDecibels=-90,t.maxDecibels=-10,t.smoothingTimeConstant=.85,t},i3=async e=>{let t,r,n=await i2(e);if(!n)throw Error("Failed to get the audio stream");let o=new(tn()),i=new(window.AudioContext||window.webkitAudioContext),a=i4(i);try{i.createMediaStreamSource(n).connect(a)}catch(e){throw Error("No audio track found")}n.getAudioTracks().forEach(e=>{e.addEventListener("ended",()=>{o.emit("destroyed","disconnected")})});let s=()=>{try{let e=new Uint8Array(a.frequencyBinCount);a.getByteFrequencyData(e);let n=e.reduce((e,t)=>e+t,0)/20;r!==n&&(r=n,o.emit("volumeChanged",Math.min(r,100))),t=requestAnimationFrame(s)}catch(e){o.emit("destroyed","error")}};t=requestAnimationFrame(s);let l=()=>{t&&cancelAnimationFrame(t),"closed"!==i.state&&i.close().catch(e=>{tN().error("Error closing the AudioContext",e)}),i1(e)||n.getTracks().forEach(e=>e.stop()),o.emit("destroyed",null),o.removeAllListeners()};return new Proxy(o,{get:(e,t,r)=>"destroy"===t?l:Reflect.get(e,t,r)})},i5=e=>{tN().info("RTCService.getUserMedia",e);let{audio:t,video:r}=e;if(t||r)return i_(e)},i7=async e=>{let{audio:t=!0,micId:r}=e,{micLabel:n=""}=e;if(r){let e=await iz(r,n,"microphone").catch(e=>null);e&&("boolean"==typeof t&&(t={}),t.deviceId={exact:e})}let{video:o=!1,camId:i}=e,{camLabel:a=""}=e;if(i){let e=await iz(i,a,"camera").catch(e=>null);e&&("boolean"==typeof o&&(o={}),o.deviceId={exact:e})}return{audio:t,video:o}},i8=e=>/^m=audio/.test(e),i6=e=>/^m=video/.test(e),i9=e=>{let t=RegExp("a=rtpmap:(\\d+) \\w+\\/\\d+"),r=e.match(t);return r&&2==r.length?r[1]:null},ae=e=>{let t=e.split("\r\n"),r=t.findIndex(e=>/^a=rtpmap/.test(e)&&/opus\/48000/.test(e));if(r<0)return e;let n=i9(t[r]),o=RegExp(`a=fmtp:${n}`),i=t.findIndex(e=>o.test(e));return i>=0?/stereo=1;/.test(t[i])||(t[i]+="; stereo=1; sprop-stereo=1"):t[r]+=`\r a=fmtp:${n} stereo=1; sprop-stereo=1`,t.join("\r\n")},at=(e,t)=>{let r=t.split("\r\n");if(r.findIndex(i8){let o=e.split("\r\n");return o.forEach((e,i)=>{/^a=fmtp:\d*/.test(e)?o[i]+=`;x-google-max-bitrate=${t};x-google-min-bitrate=${r};x-google-start-bitrate=${n}`:/^a=mid:(1|video)/.test(e)&&(o[i]+=`\r b=AS:${t}`)}),o.join("\r\n")};class an{constructor(e,t){this.call=e,this.type=t,this.uuid=(0,l.A)(),this._negotiating=!1,this.options=e.options,this.logger.debug("New Peer with type:",this.type,"Options:",this.options),this._onIce=this._onIce.bind(this)}get logger(){return tN()}get localStream(){return this._localStream}set localStream(e){this._localStream=e}get remoteStream(){return this._remoteStream}get isOffer(){return"offer"===this.type}get isAnswer(){return"answer"===this.type}get isSimulcast(){return!0===this.options.simulcast}get isSfu(){return!0===this.options.sfu}get localVideoTrack(){let e=this._getSenderByKind("video");return(null==e?void 0:e.track)||null}get localAudioTrack(){let e=this._getSenderByKind("audio");return(null==e?void 0:e.track)||null}get hasAudioSender(){return!!this._getSenderByKind("audio")}get hasVideoSender(){return!!this._getSenderByKind("video")}get hasAudioReceiver(){return!!this._getReceiverByKind("audio")}get hasVideoReceiver(){return!!this._getReceiverByKind("video")}get config(){let{rtcPeerConfig:e={}}=this.options,t=Object.assign({bundlePolicy:"max-compat",iceServers:this.call.iceServers,sdpSemantics:"unified-plan"},e);return this.logger.debug("RTC config",t),t}get localSdp(){var e,t;return null==(t=null==(e=this.instance)?void 0:e.localDescription)?void 0:t.sdp}stopTrackSender(e){var t;try{let r=this._getSenderByKind(e);if(!r)return this.logger.info(`There is not a '${e}' sender to stop.`);r.track&&(ig(r.track),null==(t=this._localStream)||t.removeTrack(r.track))}catch(t){this.logger.error("RTCPeer stopTrackSender error",e,t)}}async restoreTrackSender(e){var t;try{let r=this._getSenderByKind(e);if(!r)return this.logger.info(`There is not a '${e}' sender to restore.`);if(r.track&&"ended"!==r.track.readyState)return this.logger.info(`There is already an active ${e} track.`);let n=await i7(this.options),o=await i5({[e]:n[e]});if(o&&ih(o)){let n=o.getTracks().find(t=>t.kind===e);n&&(await r.replaceTrack(n),null==(t=this._localStream)||t.addTrack(n))}}catch(t){this.logger.error("RTCPeer restoreTrackSender error",e,t)}}getDeviceId(e){try{let t=this._getSenderByKind(e);if(!t||!t.track)return null;let{deviceId:r=null}=t.track.getSettings();return r}catch(t){return this.logger.error("RTCPeer getDeviceId error",e,t),null}}getTrackSettings(e){try{let t=this._getSenderByKind(e);if(!t||!t.track)return null;return t.track.getSettings()}catch(t){return this.logger.error("RTCPeer getTrackSettings error",e,t),null}}getDeviceLabel(e){try{let t=this._getSenderByKind(e);if(!t||!t.track)return null;return t.track.label}catch(t){return this.logger.error("RTCPeer getDeviceLabel error",e,t),null}}restartIceWithRelayOnly(){try{let e=this.instance.getConfiguration();if("relay"===e.iceTransportPolicy)return this.logger.warn("RTCPeer already with iceTransportPolicy relay only");let t=Object.assign(Object.assign({},e),{iceTransportPolicy:"relay"});this.instance.setConfiguration(t),this.instance.restartIce()}catch(e){this.logger.error("RTCPeer restartIce error",e)}}async applyMediaConstraints(e,t){try{let r=this._getSenderByKind(e);if(!r||!r.track)return this.logger.info("No sender to apply constraints",e,t);if("live"===r.track.readyState){let n=Object.assign(Object.assign({},r.track.getConstraints()),t),o=this.getDeviceId(e);o&&!this.options.screenShare&&(n.deviceId={exact:o}),this.logger.info(`Apply ${e} constraints`,this.call.id,n),await r.track.applyConstraints(n)}}catch(r){this.logger.error("Error applying constraints",e,t)}}_getSenderByKind(e){return this.instance.getSenders?this.instance.getSenders().find(({track:t})=>t&&t.kind===e):(this.logger.warn("RTCPeerConnection.getSenders() not available."),null)}_getReceiverByKind(e){return this.instance.getReceivers?this.instance.getReceivers().find(({track:t})=>t&&t.kind===e):(this.logger.warn("RTCPeerConnection.getReceivers() not available."),null)}async startNegotiation(e=!1){var t,r;if(this._negotiating)return this.logger.warn("Skip twice onnegotiationneeded!");this._negotiating=!0;try{if((this.options.additionalDevice||this.options.screenShare)&&(null==(r=null==(t=this.instance)?void 0:t.getTransceivers)||r.call(t).forEach(e=>{e.direction="sendonly"})),this.instance.removeEventListener("icecandidate",this._onIce),this.instance.addEventListener("icecandidate",this._onIce),this.isOffer){this.logger.debug("Trying to generate offer");let e={voiceActivityDetection:!1};this._supportsAddTransceiver()||(e.offerToReceiveAudio=this.options.negotiateAudio,e.offerToReceiveVideo=this.options.negotiateVideo);let t=await this.instance.createOffer(e);await this._setLocalDescription(t)}if(this.isAnswer){this.logger.debug("Trying to generate answer"),await this._setRemoteDescription({sdp:this.options.remoteSdp,type:"offer"});let e=await this.instance.createAnswer({voiceActivityDetection:!1});await this._setLocalDescription(e)}e&&this._sdpReady()}catch(e){this.logger.error(`Error creating ${this.type}:`,e)}}onRemoteBye({code:e,message:t}){this._rejectStartMethod({code:e,message:t}),this.stop()}async onRemoteSdp(e){try{let t=this.isOffer?"answer":"offer";await this._setRemoteDescription({sdp:e,type:t}),this.isOffer&&this._resolveStartMethod()}catch(e){this.logger.error(`Error handling remote SDP on call ${this.call.id}:`,e),this.call.hangup(),this._rejectStartMethod(e)}}_setupRTCPeerConnection(){this.instance||(this.instance=ia(this.config),this._attachListeners())}async start(){return new Promise(async(e,t)=>{this._resolveStartMethod=e,this._rejectStartMethod=t;try{this._localStream=await this._retrieveLocalStream()}catch(e){return this._rejectStartMethod(e),this.call.setState("hangup")}this._setupRTCPeerConnection();let r=!1;if(this._localStream&&ih(this._localStream)){let e=this._localStream.getAudioTracks();this.logger.debug("Local audio tracks: ",e);let t=this._localStream.getVideoTracks();if(this.logger.debug("Local video tracks: ",t),r=!!(e.length||t.length),this.isOffer&&"function"==typeof this.instance.addTransceiver){let r={direction:this.options.negotiateAudio?"sendrecv":"sendonly",streams:[this._localStream]};this.logger.debug("Applying audioTransceiverParams",r),e.forEach(e=>{this.instance.addTransceiver(e,r)});let n={direction:this.options.negotiateVideo?"sendrecv":"sendonly",streams:[this._localStream]};if(this.isSimulcast&&(n.sendEncodings=["0","1","2"].map(e=>({active:!0,rid:e,scaleResolutionDownBy:6*Number(e)||1}))),this.logger.debug("Applying videoTransceiverParams",n),t.forEach(e=>{this.instance.addTransceiver(e,n)}),this.isSfu){let{msStreamsNumber:e=5}=this.options;this.logger.debug("Add ",e,"recvonly MS Streams"),n.direction="recvonly";for(let t=0;tthis.instance.addTrack(e,r)),t.forEach(e=>this.instance.addTrack(e,r))}else this.instance.addStream(this._localStream)}this.isOffer?(this.options.negotiateAudio&&this._checkMediaToNegotiate("audio"),this.options.negotiateVideo&&this._checkMediaToNegotiate("video"),this._supportsAddTransceiver()||r||this.startNegotiation()):this.startNegotiation()})}detachAndStop(){var e;"function"==typeof(null==(e=this.instance)?void 0:e.getTransceivers)&&this.instance.getTransceivers().forEach(e=>{e.sender.track&&e.sender.track.stop(),e.receiver.track&&e.receiver.track.stop()}),this.stop()}stop(){var e,t,r;null==(e=this._localStream)||e.getTracks().forEach(e=>e.stop()),null==(t=this._remoteStream)||t.getTracks().forEach(e=>e.stop()),null==(r=this.instance)||r.close()}_supportsAddTransceiver(){return"function"==typeof this.instance.addTransceiver}_checkMediaToNegotiate(e){if(!this._getSenderByKind(e)&&this._supportsAddTransceiver()){let t=this.instance.addTransceiver(e,{direction:"recvonly"});this.logger.debug("Add transceiver",e,t)}}async _sdpReady(){if(clearTimeout(this._iceTimeout),this._iceTimeout=null,!this.instance.localDescription)return;let{sdp:e}=this.instance.localDescription;if(-1===e.indexOf("candidate")){this.logger.debug("No candidate - retry \n"),this.startNegotiation(!0);return}this.instance.removeEventListener("icecandidate",this._onIce);try{await this.call.onLocalSDPReady(this)}catch(e){this._rejectStartMethod(e)}}_onIce(e){this._iceTimeout||(this._iceTimeout=setTimeout(()=>this._sdpReady(),this.options.iceGatheringTimeout)),e.candidate?(this.logger.debug("IceCandidate:",e.candidate),this.call.emit("icecandidate",e)):this._sdpReady()}_setLocalDescription(e){let{useStereo:t,googleMaxBitrate:r,googleMinBitrate:n,googleStartBitrate:o}=this.options;return e.sdp&&t&&(e.sdp=ae(e.sdp)),e.sdp&&r&&n&&o&&(e.sdp=ar(e.sdp,r,n,o)),this.instance.setLocalDescription(e)}_setRemoteDescription(e){e.sdp&&this.options.useStereo&&(e.sdp=ae(e.sdp)),e.sdp&&this.instance.localDescription&&(e.sdp=at(e.sdp,this.instance.localDescription.sdp));let t=ib(e);return this.logger.debug("REMOTE SDP \n",`Type: ${e.type}`,"\n\n",e.sdp),this.instance.setRemoteDescription(t)}async _retrieveLocalStream(){return ih(this.options.localStream)?this.options.localStream:i5(await i7(this.options))}_attachListeners(){this.instance.addEventListener("signalingstatechange",()=>{switch(this.logger.debug("signalingState:",this.instance.signalingState),this.instance.signalingState){case"stable":this._negotiating=!1;break;case"have-local-offer":"complete"===this.instance.iceGatheringState&&this._sdpReady();break;case"closed":delete this.instance;break;default:this._negotiating=!0}}),this.instance.addEventListener("negotiationneeded",()=>{this.logger.debug("Negotiation needed event"),this.startNegotiation()}),this.instance.addEventListener("iceconnectionstatechange",()=>{this.logger.debug("iceConnectionState:",this.instance.iceConnectionState)}),this.instance.addEventListener("icegatheringstatechange",()=>{this.logger.debug("iceGatheringState:",this.instance.iceGatheringState)}),this.instance.addEventListener("track",e=>{this.call.emit("track",e),this.isSfu,this._remoteStream=e.streams[0]}),this.instance.addEventListener("addstream",e=>{e.stream&&(this._remoteStream=e.stream)})}}Object.create;Object.create,"function"==typeof SuppressedError&&SuppressedError;let ao=function*(e){tN().debug("vertoEventWorker started");let{channels:t,instance:r,initialState:n}=e,{swEventChannel:o}=t,{rtcPeerId:i}=n;if(!i)throw Error("Missing rtcPeerId for roomSubscribedWorker");for(;;){let{id:e,method:t,params:n={}}=(yield ew(o,e=>{var t;return"webrtc.message"===e.type&&(null==(t=e.payload.params)?void 0:t.callID)===i})).payload,{callID:a,nodeId:s}=n,l=r.getRTCPeerById(a);if(!l){tN().warn(`RTCPeer '${a}' not found for method: '${t}'`,n);continue}let c=r.peer;switch(t){case"verto.media":case"verto.answer":if(l.uuid===(null==c?void 0:c.uuid)){let e="verto.media"===t?"early":"active";r.setState(e)}(null==n?void 0:n.sdp)&&l.onRemoteSdp(n.sdp),yield ek(rP.executeAction({method:"video.message",params:{message:rE(e,t),node_id:s}}));break;case"verto.bye":yield eP(r.onVertoBye,{rtcPeerId:a,byeCause:null==n?void 0:n.cause,byeCauseCode:null==n?void 0:n.causeCode,redirectDestination:null==n?void 0:n.redirectDestination}),yield ek(rP.executeAction({method:"video.message",params:{message:rE(e,t),node_id:s}}));break;case"verto.ping":{let{nodeId:e}=n,t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}(n,["nodeId"]);yield ek(rP.executeAction({method:"video.message",params:{message:rk(t),node_id:e}}));break}case"verto.mediaParams":{if(!a||!n.mediaParams){tN().warn("Invalid mediaParams event",n);break}let{audio:e,video:t}=n.mediaParams;l&&t&&l.applyMediaConstraints("video",t),l&&e&&l.applyMediaConstraints("audio",e);break}default:return tN().warn(`Unknown Verto method: ${t}`,n)}}tN().trace("vertoEventWorker ended")},ai=function*(e){tN().debug("roomSubscribedWorker started");let{channels:t,instance:r,initialState:n}=e,{swEventChannel:o,pubSubChannel:i}=t,{rtcPeerId:a}=n;if(!a)throw Error("Missing rtcPeerId for roomSubscribedWorker");let s=yield ew(o,e=>"video.room.subscribed"===e.type&&e.payload.call_id===a);r._attachListeners(s.payload.room_session.id),r.applyEmitterTransforms(),r.setActiveRTCPeer(a),yield ek(r5.upsert({id:s.payload.call_id,roomId:s.payload.room_session.room_id,roomSessionId:s.payload.room_session.id,memberId:s.payload.member_id,previewUrl:s.payload.room_session.preview_url})),yield ek(i,{type:"video.room.joined",payload:s.payload}),tN().debug("roomSubscribedWorker ended",a)},aa=function*(e){tN().debug("promoteDemoteWorker started");let{channels:t,instance:r,initialState:n}=e,{swEventChannel:o}=t,{rtcPeerId:i}=n;if(!i)throw Error("Missing rtcPeerId for promoteDemoteWorker");let a=yield ew(o,e=>("video.member.promoted"===e.type||"video.member.demoted"===e.type)&&e.payload.member_id===r.memberId);tN().debug("promoteDemoteWorker:",a.type,a.payload),yield ek(rZ.updateAuthState(a.payload.authorization));let s=yield ex(ii.getAuthState);if(!s)throw Error(`Invalid authState for '${a.type}'`);let{audio_allowed:l,video_allowed:c}=s;switch(a.type){case"video.member.promoted":r.updateMediaOptions({audio:"both"===l,video:"both"===c,negotiateAudio:"none"!==l,negotiateVideo:"none"!==c});break;case"video.member.demoted":r.updateMediaOptions({audio:!1,video:!1,negotiateAudio:"none"!==l,negotiateVideo:"none"!==c})}r._triggerNewRTCPeer(),tN().debug("promoteDemoteWorker ended",i)},as={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},al=Object.assign(Object.assign({},as),{noiseSuppression:!1,autoGainControl:!1,googAutoGainControl:!1}),ac={width:{ideal:1280,min:320},height:{ideal:720,min:180},aspectRatio:{ideal:16/9}},au={destinationNumber:"room",remoteCallerName:"Outbound Call",remoteCallerNumber:"",callerName:"",callerNumber:"",audio:as,video:ac,useStereo:!1,attach:!1,screenShare:!1,additionalDevice:!1,userVariables:{},requestTimeout:1e4,autoApplyMediaParams:!0,iceGatheringTimeout:2e3};class ad extends nF{constructor(e){super(e),this.gotEarly=!1,this.doReinvite=!1,this._eventsPrefix="video",this.state="new",this.prevState="new",this.rtcPeerMap=new Map,this.onVertoBye=e=>{let{rtcPeerId:t,byeCause:r="NORMAL_CLEARING",byeCauseCode:n="16",redirectDestination:o}=e;this.cause=String(r),this.causeCode=String(n);let i=this.getRTCPeerById(t);if(!i)return this.logger.warn("Invalid RTCPeer to hangup",e);if(o&&i.localSdp){this.logger.debug("Redirect Destination to:",o,"for RTCPeer:",i.uuid),this.executeInvite(i.localSdp,i.uuid,o);return}i.onRemoteBye({code:this.causeCode,message:this.cause}),this.activeRTCPeerId===(null==i?void 0:i.uuid)&&this.setState("hangup")},this.options=Object.assign(Object.assign({},au),e),this._checkDefaultMediaConstraints(),this.setState("new"),this.logger.trace("New Call with Options:",this.options),this.applyEmitterTransforms({local:!0})}get id(){return this.__uuid}get active(){return"active"===this.state}get trying(){return"trying"===this.state}get memberId(){return this.component.memberId}get previewUrl(){return this.component.previewUrl}get roomId(){return this.component.roomId}get roomSessionId(){return this.component.roomSessionId}get callId(){var e;return(null==(e=this.peer)?void 0:e.uuid)||""}get localStream(){var e;return null==(e=this.peer)?void 0:e.localStream}set localStream(e){this.peer&&(this.peer.localStream=e)}get remoteStream(){var e;return null==(e=this.peer)?void 0:e.remoteStream}get iceServers(){var e,t;return null!=(t=null==(e=this.options)?void 0:e.iceServers)?t:this.select(ii.getIceServers)}get component(){return this.select(e=>nj.getComponent(e,this.callId))||{}}dialogParams(e){let{destinationNumber:t,attach:r,callerName:n,callerNumber:o,remoteCallerName:i,remoteCallerNumber:a,userVariables:s,screenShare:l,additionalDevice:c,pingSupported:u=!0}=this.options;return{dialogParams:{id:e,destinationNumber:t,attach:r,callerName:n,callerNumber:o,remoteCallerName:i,remoteCallerNumber:a,userVariables:s,screenShare:l,additionalDevice:c,pingSupported:u,version:1e3}}}get cameraId(){return this.peer?this.peer.getDeviceId("video"):null}get cameraLabel(){return this.peer?this.peer.getDeviceLabel("video"):null}get microphoneId(){return this.peer?this.peer.getDeviceId("audio"):null}get microphoneLabel(){return this.peer?this.peer.getDeviceLabel("audio"):null}get withAudio(){var e;return!!(null==(e=this.peer)?void 0:e.hasAudioReceiver)}get withVideo(){var e;return!!(null==(e=this.peer)?void 0:e.hasVideoReceiver)}get localVideoTrack(){return this.peer?this.peer.localVideoTrack:null}get localAudioTrack(){return this.peer?this.peer.localAudioTrack:null}get peer(){return this.getRTCPeerById(this.activeRTCPeerId)}set peer(e){if(!e)return void this.logger.warn("Invalid RTCPeer",e);if(this.logger.debug("Set RTCPeer",e.uuid,e),this.rtcPeerMap.set(e.uuid,e),this.peer&&this.callId!==e.uuid){let e=this.peer.uuid;this.logger.debug(">>> Stop old RTCPeer",e),this.peer.detachAndStop()}this.logger.debug(">>> Replace RTCPeer with",e.uuid),this.activeRTCPeerId=e.uuid}getRTCPeerById(e){return this.rtcPeerMap.get(e)}appendRTCPeer(e){return this.rtcPeerMap.set(e.uuid,e)}setActiveRTCPeer(e){this.peer=this.getRTCPeerById(e)}vertoExecute(e){return this.execute({method:"video.message",params:e})}async _triggerNewRTCPeer(){this.logger.debug("_triggerNewRTCPeer Start");try{this.logger.debug("Build a new RTCPeer");let e=new an(this,"offer");this.appendRTCPeer(e),this.logger.debug("Run workers for the new RTCPeer",e.uuid),this.runRTCPeerWorkers(e.uuid),this.logger.debug("Trigger start for the new RTCPeer!"),await e.start()}catch(e){this.logger.error("Error building new RTCPeer to promote/demote",e)}}updateCamera(e){return this.updateConstraints({video:Object.assign({aspectRatio:16/9},e)})}updateMicrophone(e){return this.updateConstraints({audio:e})}manageSendersWithConstraints(e){return!1===e.audio&&(this.logger.info("Switching off the microphone"),this.stopOutboundAudio()),!1===e.video&&(this.logger.info("Switching off the camera"),this.stopOutboundVideo()),e.audio||e.video}updateConstraints(e,{attempt:t=0}={}){return t>1?Promise.reject(Error("Failed to update constraints")):new Promise(async(r,n)=>{var o;try{let i;if(!this.peer)return n(Error("Invalid RTCPeerConnection."));if(!Object.keys(e).length)return n(Error("Invalid audio/video constraints."));if(this.logger.debug("updateConstraints trying constraints",this.__uuid,e),!this.manageSendersWithConstraints(e))return void this.logger.debug("Either `video` and `audio` (or both) constraints were set to `false` so their corresponding senders (if any) were stopped");try{i=await i_(e)}catch(i){if(i instanceof DOMException&&"Concurrent mic process limit."===i.message){let n={};null==(o=this.localStream)||o.getTracks().forEach(t=>{var r;n[t.kind]=t.getConstraints(),void 0!==e[t.kind]&&(this.logger.debug("updateConstraints stop old tracks to retrieve new ones"),ig(t),null==(r=this.localStream)||r.removeTrack(t))});try{return r(this.updateConstraints(e,{attempt:t+1}))}catch(e){return this.logger.error("Restoring previous constraints"),r(this.updateConstraints(n,{attempt:t+1}))}}return this.logger.error("updateConstraints",i),n(i)}this.logger.debug("updateConstraints got stream",i),this.localStream||(this.localStream=new MediaStream);let{instance:a}=this.peer,s=i.getTracks();this.logger.debug(`updateConstraints got ${s.length} tracks`);for(let e=0;er.track&&r.track.kind===t.kind?(this.logger.debug("Found transceiver by sender"),!0):n.track&&n.track.kind===t.kind?(this.logger.debug("Found transceiver by receiver"),!0):null===e&&(this.logger.debug("Found disassociated transceiver"),!0));r&&r.sender?(this.logger.debug("updateConstraints got transceiver",r.currentDirection,r.mid),await r.sender.replaceTrack(t),this.logger.debug("updateConstraints replaceTrack"),r.direction="sendrecv",this.logger.debug("updateConstraints set to sendrecv"),this.localStream.getTracks().forEach(e=>{var r;e.kind===t.kind&&e.id!==t.id&&(this.logger.debug("updateConstraints stop old track and apply new one - "),ig(e),null==(r=this.localStream)||r.removeTrack(e))}),this.localStream.addTrack(t)):(this.logger.debug("updateConstraints no transceiver found. addTrack and start dancing!"),this.peer.type="offer",this.doReinvite=!0,this.localStream.addTrack(t),a.addTrack(t,this.localStream)),this.logger.debug("updateConstraints simply update mic/cam"),"audio"===t.kind?this.options.micId=t.getSettings().deviceId:"video"===t.kind&&(this.options.camId=t.getSettings().deviceId)}this.logger.debug("updateConstraints done"),r()}catch(e){this.logger.error("updateConstraints",e),n(e)}})}runRTCPeerWorkers(e){this.runWorker("vertoEventWorker",{worker:ao,initialState:{rtcPeerId:e}}),this.options.additionalDevice||this.options.screenShare||(this.runWorker("roomSubscribedWorker",{worker:ai,initialState:{rtcPeerId:e}}),this.runWorker("promoteDemoteWorker",{worker:aa,initialState:{rtcPeerId:e}}))}invite(){return new Promise(async(e,t)=>{this.direction="outbound",this.peer=new an(this,"offer");try{this.runRTCPeerWorkers(this.peer.uuid),await this.peer.start(),e(this)}catch(e){this.logger.error("Invite error",e),t(e)}})}answer(){return new Promise(async(e,t)=>{this.direction="inbound",this.peer=new an(this,"answer");try{await this.peer.start(),e(this)}catch(e){this.logger.error("Answer error",e),t(e)}})}onLocalSDPReady(e){if(!e.instance.localDescription)throw this.logger.error("Missing localDescription",e),Error("Invalid RTCPeerConnection localDescription");let{type:t,sdp:r}=e.instance.localDescription,n=this._mungeSDP(r);switch(this.logger.debug("LOCAL SDP \n",`Type: ${t}`,"\n\n",n),t){case"offer":if(e.instance.remoteDescription)return this.executeUpdateMedia(n,e.uuid);return this.executeInvite(n,e.uuid);case"answer":this.logger.warn("Unhandled verto.answer");break;default:return this.logger.error(`Unknown SDP type: '${t}' on call ${this.id}`)}}async executeInvite(e,t,r){let n=this.getRTCPeerById(t);if(!n||n.instance.remoteDescription)throw Error(`RTCPeer '${t}' already has a remoteDescription. Invalid invite.`);"new"===this.state&&this.setState("requesting");try{let n=this.options.screenShare?{layout:this.options.layout,positions:this.options.positions}:{},o=rv(Object.assign(Object.assign(Object.assign({},this.dialogParams(t)),n),{sdp:e})),i=[];i=this.options.screenShare?["video.room.screenshare"]:this.options.additionalDevice?["video.room.additionaldevice"]:this.getSubscriptions();let a=await this.vertoExecute({message:o,node_id:r,subscribe:i});this.logger.debug("Invite response",a)}catch(e){throw this.setState("hangup"),e.jsonrpc}}async executeUpdateMedia(e,t){try{let r=rO(Object.assign(Object.assign({},this.dialogParams(t)),{sdp:e,action:"updateMedia"})),n=await this.vertoExecute({message:r});if(n.sdp||this.logger.error("UpdateMedia invalid SDP answer",n),this.logger.debug("UpdateMedia response",n),!this.peer)return this.logger.error("Invalid RTCPeer to updateMedia");await this.peer.onRemoteSdp(n.sdp)}catch(e){throw this.logger.error("UpdateMedia error",e),e.jsonrpc}}async hangup(e){let t=null!=e?e:this.callId;if(!t)throw Error("Invalid RTCPeer ID to hangup");try{let e=rS(this.dialogParams(t));await this.vertoExecute({message:e})}catch(e){this.logger.error("Hangup error:",e)}finally{if(t!==this.callId)return this.logger.warn("Prevent setState hangup",t,this.callId);this.setState("hangup")}}dtmf(e){let t=this.callId;if(!t)throw Error("Invalid RTCPeer ID to send DTMF");let r=rw(Object.assign(Object.assign({},this.dialogParams(t)),{dtmf:e}));this.vertoExecute({message:r})}doReinviteWithRelayOnly(){this.peer&&this.active&&this.peer.restartIceWithRelayOnly()}stopOutboundAudio(){this.peer&&this.active&&this.peer.stopTrackSender("audio")}restoreOutboundAudio(){this.peer&&this.active&&this.peer.restoreTrackSender("audio")}stopOutboundVideo(){this.peer&&this.active&&this.peer.stopTrackSender("video")}restoreOutboundVideo(){this.peer&&this.active&&this.peer.restoreTrackSender("video")}setState(e){switch(this.prevState=this.state,this.state=e,this.logger.trace(`Call ${this.id} state change from ${this.prevState} to ${this.state}`),this.emit(this.state,this),e){case"purge":case"destroy":this._finalize();break;case"hangup":this.setState("destroy")}}updateMediaOptions(e){this.logger.debug("updateMediaOptions",Object.assign({},e)),this.options=Object.assign(Object.assign({},this.options),e),this._checkDefaultMediaConstraints()}_mungeSDP(e){return e}_checkDefaultMediaConstraints(){!0===this.options.video&&(this.options.video=ac),!0===this.options.audio&&(this.options.audio=this.options.screenShare?al:as)}_finalize(){this.rtcPeerMap.forEach(e=>{e.stop()}),this.rtcPeerMap.clear(),this.destroy()}}function af(e){this.message=e}af.prototype=Error(),af.prototype.name="InvalidCharacterError";var ah="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new af("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,o=0,i=0,a="";n=t.charAt(i++);~n&&(r=o%4?64*r+n:n,o++%4)&&(a+=String.fromCharCode(255&r>>(-2*o&6))))n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function ap(e){this.message=e}ap.prototype=Error(),ap.prototype.name="InvalidTokenError";let am=function(e,t){if("string"!=typeof e)throw new ap("Invalid token specified");var r=+(!0!==(t=t||{}).header);try{return JSON.parse(function(e){var t,r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw"Illegal base64url string!"}try{return t=r,decodeURIComponent(ah(t).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return ah(r)}}(e.split(".")[r]))}catch(e){throw new ap("Invalid token specified: "+e.message)}};var ab=Object.defineProperty,ay=Object.defineProperties,ag=Object.getOwnPropertyDescriptors,av=Object.getOwnPropertySymbols,aS=Object.prototype.hasOwnProperty,aO=Object.prototype.propertyIsEnumerable,aw=(e,t,r)=>t in e?ab(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ak=(e,t)=>{for(var r in t||(t={}))aS.call(t,r)&&aw(e,r,t[r]);if(av)for(var r of av(t))aO.call(t,r)&&aw(e,r,t[r]);return e},aE=(e,t)=>ay(e,ag(t)),aP=(e,t)=>{var r={};for(var n in e)aS.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&av)for(var n of av(e))0>t.indexOf(n)&&aO.call(e,n)&&(r[n]=e[n]);return r},aj=(e,t)=>{for(var r in t)ab(e,r,{get:t[r],enumerable:!0})},ax=(e,t,r)=>(aw(e,"symbol"!=typeof t?t+"":t,r),r),aT={};aj(aT,{ChatMember:()=>su,ChatMessage:()=>sd,Client:()=>sc}),Object.keys(nH).map(e=>`member.updated.${e}`);var a_=e=>`sw-sdk-${e}`,aM=()=>{let e=document.createElement("video");return e.muted=!0,e.autoplay=!0,e.playsInline=!0,e.addEventListener("pause",()=>{e.play().catch(t=>{tN().error("Video Element Paused",e,t)})}),e},aC=({element:e})=>new Promise(t=>{e.addEventListener("canplay",function r(){e.removeEventListener("canplay",r),t()}),e.addEventListener("resize",function r(){e.removeEventListener("resize",r),t()})}),aA=({x:e,y:t,width:r,height:n})=>({top:`${t}%`,left:`${e}%`,width:`${r}%`,height:`${n}%`}),aR=({location:e})=>{let{top:t,left:r,width:n,height:o}=aA(e),i=document.createElement("div");return i.style.position="absolute",i.style.overflow="hidden",i.style.top=t,i.style.left=r,i.style.width=n,i.style.height=o,i},aI=({localOverlay:e,rootElement:t})=>async({layout:r,myMemberId:n,localStream:o})=>{tN().debug("Process layout.changed");try{let{layers:i=[]}=r,a=i.find(({member_id:e})=>e===n),s=e.domElement;if(e.status=a?"visible":"hidden",!a){tN().debug("Location not found"),s&&(tN().debug("Current layer not visible"),e.hide());return}if(!s){tN().debug("Build myLayer"),(s=aR({location:a})).id=e.id;let r=aM();r.srcObject=o,r.disablePictureInPicture=!0,r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",s.appendChild(r);let n=t.querySelector(".mcuLayers"),i=null==n?void 0:n.querySelector(`#${s.id}`);n&&!i&&(n.appendChild(s),e.domElement=s);return}let{top:l,left:c,width:u,height:d}=aA(a);tN().debug("Update myLayer:",l,c,u,d);let f=o.getVideoTracks().filter(e=>e.enabled&&"live"===e.readyState).length>0;f&&e.setLocalOverlayMediaStream(o),s.style.opacity=f?"1":"0",s.style.top=l,s.style.left=c,s.style.width=u,s.style.height=d}catch(e){tN().error("Layout Changed Error",e)}},aD=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},aN=({track:e,element:t})=>{t.srcObject=new MediaStream([e]),e.addEventListener("ended",()=>{t.srcObject=null,t.remove()})},aL=({video:e,rootElement:t,paddingWrapper:r})=>{let n=(t,r)=>{let n=e.videoWidth/e.videoHeight;return n>t/r?"100%":`${r*n}px`},o=e.videoHeight/e.videoWidth*100,i=function(e,t=0,r){let n=null,o=null,i=function(){n&&(clearTimeout(n),o=null,n=null)},a=function(){if(!t)return e.apply(this,arguments);let a=this,s=arguments,l=r&&!n;if(i(),o=function(){e.apply(a,s)},n=setTimeout(function(){if(n=null,!l){let e=o;return o=null,null==e?void 0:e()}},t),l&&o)return o()};return a.cancel=i,a.flush=function(){let e=o;i(),e&&e()},a}(({width:e,height:t})=>{if(r){let i=t/e*100;r.style.paddingBottom=`${i>o?o:i}%`,r.style.width=n(e,t)}},100),a=new ResizeObserver(e=>{e.forEach(e=>{if(e.contentBoxSize){let{inlineSize:t,blockSize:r}=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;i({width:t,height:r})}else e.contentRect&&i({width:e.contentRect.width,height:e.contentRect.height})})});return{start:()=>a.observe(t),stop:()=>a.disconnect()}},aU=({track:e,element:t})=>(t.autoplay=!0,t.playsinline=!0,t.srcObject=new MediaStream([e]),e.addEventListener("ended",()=>{t.srcObject=null,t.remove()}),t),aW=rP.createAction("swJs/audioSetSpeakerAction"),aF=({rootElement:e,applyLocalVideoOverlay:t})=>function*({instance:r,runSaga:n}){try{let o,i=new Map,a=aM(),s={status:"hidden",get id(){return a_(r.id)},get domElement(){return i.get(this.id)},set domElement(element){element?(tN().debug("Set localOverlay",element),i.set(this.id,element)):(tN().debug("Remove localOverlay"),i.delete(this.id))},hide(){if(!this.domElement)return tN().warn("Missing localOverlay to hide");this.domElement.style.opacity="0"},show(){return this.domElement?"hidden"===this.status?tN().info("localOverlay not visible"):void(this.domElement.style.opacity="1"):tN().warn("Missing localOverlay to show")},setLocalOverlayMediaStream(e){if(!this.domElement)return tN().warn("Missing localOverlay to set the local overlay stream");let t=this.domElement.querySelector("video");t&&(t.srcObject=e)}},l=aI({rootElement:e,localOverlay:s});r.on("layout.changed",e=>{var t;tN().debug("Received layout.changed"),(null==(t=r.peer)?void 0:t.hasVideoSender)&&r.localStream?l({layout:e.layout,localStream:r.localStream,myMemberId:r.memberId}):s.hide()}),r.on("room.subscribed",e=>{var t;let n=null==(t=e.room_session.members)?void 0:t.find(e=>e.id===r.memberId);if(null==n?void 0:n.audio_muted)try{r.stopOutboundAudio()}catch(e){tN().error("Error handling audio_muted",e)}if(null==n?void 0:n.video_muted)try{r.stopOutboundVideo()}catch(e){tN().error("Error handling video_muted",e)}r.localStream&&s.setLocalOverlayMediaStream(r.localStream)}),r.on("member.updated.video_muted",e=>{try{let{member:t}=e;t.id===r.memberId&&"video_muted"in t&&(t.video_muted?s.hide():s.show())}catch(e){tN().error("Error handling video_muted",e)}}),r.on("track",function(r){"video"===r.track.kind&&(o=n(aH,{applyLocalVideoOverlay:t,rootElement:e,track:r.track,element:a}))}),r.once("destroy",()=>{aD(e),i.clear(),null==o||o.cancel()})}catch(e){tN().error("videoElementSaga",e)}},aB=({speakerId:e})=>function*({instance:t,runSaga:r}){if("undefined"==typeof Audio)return void tN().warn("`Audio` is not supported on this environment.");try{let n,o=new Audio;t.on("track",function(i){"audio"===i.track.kind&&(n=r(aq,{track:i.track,element:o,speakerId:e,room:t}))}),t.once("destroy",()=>{null==n||n.cancel()})}catch(e){tN().error("audioElementSaga",e)}};function*az({element:e,room:t}){let r=rP.getCustomSagaActionType(t.__uuid,aW);for(;;){let n=yield ew([r]);try{if(n.type===r){let r=yield eP(im,e,n.payload);t.settleCustomSagaTrigger({dispatchId:n.dispatchId,payload:r,kind:"resolve"})}}catch(e){t.settleCustomSagaTrigger({dispatchId:n.dispatchId,payload:e,kind:"reject"}),tN().error(e)}}}function*aq({track:e,element:t,speakerId:r,room:n}){aU({track:e,element:t}),r&&im(t,r).catch(()=>{}),yield ej(az,{element:t,room:n})}function*aH({rootElement:e,applyLocalVideoOverlay:t=!0,track:r,element:n}){try{if(aN({element:n,track:r}),n.style.width="100%",n.style.maxHeight="100%",!t)return void e.appendChild(n);if(e.querySelector(".mcuContent"))return void tN().debug("MCU Content already there");let o=document.createElement("div");o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.right="0",o.style.bottom="0",o.appendChild(n);let i=document.createElement("div");i.classList.add("paddingWrapper"),i.style.paddingBottom="56.25%",i.style.position="relative",i.style.width="100%",i.appendChild(o);let a=document.createElement("div");a.classList.add("mcuLayers"),a.style.display="none",i.appendChild(a);let s=document.createElement("div");s.classList.add("mcuContent"),s.style.position="relative",s.style.width="100%",s.style.height="100%",s.style.margin="0 auto",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="center",s.appendChild(i),e.style.width="100%",e.style.height="100%",e.appendChild(s),n.readyState===HTMLMediaElement.HAVE_NOTHING&&(tN().debug("Wait for the MCU to be ready"),yield eP(aC,{element:n}));let l=aL({rootElement:e,video:n,paddingWrapper:i});l.start(),r.addEventListener("ended",()=>{l&&l.stop()}),a.style.display="block"}catch(e){tN().error("Handle video track error",e)}}var aV={errors:"onError",responses:"onSuccess"},aX={echoCancellation:!0,noiseSuppression:!1,autoGainControl:!1,googAutoGainControl:!1},aG=tJ(class extends ad{join(){return super.invite()}leave(){return super.hangup()}},{audioMute:nV.audioMuteMember,audioUnmute:nV.audioUnmuteMember,videoMute:nV.videoMuteMember,videoUnmute:nV.videoUnmuteMember,setMicrophoneVolume:nV.setInputVolumeMember,setInputVolume:nV.setInputVolumeMember,setInputSensitivity:nV.setInputSensitivityMember}),aK=tJ(class extends ad{join(){return super.invite()}leave(){return super.hangup()}},{audioMute:nV.audioMuteMember,audioUnmute:nV.audioUnmuteMember,videoMute:nV.videoMuteMember,videoUnmute:nV.videoUnmuteMember,setInputVolume:nV.setInputVolumeMember,setMicrophoneVolume:nV.setInputVolumeMember,setInputSensitivity:nV.setInputSensitivityMember}),aJ=()=>{},aZ="video.memberList.updated",aY=tX({event:aZ}),aQ=(e=>{let t=e.split(".")[0];return e.split(".").reduce((e,r)=>(e.push(r),r===t&&e.push(tO),e),[]).join(".")})(aY),a$=["video.room.joined","video.member.joined","video.member.left","video.member.updated"],a0=e=>a$.includes(e),a1=e=>rn(a$).filter(t=>!e.includes(t)),a2=e=>e.some(e=>e.includes(aY)),a4=e=>"video.room.joined"===e.type?e.payload.room_session.members:[e.payload.member],a3=({action:e,memberList:t})=>{let r=a4(e);return"video.member.left"===e.type?r.forEach(e=>{t.delete(e.id)}):r.forEach(e=>{t.set(e.id,e)}),Array.from(t.values())},a5=(e,t)=>{a1(t).forEach(t=>{e.once(t,aJ)});let r=({members:t})=>{e.emit(aZ,{members:t})};return e.on(aQ,r),{cleanup:()=>{e.off(aQ,r)}}};function*a7({pubSubChannel:e}){let t=new Map;function*r(r){let n="video.room.joined"===r.type?r.payload.room_session.id:r.payload.room_session_id,o=a3({action:r,memberList:t});yield ek(e,{type:aQ,payload:{room_session_id:n,members:o}})}for(;;){let t=yield ew(e,({type:e})=>a0(e));yield ej(r,t)}}var a8=function*({channels:{pubSubChannel:e},instance:t}){let r=t.getSubscriptions();if(!a2(r))return;let{cleanup:n}=a5(t,r);yield ej(a7,{pubSubChannel:e}),t.once("destroy",()=>{n()})},a6=function*(e){if(!e.initialState)throw Error("[memberPositionWorker] Missing initialState");yield ej(oQ.memberPositionWorker,e)},a9=function*(e){tN().trace("childMemberJoinedWorker started");let{channels:t,instance:r,initialState:n}=e,{swEventChannel:o}=t,{parentId:i}=n;if(!i)throw Error("Missing parentId for childMemberJoinedWorker");let a=yield ew(o,e=>"video.member.joined"===e.type&&e.payload.member.parent_id===i),{member:s}=a.payload;(null==s?void 0:s.parent_id)&&(r._attachListeners(s.id),r.applyEmitterTransforms(),(yield ex(nj.getComponent,s.parent_id))&&(yield ek(r5.upsert({id:r.callId,roomId:a.payload.room_id,roomSessionId:a.payload.room_session_id,memberId:s.id})))),tN().trace("childMemberJoinedWorker ended")},se=tJ(class extends ad{constructor(){super(...arguments),ax(this,"_screenShareList",new Set),ax(this,"_deviceList",new Set)}get screenShareList(){return Array.from(this._screenShareList)}get deviceList(){return Array.from(this._deviceList)}get interactivityMode(){return this.select(({session:e})=>{var t;let{authState:r}=e;return null!=(t=null==r?void 0:r.join_as)?t:""})}get permissions(){return this.select(({session:e})=>{var t,r;let{authState:n}=e;return null!=(r=null==(t=null==n?void 0:n.room)?void 0:t.scopes)?r:[]})}getEmitterTransforms(){return new Map([[["video.room.joined"],{type:"roomSession",instanceFactory:()=>({}),payloadTransform:e=>e,nestedFieldsToProcess:{recordings:{eventTransformType:"roomSessionRecording",processInstancePayload:e=>({recording:e})},playbacks:{eventTransformType:"roomSessionPlayback",processInstancePayload:e=>({playback:e})},streams:{eventTransformType:"roomSessionStream",processInstancePayload:e=>({stream:e})}}}],[[ri("video.recording.list")],{type:"roomSessionRecordingList",instanceFactory:e=>({}),payloadTransform:e=>e,nestedFieldsToProcess:{recordings:{eventTransformType:"roomSessionRecording",processInstancePayload:e=>({recording:e})}}}],[[ri("video.playback.list")],{type:"roomSessionPlaybackList",instanceFactory:e=>({}),payloadTransform:e=>e,nestedFieldsToProcess:{playbacks:{eventTransformType:"roomSessionPlayback",processInstancePayload:e=>({playback:e})}}}],[[ri("video.recording.start"),"video.recording.started","video.recording.updated","video.recording.ended"],{type:"roomSessionRecording",instanceFactory:e=>nV.createRoomSessionRecordingObject({store:this.store,emitter:this.emitter}),payloadTransform:e=>tz(aE(ak({},e.recording),{room_session_id:this.roomSessionId}))}],[[ri("video.playback.start"),"video.playback.started","video.playback.updated","video.playback.ended"],{type:"roomSessionPlayback",instanceFactory:e=>nV.createRoomSessionPlaybackObject({store:this.store,emitter:this.emitter}),payloadTransform:e=>tz(aE(ak({},e.playback),{room_session_id:this.roomSessionId}))}],[[ri("video.stream.list")],{type:"roomSessionStreamList",instanceFactory:e=>({}),payloadTransform:e=>e,nestedFieldsToProcess:{streams:{eventTransformType:"roomSessionStream",processInstancePayload:e=>({stream:e})}}}],[[ri("video.stream.start"),"video.stream.started","video.stream.ended"],{type:"roomSessionStream",instanceFactory:e=>nV.createRoomSessionStreamObject({store:this.store,emitter:this.emitter}),payloadTransform:e=>tz(aE(ak({},e.stream),{room_session_id:this.roomSessionId}))}]])}getCompoundEvents(){return new Map([...oQ.MEMBER_POSITION_COMPOUND_EVENTS])}attachPreConnectWorkers(){this.runWorker("memberListUpdated",{worker:a8})}attachOnSubscribedWorkers(e){this.runWorker("memberPositionWorker",{worker:a6,initialState:e})}async createScreenShareObject(e={}){return this.startScreenShare(e)}async startScreenShare(e={}){var t;let{autoJoin:r=!0,audio:n=!1,video:o=!0,layout:i,positions:a}=e,s=await iM({audio:!0===n?aX:n,video:o}),l=aE(ak({},this.options),{screenShare:!0,recoverCall:!1,localStream:s,remoteStream:void 0,userVariables:aE(ak({},(null==(t=this.options)?void 0:t.userVariables)||{}),{memberCallId:this.callId,memberId:this.memberId}),layout:i,positions:a}),c=nN({store:this.store,Component:aG,componentListeners:aV})(l);s.getVideoTracks().forEach(e=>{e.addEventListener("ended",()=>{c&&c.active&&c.leave()})}),c.once("destroy",()=>{c.emit("room.left"),this._screenShareList.delete(c)});try{return c.runWorker("childMemberJoinedWorker",{worker:a9,initialState:{parentId:this.memberId}}),this._screenShareList.add(c),r&&await c.join(),c}catch(e){throw this.logger.error("ScreenShare Error",e),e}}addCamera(e={}){let{autoJoin:t=!0}=e,r=aP(e,["autoJoin"]);return this.addDevice({autoJoin:t,video:r})}addMicrophone(e={}){let{autoJoin:t=!0}=e,r=aP(e,["autoJoin"]);return this.addDevice({autoJoin:t,audio:r})}async addDevice(e={}){var t;let{autoJoin:r=!0,audio:n=!1,video:o=!1}=e;if(!n&&!o)throw TypeError("At least one of `audio` or `video` must be requested.");let i=aE(ak({},this.options),{localStream:void 0,remoteStream:void 0,audio:n,video:o,additionalDevice:!0,recoverCall:!1,userVariables:aE(ak({},(null==(t=this.options)?void 0:t.userVariables)||{}),{memberCallId:this.callId,memberId:this.memberId})}),a=nN({store:this.store,Component:aK,componentListeners:aV})(i);a.once("destroy",()=>{a.emit("room.left"),this._deviceList.delete(a)});try{return a.runWorker("childMemberJoinedWorker",{worker:a9,initialState:{parentId:this.memberId}}),this._deviceList.add(a),r&&await a.join(),a}catch(e){throw this.logger.error("RoomDevice Error",e),e}}join(){return super.invite()}leave(){return this.hangup()}updateSpeaker({deviceId:e}){return this.triggerCustomSaga(aW(e))}async hangup(e){return this._screenShareList.forEach(e=>{e.leave()}),this._deviceList.forEach(e=>{e.leave()}),super.hangup(e)}_finalize(){this._screenShareList.clear(),this._deviceList.clear(),super._finalize()}getLayoutList(){return this.getLayouts()}getMemberList(){return this.getMembers()}},{audioMute:nV.audioMuteMember,audioUnmute:nV.audioUnmuteMember,videoMute:nV.videoMuteMember,videoUnmute:nV.videoUnmuteMember,deaf:nV.deafMember,undeaf:nV.undeafMember,setInputVolume:nV.setInputVolumeMember,setOutputVolume:nV.setOutputVolumeMember,setMicrophoneVolume:nV.setInputVolumeMember,setSpeakerVolume:nV.setOutputVolumeMember,setInputSensitivity:nV.setInputSensitivityMember,removeMember:nV.removeMember,removeAllMembers:nV.removeAllMembers,getMembers:nV.getMembers,getLayouts:nV.getLayouts,setLayout:nV.setLayout,setPositions:nV.setPositions,setMemberPosition:nV.setMemberPosition,hideVideoMuted:nV.hideVideoMuted,showVideoMuted:nV.showVideoMuted,getRecordings:nV.getRecordings,startRecording:nV.startRecording,getPlaybacks:nV.getPlaybacks,play:nV.play,setHideVideoMuted:nV.setHideVideoMuted,getMeta:nV.getMeta,setMeta:nV.setMeta,updateMeta:nV.updateMeta,deleteMeta:nV.deleteMeta,getMemberMeta:nV.getMemberMeta,setMemberMeta:nV.setMemberMeta,updateMemberMeta:nV.updateMemberMeta,deleteMemberMeta:nV.deleteMemberMeta,promote:nV.promote,demote:nV.demote,getStreams:nV.getStreams,startStream:nV.startStream}),st=e=>nN({store:e.store,customSagas:e.customSagas,Component:se,componentListeners:aV})(e),sr=function*(e){tN().trace("videoManagerWorker started");let{channels:t}=e,{swEventChannel:r,pubSubChannel:n}=t;for(;;){let e=yield ew(r,e=>e.type.startsWith("video-manager."));yield ek(n,e)}},sn=class extends nz{constructor(e){super(e),ax(this,"_eventsPrefix","video-manager"),this.runWorker("videoManagerWorker",{worker:sr})}getEmitterTransforms(){return new Map([[["video-manager.rooms.subscribed"],{type:"roomSession",instanceFactory:({rooms:e})=>({rooms:e.map(e=>tz(e))}),payloadTransform:({rooms:e})=>({rooms:e.map(e=>tz(e))})}],[["video-manager.room.started","video-manager.room.added","video-manager.room.updated","video-manager.room.ended","video-manager.room.deleted"],{type:"roomSession",instanceFactory:e=>tz(e),payloadTransform:e=>tz(e)}]])}},so=e=>new Proxy(nN({store:e.store,Component:sn,componentListeners:{errors:"onError",responses:"onSuccess"}})(e),{get:(e,t,r)=>"_eventsNamespace"===t?"":"eventChannel"===t?"video-manager.rooms":Reflect.get(e,t,r)}),si=class extends nB{constructor(){super(...arguments),ax(this,"_videoManager"),ax(this,"_chat"),ax(this,"_pubSub")}get rooms(){return{makeRoomObject:e=>{let{rootElement:t,applyLocalVideoOverlay:r=!0,stopCameraWhileMuted:n=!0,stopMicrophoneWhileMuted:o=!0}=e,i=aP(e,["rootElement","applyLocalVideoOverlay","stopCameraWhileMuted","stopMicrophoneWhileMuted"]),a=[];a.push(aB({speakerId:i.speakerId})),t&&a.push(aF({rootElement:t,applyLocalVideoOverlay:r}));let s=st(aE(ak({},i),{store:this.store,emitter:this.emitter,customSagas:a}));return o&&s.on("member.updated.audio_muted",({member:e})=>{try{e.id===s.memberId&&"audio_muted"in e&&(e.audio_muted?s.stopOutboundAudio():s.restoreOutboundAudio())}catch(e){this.logger.error("Error handling audio_muted",e)}}),n&&s.on("member.updated.video_muted",({member:e})=>{try{e.id===s.memberId&&"video_muted"in e&&(e.video_muted?s.stopOutboundVideo():s.restoreOutboundVideo())}catch(e){this.logger.error("Error handling video_muted",e)}}),s}}}get chat(){return this._chat||(this._chat=oT.createBaseChatObject({store:this.store,emitter:this.options.emitter})),this._chat}get pubSub(){return this._pubSub||(this._pubSub=oF.createBasePubSubObject({store:this.store,emitter:this.options.emitter})),this._pubSub}get videoManager(){return this._videoManager||(this._videoManager=so(this.options)),this._videoManager}reauthenticate(e){this.store.dispatch(rP.reauthAction({token:e}))}},sa=class extends r2{constructor(e){let t;try{t=am(e.token,{header:!0})}catch(e){}super(aE(ak({},e),{host:(null==t?void 0:t.ch)||e.host})),this.options=e,ax(this,"WebSocketConstructor",WebSocket),ax(this,"agent","@signalwire/js/browser/3.17.0")}get allowHijack(){return this.options._hijack}async retrieveRelayProtocol(){var e;if(!this.allowHijack)return"";let t=this.getRoomNameFromJWT();return t?(this.logger.info("Hijacking: search protocol for",t),null!=(e=window.sessionStorage.getItem(t))?e:""):""}async persistRelayProtocol(){if(!this.allowHijack)return;let e=this.getRoomNameFromJWT();e&&(this.logger.info("Hijacking: persist protocol",e,this.relayProtocol),window.sessionStorage.setItem(e,this.relayProtocol))}getRoomNameFromJWT(){try{let e=am(this.options.token);return null==e?void 0:e.r}catch(e){return""}}},ss=e=>{let t=aE(ak({},e),{emitter:nq()});return nN({store:nL({userOptions:t,SessionConstructor:sa}),Component:si,componentListeners:{errors:"onError",responses:"onSuccess"}})(t)},sl=["subscribe","publish","getMessages","getMembers","getMemberState","getAllowedChannels","setMemberState"],sc=function(e){let t=ss(e),r=e=>async(...r)=>(await t.connect(),t.chat[e](...r)),n={_session:t,disconnect:()=>t.disconnect()};return new Proxy(t.chat,{get:(e,t,o)=>t in n?n[t]:sl.includes(t)?r(t):Reflect.get(e,t,o)})},su=oT.ChatMember,sd=oT.ChatMessage,sf={};aj(sf,{Client:()=>sp,PubSubMessage:()=>sm});var sh=["getAllowedChannels","subscribe","publish"],sp=function(e){let t=ss(e),r=e=>async(...r)=>(await t.connect(),t.pubSub[e](...r)),n={_session:t,disconnect:()=>t.disconnect()};return new Proxy(t.pubSub,{get:(e,t,o)=>t in n?n[t]:sh.includes(t)?r(t):Reflect.get(e,t,o)})},sm=oF.PubSubMessage,sb={};aj(sb,{RoomSession:()=>sk,createClient:()=>ss,createRoomObject:()=>sg,joinRoom:()=>sv});var sy={aspectRatio:{ideal:16/9}},sg=e=>new Promise(async(t,r)=>{let n,{audio:o=!0,video:i=!0,iceServers:a,rootElementId:s,applyLocalVideoOverlay:l=!0,autoJoin:c=!1,stopCameraWhileMuted:u=!0,stopMicrophoneWhileMuted:d=!0,speakerId:f}=e,h=ss(ak({},aP(e,["audio","video","iceServers","rootElementId","applyLocalVideoOverlay","autoJoin","stopCameraWhileMuted","stopMicrophoneWhileMuted","speakerId"])));if(await h.connect(),!h)return;if(s){let e=document.getElementById(s);e?n=e:(n=document.body,tN().warn(`We couldn't find an element with id: ${s}: using 'document.body' instead.`))}let p=h.rooms.makeRoomObject({audio:o,video:!0===i?sy:i,negotiateAudio:!0,negotiateVideo:!0,iceServers:a,rootElement:n,applyLocalVideoOverlay:l,stopCameraWhileMuted:u,stopMicrophoneWhileMuted:d,speakerId:f});p.once("destroy",()=>{p.emit("room.left"),h.disconnect()});let m=()=>new Promise(async(e,t)=>{try{p.once("room.subscribed",t=>{e(p)}),await p.join()}catch(e){tN().error("Join",e),h.disconnect(),t(e)}}),b=new Proxy(p,{get:(e,t,r)=>"join"===t?m:Reflect.get(e,t,r)});if(c)try{await b.join(),t(b)}catch(e){r(e)}else t(b)}),sv=e=>sg(aE(ak({},e),{autoJoin:!0})),sS=e=>{let{authState:t,audio:r=!0,video:n=!0,sendAudio:o,sendVideo:i,receiveAudio:a,receiveVideo:s}=e;tN().debug("getJoinMediaParams options",ak({},e));let{audio_allowed:l,video_allowed:c,join_as:u}=t,d="member"===(null!=u?u:"member"),f=d&&"both"===l,h=d&&"both"===c,p="none"!==l,m="none"!==c,b=!!(null!=o?o:r),y=!!(null!=i?i:n),g=!!(null!=a?a:r),v=!!(null!=s?s:n);return!f&&b&&tN().info("Not allowed to send audio on this room. Default values will be used."),!h&&y&&tN().info("Not allowed to send video on this room. Default values will be used."),!p&&g&&tN().info("Not allowed to receive video from the room. Default values will be used."),!m&&v&&tN().info("Not allowed to receive video from the room. Default values will be used."),{mustSendAudio:f&&b,mustSendVideo:h&&y,mustRecvAudio:p&&g,mustRecvVideo:m&&v}},sO=e=>Object.values(e).some(Boolean),sw=["audioMute","audioUnmute","deaf","getLayouts","getMembers","getRecordings","hideVideoMuted","leave","removerMember","restoreOutboundAudio","restoreOutboundVideo","setInputSensitivity","setInputVolume","setLayout","setPositions","setMemberPosition","setOutputVolume","showVideoMuted","startRecording","stopOutboundAudio","stopOutboundVideo","undeaf","videoMute","videoUnmute","setMicrophoneVolume","setSpeakerVolume","getMeta","setMeta","updateMeta","deleteMeta","getMemberMeta","setMemberMeta","updateMemberMeta","deleteMemberMeta","promote","demote"],sk=function(e){let{audio:t=!0,video:r=!0,iceServers:n,rootElement:o,applyLocalVideoOverlay:i=!0,stopCameraWhileMuted:a=!0,stopMicrophoneWhileMuted:s=!0,speakerId:l}=e,c=aP(e,["audio","video","iceServers","rootElement","applyLocalVideoOverlay","stopCameraWhileMuted","stopMicrophoneWhileMuted","speakerId"]);["audio","video"].forEach(t=>{t in e&&tN().warn(`The '${t}' parameter on the RoomSession constructor is deprecated. Set it on the '.join()' function instead.`)});let u=ss(c),d=u.rooms.makeRoomObject({negotiateAudio:!0,negotiateVideo:!0,iceServers:n,rootElement:o,applyLocalVideoOverlay:i,stopCameraWhileMuted:a,stopMicrophoneWhileMuted:s,speakerId:l});d.once("destroy",()=>{d.emit("room.left"),u.disconnect()});let f={join:e=>new Promise(async(n,o)=>{var i,a;try{d.attachPreConnectWorkers(),await u.connect();let s=null!=(i=null==e?void 0:e.audio)?i:t,l=null!=(a=null==e?void 0:e.video)?a:r,c=u._sessionAuthState,f=sS(ak({authState:c,sendAudio:!!t,sendVideo:!!r},e));if(!sO(f))return u.disconnect(),o(Error(`Invalid arguments to join the room. The token used has join_as: '${c.join_as}'. ${JSON.stringify(e,null,2)} `));d.updateMediaOptions({audio:!!f.mustSendAudio&&(s||!0),video:!!f.mustSendVideo&&(l||!0),negotiateAudio:f.mustRecvAudio,negotiateVideo:f.mustRecvVideo}),d.once("room.subscribed",e=>{d.attachOnSubscribedWorkers(e),n(d)}),await d.join()}catch(e){tN().error("RoomSession Join",e),u.disconnect(),o(e)}})};return new Proxy(d,{get(e,t,r){if(t in f)return f[t];if(!e.active&&sw.includes(t))throw Error(`Tried to access the property/method "${t}" before the room was connected. Please call roomSession.join() first.`);return Reflect.get(e,t,r)}})},sE={};aj(sE,{checkCameraPermissions:()=>iP,checkMicrophonePermissions:()=>ij,checkPermissions:()=>iE,checkSpeakerPermissions:()=>ix,createCameraDeviceWatcher:()=>i0,createDeviceWatcher:()=>iY,createMicrophoneAnalyzer:()=>i3,createMicrophoneDeviceWatcher:()=>iQ,createSpeakerDeviceWatcher:()=>i$,enumerateDevices:()=>iO,getCameraDevices:()=>iW,getCameraDevicesWithPermissions:()=>iI,getDevices:()=>iU,getDevicesWithPermissions:()=>iR,getDisplayMedia:()=>iM,getMicrophoneDevices:()=>iF,getMicrophoneDevicesWithPermissions:()=>iD,getSpeakerDevices:()=>iB,getSpeakerDevicesWithPermissions:()=>iN,getSupportedConstraints:()=>id,getUserMedia:()=>i_,requestPermissions:()=>iC,setMediaElementSinkId:()=>im,stopStream:()=>iy,stopTrack:()=>ig,supportsGetDisplayMedia:()=>iu,supportsGetUserMedia:()=>ic,supportsMediaDevices:()=>is,supportsMediaOutput:()=>ip})},11415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isRoomAvailable",{enumerable:!0,get:function(){return i}});var n=r(84527);function o(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,o)}var i=function(){var e,t=(e=function(e){var t;return function(e,t){var r,n,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(i){return function(s){var l=[i,s];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]{"use strict";var n=r(99742);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"apiClient",{enumerable:!0,get:function(){return o}});var o=(function(e){return e&&e.__esModule?e:{default:e}})(r(71104)).default.create({baseURL:n.env.API_BASE_URL,headers:{"x-authorization":n.env.API_AUTH_TOKEN}})},12392:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var s=new o(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=Array(i);o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(11415),t)},15254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Carousel",{enumerable:!0,get:function(){return u}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(6005);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var u=function(e){var t,r=e.children,s=e.visibleSlides,d=void 0===s?1:s,f=c(e,["children","visibleSlides"]),h=(t=n.Children.map(r,function(e){if((0,n.isValidElement)(e)&&e.type===u.Slider)return n.Children.count(e.props.children)}),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(t,1)||function(e,t){if(e){if("string"==typeof e)return a(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}(t,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];if(h)return n.default.createElement(o.Box,l({as:i.CarouselProvider,position:"relative",totalSlides:h,visibleSlides:d,dragStep:d,step:d},f),r)};u.Slider=i.Slider,u.Slide=function(e){return n.default.createElement(o.Flex,l({_last:{marginRight:"0px"},marginRight:"24px",as:i.Slide},e))},u.ButtonBack=function(e){var t=e.children,r=c(e,["children"]);return(0,n.isValidElement)(t)&&(0,n.cloneElement)(t,l({as:i.ButtonBack,"aria-label":"back"},r))},u.ButtonNext=function(e){var t=e.children,r=c(e,["children"]);return(0,n.isValidElement)(t)&&(0,n.cloneElement)(t,l({as:i.ButtonNext,"aria-label":"next"},r))},u.DotGroup=function(e){return n.default.createElement(o.Flex,l({as:i.DotGroup,gap:"12px",disableActiveDots:!0},e))},u.Dot=function(e){return n.default.createElement(o.Flex,l({as:i.Dot,width:"12px",height:"12px",borderRadius:"50%",background:"primary-disabled",_disabled:{background:"primary-default"}},e))},u.NavigationContainer=function(e){return n.default.createElement(o.Flex,l({alignItems:"center",justifyContent:"center",gap:"12px",mt:"spacer-16"},e))}},17066:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87637);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}}))})},17311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccordionGalleryAccordion",{enumerable:!0,get:function(){return s}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(24765);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var s=function(e){var t=e.children,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);return n.default.createElement(o.Accordion,r,n.Children.map(t,function(e,t){if((0,n.isValidElement)(e))if(e.type===i.AccordionGalleryItem)return(0,n.cloneElement)(e,{index:t});else return e}))}},17748:(e,t,r)=>{"use strict";r.d(t,{rC:()=>P});var n=r(14232),o=r(37477),i=r(8169),a=r(61055),s=(0,n.createContext)({}),l=function(e){var t=e.children,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);return n.createElement(s.Provider,{value:r},t)},c=function(){try{return(0,n.useContext)(s)}catch(e){return{}}},u=function(e){var t=e.children,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]),i=c().link;return n.createElement(o.Link,function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]),a=c(),s=a.paragraph,l=a[t];return n.createElement(o.Text,function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{AccordionGalleryContext:function(){return l},AccordionGallery:function(){return c}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(24765);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children","defaultImage"]),h=(0,o.useBreakpointValue)({base:!0,lg:!1}),p=(t=(0,n.useState)(null),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){s=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(s)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return a(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],b=p[1],y=(0,n.useRef)({});(0,n.useEffect)(function(){"number"!=typeof d?(y.current.default=d,b("default")):b(d)},[]);var g=null,v=null,S=null;return n.Children.map(s,function(e){if((0,n.isValidElement)(e))switch(e.type){case o.Text:S=e;break;case o.TextPairing:g=e;break;case u:v=e}}),n.default.createElement(l.Provider,{value:{images:y}},n.default.createElement(o.Flex,function(e){for(var t=1;t{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(27988),t),n(r(3906),t)},21518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"TestimonialProps",{enumerable:!0,get:function(){return n.FlexProps}});var n=r(37477)},24765:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(17311),t),n(r(70448),t),n(r(81948),t)},26023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeroProps",{enumerable:!0,get:function(){return n.FlexProps}});var n=r(37477)},26686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(28211),t)},26788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Testimonial",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["backgroundColor"]);return n.default.createElement(o.Flex,i({backgroundColor:void 0===t?"background-page":t,px:{base:"1.5rem",lg:"2.75rem",xl:"6.625rem"},py:{base:"3.5rem",md:"5.5rem",xl:"7rem"},gap:{base:"1.5rem",lg:"2rem"},flexDirection:{base:"column",lg:"row"},alignItems:{lg:"center"},justifyContent:{lg:"center"}},r))};a.Image=o.Image,a.Content=function(e){return n.default.createElement(o.Flex,i({gap:"1.5rem",flexDirection:"column",maxWidth:{lg:"36.8125rem",xl:"33.5rem",xxl:"43.5rem"}},e))},a.Overline=function(e){return n.default.createElement(o.Flex,{flexDirection:"column",gap:"0.75rem",alignSelf:"start"},n.default.createElement(o.Text,i({as:"h3",variant:{base:"text-header-S",lg:"text-header-XS"}},e)),n.default.createElement(o.Divider,null))},a.Testimony=function(e){return n.default.createElement(o.Text,i({variant:{base:"text-body-display-M",lg:"text-body-display-L"}},e))},a.Author=function(e){return n.default.createElement(o.Text,i({variant:"text-body-medium"},e))},a.Action=function(e){return n.default.createElement(o.Link,i({target:"_blank",size:"s"},e))}},27988:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"MediaBlock",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["variant","justifyContent","bounded"]),l="horizontal"===(void 0===t?"vertical":t);return n.default.createElement(o.Flex,i({direction:l?"row":"column",gap:l?"1.25rem":"1rem",justifyContent:void 0===r?"start":r,alignItems:"start",textAlign:l?"start":e.alignItems},a&&{as:o.Card},s))};a.Image=o.Image,a.Title=o.TextPairing,a.Tag=o.Tag,a.Action=o.Link,a.Overline=function(e){return n.default.createElement(o.Text,i({color:"text-secondary",variant:"text-body-medium",textTransform:"uppercase"},e))}},28211:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(69554),t),n(r(45042),t)},28658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(4234),t)},28954:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(60610),t)},30347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(82034),t)},30613:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(61430),t)},30652:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(38168),t),n(r(75379),t),n(r(14009),t)},31008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"FooterProps",{enumerable:!0,get:function(){return n.FlexProps}});var n=r(37477)},31048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{NavigationLinks:function(){return c},NavigationLink:function(){return u}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(31430);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=function(e){var t=e.actions,r=e.image,a=e.children,c=e.linksPosition,u=e.showDividers,d=void 0===u||u,f=l(e,["actions","image","children","linksPosition","showDividers"]),h=(0,o.useDisclosure)(),p=h.isOpen,m=h.onOpen,b=h.onClose,y=(0,i.useNavigationContext)(),g=y.showBaseNavigation,v=y.keepActionsAlwaysVisible;return g?n.default.createElement(n.default.Fragment,null,n.default.createElement(o.IconButton,{icon:n.default.createElement(o.IconMenu2,null),"aria-label":"Hamburger menu button",variant:"ghost",size:"l",onClick:m}),n.default.createElement(o.Flex,{justifyContent:"space-between",flexBasis:"100%",gap:"0.75rem"},r,v&&t),p&&n.default.createElement(o.Flex,s({width:"100%",height:"100%",bg:"background-overlay",position:"fixed",top:"0",left:"0",zIndex:"1",flexDirection:"column"},f),n.default.createElement(o.Box,{pt:"0.75rem",px:"1rem"},n.default.createElement(o.IconButton,{icon:n.default.createElement(o.IconX,null),"aria-label":"Close hamburguer menu button",variant:"ghost",size:"l",onClick:b})),n.default.createElement(o.Flex,{height:"100%",width:"100%",px:"1.5rem",pt:"3.5rem",pb:"3.25rem",alignItems:"center",flexDirection:"column",overflow:"auto"},n.Children.map(a,function(e,t){return(0,n.isValidElement)(e)&&(0,n.cloneElement)(e,{showDivider:t!==n.Children.count(a)-1&&d})}),!v&&t))):n.default.createElement(o.Flex,s({maxWidth:"80rem",margin:"0 auto",alignItems:"center",width:"100%"},f),n.default.createElement(o.Box,{flexShrink:"0"},r),n.default.createElement(o.Flex,{flexBasis:"100%",mx:{lg:"2.75rem",xxl:"4.5rem"},gap:{lg:"1.5rem",xl:"2.25rem",xxl:"5rem"},justifyContent:void 0===c?"start":c},a),n.default.createElement(o.Box,{flexShrink:"0"},t))},u=function(e){var t=e.showDivider,r=e.children,a=l(e,["showDivider","children"]);return(0,i.useNavigationContext)().showBaseNavigation?n.default.createElement(n.Fragment,null,n.default.createElement(o.Link,s({size:"l",justifyContent:"center",marginBottom:!t&&"3rem",variant:"link-secondary"},a),n.default.createElement(o.Text,{variant:"text-body-display-L",color:"unset"},r)),t&&n.default.createElement(o.Divider,{my:"1.50rem",maxWidth:"24.75rem"})):n.default.createElement(o.Link,s({size:"m",variant:"link-secondary"},a),r)}},31430:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(855),t)},38208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HighlightedText",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["backgroundColor","contentAlignment"]);return n.default.createElement(o.Flex,i({backgroundColor:void 0===t?"background-page":t,flexDirection:"column",gap:{base:"0.75rem",lg:"1rem"},px:{base:"1.25rem",md:"1.5rem",lg:"3rem",xl:"6rem",xxl:"7rem"},py:{base:"2.5rem",md:"4rem",lg:"5rem",xl:"5.5rem",xxl:"6rem"},alignItems:a,textAlign:a},s))};a.Title=o.TextPairing,a.Actions=function(e){return n.default.createElement(o.Flex,i({gap:{base:"1rem",md:"1.5rem"},flexDirection:{base:"column",md:"row"},mt:{base:"0.75rem",lg:"1rem",xl:"2rem"},width:{base:"100%",md:"unset"}},e))},a.Action=function(e){return n.default.createElement(o.Link,i({target:"_blank",size:"l",justifyContent:"center"},e))},a.Overline=function(e){return n.default.createElement(o.Text,i({color:"text-secondary",variant:"text-body-display-S",textTransform:"uppercase",display:"flex"},e))}},40836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BrandLogos",{enumerable:!0,get:function(){return s}});var n,o=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),i=r(37477);function a(e){for(var t=1;t{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(66030),t),n(r(26023),t)},42760:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(95080),t),n(r(54253),t)},44103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccordionGalleryImageProps",{enumerable:!0,get:function(){return n.ImageProps}});var n=r(37477)},45042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},45843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(5e4),t)},46400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BrandLogosProps",{enumerable:!0,get:function(){return n.FlexProps}});var n=r(37477)},46792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(94546),t)},5e4:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(15254),t),n(r(66805),t)},54253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"QuoteProps",{enumerable:!0,get:function(){return n.FlexProps}});var n=r(37477)},56264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Footer",{enumerable:!0,get:function(){return s}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=function(e){return n.default.createElement(o.Flex,i({maxWidth:"66.75rem",flexDirection:"column",width:"100%"},e))};s.Logo=function(e){return n.default.createElement(o.Image,i({alt:"Footer image",width:"100%",mb:{base:"2.75rem",md:"3rem"}},e))},s.ActionsContainer=function(e){return n.default.createElement(o.Flex,i({gap:{base:"2.75rem",lg:"1.5rem"},flexDirection:{base:"column",md:"row"},flex:{lg:1}},e))},s.Actions=function(e){var t=e.children,r=e.title,s=a(e,["children","title"]);return n.default.createElement(o.Flex,i({flexDirection:"column",gap:"0.75rem",flex:1},s),r&&n.default.createElement(o.Text,{variant:"text-body-bold",mb:"0.5rem"},r),t)},s.Action=function(e){return n.default.createElement(o.Link,i({size:"m",variant:"link-secondary"},e))},s.Bottom=function(e){var t=e.children,r=a(e,["children"]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Divider,i({width:"100%",my:{base:"2.75rem",md:"4rem"}},r)),t)},s.CopyGroup=o.Flex,s.Content=function(e){return n.default.createElement(o.Flex,i({flexDirection:{base:"column",lg:"row"},gap:{base:"2.75rem",md:"3rem"}},e))}},57546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useRoom",{enumerable:!0,get:function(){return f}});var n=r(14232),o=r(8912);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"VideoRoom",{enumerable:!0,get:function(){return h}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(60834);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(57546),t)},61040:(e,t,r)=>{e.exports=r(26686)},61055:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(78778),t),n(r(75921),t),n(r(74318),t),n(r(28658),t),n(r(3665),t),n(r(42586),t),n(r(85026),t),n(r(19619),t),n(r(46792),t),n(r(42760),t),n(r(3943),t)},61373:function(e,t,r){var n,o;!function(i,a){"use strict";void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(){"use strict";var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function o(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(t,r){for(var o=0;o=0&&r<=s.levels.SILENT){if(i=r,!1!==o&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{window.localStorage[c]=r;return}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+r+";"}catch(e){}}}(r),a.call(s,r,e),typeof console===t&&r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Avatar",{enumerable:!0,get:function(){return i}});var n=r(37477),o=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),i=function(e){var t=e.name,r=e.size;return o.default.createElement(n.Avatar,{size:void 0===r?"l":r,name:t,getInitials:function(e){return e.substring(0,2).toUpperCase()}})}},63054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"MembersList",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(99003),i=r(30613),a=function(e){var t=e.members,r=e.ownMemberId,a=e.ownUserName,s=t.filter(function(e){return e.id!==r});return n.default.createElement(o.List,{position:"fixed",top:"1rem",left:"1rem",zIndex:"2",display:"flex",flexDir:"column",alignItems:"center"},a&&n.default.createElement(o.ListItem,null,n.default.createElement(i.Avatar,{name:a})),s.map(function(e){return n.default.createElement(o.ListItem,{mt:"1rem",color:"white",key:e.id},n.default.createElement(i.Avatar,{name:e.name,size:"m"}))}))}},64347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(95078),t)},64929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRoomToken",{enumerable:!0,get:function(){return i}});var n=r(84527);function o(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){r(e);return}s.done?t(l):Promise.resolve(l).then(n,o)}var i=function(){var e,t=(e=function(e){var t,r,o,i;return function(e,t){var r,n,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(i){return function(s){var l=[i,s];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Hero",{enumerable:!0,get:function(){return l}});var n,o=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),i=r(37477),a=r(19619);function s(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["contentAlignment"]);return o.default.createElement(i.Flex,s({flexDirection:"column",px:{base:"1.5rem",lg:0},pt:{base:"2rem",md:"2.75rem",lg:"5.75rem"},pb:{base:"2.75rem",lg:"5.75rem"},gap:"2rem",alignItems:r,textAlign:r},n))},l.Title=i.TextPairing,l.Actions=function(e){return o.default.createElement(i.Flex,s({gap:"1rem",flexDirection:{base:"column",md:"row"}},e))},l.Action=function(e){return o.default.createElement(i.Link,s({target:"_blank",size:"l"},e))},l.Tag=function(e){return o.default.createElement(i.Tag,s({size:"m",alignSelf:"start"},e))},l.ContentContainer=function(e){return o.default.createElement(i.Flex,s({gap:"1rem",flexDirection:"column"},e))},l.Disclaimer=function(e){return o.default.createElement(i.Text,s({color:"text-secondary",variant:"text-body-meta-regular"},e))},l.Overline=function(e){return o.default.createElement(i.Text,s({color:"text-secondary",variant:"text-header-L"},e))};var c=function(e){return o.default.createElement(a.MediaBlock,s({variant:"horizontal"},e))};c.Image=a.MediaBlock.Image,c.Title=a.MediaBlock.Title,c.Tag=a.MediaBlock.Tag,c.Action=a.MediaBlock.Action,c.Overline=a.MediaBlock.Overline,l.MediaBlock=c},66398:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(74760),t)},66805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"VideoChat",{enumerable:!0,get:function(){return h}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(30652),a=r(4921);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["room","role"]),h=d((0,n.useState)(!0),2),p=h[0],m=h[1],b=d((0,n.useState)(!1),2),y=b[0],g=b[1],v=d((0,n.useState)(""),2),S=v[0],O=v[1],w=d((0,n.useState)(""),2),k=w[0],E=w[1],P=d((0,n.useState)(""),2),j=P[0],x=P[1],T=d((0,n.useState)([]),2),_=T[0],M=T[1],C="interviewer"===l;(0,n.useEffect)(function(){var e;(e=c(function(){return f(this,function(e){switch(e.label){case 0:return m(!0),[4,(0,i.isRoomAvailable)(s)];case 1:return g(e.sent()),m(!1),[2]}})}),function(){return e.apply(this,arguments)})()},[s]);var A=(t=c(function(e){return f(this,function(t){switch(t.label){case 0:if(!e)return[2];return E(e),m(!0),[4,(0,i.getRoomToken)({user:e,room:s,isModerator:C})];case 1:return O(t.sent()),m(!1),[2]}})}),function(e){return t.apply(this,arguments)}),R=(r=c(function(){return f(this,function(e){return O(""),M([]),[2]})}),function(){return r.apply(this,arguments)});return p?n.default.createElement(a.Loading,null):n.default.createElement(o.Flex,function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccordionGalleryImage",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(){var e,t,r=(e=["\n from { opacity: 0; }\n to { opacity: 1; }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return i=function(){return r},r}var a=function(e){if(e){var t=(0,o.keyframes)(i());return n.default.createElement(o.Box,{animation:"".concat(t," 0.5s linear"),key:e.src},n.default.createElement(o.Image,function(e){for(var t=1;t{"use strict";let n;var o,i,a,s=r(99742),l=r(82909).hp;function c(e,t){return function(){return e.apply(t,arguments)}}let{toString:u}=Object.prototype,{getPrototypeOf:d}=Object,{iterator:f,toStringTag:h}=Symbol,p=(e=>t=>{let r=u.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),m=e=>(e=e.toLowerCase(),t=>p(t)===e),b=e=>t=>typeof t===e,{isArray:y}=Array,g=b("undefined"),v=m("ArrayBuffer"),S=b("string"),O=b("function"),w=b("number"),k=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==p(e))return!1;let t=d(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(h in e)&&!(f in e)},P=m("Date"),j=m("File"),x=m("Blob"),T=m("FileList"),_=m("URLSearchParams"),[M,C,A,R]=["ReadableStream","Request","Response","Headers"].map(m);function I(e,t,{allOwnKeys:r=!1}={}){let n,o;if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(n=0,o=e.length;n0;)if(t===(r=n[o]).toLowerCase())return r;return null}let N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,L=e=>!g(e)&&e!==N,U=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&d(Uint8Array)),W=m("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),B=m("RegExp"),z=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};I(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)},q=m("AsyncFunction"),H=(o="function"==typeof setImmediate,i=O(N.postMessage),o?setImmediate:i?((e,t)=>(N.addEventListener("message",({source:r,data:n})=>{r===N&&n===e&&t.length&&t.shift()()},!1),r=>{t.push(r),N.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e)),V="undefined"!=typeof queueMicrotask?queueMicrotask.bind(N):void 0!==s&&s.nextTick||H;var X={isArray:y,isArrayBuffer:v,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||O(e.append)&&("formdata"===(t=p(e))||"object"===t&&O(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&v(e.buffer)},isString:S,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:k,isPlainObject:E,isReadableStream:M,isRequest:C,isResponse:A,isHeaders:R,isUndefined:g,isDate:P,isFile:j,isBlob:x,isRegExp:B,isFunction:O,isStream:e=>k(e)&&O(e.pipe),isURLSearchParams:_,isTypedArray:U,isFileList:T,forEach:I,merge:function e(){let{caseless:t}=L(this)&&this||{},r={},n=(n,o)=>{let i=t&&D(r,o)||o;E(r[i])&&E(n)?r[i]=e(r[i],n):E(n)?r[i]=e({},n):y(n)?r[i]=n.slice():r[i]=n};for(let e=0,t=arguments.length;e(I(t,(t,n)=>{r&&O(t)?e[n]=c(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==r&&d(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:p,kindOfTest:m,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!w(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,n=(e&&e[f]).call(e);for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r,n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:W,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:z,freezeMethods:e=>{z(e,(t,r)=>{if(O(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(O(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(y(e)?e:String(e).split(t)).forEach(e=>{r[e]=!0}),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:D,global:N,isContextDefined:L,isSpecCompliantForm:function(e){return!!(e&&O(e.append)&&"FormData"===e[h]&&e[f])},toJSONObject:e=>{let t=Array(10),r=(e,n)=>{if(k(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;let o=y(e)?[]:{};return I(e,(e,t)=>{let i=r(e,n+1);g(i)||(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:q,isThenable:e=>e&&(k(e)||O(e))&&O(e.then)&&O(e.catch),setImmediate:H,asap:V,isIterable:e=>null!=e&&O(e[f])};function G(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}X.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:X.toJSONObject(this.config),code:this.code,status:this.status}}});let K=G.prototype,J={};function Z(e){return X.isPlainObject(e)||X.isArray(e)}function Y(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,r){return e?e.concat(t).map(function(e,t){return e=Y(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{J[e]={value:e}}),Object.defineProperties(G,J),Object.defineProperty(K,"isAxiosError",{value:!0}),G.from=(e,t,r,n,o,i)=>{let a=Object.create(K);return X.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),G.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};let $=X.toFlatObject(X,{},null,function(e){return/^is[A-Z]/.test(e)});function ee(e,t,r){if(!X.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(r=X.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!X.isUndefined(t[e])})).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(o))throw TypeError("visitor must be a function");function c(e){if(null===e)return"";if(X.isDate(e))return e.toISOString();if(!s&&X.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(e)||X.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):l.from(e):e}function u(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(X.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else{var l;if(X.isArray(e)&&(l=e,X.isArray(l)&&!l.some(Z))||(X.isFileList(e)||X.endsWith(r,"[]"))&&(s=X.toArray(e)))return r=Y(r),s.forEach(function(e,n){X.isUndefined(e)||null===e||t.append(!0===a?Q([r],n,i):null===a?r:r+"[]",c(e))}),!1}return!!Z(e)||(t.append(Q(o,r,i),c(e)),!1)}let d=[],f=Object.assign($,{defaultVisitor:u,convertValue:c,isVisitable:Z});if(!X.isObject(e))throw TypeError("data must be an object");return!function e(r,n){if(!X.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),X.forEach(r,function(r,i){!0===(!(X.isUndefined(r)||null===r)&&o.call(t,r,X.isString(i)?i.trim():i,n,f))&&e(r,n?n.concat(i):[i])}),d.pop()}}(e),t}function et(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function er(e,t){this._pairs=[],e&&ee(e,this,t)}let en=er.prototype;function eo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ei(e,t,r){let n;if(!t)return e;let o=r&&r.encode||eo;X.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize;if(n=i?i(t,r):X.isURLSearchParams(t)?t.toString():new er(t,r).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}en.append=function(e,t){this._pairs.push([e,t])},en.toString=function(e){let t=e?function(t){return e.call(this,t,et)}:et;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ea{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){X.forEach(this.handlers,function(t){null!==t&&e(t)})}}var es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},el="undefined"!=typeof URLSearchParams?URLSearchParams:er,ec="undefined"!=typeof FormData?FormData:null,eu="undefined"!=typeof Blob?Blob:null;let ed="undefined"!=typeof window&&"undefined"!=typeof document,ef="object"==typeof navigator&&navigator||void 0,eh=ed&&(!ef||0>["ReactNative","NativeScript","NS"].indexOf(ef.product)),ep="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,em=ed&&window.location.href||"http://localhost";var eb={...Object.freeze({__proto__:null,hasBrowserEnv:ed,hasStandardBrowserWebWorkerEnv:ep,hasStandardBrowserEnv:eh,navigator:ef,origin:em}),isBrowser:!0,classes:{URLSearchParams:el,FormData:ec,Blob:eu},protocols:["http","https","file","blob","url","data"]};function ey(e){if(X.isFormData(e)&&X.isFunction(e.entries)){let t={};return X.forEachEntry(e,(e,r)=>{!function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=o>=t.length;return(i=!i&&X.isArray(n)?n.length:i,s)?X.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r:(n[i]&&X.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&X.isArray(n[i])&&(n[i]=function(e){let t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null}let eg={transitional:es,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=X.isObject(e);if(i&&X.isHTMLForm(e)&&(e=new FormData(e)),X.isFormData(e))return o?JSON.stringify(ey(e)):e;if(X.isArrayBuffer(e)||X.isBuffer(e)||X.isStream(e)||X.isFile(e)||X.isBlob(e)||X.isReadableStream(e))return e;if(X.isArrayBufferView(e))return e.buffer;if(X.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1){var a,s;return(a=e,s=this.formSerializer,ee(a,new eb.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return eb.isNode&&X.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},s))).toString()}if((r=X.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return ee(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(i||o){t.setContentType("application/json",!1);var l=e;if(X.isString(l))try{return(0,JSON.parse)(l),X.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||eg.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(X.isResponse(e)||X.isReadableStream(e))return e;if(e&&X.isString(e)&&(r&&!this.responseType||n)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!r&&n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eb.classes.FormData,Blob:eb.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{eg.headers[e]={}});let ev=X.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var eS=e=>{let t,r,n,o={};return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!t||o[t]&&ev[t]||("set-cookie"===t?o[t]?o[t].push(r):o[t]=[r]:o[t]=o[t]?o[t]+", "+r:r)}),o};let eO=Symbol("internals");function ew(e){return e&&String(e).trim().toLowerCase()}function ek(e){return!1===e||null==e?e:X.isArray(e)?e.map(ek):String(e)}let eE=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eP(e,t,r,n,o){if(X.isFunction(n))return n.call(this,t,r);if(o&&(t=r),X.isString(t)){if(X.isString(n))return -1!==t.indexOf(n);if(X.isRegExp(n))return n.test(t)}}class ej{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function o(e,t,r){let o=ew(t);if(!o)throw Error("header name must be a non-empty string");let i=X.findKey(n,o);i&&void 0!==n[i]&&!0!==r&&(void 0!==r||!1===n[i])||(n[i||t]=ek(e))}let i=(e,t)=>X.forEach(e,(e,r)=>o(e,r,t));if(X.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(X.isString(e)&&(e=e.trim())&&!eE(e))i(eS(e),t);else if(X.isObject(e)&&X.isIterable(e)){let r={},n,o;for(let t of e){if(!X.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[o=t[0]]=(n=r[o])?X.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(r,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=ew(e)){let r=X.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t){let t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)r[t[1]]=t[2];return r}if(X.isFunction(t))return t.call(this,e,r);if(X.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ew(e)){let r=X.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||eP(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function o(e){if(e=ew(e)){let o=X.findKey(r,e);o&&(!t||eP(r,r[o],o,t))&&(delete r[o],n=!0)}}return X.isArray(e)?e.forEach(o):o(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let o=t[r];(!e||eP(this,this[o],o,e,!0))&&(delete this[o],n=!0)}return n}normalize(e){let t=this,r={};return X.forEach(this,(n,o)=>{let i=X.findKey(r,o);if(i){t[i]=ek(n),delete t[o];return}let a=e?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(o).trim();a!==o&&delete t[o],t[a]=ek(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return X.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&X.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[eO]=this[eO]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=ew(e);if(!t[n]){let o=X.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(r,t+o,{value:function(r,n,o){return this[t].call(this,e,r,n,o)},configurable:!0})}),t[n]=!0}}return X.isArray(e)?e.forEach(n):n(e),this}}function ex(e,t){let r=this||eg,n=t||r,o=ej.from(n.headers),i=n.data;return X.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function eT(e){return!!(e&&e.__CANCEL__)}function e_(e,t,r){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,r),this.name="CanceledError"}function eM(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}ej.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),X.reduceDescriptors(ej.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),X.freezeMethods(ej),X.inherits(e_,G,{__CANCEL__:!0});let eC=(e,t,r=3)=>{let n=0,o=function(e,t){let r,n=Array(e=e||10),o=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=o[a];r||(r=l),n[i]=s,o[i]=l;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),l-r{o=i,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{let t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]}(r=>{let i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,l=o(s);n=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},eA=(e,t)=>{let r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},eR=e=>(...t)=>X.asap(()=>e(...t));var eI=eb.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,eb.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(eb.origin),eb.navigator&&/(msie|trident)/i.test(eb.navigator.userAgent)):()=>!0,eD=eb.hasStandardBrowserEnv?{write(e,t,r,n,o,i){let a=[e+"="+encodeURIComponent(t)];X.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),X.isString(n)&&a.push("path="+n),X.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function eN(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||!1==r)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let eL=e=>e instanceof ej?{...e}:e;function eU(e,t){t=t||{};let r={};function n(e,t,r,n){return X.isPlainObject(e)&&X.isPlainObject(t)?X.merge.call({caseless:n},e,t):X.isPlainObject(t)?X.merge({},t):X.isArray(t)?t.slice():t}function o(e,t,r,o){return X.isUndefined(t)?X.isUndefined(e)?void 0:n(void 0,e,r,o):n(e,t,r,o)}function i(e,t){if(!X.isUndefined(t))return n(void 0,t)}function a(e,t){return X.isUndefined(t)?X.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,r)=>o(eL(e),eL(t),r,!0)};return X.forEach(Object.keys(Object.assign({},e,t)),function(n){let i=l[n]||o,a=i(e[n],t[n],n);X.isUndefined(a)&&i!==s||(r[n]=a)}),r}var eW=e=>{let t,r=eU({},e),{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=r;if(r.headers=s=ej.from(s),r.url=ei(eN(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),X.isFormData(n)){if(eb.hasStandardBrowserEnv||eb.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(t=s.getContentType())){let[e,...r]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...r].join("; "))}}if(eb.hasStandardBrowserEnv&&(o&&X.isFunction(o)&&(o=o(r)),o||!1!==o&&eI(r.url))){let e=i&&a&&eD.read(a);e&&s.set(i,e)}return r},eF="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){let n,o,i,a,s,l=eW(e),c=l.data,u=ej.from(l.headers).normalize(),{responseType:d,onUploadProgress:f,onDownloadProgress:h}=l;function p(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(n),l.signal&&l.signal.removeEventListener("abort",n)}let m=new XMLHttpRequest;function b(){if(!m)return;let n=ej.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());eM(function(e){t(e),p()},function(e){r(e),p()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(r(new G("Request aborted",G.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",n=l.transitional||es;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),r(new G(t,n.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,m)),m=null},void 0===c&&u.setContentType(null),"setRequestHeader"in m&&X.forEach(u.toJSON(),function(e,t){m.setRequestHeader(t,e)}),X.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),h&&([i,s]=eC(h,!0),m.addEventListener("progress",i)),f&&m.upload&&([o,a]=eC(f),m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)),(l.cancelToken||l.signal)&&(n=t=>{m&&(r(!t||t.type?new e_(null,e,m):t),m.abort(),m=null)},l.cancelToken&&l.cancelToken.subscribe(n),l.signal&&(l.signal.aborted?n():l.signal.addEventListener("abort",n)));let y=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l.url);if(y&&-1===eb.protocols.indexOf(y))return void r(new G("Unsupported protocol "+y+":",G.ERR_BAD_REQUEST,e));m.send(c||null)})},eB=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController,o=function(e){if(!r){r=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof G?t:new e_(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,o(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));let{signal:s}=n;return s.unsubscribe=()=>X.asap(a),s}};let ez=function*(e,t){let r,n=e.byteLength;if(!t||n{let o,i=eq(e,t),a=0,s=e=>{!o&&(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await i.next();if(t){s(),e.close();return}let o=n.byteLength;if(r){let e=a+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),i.return())},{highWaterMark:2})},eX="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,eG=eX&&"function"==typeof ReadableStream,eK=eX&&("function"==typeof TextEncoder?(n=new TextEncoder,e=>n.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer())),eJ=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},eZ=eG&&eJ(()=>{let e=!1,t=new Request(eb.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),eY=eG&&eJ(()=>X.isReadableStream(new Response("").body)),eQ={stream:eY&&(e=>e.body)};eX&&(a=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{eQ[e]||(eQ[e]=X.isFunction(a[e])?t=>t[e]():(t,r)=>{throw new G(`Response type '${e}' is not supported`,G.ERR_NOT_SUPPORT,r)})}));let e$=async e=>{if(null==e)return 0;if(X.isBlob(e))return e.size;if(X.isSpecCompliantForm(e)){let t=new Request(eb.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return X.isArrayBufferView(e)||X.isArrayBuffer(e)?e.byteLength:(X.isURLSearchParams(e)&&(e+=""),X.isString(e))?(await eK(e)).byteLength:void 0},e0=async(e,t)=>{let r=X.toFiniteNumber(e.getContentLength());return null==r?e$(t):r},e1={http:null,xhr:eF,fetch:eX&&(async e=>{let t,r,{url:n,method:o,data:i,signal:a,cancelToken:s,timeout:l,onDownloadProgress:c,onUploadProgress:u,responseType:d,headers:f,withCredentials:h="same-origin",fetchOptions:p}=eW(e);d=d?(d+"").toLowerCase():"text";let m=eB([a,s&&s.toAbortSignal()],l),b=m&&m.unsubscribe&&(()=>{m.unsubscribe()});try{if(u&&eZ&&"get"!==o&&"head"!==o&&0!==(r=await e0(f,i))){let e,t=new Request(n,{method:"POST",body:i,duplex:"half"});if(X.isFormData(i)&&(e=t.headers.get("content-type"))&&f.setContentType(e),t.body){let[e,n]=eA(r,eC(eR(u)));i=eV(t.body,65536,e,n)}}X.isString(h)||(h=h?"include":"omit");let a="credentials"in Request.prototype;t=new Request(n,{...p,signal:m,method:o.toUpperCase(),headers:f.normalize().toJSON(),body:i,duplex:"half",credentials:a?h:void 0});let s=await fetch(t),l=eY&&("stream"===d||"response"===d);if(eY&&(c||l&&b)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});let t=X.toFiniteNumber(s.headers.get("content-length")),[r,n]=c&&eA(t,eC(eR(c),!0))||[];s=new Response(eV(s.body,65536,r,()=>{n&&n(),b&&b()}),e)}d=d||"text";let y=await eQ[X.findKey(eQ,d)||"text"](s,e);return!l&&b&&b(),await new Promise((r,n)=>{eM(r,n,{data:y,headers:ej.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:t})})}catch(r){if(b&&b(),r&&"TypeError"===r.name&&/Load failed|fetch/i.test(r.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,e,t),{cause:r.cause||r});throw G.from(r,r&&r.code,e,t)}})};X.forEach(e1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e2=e=>`- ${e}`,e4=e=>X.isFunction(e)||null===e||!1===e;var e3={getAdapter:e=>{let t,r,{length:n}=e=X.isArray(e)?e:[e],o={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new G("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(e2).join("\n"):" "+e2(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r}};function e5(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new e_(null,e)}function e7(e){return e5(e),e.headers=ej.from(e.headers),e.data=ex.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e3.getAdapter(e.adapter||eg.adapter)(e).then(function(t){return e5(e),t.data=ex.call(e,e.transformResponse,t),t.headers=ej.from(t.headers),t},function(t){return!eT(t)&&(e5(e),t&&t.response&&(t.response.data=ex.call(e,e.transformResponse,t.response),t.response.headers=ej.from(t.response.headers))),Promise.reject(t)})}let e8="1.9.0",e6={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e6[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let e9={};e6.transitional=function(e,t,r){function n(e,t){return"[Axios v"+e8+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new G(n(o," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!e9[o]&&(e9[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},e6.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var te={assertOptions:function(e,t,r){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),o=n.length;for(;o-- >0;){let i=n[o],a=t[i];if(a){let t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new G("option "+i+" must be "+r,G.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:e6};let tt=te.validators;class tr{constructor(e){this.defaults=e||{},this.interceptors={request:new ea,response:new ea}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:o,paramsSerializer:i,headers:a}=t=eU(this.defaults,t);void 0!==o&&te.assertOptions(o,{silentJSONParsing:tt.transitional(tt.boolean),forcedJSONParsing:tt.transitional(tt.boolean),clarifyTimeoutError:tt.transitional(tt.boolean)},!1),null!=i&&(X.isFunction(i)?t.paramsSerializer={serialize:i}:te.assertOptions(i,{encode:tt.function,serialize:tt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),te.assertOptions(t,{baseUrl:tt.spelling("baseURL"),withXsrfToken:tt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&X.merge(a.common,a[t.method]);a&&X.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=ej.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(c=c&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let u=[];this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let d=0;if(!c){let e=[e7.bind(this),void 0];for(e.unshift.apply(e,l),e.push.apply(e,u),n=e.length,r=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t,n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new e_(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason)return void e(this.reason);this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new tn(function(t){e=t}),cancel:e}}}let to={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(to).forEach(([e,t])=>{to[t]=e});let ti=function e(t){let r=new tr(t),n=c(tr.prototype.request,r);return X.extend(n,tr.prototype,r,{allOwnKeys:!0}),X.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(eU(t,r))},n}(eg);ti.Axios=tr,ti.CanceledError=e_,ti.CancelToken=tn,ti.isCancel=eT,ti.VERSION=e8,ti.toFormData=ee,ti.AxiosError=G,ti.Cancel=ti.CanceledError,ti.all=function(e){return Promise.all(e)},ti.spread=function(e){return function(t){return e.apply(null,t)}},ti.isAxiosError=function(e){return X.isObject(e)&&!0===e.isAxiosError},ti.mergeConfig=eU,ti.AxiosHeaders=ej,ti.formToJSON=e=>ey(X.isHTMLForm(e)?new FormData(e):e),ti.getAdapter=e3.getAdapter,ti.HttpStatusCode=to,ti.default=ti,e.exports=ti},73710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{NavigationActions:function(){return s},NavigationAction:function(){return l}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477),i=r(31430);function a(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["size"]),s=(0,i.useNavigationContext)().keepActionsAlwaysVisible,l=t||s?"m":(0,o.useBreakpointValue)({base:"l",lg:"m"},"base");return n.default.createElement(o.Link,a({size:l},r))}},74318:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(8830),t),n(r(97491),t)},74666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(85930),t)},74760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Chat",{enumerable:!0,get:function(){return u}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(99003),a=r(64347);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["userId","channel","floating"]),u=(0,n.useRef)(),d=(0,a.useChat)({channel:r}),f=d.sendMessage,h=d.messages,p=d.fetchTokenAndStartChat,m=d.ready,b=c((0,n.useState)(""),2),y=b[0],g=b[1],v=(0,o.useBreakpointValue)({base:!0,md:!1}),S=c((0,n.useState)(!0),2),O=S[0],w=S[1];(0,n.useEffect)(function(){u.current&&O&&(u.current.scrollTop=u.current.scrollHeight)},[h,O,u.current]),(0,n.useEffect)(function(){w(!v)},[v]),(0,n.useEffect)(function(){p(t)},[p,t]);var k=function(){f(y),g("")};return n.default.createElement(o.Flex,function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(64929),t)},75921:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(40836),t),n(r(46400),t)},78778:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(18290),t),n(r(44103),t)},81948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AccordionGalleryItem",{enumerable:!0,get:function(){return l}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(78778),a=r(24765);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}var l=function(e){var t=e.children,r=e.index,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children","index"]),l=(0,n.useContext)(i.AccordionGalleryContext).images;return n.default.createElement(o.Accordion.Item,s,n.Children.map(t,function(e){if(!(0,n.isValidElement)(e)||e.type!==a.AccordionGalleryImage)return e;l.current[r]=e}))}},82034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Login",{enumerable:!0,get:function(){return s}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(11991),t)},85026:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(38208),t),n(r(89519),t)},85930:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Loading",{enumerable:!0,get:function(){return i}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477),i=function(){return n.default.createElement(o.Flex,{justifyContent:"center",alignItems:"center",backgroundColor:"background-dark",width:"100%",height:"100vh"},n.default.createElement(o.Spinner,{size:"s"}))}},87637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMDXComponent=function(e,t){return l(e,t).default},t.getMDXExport=l;var n=s(r(14232)),o=s(r(98477)),i=s(r(37876));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&({}).hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}function l(e,t){let r={React:n,ReactDOM:o,_jsx_runtime:i,...t};return Function(...Object.keys(r),e)(...Object.values(r))}},89519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},91929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(63054),t)},94546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Navigation",{enumerable:!0,get:function(){return s}});var n=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(14232)),o=r(37477),i=r(98203);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var s=function(e){var t=e.sticky,r=e.keepActionsAlwaysVisible,a=e.children,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["sticky","keepActionsAlwaysVisible","children"]),l=(0,o.useBreakpointValue)({base:!0,lg:!1}),c=(0,o.useScrollPosition)(),u=null,d=null,f=null;return n.Children.map(a,function(e){if((0,n.isValidElement)(e))switch(e.type){case i.NavigationImage:u=e;break;case i.NavigationLinks:d=e;break;case i.NavigationActions:f=e}}),n.default.createElement(i.NavigationProvider,{value:{showBaseNavigation:l,keepActionsAlwaysVisible:void 0!==r&&r}},n.default.createElement(o.Flex,function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useChat",{enumerable:!0,get:function(){return f}});var n=r(8912),o=r(14232),i=r(30652);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]0&&u&&w()},[n,a,u,w]),{messages:h,members:b,ready:v,sendMessage:function(e,t){O.current&&e&&O.current.publish({channel:t||a,content:e})},fetchTokenAndStartChat:w,clientRef:O}}},95080:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Quote",{enumerable:!0,get:function(){return a}});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(14232)),o=r(37477);function i(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98203:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(73710),t),n(r(31430),t),n(r(31048),t),n(r(668),t)}}]);