(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[604],{88373:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),function(r,a){for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]})}(a,{AccordionGalleryContext:function(){return d},AccordionGallery:function(){return AccordionGallery}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(59028);function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}function _sliced_to_array(r,a){return _array_with_holes(r)||_iterable_to_array_limit(r,a)||_unsupported_iterable_to_array(r,a)||_non_iterable_rest()}function _unsupported_iterable_to_array(r,a){if(r){if("string"==typeof r)return _array_like_to_array(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);if("Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _array_like_to_array(r,a)}}var d=(0,l.createContext)({images:null}),AccordionGallery=function(r){var a,s,u=r.children,f=r.defaultImage,m=void 0===f?0:f,b=_object_without_properties(r,["children","defaultImage"]),g=(0,c.useBreakpointValue)({base:!0,lg:!1}),y=_sliced_to_array((0,l.useState)(null),2),_=y[0],v=y[1],S=(0,l.useRef)({});(0,l.useEffect)(function(){"number"!=typeof m?(S.current.default=m,v("default")):v(m)},[]);var w=null,O=null,k=null;return l.Children.map(u,function(r){if((0,l.isValidElement)(r))switch(r.type){case c.Text:k=r;break;case c.TextPairing:w=r;break;case p:O=r}}),l.default.createElement(d.Provider,{value:{images:S}},l.default.createElement(c.Flex,_object_spread({gap:{md:"2rem",lg:"3rem",xxl:"5.75rem"},alignItems:{md:"center"},justifyContent:"center"},b),!g&&(null===(a=S.current)||void 0===a?void 0:a[_])?S.current[_]:null,l.default.createElement(c.Flex,{flexDirection:"column",gap:{base:"2rem",md:"1.5rem",lg:"3rem"}},k,w,g&&(null===(s=S.current)||void 0===s?void 0:s[_])?S.current[_]:null,O&&(0,l.cloneElement)(O,{onChange:function(r){var a,s,l=-1!==r?r:"number"==typeof m?m:"default";null===(s=O.props)||void 0===s||null===(a=s.onChange)||void 0===a||a.call(s,r),v(l)}}))))},p=Object.assign(u.AccordionGalleryAccordion,{Image:u.AccordionGalleryImage,Item:u.AccordionGalleryItem,Button:c.Accordion.Button,Panel:c.Accordion.Panel,Icon:c.Accordion.Icon});AccordionGallery.Title=c.TextPairing,AccordionGallery.Accordion=p,AccordionGallery.Overline=c.Text},35438:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"AccordionGalleryAccordion",{enumerable:!0,get:function(){return AccordionGalleryAccordion}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(59028);function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var a=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(r){return r?s:a})(r)}function _interop_require_wildcard(r,a){if(!a&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var s=_getRequireWildcardCache(a);if(s&&s.has(r))return s.get(r);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var d=c?Object.getOwnPropertyDescriptor(r,u):null;d&&(d.get||d.set)?Object.defineProperty(l,u,d):l[u]=r[u]}return l.default=r,s&&s.set(r,l),l}function _object_without_properties(r,a){if(null==r)return{};var s,l,c=_object_without_properties_loose(r,a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var AccordionGalleryAccordion=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return l.default.createElement(c.Accordion,s,l.Children.map(a,function(r,a){if((0,l.isValidElement)(r))return r.type===u.AccordionGalleryItem?(0,l.cloneElement)(r,{index:a}):r}))}},33470:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"AccordionGalleryImage",{enumerable:!0,get:function(){return AccordionGalleryImage}});var l=_interop_require_default(s(67294)),c=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var AccordionGalleryItem=function(r){var a=r.children,s=r.index,p=_object_without_properties(r,["children","index"]),f=(0,l.useContext)(u.AccordionGalleryContext).images;return l.default.createElement(c.Accordion.Item,p,l.Children.map(a,function(r){if(!(0,l.isValidElement)(r)||r.type!==d.AccordionGalleryImage)return r;f.current[s]=r}))}},59028:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(35438),a),_export_star(s(33470),a),_export_star(s(22002),a)},54598:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(88373),a),_export_star(s(69608),a)},69608:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"AccordionGalleryImageProps",{enumerable:!0,get:function(){return l.ImageProps}});var l=s(71986)},72275:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"BrandLogos",{enumerable:!0,get:function(){return BrandLogos}});var l,c=_interop_require_default(s(67294)),u=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;ar.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}function _sliced_to_array(r,a){return _array_with_holes(r)||_iterable_to_array_limit(r,a)||_unsupported_iterable_to_array(r,a)||_non_iterable_rest()}function _unsupported_iterable_to_array(r,a){if(r){if("string"==typeof r)return _array_like_to_array(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);if("Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _array_like_to_array(r,a)}}var d=_sliced_to_array((0,c.createContext)({name:"CookieBannerContext"}),2),p=d[0],f=d[1],CookieBanner=function(r){var a=r.children,s=r.cookieKey,c=void 0===s?"cmpsr-cookies-policy":s,d=r.cookieVersion,f=void 0===d?"1.0.0":d,m=_object_without_properties(r,["children","cookieKey","cookieVersion"]),b=_sliced_to_array((0,l.useState)(!1),2),g=b[0],y=b[1],_=_sliced_to_array((0,l.useState)(void 0),2),v=_[0],S=_[1];(0,l.useEffect)(function(){var r=localStorage.getItem(c);r?S(r):S("")},[]),(0,l.useEffect)(function(){if(void 0!==v){if(""===v){y(!0);return}if(JSON.parse(v).cookieVersion===f){y(!1);return}y(!0)}},[v]);var updatePolicy=function(r){var a=JSON.stringify({cookieVersion:f,allow:r});localStorage.setItem(c,a),S(a)},w=l.default.Children.map(a,function(r){return(0,l.isValidElement)(r)&&r.type===CookieBannerActions}).some(Boolean);return l.default.createElement(p,{value:{allowAllCookies:function(){return updatePolicy("all")},allowRequiredOnly:function(){return updatePolicy("required")},cookiePolicy:v}},g?l.default.createElement(u.Flex,_object_spread({direction:{base:"column",lg:"row"},alignItems:"center",bg:"background-inform",pr:"1rem",py:"1.5rem"},m),a,!w&&l.default.createElement(CookieBanner.Actions,null,l.default.createElement(CookieBanner.Actions.AcceptRequired,null),l.default.createElement(CookieBanner.Actions.AcceptAll,null))):null)};CookieBanner.Content=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return l.default.createElement(u.Alert,_object_spread({variant:"subtle",pt:"0",pr:{base:"0",lg:"2rem"},pb:{base:"2rem",lg:"0"}},s),l.default.createElement(u.Alert.Icon,null),"string"==typeof a?l.default.createElement(u.Text,{color:"text-secondary"},a):a)};var CookieBannerActions=function(r){return l.default.createElement(u.Flex,_object_spread({justifyContent:"center",alignItems:"center",direction:{base:"column",lg:"row"},gap:"1.5rem"},r))};CookieBannerActions.AcceptAll=function(r){var a=r.onClick,s=r.children,c=void 0===s?"Allow all Cookies":s,d=_object_without_properties(r,["onClick","children"]),p=f().allowAllCookies;return l.default.createElement(u.Button,_object_spread({variant:"primary",onClick:function(r){p(),null==a||a(r)}},d),c)},CookieBannerActions.AcceptRequired=function(r){var a=r.onClick,s=r.children,c=void 0===s?"Allow functional only":s,d=_object_without_properties(r,["onClick","children"]),p=f().allowRequiredOnly;return l.default.createElement(u.Button,_object_spread({variant:"link",onClick:function(r){p(),null==a||a(r)}},d),c)},CookieBanner.Actions=CookieBannerActions},30890:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(30400),a)},45694:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Footer",{enumerable:!0,get:function(){return Footer}});var l=_interop_require_default(s(67294)),c=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var Footer=function(r){return l.default.createElement(c.Flex,_object_spread({maxWidth:"66.75rem",flexDirection:"column",width:"100%"},r))};Footer.Logo=function(r){return l.default.createElement(c.Image,_object_spread({alt:"Footer image",width:"100%",mb:{base:"2.75rem",md:"3rem"}},r))},Footer.ActionsContainer=function(r){return l.default.createElement(c.Flex,_object_spread({gap:{base:"2.75rem",lg:"1.5rem"},flexDirection:{base:"column",md:"row"},flex:{lg:1}},r))},Footer.Actions=function(r){var a=r.children,s=r.title,u=_object_without_properties(r,["children","title"]);return l.default.createElement(c.Flex,_object_spread({flexDirection:"column",gap:"0.75rem",flex:1},u),s&&l.default.createElement(c.Text,{variant:"text-body-bold",mb:"0.5rem"},s),a)},Footer.Action=function(r){return l.default.createElement(c.Link,_object_spread({size:"m",variant:"link-secondary"},r))},Footer.Bottom=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Divider,_object_spread({width:"100%",my:{base:"2.75rem",md:"4rem"}},s)),a)},Footer.CopyGroup=c.Flex,Footer.Content=function(r){return l.default.createElement(c.Flex,_object_spread({flexDirection:{base:"column",lg:"row"},gap:{base:"2.75rem",md:"3rem"}},r))}},19434:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(45694),a),_export_star(s(2682),a)},2682:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"FooterProps",{enumerable:!0,get:function(){return l.FlexProps}});var l=s(71986)},37827:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Hero",{enumerable:!0,get:function(){return Hero}});var l,c=_interop_require_default(s(67294)),u=s(71986),d=s(35417);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var Hero=function(r){return c.default.createElement(u.Flex,_object_spread({backgroundColor:null!==(l=r.backgroundColor)&&void 0!==l?l:"background-page",flexDirection:{base:"column",lg:"row"},gap:{lg:"2.75rem"},alignItems:"center",justifyContent:"center"},r))};Hero.Image=u.Image,Hero.Content=function(r){var a=r.contentAlignment,s=void 0===a?"start":a,l=_object_without_properties(r,["contentAlignment"]);return c.default.createElement(u.Flex,_object_spread({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:s,textAlign:s},l))},Hero.Title=u.TextPairing,Hero.Actions=function(r){return c.default.createElement(u.Flex,_object_spread({gap:"1rem",flexDirection:{base:"column",md:"row"}},r))},Hero.Action=function(r){return c.default.createElement(u.Link,_object_spread({target:"_blank",size:"l"},r))},Hero.Tag=function(r){return c.default.createElement(u.Tag,_object_spread({size:"m",alignSelf:"start"},r))},Hero.ContentContainer=function(r){return c.default.createElement(u.Flex,_object_spread({gap:"1rem",flexDirection:"column"},r))},Hero.Disclaimer=function(r){return c.default.createElement(u.Text,_object_spread({color:"text-secondary",variant:"text-body-meta-regular"},r))},Hero.Overline=function(r){return c.default.createElement(u.Text,_object_spread({color:"text-secondary",variant:"text-header-L"},r))};var HeroMediaBlock=function(r){return c.default.createElement(d.MediaBlock,_object_spread({variant:"horizontal"},r))};HeroMediaBlock.Image=d.MediaBlock.Image,HeroMediaBlock.Title=d.MediaBlock.Title,HeroMediaBlock.Tag=d.MediaBlock.Tag,HeroMediaBlock.Action=d.MediaBlock.Action,HeroMediaBlock.Overline=d.MediaBlock.Overline,Hero.MediaBlock=HeroMediaBlock},12588:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(37827),a),_export_star(s(25030),a)},25030:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"HeroProps",{enumerable:!0,get:function(){return l.FlexProps}});var l=s(71986)},48002:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"HighlightedText",{enumerable:!0,get:function(){return HighlightedText}});var l=_interop_require_default(s(67294)),c=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var HighlightedText=function(r){var a=r.backgroundColor,s=r.contentAlignment,u=void 0===s?"start":s,d=_object_without_properties(r,["backgroundColor","contentAlignment"]);return l.default.createElement(c.Flex,_object_spread({backgroundColor:void 0===a?"background-page":a,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:u,textAlign:u},d))};HighlightedText.Title=c.TextPairing,HighlightedText.Actions=function(r){return l.default.createElement(c.Flex,_object_spread({gap:{base:"1rem",md:"1.5rem"},flexDirection:{base:"column",md:"row"},mt:{base:"0.75rem",lg:"1rem",xl:"2rem"},width:{base:"100%",md:"unset"}},r))},HighlightedText.Action=function(r){return l.default.createElement(c.Link,_object_spread({target:"_blank",size:"l",justifyContent:"center"},r))},HighlightedText.Overline=function(r){return l.default.createElement(c.Text,_object_spread({color:"text-secondary",variant:"text-body-display-S",textTransform:"uppercase",display:"flex"},r))}},50557:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(48002),a),_export_star(s(93706),a)},93706:function(r,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0})},93989:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"MediaBlock",{enumerable:!0,get:function(){return MediaBlock}});var l=_interop_require_default(s(67294)),c=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var MediaBlock=function(r){var a=r.variant,s=r.justifyContent,u=r.bounded,d=_object_without_properties(r,["variant","justifyContent","bounded"]),p="horizontal"===(void 0===a?"vertical":a);return l.default.createElement(c.Flex,_object_spread({direction:p?"row":"column",gap:p?"1.25rem":"1rem",justifyContent:void 0===s?"start":s,alignItems:"start",textAlign:p?"start":r.alignItems},u&&{as:c.Card},d))};MediaBlock.Image=c.Image,MediaBlock.Title=c.TextPairing,MediaBlock.Tag=c.Tag,MediaBlock.Action=c.Link,MediaBlock.Overline=function(r){return l.default.createElement(c.Text,_object_spread({color:"text-secondary",variant:"text-body-medium",textTransform:"uppercase"},r))}},35417:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(93989),a),_export_star(s(36222),a)},36222:function(r,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"mediaBlockVariants",{enumerable:!0,get:function(){return s}});var s=["vertical","horizontal"]},78510:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Navigation",{enumerable:!0,get:function(){return Navigation}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(2304);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var a=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(r){return r?s:a})(r)}function _interop_require_wildcard(r,a){if(!a&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var s=_getRequireWildcardCache(a);if(s&&s.has(r))return s.get(r);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var d=c?Object.getOwnPropertyDescriptor(r,u):null;d&&(d.get||d.set)?Object.defineProperty(l,u,d):l[u]=r[u]}return l.default=r,s&&s.set(r,l),l}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var Navigation=function(r){var a=r.sticky,s=void 0!==a&&a,d=r.keepActionsAlwaysVisible,p=r.children,f=_object_without_properties(r,["sticky","keepActionsAlwaysVisible","children"]),m=(0,c.useBreakpointValue)({base:!0,lg:!1}),b=(0,c.useScrollPosition)(),g=null,y=null,_=null;return l.Children.map(p,function(r){if((0,l.isValidElement)(r))switch(r.type){case u.NavigationImage:g=r;break;case u.NavigationLinks:y=r;break;case u.NavigationActions:_=r}}),l.default.createElement(u.NavigationProvider,{value:{showBaseNavigation:m,keepActionsAlwaysVisible:void 0!==d&&d}},l.default.createElement(c.Flex,_object_spread({as:"nav",bg:"background-page",py:{base:"0.75rem",lg:"1.5rem"},px:{base:"1rem",lg:"2.75rem"},alignItems:"center",gap:"0.75rem",minHeight:{base:"4.75rem",lg:"5rem"},transition:"box-shadow ease-in-out .15s;",zIndex:1},s&&{position:"sticky",top:0},b&&{boxShadow:"elevation-interactive"},f),(0,l.cloneElement)(y,{actions:_,image:g})))};Navigation.Image=u.NavigationImage,Navigation.Links=u.NavigationLinks,Navigation.Link=u.NavigationLink,Navigation.Actions=u.NavigationActions,Navigation.Action=u.NavigationAction},1913:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),function(r,a){for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]})}(a,{NavigationActions:function(){return NavigationActions},NavigationAction:function(){return NavigationAction}});var l=_interop_require_default(s(67294)),c=s(71986),u=s(77882);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var NavigationActions=function(r){var a=(0,u.useNavigationContext)().keepActionsAlwaysVisible;return l.default.createElement(c.Flex,_object_spread({flexDirection:{base:"column",md:"row"},gap:{base:"1.5rem",lg:"0.75rem"},pt:{base:"7rem",md:"5.75rem",lg:0}},a?{flexDirection:{base:"row"},pt:0}:{},r))},NavigationAction=function(r){var a=r.size,s=_object_without_properties(r,["size"]),d=(0,u.useNavigationContext)().keepActionsAlwaysVisible,p=a||d?"m":(0,c.useBreakpointValue)({base:"l",lg:"m"},"base");return l.default.createElement(c.Link,_object_spread({size:p},s))}},77882:function(r,a,s){"use strict";function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var NavigationImage=function(r){var a=r.href,s=_object_without_properties(r,["href"]);return a?l.default.createElement(c.Link,{href:a},l.default.createElement(c.Image,_object_spread({alt:"navigation logotype",height:"2rem"},s))):l.default.createElement(c.Image,_object_spread({alt:"navigation logotype",height:"2rem"},s))}},47162:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),function(r,a){for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]})}(a,{NavigationLinks:function(){return NavigationLinks},NavigationLink:function(){return NavigationLink}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(77882);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var a=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(r){return r?s:a})(r)}function _interop_require_wildcard(r,a){if(!a&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var s=_getRequireWildcardCache(a);if(s&&s.has(r))return s.get(r);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var d=c?Object.getOwnPropertyDescriptor(r,u):null;d&&(d.get||d.set)?Object.defineProperty(l,u,d):l[u]=r[u]}return l.default=r,s&&s.set(r,l),l}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var NavigationLinks=function(r){var a=r.actions,s=r.image,d=r.children,p=r.linksPosition,f=r.showDividers,m=void 0===f||f,b=_object_without_properties(r,["actions","image","children","linksPosition","showDividers"]),g=(0,c.useDisclosure)(),y=g.isOpen,_=g.onOpen,v=g.onClose,S=(0,u.useNavigationContext)(),w=S.showBaseNavigation,O=S.keepActionsAlwaysVisible;return w?l.default.createElement(l.default.Fragment,null,l.default.createElement(c.IconButton,{icon:l.default.createElement(c.IconMenu2,null),"aria-label":"Hamburger menu button",variant:"ghost",size:"l",onClick:_}),l.default.createElement(c.Flex,{justifyContent:"space-between",flexBasis:"100%",gap:"0.75rem"},s,O&&a),y&&l.default.createElement(c.Flex,_object_spread({width:"100%",height:"100%",bg:"background-overlay",position:"fixed",top:"0",left:"0",zIndex:"1",flexDirection:"column"},b),l.default.createElement(c.Box,{pt:"0.75rem",px:"1rem"},l.default.createElement(c.IconButton,{icon:l.default.createElement(c.IconX,null),"aria-label":"Close hamburguer menu button",variant:"ghost",size:"l",onClick:v})),l.default.createElement(c.Flex,{height:"100%",width:"100%",px:"1.5rem",pt:"3.5rem",pb:"3.25rem",alignItems:"center",flexDirection:"column",overflow:"auto"},l.Children.map(d,function(r,a){return(0,l.isValidElement)(r)&&(0,l.cloneElement)(r,{showDivider:a!==l.Children.count(d)-1&&m})}),!O&&a))):l.default.createElement(c.Flex,_object_spread({maxWidth:"80rem",margin:"0 auto",alignItems:"center",width:"100%"},b),l.default.createElement(c.Box,{flexShrink:"0"},s),l.default.createElement(c.Flex,{flexBasis:"100%",mx:{lg:"2.75rem",xxl:"4.5rem"},gap:{lg:"1.5rem",xl:"2.25rem",xxl:"5rem"},justifyContent:void 0===p?"start":p},d),l.default.createElement(c.Box,{flexShrink:"0"},a))},NavigationLink=function(r){var a=r.showDivider,s=r.children,d=_object_without_properties(r,["showDivider","children"]);return(0,u.useNavigationContext)().showBaseNavigation?l.default.createElement(l.Fragment,null,l.default.createElement(c.Link,_object_spread({size:"l",justifyContent:"center",marginBottom:!a&&"3rem",variant:"link-secondary"},d),l.default.createElement(c.Text,{variant:"text-body-display-L",color:"unset"},s)),a&&l.default.createElement(c.Divider,{my:"1.50rem",maxWidth:"24.75rem"})):l.default.createElement(c.Link,_object_spread({size:"m",variant:"link-secondary"},d),s)}},2304:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(1913),a),_export_star(s(77882),a),_export_star(s(47162),a),_export_star(s(96166),a)},10506:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(78510),a)},10964:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Quote",{enumerable:!0,get:function(){return Quote}});var l=_interop_require_default(s(67294)),c=s(71986);function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var Testimonial=function(r){var a=r.backgroundColor,s=_object_without_properties(r,["backgroundColor"]);return l.default.createElement(c.Flex,_object_spread({backgroundColor:void 0===a?"background-page":a,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"}},s))};Testimonial.Image=c.Image,Testimonial.Content=function(r){return l.default.createElement(c.Flex,_object_spread({gap:"1.5rem",flexDirection:"column",maxWidth:{lg:"36.8125rem",xl:"33.5rem",xxl:"43.5rem"}},r))},Testimonial.Overline=function(r){return l.default.createElement(c.Flex,{flexDirection:"column",gap:"0.75rem",alignSelf:"start"},l.default.createElement(c.Text,_object_spread({as:"h3",variant:{base:"text-header-S",lg:"text-header-XS"}},r)),l.default.createElement(c.Divider,null))},Testimonial.Testimony=function(r){return l.default.createElement(c.Text,_object_spread({variant:{base:"text-body-display-M",lg:"text-body-display-L"}},r))},Testimonial.Author=function(r){return l.default.createElement(c.Text,_object_spread({variant:"text-body-medium"},r))},Testimonial.Action=function(r){return l.default.createElement(c.Link,_object_spread({target:"_blank",size:"s"},r))}},90986:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(91142),a),_export_star(s(92335),a)},92335:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"TestimonialProps",{enumerable:!0,get:function(){return l.FlexProps}});var l=s(71986)},52181:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(54598),a),_export_star(s(65411),a),_export_star(s(50039),a),_export_star(s(30890),a),_export_star(s(19434),a),_export_star(s(12588),a),_export_star(s(50557),a),_export_star(s(35417),a),_export_star(s(10506),a),_export_star(s(54696),a),_export_star(s(90986),a)},39407:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Carousel",{enumerable:!0,get:function(){return Carousel}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(28777);function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}function _sliced_to_array(r,a){return _array_with_holes(r)||_iterable_to_array_limit(r,a)||_unsupported_iterable_to_array(r,a)||_non_iterable_rest()}function _unsupported_iterable_to_array(r,a){if(r){if("string"==typeof r)return _array_like_to_array(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);if("Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _array_like_to_array(r,a)}}var Carousel=function(r){var a=r.children,s=r.visibleSlides,d=void 0===s?1:s,p=_object_without_properties(r,["children","visibleSlides"]),f=_sliced_to_array(l.Children.map(a,function(r){if((0,l.isValidElement)(r)&&r.type===Carousel.Slider)return l.Children.count(r.props.children)}),1)[0];if(f)return l.default.createElement(c.Box,_object_spread({as:u.CarouselProvider,position:"relative",totalSlides:f,visibleSlides:d,dragStep:d,step:d},p),a)};Carousel.Slider=u.Slider,Carousel.Slide=function(r){return l.default.createElement(c.Flex,_object_spread({_last:{marginRight:"0px"},marginRight:"24px",as:u.Slide},r))},Carousel.ButtonBack=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return(0,l.isValidElement)(a)&&(0,l.cloneElement)(a,_object_spread({as:u.ButtonBack,"aria-label":"back"},s))},Carousel.ButtonNext=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return(0,l.isValidElement)(a)&&(0,l.cloneElement)(a,_object_spread({as:u.ButtonNext,"aria-label":"next"},s))},Carousel.DotGroup=function(r){return l.default.createElement(c.Flex,_object_spread({as:u.DotGroup,gap:"12px",disableActiveDots:!0},r))},Carousel.Dot=function(r){return l.default.createElement(c.Flex,_object_spread({as:u.Dot,width:"12px",height:"12px",borderRadius:"50%",background:"primary-disabled",_disabled:{background:"primary-default"}},r))},Carousel.NavigationContainer=function(r){return l.default.createElement(c.Flex,_object_spread({alignItems:"center",justifyContent:"center",gap:"12px",mt:"spacer-16"},r))}},85428:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(39407),a),_export_star(s(35473),a)},35473:function(r,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0})},17491:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(85428),a)},50723:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:function(){return Avatar}});var l=s(71986),c=_interop_require_default(s(67294));function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}var Avatar=function(r){var a=r.name,s=r.size;return c.default.createElement(l.Avatar,{size:void 0===s?"l":s,name:a,getInitials:function(r){return r.substring(0,2).toUpperCase()}})}},6186:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(50723),a)},87481:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Chat",{enumerable:!0,get:function(){return Chat}});var l=_interop_require_wildcard(s(67294)),c=s(71986),u=s(53159),d=s(78155);function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}function _sliced_to_array(r,a){return _array_with_holes(r)||_iterable_to_array_limit(r,a)||_unsupported_iterable_to_array(r,a)||_non_iterable_rest()}function _unsupported_iterable_to_array(r,a){if(r){if("string"==typeof r)return _array_like_to_array(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);if("Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _array_like_to_array(r,a)}}var Chat=function(r){var a=r.userId,s=r.channel,p=r.floating,f=_object_without_properties(r,["userId","channel","floating"]),m=(0,l.useRef)(),b=(0,d.useChat)({channel:s}),g=b.sendMessage,y=b.messages,_=b.fetchTokenAndStartChat,v=b.ready,S=_sliced_to_array((0,l.useState)(""),2),w=S[0],O=S[1],k=(0,c.useBreakpointValue)({base:!0,md:!1}),E=_sliced_to_array((0,l.useState)(!0),2),P=E[0],x=E[1];(0,l.useEffect)(function(){m.current&&P&&(m.current.scrollTop=m.current.scrollHeight)},[y,P,m.current]),(0,l.useEffect)(function(){x(!k)},[k]),(0,l.useEffect)(function(){_(a)},[_,a]);var handleSendMessage=function(){g(w),O("")};return l.default.createElement(c.Flex,_object_spread({flexDir:"column",padding:{base:"0.5rem",md:"0"},borderColor:"gray",width:{base:"100%",md:"320px"},height:"100%",maxHeight:"calc(100% - 5rem)",color:"white",justifyContent:"end"},void 0===p||p?{position:"fixed",bottom:{base:"5rem",md:"3rem"},right:{base:"0",md:"3rem"},height:"442px"}:{},f),v&&l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Flex,{paddingX:"16px",paddingY:{base:"8px",md:"16px"},borderTopRadius:"6px",backgroundColor:"background-dark",flexDir:"row",onClick:function(){return x(function(r){return!r})},cursor:"pointer"},l.default.createElement(c.Text,{flex:"1",variant:"text-body-bold",color:"text-light"},"Chat"),P?l.default.createElement(c.IconChevronDown,{size:"l"}):l.default.createElement(c.IconChevronUp,{size:"l"})),P&&l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Flex,{flex:"6",maxHeight:"86%",overflowY:"scroll",__css:{"&::-webkit-scrollbar":{display:"none"}},ref:function(r){m.current=r}},l.default.createElement(u.List,{width:"100%"},y&&y.map(function(r,s){return l.default.createElement(u.ListItem,{mt:"8px",key:s},l.default.createElement(c.Flex,{py:"8px",px:"12px",flexDir:"column",position:"relative"},l.default.createElement(c.Box,{zIndex:"-1",position:"absolute",width:"100%",height:"100%",top:"0",left:"0",backgroundColor:r.member.id===a?"accent-default":"rgba(0, 0, 0, 0.4)",borderRadius:"6px"}),l.default.createElement(c.Box,{color:r.member.id===a?"black":"accent-default",fontStyle:"bold",fontSize:"20px"},r.member.id),l.default.createElement(c.Box,{color:r.member.id===a?"black":"white",fontSize:"20px"},r.content)))}))),l.default.createElement(c.Flex,{maxH:"44px",mt:"16px",pl:"14px",flex:"1",border:"2px solid #FFFFFF",borderRadius:"23px"},l.default.createElement(c.Input,{_focus:{},_hover:{},_active:{},border:"none",fontSize:"20px",outline:"none",variant:"outline",textColor:"text-light",backgroundColor:"transparent",placeholder:"Write your message",flex:"4",value:w,onChange:function(r){return O(r.target.value)},onKeyDown:function(r){"Enter"===r.key&&handleSendMessage()}}),l.default.createElement(c.IconButton,{_hover:{color:"#FFFFFFCC"},_focus:{},padding:"0.5rem",onClick:g,mr:"10px",height:"100%",variant:"ghost",size:"l","aria-label":"send message",backgroundColor:"transparent",color:"#FFFFFF",icon:l.default.createElement(c.IconSend,null)})))))}},41872:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(87481),a)},31154:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Loading",{enumerable:!0,get:function(){return Loading}});var l=_interop_require_default(s(67294)),c=s(71986);function _interop_require_default(r){return r&&r.__esModule?r:{default:r}}var Loading=function(){return l.default.createElement(c.Flex,{justifyContent:"center",alignItems:"center",backgroundColor:"background-dark",width:"100%",height:"100vh"},l.default.createElement(c.Spinner,{size:"s"}))}},52110:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(31154),a)},21703:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"Login",{enumerable:!0,get:function(){return Login}});var l=_interop_require_wildcard(s(67294)),c=s(71986);function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);sr.length)&&(a=r.length);for(var s=0,l=Array(a);s=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}function _sliced_to_array(r,a){return _array_with_holes(r)||_iterable_to_array_limit(r,a)||_unsupported_iterable_to_array(r,a)||_non_iterable_rest()}function _unsupported_iterable_to_array(r,a){if(r){if("string"==typeof r)return _array_like_to_array(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);if("Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s)return Array.from(s);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return _array_like_to_array(r,a)}}function _ts_generator(r,a){var s,l,c,u,d={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]};return u={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function verb(r){return function(a){return step([r,a])}}function step(u){if(s)throw TypeError("Generator is already executing.");for(;d;)try{if(s=1,l&&(c=2&u[0]?l.return:u[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,u[1])).done)return c;switch(l=0,c&&(u=[2&u[0],c.value]),u[0]){case 0:case 1:c=u;break;case 4:return d.label++,{value:u[1],done:!1};case 5:d.label++,l=u[1],u=[0];continue;case 7:u=d.ops.pop(),d.trys.pop();continue;default:if(!(c=(c=d.trys).length>0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]r.length)&&(a=r.length);for(var s=0,l=Array(a);s0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]r.length)&&(a=r.length);for(var s=0,l=Array(a);s0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]0&&d&&O()},[s,l,d,O]),{messages:f,members:g,ready:v,sendMessage:function(r,a){w.current&&r&&w.current.publish({channel:a||l,content:r})},fetchTokenAndStartChat:O,clientRef:w}}},49584:function(r,a,s){"use strict";function _export_star(r,a){return Object.keys(r).forEach(function(s){"default"===s||Object.prototype.hasOwnProperty.call(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:function(){return r[s]}})}),r}Object.defineProperty(a,"__esModule",{value:!0}),_export_star(s(96703),a)},96703:function(r,a,s){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useRoom",{enumerable:!0,get:function(){return useRoom}});var l,c=s(67294),u=s(63404);function _array_like_to_array(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]0&&c[c.length-1])&&(6===u[0]||2===u[0])){d=0;continue}if(3===u[0]&&(!c||u[1]>c[0]&&u[1]=0&&r.splice(s,1)}function once(r){var a=!1;return function(){a||(a=!0,r())}}var kThrow=function(r){throw r},kReturn=function(r){return{value:r,done:!0}};function makeIterator(r,a,s){void 0===a&&(a=kThrow),void 0===s&&(s="iterator");var l={meta:{name:s},next:r,throw:a,return:kReturn,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(l[Symbol.iterator]=function(){return l}),l}function logError(r,a){var s=a.sagaStack;console.error(r),console.error(s)}var createEmptyArray=function(r){return Array.apply(null,Array(r))},shouldTerminate=function(r){return r===j},shouldCancel=function(r){return r===x},shouldComplete=function(r){return shouldTerminate(r)||shouldCancel(r)};function createAllStyleChildCallbacks(r,a){var s,l=Object.keys(r),c=l.length,u=0,d=A(r)?createEmptyArray(c):{},p={};function checkEnd(){u===c&&(s=!0,a(d))}return l.forEach(function(r){var chCbAtKey=function(l,c){s||(c||shouldComplete(l)?(a.cancel(),a(l,c)):(d[r]=l,u++,checkEnd()))};chCbAtKey.cancel=noop,p[r]=chCbAtKey}),a.cancel=function(){s||(s=!0,l.forEach(function(r){return p[r].cancel()}))},p}function getMetaInfo(r){return{name:r.name||"anonymous",location:r[C]}}var R={isEmpty:kTrue,put:noop,take:noop};function ringBuffer(r,a){void 0===r&&(r=10);var s=Array(r),l=0,c=0,u=0,push=function(a){s[c]=a,c=(c+1)%r,l++},take=function(){if(0!=l){var a=s[u];return s[u]=null,l--,u=(u+1)%r,a}},flush=function(){for(var r=[];l;)r.push(take());return r};return{isEmpty:function(){return 0==l},put:function(d){if(l1?a-1:0),l=1;l1?a-1:0),l=1;l1?s-1:0),c=1;c1?a-1:0),l=1;l2?y-2:0),v=2;va in r?K(r,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[a]=s,__spreadValues=(r,a)=>{for(var s in a||(a={}))ee.call(a,s)&&__defNormalProp(r,s,a[s]);if($)for(var s of $(a))et.call(a,s)&&__defNormalProp(r,s,a[s]);return r},__spreadProps=(r,a)=>J(r,Y(a)),__objRest=(r,a)=>{var s={};for(var l in r)ee.call(r,l)&&0>a.indexOf(l)&&(s[l]=r[l]);if(null!=r&&$)for(var l of $(r))0>a.indexOf(l)&&et.call(r,l)&&(s[l]=r[l]);return s},__export=(r,a)=>{for(var s in a)K(r,s,{get:a[s],enumerable:!0})},__copyProps=(r,a,s,l)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let c of Q(a))ee.call(r,c)||c===s||K(r,c,{get:()=>a[c],enumerable:!(l=Z(a,c))||l.enumerable});return r},__reExport=(r,a,s)=>(__copyProps(r,a,"default"),s&&__copyProps(s,a,"default")),__publicField=(r,a,s)=>(__defNormalProp(r,"symbol"!=typeof a?a+"":a,s),s),er="__local__",en="__synthetic__",eo="video",ei="chat",ea="chat",es=["room.started","room.ended"].map(r=>`${eo}.${r}`),datetime=()=>new Date().toISOString(),el=p().getLogger("signalwire"),ec=el.methodFactory;el.methodFactory=(r,a,s)=>{let l=ec(r,a,s);return function(...r){r.unshift(datetime(),"-"),l.apply(void 0,r)}};var eu=el.getLevel();el.setLevel(eu);var setLogger=r=>{c=r},ed={},setDebugOptions=r=>{if(null==r){ed={};return}Object.assign(ed,r)},getLoggerInstance=()=>null!=c?c:el,shouldStringify=r=>!("method"in r)||"signalwire.ping"!==r.method,wsTraffic=({type:r,payload:a})=>{let s=getLoggerInstance(),{logWsTraffic:l}=ed||{};if(!l)return;let c=shouldStringify(a)?JSON.stringify(a,null,2):a;return s.info(`${r.toUpperCase()}: `,c,"\n")},getLogger=()=>{let r=getLoggerInstance();return new Proxy(r,{get:(r,a,s)=>"wsTraffic"===a?wsTraffic:Reflect.get(r,a,s)})},parseRPCResponse=({response:r,request:a})=>{let{result:s={},error:l}=r;return l?{error:l}:"signalwire.connect"===a.method?{result:s}:parseResponse(r)},parseResponse=(r,a)=>{let{result:s={},error:l}=r;if(l)return{error:l};let{code:c,node_id:u,result:d=null}=s;return c&&"200"!==c?{error:s}:null===d?(a&&(s.node_id=a),{result:s}):d?d.jsonrpc?parseResponse(d,u):{result:d}:{result:s}},toDateObject=r=>{if(void 0===r)return r;let a=new Date(1e3*r);return isNaN(a.getTime())?r:a},ep={propsToUpdateValue:["updated","layers","members","recordings","playbacks"]},isTimestampProperty=r=>r.endsWith("At"),toExternalJSON=(r,a=ep)=>(null==r?void 0:r.__sw_symbol)||(null==r?void 0:r.__sw_proxy)?r:Object.entries(r).reduce((r,[s,l])=>{let c=fromSnakeToCamelCase(s),u=typeof l;return"object"===u&&l?Array.isArray(l)?a.propsToUpdateValue.includes(s)?r[c]=l.map(r=>"string"==typeof r?fromSnakeToCamelCase(r):toExternalJSON(r)):r[c]=l:r[c]=toExternalJSON(l):isTimestampProperty(c)?r[c]=toDateObject(l):r[c]=l,r},{}),fromSnakeToCamelCase=r=>r.includes("_")?r.split("_").reduce((r,a,s)=>{let l=a.trim().charAt(0),c=a.substr(1).toLowerCase();return`${r}${0===s?l.toLowerCase():l.toUpperCase()}${c}`},""):r,ef=/[A-Z]/g,fromCamelToSnakeCase=r=>r.replace(ef,r=>`_${r.toLowerCase()}`),toInternalEventName=({event:r,namespace:a})=>("string"==typeof r&&(r=fromCamelToSnakeCase(r=getNamespacedEvent({event:r,namespace:a}))),r),getNamespacedEvent=({namespace:r,event:a})=>!r||a.startsWith(r)?a:`${r}:${a}`,toInternalAction=r=>{let{event_type:a,params:s,node_id:l}=r;return"queuing.relay.tasks"===a?{type:a,payload:r}:("webrtc.message"===a&&(null==s?void 0:s.jsonrpc)&&s.params&&(s.params.nodeId=l),{type:a,payload:s})},extendComponent=(r,a)=>(Object.keys(a).forEach(a=>{if(r.prototype.hasOwnProperty(a))throw Error(`[extendComponent] Duplicated method name: ${a}`)}),Object.defineProperties(r.prototype,a),r),proxyToString=({property:r,payload:a})=>"function"==typeof r?()=>JSON.stringify(a):r,getAllMethods=r=>{let a={},s=r,l=!0;for(;l;)Object.getOwnPropertyNames(s).forEach(s=>{"function"!=typeof r[s]||"string"!=typeof s||s in a||(a[s]=r[s])}),s&&s.__sw_symbol?s=Object.getPrototypeOf(s):l=!1;return a},serializeableProxy=({instance:r,proxiedObj:a,payload:s,transformedPayload:l,transform:c})=>{let u=__spreadValues(__spreadProps(__spreadValues({},l),{_eventsNamespace:c.getInstanceEventNamespace?c.getInstanceEventNamespace(s):void 0,eventChannel:c.getInstanceEventChannel?c.getInstanceEventChannel(s):void 0}),getAllMethods(r));return Object.defineProperties(a,Object.entries(u).reduce((r,[a,s])=>(void 0===s||(r[a]={value:s,enumerable:!0,configurable:!0,writable:!0}),r),{}))},proxyFactory=({instance:r,transform:a,payload:s,transformedPayload:l})=>{let c=new Proxy(r,{get:(r,c,u)=>"__sw_proxy"===c||("toString"===c?proxyToString({property:r[c],payload:l}):"_eventsNamespace"===c&&a.getInstanceEventNamespace?a.getInstanceEventNamespace(s):"eventChannel"===c&&a.getInstanceEventChannel?a.getInstanceEventChannel(s):c in l?l[c]:Reflect.get(r,c,u))});return serializeableProxy({instance:r,proxiedObj:c,payload:s,transformedPayload:l,transform:a})},eh=new Map,_getOrCreateInstance=({transform:r,payload:a})=>{if(!eh.has(r.type)){let s=r.instanceFactory(a);return eh.set(r.type,s),s}return eh.get(r.type)},instanceProxyFactory=({transform:r,payload:a})=>{let s=_getOrCreateInstance({transform:r,payload:a}),l=r.payloadTransform(a),c=proxyFactory({transform:r,payload:a,instance:s,transformedPayload:l});return c};function index_esm_debounce(r,a=0,s){let l=null,c=null,clear=function(){l&&(clearTimeout(l),c=null,l=null)},debounceWrapper=function(){if(!a)return r.apply(this,arguments);let u=this,d=arguments,p=s&&!l;if(clear(),c=function(){r.apply(u,d)},l=setTimeout(function(){if(l=null,!p){let r=c;return c=null,null==r?void 0:r()}},a),p&&c)return c()};return debounceWrapper.cancel=clear,debounceWrapper.flush=function(){let r=c;clear(),r&&r()},debounceWrapper}var safeParseJson=r=>{if("string"!=typeof r)return r;try{return JSON.parse(r)}catch(a){return r}},em=/^(ws|wss):\/\//,checkWebSocketHost=r=>{let a=em.test(r)?"":"wss://";return`${a}${r}`},timeoutPromise=(r,a,s)=>{let l=null;return Promise.race([r,new Promise((r,c)=>l=setTimeout(c,a,s))]).finally(()=>clearTimeout(l))},isInternalGlobalEvent=r=>es.includes(r),isSyntheticEvent=r=>r.includes(en),isSessionEvent=r=>r.includes("session."),cleanupEventNamespace=r=>{let a=r.split(":");return a[a.length-1]},eb=["video.member.updated","video.member.talking"],eg=["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"],validateEventsToSubscribe=r=>{let a=r.map(r=>{if("string"==typeof r){let a=cleanupEventNamespace(r);if(eg.includes(a)||isSyntheticEvent(a)||isLocalEvent(a)||isSessionEvent(a))return null;let s=eb.find(r=>a.startsWith(r));return s||a}return r});return Array.from(new Set(a)).filter(Boolean)},isLocalEvent=r=>r.includes(er),toLocalEvent=r=>{let a=r.split("."),s=a[0];return r.split(".").reduce((r,a)=>(r.push(a),a===s&&r.push(er),r),[]).join(".")},isJSONRPCRequest=r=>!!r.method,isJSONRPCResponse=r=>!isJSONRPCRequest(r),makeRPCRequest=r=>{var a;return __spreadValues({jsonrpc:"2.0",id:null!=(a=r.id)?a:(0,f.Z)()},r)},makeRPCResponse=r=>__spreadValues({jsonrpc:"2.0"},r),ey={major:3,minor:0,revision:0},RPCConnect=r=>makeRPCRequest({method:"signalwire.connect",params:__spreadValues({version:ey},r)}),RPCReauthenticate=r=>makeRPCRequest({method:"signalwire.reauthenticate",params:{authentication:r}}),RPCPingResponse=(r,a)=>makeRPCResponse({id:r,result:{timestamp:a||Date.now()/1e3}}),RPCExecute=({method:r,params:a})=>makeRPCRequest({method:r,params:a}),RPCDisconnectResponse=r=>makeRPCResponse({id:r,result:{}}),e_={id:"callID",destinationNumber:"destination_number",remoteCallerName:"remote_caller_id_name",remoteCallerNumber:"remote_caller_id_number",callerName:"caller_id_name",callerNumber:"caller_id_number"},filterVertoParams=r=>{if(r.hasOwnProperty("dialogParams")){let a=r.dialogParams,{remoteSdp:s,localStream:l,remoteStream:c}=a,u=__objRest(a,["remoteSdp","localStream","remoteStream"]);for(let r in e_)r&&u.hasOwnProperty(r)&&(u[e_[r]]=u[r],delete u[r]);r.dialogParams=u}return r},buildVertoRPCMessage=r=>(a={})=>makeRPCRequest({method:r,params:filterVertoParams(a)}),ev=buildVertoRPCMessage("verto.invite"),eS=buildVertoRPCMessage("verto.bye");buildVertoRPCMessage("verto.attach");var ew=buildVertoRPCMessage("verto.modify"),eO=buildVertoRPCMessage("verto.info");buildVertoRPCMessage("verto.answer");var ek=buildVertoRPCMessage("verto.pong"),VertoResult=(r,a)=>makeRPCResponse({id:r,result:{method:a}}),eE={};__export(eE,{authErrorAction:()=>eA,authExpiringAction:()=>eL,authSuccessAction:()=>eR,compoundEventAttachAction:()=>eq,createAction:()=>createAction,destroyAction:()=>eC,executeAction:()=>eT,getCustomSagaActionType:()=>getCustomSagaActionType,initAction:()=>ej,makeCustomSagaAction:()=>makeCustomSagaAction,reauthAction:()=>eM,sessionAuthErrorAction:()=>eF,sessionConnectedAction:()=>eD,sessionDisconnectedAction:()=>eN,sessionExpiringAction:()=>eV,sessionReconnectingAction:()=>eW,socketMessageAction:()=>eI});var eP={};function createAction(r,a){function actionCreator(...s){if(a){let l=a(...s);if(!l)throw Error("prepareAction did not return an object");return __spreadValues(__spreadValues({type:r,payload:l.payload},"meta"in l&&{meta:l.meta}),"error"in l&&{error:l.error})}return{type:r,payload:s[0]}}return actionCreator.toString=()=>`${r}`,actionCreator.type=r,actionCreator.match=a=>a.type===r,actionCreator}__export(eP,{configureStore:()=>configureStore,createAction:()=>createAction}),__reExport(eP,u);var ex="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?compose:compose.apply(null,arguments)};function index_esm_isPlainObject(r){if("object"!=typeof r||null===r)return!1;let a=Object.getPrototypeOf(r);if(null===a)return!0;let s=a;for(;null!==Object.getPrototypeOf(s);)s=Object.getPrototypeOf(s);return a===s}function curryGetDefaultMiddleware(){return function(){return[]}}function configureStore(r){let a;let s=curryGetDefaultMiddleware(),{reducer:l,middleware:c=s(),devTools:u=!0,preloadedState:d,enhancers:p}=r||{};if("function"==typeof l)a=l;else if(index_esm_isPlainObject(l))a=combineReducers(l);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 f=c;"function"==typeof f&&(f=f(s));let m=applyMiddleware(...f),b=compose;u&&(b=ex(__spreadValues({trace:!1},"object"==typeof u&&u)));let g=[m];Array.isArray(p)?g=[m,...p]:"function"==typeof p&&(g=p(g));let y=b(...g);return createStore(a,d,y)}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var ej=createAction("swSdk/init"),eC=createAction("swSdk/destroy"),eM=createAction("swSdk/reauth"),eT=createAction("swSdk/executeRequest"),eA=createAction("auth/error"),eR=createAction("auth/success"),eL=createAction("auth/expiring"),eI=createAction("socket/message"),eD=createAction("session.connected"),eN=createAction("session.disconnected"),eW=createAction("session.reconnecting"),eF=createAction("session.auth_error"),eV=createAction("session.expiring"),formatCustomSagaAction=(r,a)=>`${a.type}/${r}`,makeCustomSagaAction=(r,a)=>__spreadProps(__spreadValues({},a),{type:formatCustomSagaAction(r,a)}),getCustomSagaActionType=(r,a)=>formatCustomSagaAction(r,a),eq=createAction("compound_event:attach");function executeReducerBuilderCallback(r){let a;let s={},l=[],c={addCase(r,a){let l="string"==typeof r?r:r.type;if(l in s)throw Error("addCase cannot be called with two reducers for the same action type");return s[l]=a,c},addMatcher:(r,a)=>(l.push({matcher:r,reducer:a}),c),addDefaultCase:r=>(a=r,c)};return r(c),[s,l,a]}function isStateFunction(r){return"function"==typeof r}function createReducer(r,a,s=[],l){let c,[u,d,p]="function"==typeof a?executeReducerBuilderCallback(a):[a,s,l];function reducer(r=c(),a){let s=[u[a.type],...d.filter(({matcher:r})=>r(a)).map(({reducer:r})=>r)];return 0===s.filter(r=>!!r).length&&(s=[p]),s.reduce((r,s)=>s?s(r,a):r,r)}return c=isStateFunction(r)?()=>r():()=>r,reducer.getInitialState=c,reducer}function getType(r,a){return`${r}/${a}`}function createSlice(r){let a;let{name:s}=r;if(!s)throw Error("`name` is a required option for createSlice");let l=r.initialState,c=r.reducers||{},u=Object.keys(c),d={},p={},f={};function buildReducer(){let[a={},s=[],c]="function"==typeof r.extraReducers?executeReducerBuilderCallback(r.extraReducers):[r.extraReducers],u=__spreadValues(__spreadValues({},a),p);return createReducer(l,u,s,c)}return u.forEach(r=>{let a,l;let u=c[r],m=getType(s,r);"reducer"in u?(a=u.reducer,l=u.prepare):a=u,d[r]=a,p[m]=a,f[r]=l?createAction(m,l):createAction(m)}),{name:s,reducer:(r,s)=>(a||(a=buildReducer()),a(r,s)),actions:f,caseReducers:d,getInitialState:()=>(a||(a=buildReducer()),a.getInitialState())}}var createDestroyableSlice=({name:r="",initialState:a,reducers:s,extraReducers:l})=>createSlice({name:r,initialState:a,reducers:s,extraReducers:r=>{r.addCase(eC.type,()=>a),"function"==typeof l&&l(r)}});function authorizingAction(r){return[ej.type,eM.type].includes(r.type)}var{actions:eU,reducer:eB}=createDestroyableSlice({name:"session",initialState:{protocol:"",iceServers:[],authStatus:"unknown",authState:void 0,authError:void 0,authCount:0},reducers:{connected:(r,{payload:a})=>{var s,l;return __spreadProps(__spreadValues({},r),{authStatus:"authorized",authState:null==a?void 0:a.authorization,authCount:r.authCount+1,protocol:null!=(s=null==a?void 0:a.protocol)?s:"",iceServers:null!=(l=null==a?void 0:a.ice_servers)?l:[]})},authStatus:(r,{payload:a})=>__spreadProps(__spreadValues({},r),{authStatus:a}),updateAuthState:(r,{payload:a})=>__spreadProps(__spreadValues({},r),{authState:a})},extraReducers:r=>{r.addCase(eA.type,(r,{payload:a})=>__spreadProps(__spreadValues({},r),{authStatus:"unauthorized",authError:a.error})),r.addMatcher(authorizingAction,r=>__spreadProps(__spreadValues({},r),{authStatus:"authorizing"}))}}),ez=Symbol("BaseSession"),randomInt=(r,a)=>Math.floor(Math.random()*(a-r+1)+r),reconnectDelay=()=>1e3*randomInt(1,4),eH=class{constructor(r){var a,s;this.options=r,__publicField(this,"__sw_symbol",ez),__publicField(this,"uuid",(0,f.Z)()),__publicField(this,"WebSocketConstructor"),__publicField(this,"agent"),__publicField(this,"connectVersion",ey),__publicField(this,"_rpcConnectResult"),__publicField(this,"_requests",new Map),__publicField(this,"_socket",null),__publicField(this,"_host","wss://relay.signalwire.com"),__publicField(this,"_executeTimeoutMs",1e4),__publicField(this,"_executeTimeoutError",Symbol.for("sw-execute-timeout")),__publicField(this,"_executeQueue",new Set),__publicField(this,"_checkPingDelay",15e3),__publicField(this,"_checkPingTimer",null),__publicField(this,"_reconnectTimer"),__publicField(this,"_status","unknown"),__publicField(this,"wsOpenHandler"),__publicField(this,"wsCloseHandler"),__publicField(this,"wsErrorHandler");let{host:l,logLevel:c="info"}=r;l&&(this._host=checkWebSocketHost(l)),c&&(null==(s=(a=this.logger).setLevel)||s.call(a,c)),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=r=>{var a;null==(a=this._socket)||a.removeEventListener("open",this.wsOpenHandler),this._onSocketOpen(r)},this.wsCloseHandler=r=>{var a;null==(a=this._socket)||a.removeEventListener("close",this.wsCloseHandler),this._onSocketClose(r)},this.wsErrorHandler=r=>{var a;null==(a=this._socket)||a.removeEventListener("error",this.wsErrorHandler),this._onSocketError(r)}}get host(){return this._host}get rpcConnectResult(){return this._rpcConnectResult}get relayProtocol(){var r,a;return null!=(a=null==(r=this._rpcConnectResult)?void 0:r.protocol)?a:""}get signature(){var r,a;return null==(a=null==(r=this._rpcConnectResult)?void 0:r.authorization)?void 0:a.signature}get logger(){return getLogger()}get connecting(){var r;return(null==(r=this._socket)?void 0:r.readyState)===0}get connected(){var r;return(null==(r=this._socket)?void 0:r.readyState)===1}get closing(){var r;return(null==(r=this._socket)?void 0:r.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(r){this.options.token=r}connect(){if(!(this==null?void 0:this.WebSocketConstructor))throw Error("Missing WebSocketConstructor");if(this._clearTimers(),this.connecting||this.connected){this.logger.warn("Session already connected.");return}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){this.logger.debug("Session not connected or already in closing state.");return}this._clearCheckPingTimer(),this._requests.clear(),this._closeConnection("disconnected"),this.dispatch(eN())}execute(r){let a=Promise.resolve();return("params"in r&&(a=new Promise((a,s)=>{this._requests.set(r.id,{rpcRequest:r,resolve:a,reject:s})})),this.ready)?(this._send(r),timeoutPromise(a,this._executeTimeoutMs,this._executeTimeoutError).catch(a=>{if(a===this._executeTimeoutError){if(this.logger.error("Request Timeout",r),"disconnected"===this.status)return this.logger.debug("Request failed because the session is disconnected",this.status,this._socket);this._closeConnection("reconnecting")}else throw a})):(this._addToExecuteQueue(r),this.connect(),a)}async authenticate(){var r;let a={agent:this.agent,version:this.connectVersion,authentication:{project:this.options.project,token:this.options.token}};this._relayProtocolIsValid()&&(a.protocol=this.relayProtocol),(null==(r=this.options.contexts)?void 0:r.length)&&(a.contexts=this.options.contexts),this._rpcConnectResult=await this.execute(RPCConnect(a))}authError(r){this._removeSocketListeners(),this.dispatch(eA({error:r}))}async _onSocketOpen(r){this.logger.debug("_onSocketOpen",r.type);try{this._clearTimers(),await this.authenticate(),this._status="connected",this._flushExecuteQueue(),this.dispatch(eR())}catch(r){this.logger.error("Auth Error",r),this.authError(r)}}_onSocketError(r){this.logger.debug("_onSocketError",r)}_onSocketClose(r){this.logger.debug("_onSocketClose",r.type,r.code,r.reason),"disconnected"!==this._status&&(this._status="reconnecting",this.dispatch(eW()),this._clearTimers(),this._reconnectTimer=setTimeout(()=>{this.connect()},reconnectDelay())),this._socket=null}_clearTimers(){clearTimeout(this._reconnectTimer)}_onSocketMessage(r){let a=this.decode(r.data);if(this.logger.wsTraffic({type:"recv",payload:a}),isJSONRPCResponse(a)){let r=this._requests.get(a.id);if(r){let{rpcRequest:s,resolve:l,reject:c}=r;this._requests.delete(a.id);let{result:u,error:d}=parseRPCResponse({response:a,request:s});return d?c(d):l(u)}return this.logger.warn("Unknown request for",a)}switch(a.method){case"signalwire.ping":return this._pingHandler(a);case"signalwire.disconnect":this.execute(RPCDisconnectResponse(a.id)).catch(r=>{this.logger.error("SwDisconnect Error",r)}).finally(()=>{this._status="idle"});break;default:this.dispatch(eI(a)),this._handleWebSocketMessage(a)}}_handleWebSocketMessage(r){}dispatch(r){throw Error("Method not implemented")}_relayProtocolIsValid(){var r;return this.signature&&(null==(r=this==null?void 0:this.relayProtocol)?void 0:r.split("_")[1])===this.signature}encode(r){return JSON.stringify(r)}decode(r){return safeParseJson(r)}_send(r){this.logger.wsTraffic({type:"send",payload:r}),this._socket.send(this.encode(r))}_addToExecuteQueue(r){this.logger.warn("Request queued waiting for session to reconnect",r),this._executeQueue.add(r)}_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(r=>{this._send(r),this._executeQueue.delete(r)}),this._executeQueue.clear()}}_clearCheckPingTimer(){clearTimeout(this._checkPingTimer)}async _pingHandler(r){var a;this._clearCheckPingTimer(),this._checkPingTimer=setTimeout(()=>{this.logger.debug("Timeout waiting for ping"),this._closeConnection("reconnecting")},this._checkPingDelay),await this.execute(RPCPingResponse(r.id,null==(a=null==r?void 0:r.params)?void 0:a.timestamp))}_closeConnection(r){this._clearCheckPingTimer(),this.logger.debug("Close Connection"),this._status=r,this.dispatch(eU.authStatus("disconnected"===r?"unauthorized":"unknown")),this.destroySocket()}},eG=class extends eH{constructor(r){super(r),this.options=r,__publicField(this,"_expiredDiffSeconds",0),__publicField(this,"_refreshTokenNotificationDiff",120),__publicField(this,"_checkTokenExpirationDelay",2e4),__publicField(this,"_checkTokenExpirationTimer",null),this._checkTokenExpiration=this._checkTokenExpiration.bind(this),this.reauthenticate=this.reauthenticate.bind(this)}get expiresAt(){var r,a,s;let l=null!=(s=null==(a=null==(r=this==null?void 0:this._rpcConnectResult)?void 0:r.authorization)?void 0:a.expires_at)?s:0;if("string"==typeof l){let r=Date.parse(l);if(!isNaN(r))return Math.floor(r/1e3)}return l}get expiresIn(){let r=Math.floor(Date.now()/1e3);return this.expiresAt-r}get expired(){return this.expiresAt>0&&this.expiresIn<=this._expiredDiffSeconds}async authenticate(){let r={agent:this.agent,version:this.connectVersion,authentication:{jwt_token:this.options.token}};if(this._relayProtocolIsValid())r.protocol=this.relayProtocol;else{let a=await this.retrieveRelayProtocol();a&&(r.protocol=a)}this._rpcConnectResult=await this.execute(RPCConnect(r)),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 r={project:this._rpcConnectResult.authorization.project,jwt_token:this.options.token};try{this._rpcConnectResult=await this.execute(RPCReauthenticate(r))}catch(r){throw clearTimeout(this._checkTokenExpirationTimer),r}}_onSocketClose(r){clearTimeout(this._checkTokenExpirationTimer),super._onSocketClose(r)}_checkTokenExpiration(){this.expiresAt&&(this.expiresIn<=this._refreshTokenNotificationDiff&&(this.dispatch(eL()),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)))}},eX={};__export(eX,{authErrorAction:()=>eA,authExpiringAction:()=>eL,authSuccessAction:()=>eR,compoundEventAttachAction:()=>eq,configureStore:()=>configureStore2,connect:()=>connect,createAction:()=>createAction,createCatchableSaga:()=>createCatchableSaga,createRestartableSaga:()=>createRestartableSaga,destroyAction:()=>eC,eventChannel:()=>eventChannel,executeAction:()=>eT,getCustomSagaActionType:()=>getCustomSagaActionType,initAction:()=>ej,makeCustomSagaAction:()=>makeCustomSagaAction,reauthAction:()=>eM,sessionAuthErrorAction:()=>eF,sessionConnectedAction:()=>eD,sessionDisconnectedAction:()=>eN,sessionExpiringAction:()=>eV,sessionReconnectingAction:()=>eW,socketMessageAction:()=>eI});var requestUpdater=({state:r,payload:a,componentId:s,key:l,requestId:c})=>s in r.byId?__spreadProps(__spreadValues({},r),{byId:__spreadProps(__spreadValues({},r.byId),{[s]:__spreadProps(__spreadValues({},r.byId[s]),{[l]:__spreadProps(__spreadValues({},r.byId[s][l]),{[c]:a})})})}):__spreadProps(__spreadValues({},r),{byId:__spreadProps(__spreadValues({},r.byId),{[s]:{id:s,[l]:{[c]:a}}})}),{actions:eK,reducer:eJ}=createDestroyableSlice({name:"components",initialState:{byId:{}},reducers:{upsert:(r,{payload:a})=>a.id in r.byId?__spreadProps(__spreadValues({},r),{byId:__spreadProps(__spreadValues({},r.byId),{[a.id]:__spreadValues(__spreadValues({},r.byId[a.id]),a)})}):__spreadProps(__spreadValues({},r),{byId:__spreadProps(__spreadValues({},r.byId),{[a.id]:a})}),executeSuccess:(r,{payload:a})=>{let{componentId:s,requestId:l,response:c}=a;return requestUpdater({componentId:s,requestId:l,state:r,key:"responses",payload:c})},executeFailure:(r,{payload:a})=>{let{componentId:s,requestId:l,error:c,action:u}=a;return requestUpdater({componentId:s,requestId:l,state:r,key:"errors",payload:{action:u,jsonrpc:c}})},cleanup:(r,{payload:a})=>__spreadProps(__spreadValues({},r),{byId:Object.entries(r.byId).reduce((r,[s,l])=>(a.ids.includes(s)||(r[s]=l),r),{})})}}),eZ={queue:[]},{actions:eY,reducer:eQ}=createDestroyableSlice({name:"executeQueue",initialState:eZ,reducers:{add:(r,{payload:a})=>__spreadProps(__spreadValues({},r),{queue:r.queue.concat(a)}),clean:()=>eZ}}),e$=(0,eP.combineReducers)({components:eJ,session:eB,executeQueue:eQ});__export({},{createCatchableSaga:()=>createCatchableSaga,createRestartableSaga:()=>createRestartableSaga,eventChannel:()=>eventChannel});var createRestartableSaga=r=>function*(){spawn(function*(){for(;;)try{getLogger().debug("Run a restartable saga"),yield call(r),getLogger().debug("One of the restartable saga has ended. Restarting..")}catch(r){getLogger().error("Restartable Saga Error",r)}})},defaultCatchHandler=r=>getLogger().error("Catchable Saga Error",r),createCatchableSaga=(r,a=defaultCatchHandler)=>function*(...s){try{yield call(r,...s)}catch(r){a(r)}},isWebrtcEvent=r=>(null==r?void 0:r.event_type)==="webrtc.message",isVideoEvent=r=>{var a;return!!(null==(a=null==r?void 0:r.event_type)?void 0:a.startsWith("video."))};function*executeActionWatcher(r){function*worker(a){let{componentId:s,requestId:l,method:c,params:u}=a.payload;try{let a=RPCExecute({id:l,method:c,params:u}),d=yield call(r.execute,a);s&&l&&(yield put(eK.executeSuccess({componentId:s,requestId:l,response:d})))}catch(r){getLogger().warn("Execute error:",r),s&&l&&(yield put(eK.executeFailure({componentId:s,requestId:l,action:a,error:r})))}finally{let r=yield cancelled();if(r&&s&&l){let r={jsonrpc:"2.0",id:l,error:{code:-32600,message:"Cancelled task"}};getLogger().debug("executeActionWorker cancelled",{requestId:l,componentId:s,error:r}),yield put(eK.executeFailure({componentId:s,requestId:l,action:a,error:r}))}}}for(;;){let r=yield take(eT.type);yield fork(worker,r)}}function*sessionChannelWatcher({sessionChannel:r,pubSubChannel:a,swEventChannel:s}){function*videoAPIWorker(r){switch(r.event_type){case"video.room.audience_count":yield put(a,{type:"video.room.audienceCount",payload:r.params});return;case"video.member.updated":return;case"video.member.talking":{let{member:s}=r.params;if("talking"in s){let l=s.talking?"started":"ended";yield put(a,{type:`video.member.talking.${l}`,payload:r.params});let c=s.talking?"start":"stop";yield put(a,{type:`video.member.talking.${c}`,payload:r.params})}}}yield put(a,{type:r.event_type,payload:r.params})}function*swEventWorker(r){if(yield put(s,toInternalAction(r)),!isWebrtcEvent(r)){if(isVideoEvent(r)){yield fork(videoAPIWorker,r);return}yield put({type:r.event_type,payload:r})}}function*sessionChannelWorker(r){if(r.type!==eI.type){yield put(r);return}let{method:a,params:s}=r.payload;if("signalwire.event"!==a)return getLogger().debug(`Unknown message: ${a}`,r);yield fork(swEventWorker,s)}let l=createCatchableSaga(sessionChannelWorker,r=>{getLogger().error("Channel Error",r)});for(;;)try{for(;;){let a=yield take(r);yield fork(l,a)}}catch(r){getLogger().error("sessionChannelWorker error:",r)}finally{getLogger().debug("sessionChannelWorker finally")}}function createSessionChannel(r){return eventChannel(a=>(r.dispatch=r=>{a(r)},()=>{getLogger().debug("sessionChannel unsubscribe"),r.disconnect()}))}var isVideoMemberEvent=r=>r.type.startsWith("video.member.")||r.type.startsWith("video.__synthetic__.member"),isVideoRoomEvent=r=>r.type.startsWith("video.room."),isVideoRoomAudienceCountEvent=r=>"video.room.audience_count"===r.type||"video.room.audienceCount"===r.type,isVideoLayoutEvent=r=>r.type.startsWith("video.layout."),isVideoRecordingEvent=r=>r.type.startsWith("video.recording."),isVideoPlaybackEvent=r=>r.type.startsWith("video.playback."),isVideoStreamEvent=r=>r.type.startsWith("video.stream."),isChatEvent=r=>r.type.startsWith("chat."),isVoiceCallEvent=r=>r.type.startsWith("calling."),findNamespaceInPayload=r=>{var a;if(void 0===r.payload)return"";if(isVideoMemberEvent(r)||isVideoLayoutEvent(r)||isVideoRecordingEvent(r)||isVideoPlaybackEvent(r)||isVideoStreamEvent(r)||isVideoRoomAudienceCountEvent(r))return r.payload.room_session_id;if(isVideoRoomEvent(r))return r.payload.room_session.id;if(isChatEvent(r));else if(isVoiceCallEvent(r))return null!=(a=r.payload.tag)?a:"";return""};function*pubSubSaga({pubSubChannel:r,emitter:a}){getLogger().debug("pubSubSaga [started]");try{for(;;){let s=yield take(r,"*"),{type:l,payload:c}=s;try{let r=findNamespaceInPayload(s);isInternalGlobalEvent(l)&&a.emit(l,c),getLogger().trace("Emit:",toInternalEventName({namespace:r,event:l})),a.emit(toInternalEventName({namespace:r,event:l}),c)}catch(r){getLogger().error(r)}}}finally{(yield cancelled())&&getLogger().debug("pubSubSaga [cancelled]")}}var e0=class extends Error{constructor(r,a){super(a),this.code=r,this.message=a,__publicField(this,"name","AuthError"),Object.setPrototypeOf(this,e0.prototype)}};function*initSessionSaga({SessionConstructor:r,userOptions:a,channels:s}){var l;let c=new r(a),u=yield call(createSessionChannel,c),d=s.pubSubChannel,p=s.swEventChannel,f=[];if(null==(l=a.workers)?void 0:l.length)try{let r=a.workers.map(r=>call(createRestartableSaga(r)));f=yield io_c3792963_all(r)}catch(r){getLogger().error("Error running custom workers",r)}yield fork(sessionChannelWatcher,{sessionChannel:u,pubSubChannel:d,swEventChannel:p});let m=yield fork(pubSubSaga,{pubSubChannel:d,emitter:a.emitter}),b=yield fork(sessionStatusWatcher,{session:c,sessionChannel:u,pubSubChannel:d,userOptions:a}),g=yield fork(executeActionWatcher,c);c.connect(),yield take(eC.type),m.cancel(),b.cancel(),g.cancel(),u.close(),f.forEach(r=>r.cancel())}function*reauthenticateWorker({session:r,token:a,pubSubChannel:s}){try{r.reauthenticate&&(r.token=a,yield call(r.reauthenticate),yield put(eU.connected(r.rpcConnectResult)),yield put(s,eD()))}catch(a){getLogger().error("Reauthenticate Error",a),r.authError(a)}}function*sessionStatusWatcher(r){getLogger().debug("sessionStatusWatcher [started]");try{for(;;){let a=yield take([eR.type,eA.type,eL.type,eM.type,eW.type,eN.type]);switch(getLogger().debug("sessionStatusWatcher",a.type,a.payload),a.type){case eR.type:{let{session:a,pubSubChannel:s}=r;yield put(eU.connected(a.rpcConnectResult)),yield put(s,eD());break}case eA.type:yield fork(sessionAuthErrorSaga,__spreadProps(__spreadValues({},r),{action:a}));break;case eL.type:yield put(r.pubSubChannel,eV());break;case eM.type:yield fork(reauthenticateWorker,{session:r.session,token:a.payload.token,pubSubChannel:r.pubSubChannel});break;case eW.type:yield put(r.pubSubChannel,eW());break;case eN.type:yield put(r.pubSubChannel,eN()),yield put(eC())}}}finally{(yield cancelled())&&getLogger().debug("sessionStatusWatcher [cancelled]")}}function*sessionAuthErrorSaga(r){getLogger().debug("sessionAuthErrorSaga [started]");try{let{pubSubChannel:a,action:s}=r,{error:l}=s.payload,c=l?new e0(l.code,l.message):Error("Unauthorized");yield put(a,eF(c))}finally{(yield cancelled())&&getLogger().debug("sessionAuthErrorSaga [cancelled]")}}var rootSaga_default=r=>function*({userOptions:a,channels:s}){var l;for(a.logger&&setLogger(a.logger),a.debug&&setDebugOptions(a.debug);;){let c=yield take([ej.type,eM.type]);(null==(l=null==c?void 0:c.payload)?void 0:l.token)&&(a.token=c.payload.token);try{yield call(initSessionSaga,__spreadProps(__spreadValues({},r),{userOptions:a,channels:s}))}catch(r){getLogger().error("RootSaga Error:",r)}finally{(yield cancelled())&&getLogger().debug("rootSaga [cancelled]"),getLogger().debug("Reboot rootSaga")}}},e1={};__export(e1,{getComponent:()=>getComponent,getComponentsById:()=>getComponentsById,getComponentsToCleanup:()=>getComponentsToCleanup});var getComponent=({components:r},a)=>{var s;return null==(s=r.byId)?void 0:s[a]},getComponentsById=({components:r})=>r.byId,getComponentsToCleanup=r=>{let a=getComponentsById(r),s=[];return Object.keys(a).forEach(r=>{(a[r].responses||a[r].errors)&&s.push(r)}),s},e2={};__export(e2,{getAuthError:()=>getAuthError,getAuthState:()=>getAuthState,getAuthStatus:()=>getAuthStatus,getIceServers:()=>getIceServers,getSession:()=>getSession});var getIceServers=({session:r})=>{var a;return null!=(a=null==r?void 0:r.iceServers)?a:[]},getSession=r=>r.session,getAuthStatus=({session:r})=>r.authStatus,getAuthError=({session:r})=>r.authError,getAuthState=({session:r})=>r.authState,connect=r=>{let{componentListeners:a={},sessionListeners:s={},store:l,Component:c,customSagas:u=[]}=r,d=Object.keys(a),p=Object.keys(s);return r=>{let f=new c(__spreadProps(__spreadValues({},r),{store:l})),m=new Map,b=!0,g=l.subscribe(()=>{let r=l.getState(),c=getComponent(r,f.__uuid)||{};for(let r of d){if(!1===b)return;let s=`${f.__uuid}.${r}`,l=m.get(s),u=c[r];if(void 0!==u&&l!==u){m.set(s,u);let l=a[r];"string"==typeof l?f[l](c):l(c)}}let u=getSession(r);for(let r of p){if(!1===b)return;let a=`session.${r}`,l=m.get(a),c=u[r];if(void 0!==c&&l!==c){m.set(a,c);let l=s[r];"string"==typeof l?f[l](u):"function"==typeof l&&l(u)}}}),y=null==u?void 0:u.map(r=>l.runSaga(r,{instance:f,runSaga:l.runSaga}));return f.destroyer=()=>{b=!1,g(),m.clear(),(null==y?void 0:y.length)&&y.forEach(r=>r.cancel())},f}};__reExport(eX,eP);var configureStore2=r=>{var a;let{userOptions:s,SessionConstructor:l,preloadedState:c={},runSagaMiddleware:u=!0}=r,d=redux_saga_core_esm(),p=multicastChannel(),f=multicastChannel(),m={pubSubChannel:p,swEventChannel:f},b=configureStore({devTools:null==(a=null==s?void 0:s.devTools)||a,reducer:e$,preloadedState:c,middleware:r=>r().concat(d)});if(u){let r=rootSaga_default({SessionConstructor:l});d.run(r,{userOptions:s,channels:m})}return __spreadProps(__spreadValues({},b),{runSaga:(r,a)=>d.run(r,__spreadProps(__spreadValues({},a),{channels:m}))})},index_esm_identity=r=>r,e3=Symbol("BaseComponent"),e5=class{constructor(r){this.options=r,__publicField(this,"__sw_symbol",e3),__publicField(this,"uuid",(0,f.Z)()),__publicField(this,"_eventsPrefix",""),__publicField(this,"_eventsRegisterQueue",new Set),__publicField(this,"_eventsEmitQueue",new Set),__publicField(this,"_eventsNamespace"),__publicField(this,"_eventsTransformsCache",new Map),__publicField(this,"_requests",new Map),__publicField(this,"_customSagaTriggers",new Map),__publicField(this,"_destroyer"),__publicField(this,"_emitterTransforms",new Map),__publicField(this,"_emitterListenersCache",new Map),__publicField(this,"_trackedEvents",[]),__publicField(this,"_runningWorkers",[]),__publicField(this,"_workers",new Map)}get __uuid(){return this.uuid}_handleCompoundEvents(r){let a;let s=this._getInternalEvent(r);for(let r of this.getCompoundEvents().keys())if(this._getInternalEvent(r)===s){a=this.getCompoundEvents().get(r);break}a&&0!==a.length&&(this.store.dispatch(eq({compoundEvents:a,event:s,namespace:this._eventsNamespace})),a.forEach(r=>{"string"==typeof r&&this._trackEvent(r)}))}_getNamespacedEvent(r){let a=this._eventsNamespace;return"string"==typeof r&&isLocalEvent(r)&&(a=this.__uuid),toInternalEventName({event:r,namespace:a})}_getPrefixedEvent(r){return!this._eventsPrefix||"string"!=typeof r||r.includes(`${this._eventsPrefix}.`)||isSessionEvent(r)?r:`${this._eventsPrefix}.${r}`}_getInternalEvent(r){return this._getNamespacedEvent(this._getPrefixedEvent(r))}get logger(){return getLogger()}set destroyer(r){this._destroyer=r}get store(){return this.options.store}get emitter(){return this.options.emitter}addEventToRegisterQueue(r){let[a,s]=r.params;return this.logger.trace("Adding event to the register queue",{event:a,fn:s}),this._eventsRegisterQueue.add({type:r.type,params:r.params}),this.emitter}_addEventToEmitQueue(r,a){this.logger.trace("Adding to the emit queue",r),this._eventsEmitQueue.add({event:r,args:a})}shouldAddToQueue(){return void 0===this._eventsNamespace}runAndCacheEventHandlerTransform({internalEvent:r,transform:a,payload:s}){if("no-cache"===a.mode){let r=a.instanceFactory(s);return r}if(!this._eventsTransformsCache.has(r)){let l=a.instanceFactory(s);return this._eventsTransformsCache.set(r,l),l}return this._eventsTransformsCache.get(r)}cleanupEventHandlerTransformCache({internalEvent:r,force:a}){let s=this._eventsTransformsCache.get(r),l=this.listenerCount(r);return s&&(a||l<=1)?(s.__uuid!==this.__uuid&&"function"==typeof s.destroy&&s.destroy(),this._eventsTransformsCache.delete(r)):(this.logger.trace("[cleanupEventHandlerTransformCache] Key wasn't cached",r),!1)}getEmitterListenersMapByInternalEventName(r){var a;return null!=(a=this._emitterListenersCache.get(r))?a:new Map}getAndRemoveStableEventHandler(r,a){let s=this.getEmitterListenersMapByInternalEventName(r);if(a&&s.has(a)){let l=s.get(a);return s.delete(a),this._emitterListenersCache.set(r,s),l}return a}_createStableEventHandler(r,a){return s=>{let l=this._emitterTransforms.get(r);if(this.logger.trace("Got emitterTransform for",r,l),!l)return a(s);let c=this.runAndCacheEventHandlerTransform({internalEvent:r,transform:l,payload:s}),u=this._parseNestedFields(s,l);return a(proxyFactory({instance:c,payload:s,transformedPayload:u,transform:l}))}}_parseNestedFields(r,a,s=r=>r,l){if(!a.nestedFieldsToProcess)return a.payloadTransform(r);if(r.__sw_proxy)return r;if(!l){let l=a.payloadTransform(r);return this._parseNestedFields(l,a,s,l)}return Array.isArray(r)?l=r.map((l,c)=>this._parseNestedFields(s(l),a,s,r[c])):r&&"object"==typeof r&&Object.entries(r).forEach(([r,c])=>{var u;let d=null==(u=a.nestedFieldsToProcess)?void 0:u[r],p=d?this._emitterTransforms.get(d.eventTransformType):void 0;c&&"object"==typeof c?l[r]=this._parseNestedFields(c,a,r=>d&&p&&r&&"object"==typeof r?instanceProxyFactory({transform:p,payload:s(d.processInstancePayload(r))}):r,l[r]):l[r]=s(c)}),l}getOrCreateStableEventHandler(r,a){let s=this.getEmitterListenersMapByInternalEventName(r),l=s.get(a);return l||(l=this._createStableEventHandler(r,a),s.set(a,l),this._emitterListenersCache.set(r,s)),l}_trackEvent(r){this._trackedEvents=Array.from(new Set(this._trackedEvents.concat(r)))}_untrackEvent(r){this._trackedEvents=this._trackedEvents.filter(a=>a!==r)}_addListener(r,a,s){this._handleCompoundEvents(r);let l=this._getInternalEvent(r);this._trackEvent(l);let c=s?"once":"on";if(this.shouldAddToQueue())return this.addEventToRegisterQueue({type:c,params:[r,a]}),this.emitter;let u=this.getOrCreateStableEventHandler(l,a);return this.logger.trace("Registering event",l),this.emitter[c](l,u)}on(r,a){return this._addListener(r,a)}once(r,a){return this._addListener(r,a,!0)}off(r,a){if(this.shouldAddToQueue())return this.addEventToRegisterQueue({type:"off",params:[r,a]}),this.emitter;let s=this._getInternalEvent(r),l=this.getAndRemoveStableEventHandler(s,a);return this.cleanupEventHandlerTransformCache({internalEvent:s,force:!l}),this.logger.trace("Removing event listener",s),this._untrackEvent(s),this.emitter.off(s,l)}removeAllListeners(r){return this.shouldAddToQueue()?(this.addEventToRegisterQueue({type:"removeAllListeners",params:[r]}),this.emitter):r?this.off(r):(this.eventNames().forEach(r=>{this.off(r)}),this.emitter)}eventNames(){return this._trackedEvents}getSubscriptions(){return validateEventsToSubscribe(this.eventNames())}emit(r,...a){if(this.shouldAddToQueue())return this._addEventToEmitQueue(r,a),!1;let s=this._getInternalEvent(r);return this.logger.trace("Emit on event:",s),this.emitter.emit(s,...a)}listenerCount(r){return this.emitter.listenerCount(r)}destroy(){var r;null==(r=this._destroyer)||r.call(this),this.removeAllListeners(),this.detachWorkers()}execute({method:r,params:a},{transformParams:s=index_esm_identity,transformResolve:l=index_esm_identity,transformReject:c=index_esm_identity}={transformParams:index_esm_identity,transformResolve:index_esm_identity,transformReject:index_esm_identity}){return new Promise((u,d)=>{let p=(0,f.Z)();this._requests.set(p,{resolve:u,reject:d,transformResolve:l,transformReject:c}),this.store.dispatch(eT({requestId:p,componentId:this.__uuid,method:r,params:s(a)}))})}triggerCustomSaga(r){return new Promise((a,s)=>{let l=(0,f.Z)();this._customSagaTriggers.set(l,{resolve:a,reject:s}),this.store.dispatch(__spreadValues({dispatchId:l},makeCustomSagaAction(this.__uuid,r)))})}settleCustomSagaTrigger({dispatchId:r,payload:a,kind:s}){let l=this._customSagaTriggers.get(r);l&&(l[s](a),this._customSagaTriggers.delete(r))}select(r){return r(this.store.getState())}onError(r){this._requests.forEach((a,s)=>{(null==r?void 0:r.errors[s])!==void 0&&(a.reject(a.transformReject(r.errors[s])),this._requests.delete(s))})}onSuccess(r){this._requests.forEach((a,s)=>{(null==r?void 0:r.responses[s])!==void 0&&(a.resolve(a.transformResolve(r.responses[s])),this._requests.delete(s))})}getStateProperty(r){return this[r]}flushEventsRegisterQueue(){this._eventsRegisterQueue.forEach(r=>{this[r.type](...r.params),this._eventsRegisterQueue.delete(r)})}flushEventsEmitQueue(){this._eventsEmitQueue.forEach(r=>{let{event:a,args:s}=r;this.emit(a,...s),this._eventsEmitQueue.delete(r)})}flushEventsQueue(){this.flushEventsRegisterQueue(),this.flushEventsEmitQueue()}_attachListeners(r){"string"==typeof r&&(this._eventsNamespace=r),this.flushEventsQueue()}getCompoundEvents(){return new Map}getEmitterTransforms(){return new Map}get _sessionAuthStatus(){return getAuthStatus(this.store.getState())}get _sessionAuthState(){return getAuthState(this.store.getState())}_waitUntilSessionAuthorized(){let r=getAuthStatus(this.store.getState());switch(r){case"authorized":return Promise.resolve(this);case"unknown":case"authorizing":return new Promise((r,a)=>{let s=this.store.subscribe(()=>{let l=getAuthStatus(this.store.getState()),c=getAuthError(this.store.getState());if("authorized"===l)r(this),s();else if("unauthorized"===l){let r=c?new e0(c.code,c.message):Error("Unauthorized");a(r),s()}})});case"unauthorized":return Promise.reject(Error("Unauthorized"))}}_setEmitterTransform({event:r,handler:a,local:s}){let l=this._getInternalEvent(r);(s?!isLocalEvent(r):isLocalEvent(r)||!this.eventNames().includes(l))||this._emitterTransforms.set(l,a)}applyEmitterTransforms({local:r=!1}={local:!1}){this.getEmitterTransforms().forEach((a,s)=>{Array.isArray(s)?s.forEach(s=>{this._setEmitterTransform({event:s,handler:a,local:r})}):this._setEmitterTransform({event:s,handler:a,local:r}),this._emitterTransforms.set(a.type,a)})}runWorker(r,a){this._workers.has(r)?getLogger().warn(`[runWorker] Worker with name ${r} has already been registerd.`):this._setWorker(r,a),this._attachWorker(r,a)}_setWorker(r,a){this._workers.set(r,a)}_attachWorker(r,a){var{worker:s}=a,l=__objRest(a,["worker"]);let c=this.store.runSaga(s,__spreadValues({instance:this,runSaga:this.store.runSaga},l));this._runningWorkers.push(c),this._workers.delete(r)}detachWorkers(){this._runningWorkers.forEach(r=>{r.cancel()}),this._runningWorkers=[]}},e4=class extends e5{constructor(r){super(r),this.options=r,this._attachListeners("")}connect(){let r=getAuthStatus(this.store.getState());return("unknown"===r||"unauthorized"===r)&&this.store.dispatch(ej()),this._waitUntilSessionAuthorized()}disconnect(){this.store.dispatch(eC())}},e8=class extends e5{constructor(r){super(r),this.options=r,__publicField(this,"subscribeMethod","signalwire.subscribe"),__publicField(this,"subscribeParams",{}),__publicField(this,"_latestExecuteParams"),this.applyEmitterTransforms({local:!0});let resetLatestExecuteParams=()=>{this._latestExecuteParams=void 0};super.on("session.connected",resetLatestExecuteParams),super.on("session.disconnected",resetLatestExecuteParams),super.on("session.reconnecting",resetLatestExecuteParams)}shouldExecuteSubscribe(r){return!this._latestExecuteParams||JSON.stringify(r)!==JSON.stringify(this._latestExecuteParams)}async subscribe(){await this._waitUntilSessionAuthorized();let r=this.getSubscriptions();if(0===r.length){this.logger.debug("`subscribe()` was called without any listeners attached.");return}let a={method:this.subscribeMethod,params:__spreadProps(__spreadValues({},this.subscribeParams),{event_channel:this.getStateProperty("eventChannel"),events:r})};if(!this.shouldExecuteSubscribe(a)){this.logger.debug("BaseConsumer.subscribe() - Skipped .execute() since the execParams are exactly the same as last time");return}return this._latestExecuteParams=a,new Promise(async(r,s)=>{try{return this.applyEmitterTransforms(),await this.execute(a),r(void 0)}catch(r){return s(r)}})}},getEventEmitter=()=>new(X()),e7={audio_muted:!0,video_muted:!0,deaf:!0,visible:!0,input_volume:1,output_volume:1,input_sensitivity:1};Object.keys(e7).map(r=>`${eo}.member.updated.${r}`),Object.keys(toExternalJSON(e7)).map(r=>`member.updated.${r}`);var e6={};__export(e6,{RoomSessionPlaybackAPI:()=>tD,RoomSessionRecordingAPI:()=>tI,RoomSessionStreamAPI:()=>tN,audioMuteMember:()=>tb,audioUnmuteMember:()=>tg,createRoomSessionPlaybackObject:()=>createRoomSessionPlaybackObject,createRoomSessionRecordingObject:()=>createRoomSessionRecordingObject,createRoomSessionStreamObject:()=>createRoomSessionStreamObject,deafMember:()=>tv,deleteMemberMeta:()=>tL,deleteMeta:()=>tf,demote:()=>tx,getLayouts:()=>e9,getMemberMeta:()=>tT,getMembers:()=>te,getMeta:()=>tu,getPlaybacks:()=>tl,getRecordings:()=>ta,getStreams:()=>th,hideVideoMuted:()=>tn,play:()=>tc,promote:()=>tP,removeAllMembers:()=>tM,removeMember:()=>tC,setDeaf:()=>tw,setHideVideoMuted:()=>ti,setInputSensitivityMember:()=>tE,setInputVolumeMember:()=>tO,setLayout:()=>tt,setMemberMeta:()=>tA,setMemberPosition:()=>tj,setMeta:()=>td,setOutputVolumeMember:()=>tk,setPositions:()=>tr,showVideoMuted:()=>to,startRecording:()=>ts,startStream:()=>tm,undeafMember:()=>tS,updateMemberMeta:()=>tR,updateMeta:()=>tp,videoMuteMember:()=>ty,videoUnmuteMember:()=>t_});var baseCodeTransform=()=>{},createRoomMethod=(r,a={})=>({value:function(s={}){return this.execute({method:r,params:__spreadValues({room_session_id:this.roomSessionId},s)},a)}}),createRoomMemberMethod=(r,a={})=>({value:function(s={}){var{memberId:l}=s,c=__objRest(s,["memberId"]);return this.execute({method:r,params:__spreadValues({room_session_id:this.roomSessionId,member_id:l||this.memberId},c)},a)}}),e9=createRoomMethod("video.list_available_layouts",{transformResolve:r=>({layouts:r.layouts})}),te=createRoomMethod("video.members.get",{transformResolve:r=>({members:r.members})}),tt=createRoomMethod("video.set_layout",{transformResolve:baseCodeTransform}),tr=createRoomMethod("video.set_position",{transformResolve:baseCodeTransform}),tn=createRoomMethod("video.hide_video_muted",{transformResolve:baseCodeTransform}),to=createRoomMethod("video.show_video_muted",{transformResolve:baseCodeTransform}),ti={value:function(r){return this.execute({method:r?"video.hide_video_muted":"video.show_video_muted",params:{room_session_id:this.roomSessionId}},{transformResolve:baseCodeTransform})}},ta={value:function(){return new Promise(async r=>{let handler=a=>{r(a)};this.on(toLocalEvent("video.recording.list"),handler);try{let r=await this.execute({method:"video.recording.list",params:{room_session_id:this.roomSessionId}});this.emit(toLocalEvent("video.recording.list"),__spreadProps(__spreadValues({},r),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.recording.list"),handler),r}})}},ts={value:function(){return new Promise(async r=>{let handler=a=>{r(a)};this.on(toLocalEvent("video.recording.start"),handler);try{let r=await this.execute({method:"video.recording.start",params:{room_session_id:this.roomSessionId}});this.emit(toLocalEvent("video.recording.start"),__spreadProps(__spreadValues({},r),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.recording.start"),handler),r}})}},tl={value:function(){return new Promise(async r=>{let handler=a=>{r(a)};this.on(toLocalEvent("video.playback.list"),handler);try{let r=await this.execute({method:"video.playback.list",params:{room_session_id:this.roomSessionId}});this.emit(toLocalEvent("video.playback.list"),__spreadProps(__spreadValues({},r),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.playback.list"),handler),r}})}},tc={value:function(r){return new Promise(async a=>{let handler=r=>{a(r)};this.on(toLocalEvent("video.playback.start"),handler);try{let a=await this.execute({method:"video.playback.start",params:__spreadValues({room_session_id:this.roomSessionId},r)});this.emit(toLocalEvent("video.playback.start"),__spreadProps(__spreadValues({},a),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.playback.start"),handler),r}})}},createRoomMetaMethod=r=>createRoomMethod(r,{transformResolve:baseCodeTransform,transformParams:r=>{let{room_session_id:a}=r,s=__objRest(r,["room_session_id"]);return{room_session_id:a,meta:s}}}),tu=createRoomMethod("video.get_meta",{transformResolve:({meta:r})=>({meta:r})}),td=createRoomMetaMethod("video.set_meta"),tp=createRoomMetaMethod("video.update_meta"),tf={value:function(r){return this.execute({method:"video.delete_meta",params:{room_session_id:this.roomSessionId,keys:r}})}},th={value:function(){return new Promise(async r=>{let handler=a=>{r(a)};this.on(toLocalEvent("video.stream.list"),handler);try{let r=await this.execute({method:"video.stream.list",params:{room_session_id:this.roomSessionId}});this.emit(toLocalEvent("video.stream.list"),__spreadProps(__spreadValues({},r),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.stream.list"),handler),r}})}},tm={value:function(r){return new Promise(async a=>{let handler=r=>{a(r)};this.on(toLocalEvent("video.stream.start"),handler);try{let a=await this.execute({method:"video.stream.start",params:__spreadValues({room_session_id:this.roomSessionId},r)});this.emit(toLocalEvent("video.stream.start"),__spreadProps(__spreadValues({},a),{room_session_id:this.roomSessionId}))}catch(r){throw this.off(toLocalEvent("video.stream.start"),handler),r}})}},tb=createRoomMemberMethod("video.member.audio_mute",{transformResolve:baseCodeTransform}),tg=createRoomMemberMethod("video.member.audio_unmute",{transformResolve:baseCodeTransform}),ty=createRoomMemberMethod("video.member.video_mute",{transformResolve:baseCodeTransform}),t_=createRoomMemberMethod("video.member.video_unmute",{transformResolve:baseCodeTransform}),tv=createRoomMemberMethod("video.member.deaf",{transformResolve:baseCodeTransform}),tS=createRoomMemberMethod("video.member.undeaf",{transformResolve:baseCodeTransform}),tw={value:function(r){return this.execute({method:r?"video.member.deaf":"video.member.undeaf",params:{room_session_id:this.roomSessionId,member_id:this.memberId}},{transformResolve:baseCodeTransform})}},tO=createRoomMemberMethod("video.member.set_input_volume",{transformResolve:baseCodeTransform}),tk=createRoomMemberMethod("video.member.set_output_volume",{transformResolve:baseCodeTransform}),tE=createRoomMemberMethod("video.member.set_input_sensitivity",{transformResolve:baseCodeTransform}),tP={value:function(r){var{memberId:a,mediaAllowed:s,joinAudioMuted:l,joinVideoMuted:c}=r,u=__objRest(r,["memberId","mediaAllowed","joinAudioMuted","joinVideoMuted"]);return this.execute({method:"video.member.promote",params:__spreadValues({room_session_id:this.roomSessionId,member_id:a,media_allowed:s,join_audio_muted:l,join_video_muted:c},u)},{transformResolve:baseCodeTransform})}},tx={value:function({memberId:r,mediaAllowed:a}){return this.execute({method:"video.member.demote",params:{room_session_id:this.roomSessionId,member_id:r,media_allowed:a}},{transformResolve:baseCodeTransform})}},tj=createRoomMemberMethod("video.member.set_position",{transformResolve:baseCodeTransform}),tC={value:function(r){var{memberId:a}=r,s=__objRest(r,["memberId"]);if(!a)throw TypeError('Invalid or missing "memberId" argument');return this.execute({method:"video.member.remove",params:__spreadValues({room_session_id:this.roomSessionId,member_id:a},s)},{transformResolve:baseCodeTransform})}},tM={value:function(){return this.execute({method:"video.member.remove",params:{room_session_id:this.roomSessionId,member_id:"all"}},{transformResolve:baseCodeTransform})}},tT=createRoomMemberMethod("video.member.get_meta",{transformResolve:({meta:r})=>({meta:r})}),tA=createRoomMemberMethod("video.member.set_meta",{transformResolve:baseCodeTransform}),tR=createRoomMemberMethod("video.member.update_meta",{transformResolve:baseCodeTransform}),tL=createRoomMemberMethod("video.member.delete_meta",{transformResolve:baseCodeTransform}),tI=class extends e5{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")}})}},createRoomSessionRecordingObject=r=>{let a=connect({store:r.store,Component:tI,componentListeners:{errors:"onError",responses:"onSuccess"}})(r);return a},tD=class extends e5{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(r){await this.execute({method:"video.playback.set_volume",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),volume:r}})}async seek(r){await this.execute({method:"video.playback.seek_absolute",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:Math.abs(r)}})}async forward(r=5e3){await this.execute({method:"video.playback.seek_relative",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:Math.abs(r)}})}async rewind(r=5e3){await this.execute({method:"video.playback.seek_relative",params:{room_session_id:this.getStateProperty("roomSessionId"),playback_id:this.getStateProperty("id"),position:-Math.abs(r)}})}},createRoomSessionPlaybackObject=r=>{let a=connect({store:r.store,Component:tD,componentListeners:{errors:"onError",responses:"onSuccess"}})(r);return a},tN=class extends e5{async stop(){await this.execute({method:"video.stream.stop",params:{room_session_id:this.getStateProperty("roomSessionId"),stream_id:this.getStateProperty("id")}})}},createRoomSessionStreamObject=r=>{let a=connect({store:r.store,Component:tN,componentListeners:{errors:"onError",responses:"onSuccess"}})(r);return a},tW={};__export(tW,{BaseChatAPI:()=>tZ,BaseChatConsumer:()=>tJ,ChatMember:()=>tX,ChatMessage:()=>tK,createBaseChatObject:()=>createBaseChatObject,getMemberState:()=>tB,getMembers:()=>tq,getMessages:()=>tV,publish:()=>tF,setMemberState:()=>tU});var toInternalChatChannels=r=>{let a=!r||Array.isArray(r)?r:[r];return Array.isArray(a)?a.map(r=>({name:r})):[]},isValidChannels=r=>Array.isArray(r)||"string"==typeof r,baseCodeTransform2=()=>{},createChatMethod=(r,a={})=>({value:function(s={}){return this.execute({method:r,params:s},a)}}),createChatMemberMethod=(r,a={})=>({value:function(s={}){var{memberId:l}=s,c=__objRest(s,["memberId"]);return this.execute({method:r,params:__spreadValues({member_id:l},c)},a)}}),tF=createChatMethod("chat.publish",{transformResolve:baseCodeTransform2}),tV=createChatMethod("chat.messages.get",{transformResolve:r=>({messages:r.messages.map(r=>toExternalJSON(r)),cursor:r.cursor})}),tq=createChatMethod("chat.members.get",{transformResolve:r=>({members:r.members.map(r=>toExternalJSON(r))})}),transformParamChannels=r=>{let a=isValidChannels(null==r?void 0:r.channels)?toInternalChatChannels(r.channels):void 0;return __spreadProps(__spreadValues({},r),{channels:a})},tU=createChatMemberMethod("chat.member.set_state",{transformResolve:baseCodeTransform2,transformParams:transformParamChannels}),tB=createChatMemberMethod("chat.member.get_state",{transformResolve:r=>({channels:r.channels}),transformParams:transformParamChannels}),tz={};__export(tz,{BasePubSubConsumer:()=>tG,PubSubMessage:()=>tH,createBasePubSubObject:()=>createBasePubSubObject});var tH=class{constructor(r){this.payload=r}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}},pubSubWorker=function*({channels:{pubSubChannel:r}}){for(;;){let a=yield take(r=>r.type.startsWith(`${ea}.`));a.type===`${ea}.channel.message`?yield put(r,{type:`${ea}.message`,payload:a.payload}):getLogger().debug("[pubSubWorker] Unrecognized Action",a)}},toInternalPubSubChannels=r=>r.map(r=>({name:r})),tG=class extends e8{constructor(r){super(r),__publicField(this,"_eventsPrefix",ea),__publicField(this,"subscribeMethod",`${ea}.subscribe`),this._attachListeners(""),this.runWorker("pubSub",{worker:pubSubWorker})}getEmitterTransforms(){return new Map([[["message"],{type:"pubSubMessage",instanceFactory:()=>new tH({}),payloadTransform:r=>{let{channel:a,message:s}=r.params,{member:l}=s,c=__objRest(s,["member"]);return toExternalJSON(__spreadProps(__spreadValues({},c),{channel:a}))}}]])}_getChannelsParam(r,a){let s=!r||Array.isArray(r)?r:[r];if(!Array.isArray(s)||0===s.length)throw Error(`Please specify one or more channels when calling .${a}()`);return{channels:toInternalPubSubChannels(s)}}_setSubscribeParams(r){this.subscribeParams=__spreadValues(__spreadValues({},this.subscribeParams),r)}_getSubscribeParams({channels:r}){return __spreadValues({},this._getChannelsParam(r,"subscribe"))}_getUnsubscribeParams({channels:r}){let a=this._getChannelsParam(r,"unsubscribe");return __spreadValues({},a)}_checkMissingSubscriptions(){let r=this.getSubscriptions();0===r.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(r){this._checkMissingSubscriptions();let a=this._getSubscribeParams({channels:r});return this._setSubscribeParams(a),super.subscribe()}async unsubscribe(r){if("unknown"===this._sessionAuthStatus||"unauthorized"===this._sessionAuthStatus)throw Error("You must be authenticated to unsubscribe from a channel");let a=this._getUnsubscribeParams({channels:r});return new Promise(async(r,s)=>{let l=this.getSubscriptions();if(l.length>0){let r={method:`${ea}.unsubscribe`,params:__spreadProps(__spreadValues({},a),{events:l})};try{await this.execute(r)}catch(r){return s(r)}}else this.logger.warn("`unsubscribe()` was called without any listeners attached.");return r()})}updateToken(r){return new Promise((a,s)=>{this.once("session.auth_error",r=>{s(r)}),this.once("session.connected",()=>{a()}),this.store.dispatch(eE.reauthAction({token:r}))})}publish(r){return this.execute({method:`${ea}.publish`,params:r})}async getAllowedChannels(){await this._waitUntilSessionAuthorized();let r=this.select(getAuthState);return r&&"channels"in r&&r.channels?r.channels:{}}},createBasePubSubObject=r=>{let a=connect({store:r.store,Component:tG,componentListeners:{errors:"onError",responses:"onSuccess"}})(r);return a},tX=class{constructor(r){this.payload=r}get id(){return this.payload.id}get channel(){return this.payload.channel}get state(){var r;return null!=(r=this.payload.state)?r:{}}},tK=class extends tH{get member(){return this.payload.member}},chatWorker=function*({channels:{pubSubChannel:r}}){for(;;){let a=yield take(r=>r.type.startsWith("chat."));switch(a.type){case"chat.channel.message":if(ei===ea)break;yield put(r,{type:"chat.message",payload:a.payload});break;case"chat.member.joined":case"chat.member.updated":case"chat.member.left":yield put(r,a);break;default:getLogger().debug("[chatWorker] Unrecognized Action",a)}}},tJ=class extends tG{constructor(r){super(r),__publicField(this,"_eventsPrefix",ei),__publicField(this,"subscribeMethod",`${ei}.subscribe`),this.runWorker("chat",{worker:chatWorker})}getEmitterTransforms(){return new Map([[["message"],{type:"chatMessage",instanceFactory:()=>new tK({}),payloadTransform:r=>{let{channel:a,message:s}=r.params;return toExternalJSON(__spreadProps(__spreadValues({},s),{channel:a}))}}],[["member.joined","member.left","member.updated"],{type:"chatMember",instanceFactory:r=>{let{member:a}=r.params;return new tX(toExternalJSON(a))},payloadTransform:r=>{let{member:a}=r.params;return toExternalJSON(a)}}]])}},tZ=extendComponent(tJ,{publish:tF,getMembers:tq,getMessages:tV,setMemberState:tU,getMemberState:tB}),createBaseChatObject=r=>{let a=connect({store:r.store,Component:tZ,componentListeners:{errors:"onError",responses:"onSuccess"}})(r);return a},tY={};function*memberPositionLayoutChangedWorker(r){let{action:a,memberList:s,channels:{pubSubChannel:l}}=r,c=a.payload.layout.layers,u={};for(let[r,a]of(c.forEach(r=>{var a;let l=r.member_id;if(!l)return;let c=s.get(l);c&&r.position!==(null==(a=c.member)?void 0:a.current_position)?(mutateMemberCurrentPosition({memberList:s,memberId:l,currentPosition:r.position}),u[l]=!0):u[l]=!1}),s))if(u[r])yield put(l,{type:"video.member.updated",payload:a});else if(void 0===u[r]){let a=mutateMemberCurrentPosition({memberList:s,memberId:r,currentPosition:"off-canvas"});if(!a)return;yield put(l,{type:"video.member.updated",payload:a})}}function*memberUpdatedWorker({action:r,channels:a,memberList:s}){var l,c;let u=r.payload.member.id,d=mutateMemberCurrentPosition({memberList:s,memberId:u,currentPosition:null==(c=null==(l=s.get(u))?void 0:l.member)?void 0:c.current_position});if(!d)return;let{member:{updated:p=[]}}=r.payload,f=__spreadProps(__spreadValues({},d),{member:__spreadValues(__spreadValues({},d.member),r.payload.member)});for(let l of(s.set(u,f),p)){let s=`${r.type}.${l}`;yield put(a.pubSubChannel,{type:s,payload:f})}yield put(a.pubSubChannel,{type:r.type,payload:f})}__export(tY,{MEMBER_POSITION_COMPOUND_EVENTS:()=>tQ,memberPositionWorker:()=>memberPositionWorker,memberUpdatedWorker:()=>memberUpdatedWorker});var tQ=new Map([["video.member.updated",["video.layout.changed","video.member.joined","video.member.left"]]]),memberPositionWorker=function*({instance:r,channels:a,initialState:s}){if(!s)return;let{swEventChannel:l}=a,c=initializeMemberList(s),addToMemberList=r=>{c.has(r.member.id)||c.set(r.member.id,r)};for(;;){let s=yield take(l,a=>{let s="video.member.updated"===a.type||"video.layout.changed"===a.type||"video.member.joined"===a.type||"video.member.left"===a.type;return s&&findNamespaceInPayload(a)===r._eventsNamespace});switch(s.type){case"video.member.updated":addToMemberList(s.payload),yield fork(memberUpdatedWorker,{action:s,channels:a,memberList:c,instance:r});break;case"video.member.joined":addToMemberList(s.payload);break;case"video.member.left":{let r=s.payload.member;c.delete(r.id);break}case"video.layout.changed":yield fork(memberPositionLayoutChangedWorker,{action:s,channels:a,memberList:c,instance:r})}}},mutateMemberCurrentPosition=({memberList:r,memberId:a,currentPosition:s})=>{let l=r.get(a);if(!l)return;if(!s)return l;let c=__spreadProps(__spreadValues({},l),{member:__spreadProps(__spreadValues({},null==l?void 0:l.member),{current_position:s})});return r.set(a,c),c},initializeMemberList=r=>{let a=r.room_session.members,s=new Map;return a.forEach(a=>{s.set(a.id,{room_id:r.room_session.room_id,room_session_id:r.room_session.id,member:a})}),s};__export({},{configureFullStack:()=>configureFullStack,configureJestStore:()=>configureJestStore,createMockedLogger:()=>createMockedLogger,createPubSubChannel:()=>createPubSubChannel,createSwEventChannel:()=>createSwEventChannel,rpcConnectResultVRT:()=>t1,wait:()=>wait});var t$="8f0a119a-cda7-4497-a47d-c81493b824d4",t0="",createMockedLogger=()=>({fatal:jest.fn(),error:jest.fn(),warn:jest.fn(),info:jest.fn(),debug:jest.fn(),trace:jest.fn(),wsTraffic:jest.fn()}),configureJestStore=r=>configureStore2(__spreadValues({userOptions:{project:t$,token:t0,devTools:!1,emitter:new(X())},SessionConstructor:eH,runSagaMiddleware:!1},r)),configureFullStack=()=>{let r={dispatch:console.log,connect:jest.fn(),disconnect:jest.fn(),execute:jest.fn()},a=new(X()),s=configureStore2({userOptions:{project:t$,token:t0,devTools:!1,emitter:a},SessionConstructor:jest.fn().mockImplementation(()=>r)});return s.dispatch(eE.initAction()),s.dispatch(eE.authSuccessAction()),{store:s,session:r,emitter:a,destroy:()=>s.dispatch(eE.destroyAction())}},wait=r=>new Promise(a=>{setTimeout(a,r)}),t1={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"}]},createPubSubChannel=()=>multicastChannel(),createSwEventChannel=()=>multicastChannel(),t2=__spreadValues({},e2);let RTCPeerConnection=r=>new window.RTCPeerConnection(r),supportsMediaDevices=()=>"undefined"!=typeof navigator&&!!navigator.mediaDevices,getMediaDevicesApi=()=>{if(!supportsMediaDevices())throw Error("The media devices API isn't supported in this environment");return navigator.mediaDevices},supportsGetUserMedia=()=>"function"==typeof getMediaDevicesApi().getUserMedia,supportsGetDisplayMedia=()=>"function"==typeof getMediaDevicesApi().getDisplayMedia,getSupportedConstraints=()=>getMediaDevicesApi().getSupportedConstraints(),streamIsValid=r=>r&&r instanceof MediaStream,supportsMediaOutput=()=>"sinkId"in HTMLMediaElement.prototype,setMediaElementSinkId=async(r,a)=>{if(null===r){getLogger().warn("No HTMLMediaElement to attach the speakerId");return}if("string"!=typeof a){getLogger().warn(`Invalid speaker deviceId: '${a}'`);return}if(!supportsMediaOutput()){getLogger().warn("Browser does not support output device selection.");return}try{return await r.setSinkId(a)}catch(r){throw"SecurityError"===r.name?getLogger().error(`You need to use HTTPS for selecting audio output device: ${r}`):getLogger().error(`Error: ${r}`),r}},sdpToJsonHack=r=>r,stopStream=r=>{var a;streamIsValid(r)&&(null===(a=null==r?void 0:r.getTracks())||void 0===a||a.forEach(stopTrack))},stopTrack=r=>{r&&"live"===r.readyState&&(r.stop(),r.dispatchEvent(new Event("ended")))},t3={camera:"videoinput",microphone:"audioinput",speaker:"audiooutput"},_getMediaDeviceKindByName=r=>{if(r)return t3[r]},enumerateDevices=()=>getMediaDevicesApi().enumerateDevices(),enumerateDevicesByKind=async r=>{let a=await enumerateDevices().catch(r=>[]);return r&&(a=a.filter(({kind:a})=>a===r)),a},_legacyCheckPermissions=async r=>{let a=await enumerateDevicesByKind(r);return a.length?a.every(({deviceId:r,label:a})=>!!(r&&a)):(getLogger().warn(`No ${r} devices to check for permissions!`),null)},checkPermissions=async r=>{if("permissions"in navigator&&"function"==typeof navigator.permissions.query&&r)try{let a=await navigator.permissions.query({name:r});return"granted"===a.state}catch(r){}return _legacyCheckPermissions(_getMediaDeviceKindByName(r))},checkCameraPermissions=()=>checkPermissions("camera"),checkMicrophonePermissions=()=>checkPermissions("microphone"),checkSpeakerPermissions=()=>checkPermissions("speaker"),_useTimeoutForGUM=async r=>{let a=[];if((null==r?void 0:r.audio)&&a.push(checkMicrophonePermissions()),(null==r?void 0:r.video)&&a.push(checkCameraPermissions()),a.length){let r=await Promise.all(a);return r.every(Boolean)}return!1},getUserMedia=async(r={audio:!0,video:!0})=>{var a;try{let a=getMediaDevicesApi().getUserMedia(r),s=await _useTimeoutForGUM(r);if(s){let r=Error("Timeout reading from your devices");return await timeoutPromise(a,5e3,r)}return await a}catch(s){switch(s.name){case"Error":getLogger().error(null!==(a=null==s?void 0:s.message)&&void 0!==a?a:"navigator.mediaDevices.getUserMedia doesn't seem to be supported.");break;case"NotFoundError":getLogger().error("No media tracks of the type specified were found that satisfy the given constraints.");break;case"NotReadableError":getLogger().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":getLogger().error(`The constraint: ${s.constraint} cannot be met by the selected device.`),getLogger().info("List of available constraints:",getSupportedConstraints());break;case"NotAllowedError":getLogger().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(r).length?getLogger().error('Constraints can\'t be empty nor have "video" and "audio" set to false.'):getLogger().error("Please check that you are calling this method from a secure context (using HTTPS rather than HTTP).");break;case"SecurityError":getLogger().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 s}},getDisplayMedia=r=>getMediaDevicesApi().getDisplayMedia(r),requestPermissions=async r=>{try{let a=await getUserMedia(r);stopStream(a)}catch(r){throw r}},_constraintsByKind=r=>({audio:!r||"all"===r||"microphone"===r||"speaker"===r,video:!r||"all"===r||"camera"===r}),getDevicesWithPermissions=async(r,a=!1)=>getDevices(r,a),getCameraDevicesWithPermissions=()=>getDevicesWithPermissions("camera"),getMicrophoneDevicesWithPermissions=()=>getDevicesWithPermissions("microphone"),getSpeakerDevicesWithPermissions=()=>getDevicesWithPermissions("speaker"),_filterDevices=(r,a={})=>{let s=[];return r.filter(({deviceId:r,kind:l,groupId:c})=>{var u;if(!r||a.targets&&!(null===(u=a.targets)||void 0===u?void 0:u.includes(l)))return!1;if(!c)return!0;let d=`${l}-${c}`,p=null==a||!a.excludeDefault||"default"!==r;return!s.includes(d)&&!!p&&(s.push(d),!0)})},getDevices=async(r,a=!1)=>{let s;let l=await checkPermissions(r);if(!1===l){let a=_constraintsByKind(r);s=await getUserMedia(a)}let c=await enumerateDevicesByKind(_getMediaDeviceKindByName(r));return(s&&stopStream(s),!0===a)?c:_filterDevices(c)},getCameraDevices=()=>getDevices("camera"),getMicrophoneDevices=()=>getDevices("microphone"),getSpeakerDevices=()=>getDevices("speaker"),assureDeviceId=async(r,a,s)=>{let l=await getDevices(s,!0);for(let s=0;s{let a=new Map;return r.forEach(r=>{r.deviceId&&a.set(r.deviceId,r)}),a},_getDeviceListDiff=(r,a)=>{let s=_deviceInfoToMap(r),l=_deviceInfoToMap(r),c=[];getLogger().debug("[_getDeviceListDiff] <- oldDevices",r),getLogger().debug("[_getDeviceListDiff] -> newDevices",a);let u=a.filter(r=>{let a=r.deviceId,u=s.get(a);return u&&(l.delete(a),r.label!==u.label&&c.push(r)),void 0===u});return{updated:c.map(r=>({type:"updated",payload:r})),removed:Array.from(l,([r,a])=>a).map(r=>({type:"removed",payload:r})),added:u.map(r=>({type:"added",payload:r}))}},t5={camera:checkCameraPermissions,microphone:checkMicrophonePermissions,speaker:checkSpeakerPermissions},t4=["camera","microphone","speaker"],t8=`Allowed targets are: '${t4.join("', '")}'`,t7={speaker:supportsMediaOutput},checkTargetPermissions=async r=>{let a=r.targets,s=await Promise.all(a.map(r=>t5[r]()));return s.reduce((r,s,l)=>{var c;let u=a[l],d=!(u in t7)||(null===(c=t7[u])||void 0===c?void 0:c.call(t7));return r[d?"supported":"unsupported"].push([u,!!s]),r},{supported:[],unsupported:[]})},validateTargets=async r=>{var a;let s=(null!==(a=r.targets)&&void 0!==a?a:t4).filter(r=>!!t4.includes(r)||(getLogger().warn(`We'll ignore the "${r}" target as it is not allowed. ${t8}.`),!1));if(!s.length)throw Error(`At least one "target" is required for createDeviceWatcher(). ${t8}.`);let l=await checkTargetPermissions({targets:s});if(l.unsupported.length>0&&s.length===l.unsupported.length)throw Error(`The platform doesn't support "${s.join(", ")}" as target/s, which means it's not possible to watch for changes on those devices.`);if(l.supported.every(([r,a])=>!a))throw Error("You must ask the user for permissions before being able to listen for device changes. Try calling getUserMedia() before calling `createDeviceWatcher()`.");let c=[],u=l.supported.reduce((r,[a,s])=>(s?r.push(a):c.push(a),r),[]);if(u.length!==s.length){let r=l.unsupported.length>0?`The platform doesn't support "${l.unsupported.map(([r])=>r).join(", ")}" as target/s, which means it's not possible to watch for changes on those devices. `:"",a=c.length>0?`The user hasn't granted permissions for the following targets: ${c.join(", ")}. `:"";getLogger().warn(`${r}${a}We'll be watching for the following targets instead: "${u.join(", ")}"`)}return getLogger().debug(`Watching these targets: "${u.join(", ")}"`),u},createDeviceWatcher=async(r={})=>{let a=await validateTargets({targets:r.targets}),s=new(X()),l=await enumerateDevices(),c=null==a?void 0:a.reduce((r,a)=>{let s=_getMediaDeviceKindByName(a);return s&&r.push(s),r},[]),u=_filterDevices(l,{excludeDefault:!0,targets:c}),deviceChangeHandler=async()=>{let r=await enumerateDevices(),a=u,l=_filterDevices(r,{excludeDefault:!0,targets:c});u=l;let d=_getDeviceListDiff(a,l),p=d.added.length>0,f=d.removed.length>0,m=d.updated.length>0;(p||f||m)&&s.emit("changed",{changes:d,devices:l}),p&&s.emit("added",{changes:d.added,devices:l}),f&&s.emit("removed",{changes:d.removed,devices:l}),m&&s.emit("updated",{changes:d.updated,devices:l})};return getMediaDevicesApi().addEventListener("devicechange",deviceChangeHandler),s},createMicrophoneDeviceWatcher=()=>createDeviceWatcher({targets:["microphone"]}),createSpeakerDeviceWatcher=()=>createDeviceWatcher({targets:["speaker"]}),createCameraDeviceWatcher=()=>createDeviceWatcher({targets:["camera"]}),isMediaStream=r=>"function"==typeof(null==r?void 0:r.getTracks),getMicrophoneAnalyzerMediaStream=async r=>isMediaStream(r)?r:getUserMedia("string"==typeof r?{audio:{deviceId:r}}:{audio:r}),createAnalyzer=r=>{let a=r.createAnalyser();return a.fftSize=64,a.minDecibels=-90,a.maxDecibels=-10,a.smoothingTimeConstant=.85,a},createMicrophoneAnalyzer=async r=>{let a,s;let l=await getMicrophoneAnalyzerMediaStream(r);if(!l)throw Error("Failed to get the audio stream");let c=new(X()),u=new(window.AudioContext||window.webkitAudioContext),d=createAnalyzer(u);try{u.createMediaStreamSource(l).connect(d)}catch(r){throw Error("No audio track found")}l.getAudioTracks().forEach(r=>{r.addEventListener("ended",()=>{c.emit("destroyed","disconnected")})});let startMetering=()=>{try{let r=new Uint8Array(d.frequencyBinCount);d.getByteFrequencyData(r);let l=r.reduce((r,a)=>r+a,0)/20;s!==l&&(s=l,c.emit("volumeChanged",Math.min(s,100))),a=requestAnimationFrame(startMetering)}catch(r){c.emit("destroyed","error")}};a=requestAnimationFrame(startMetering);let destroy=()=>{a&&cancelAnimationFrame(a),"closed"!==u.state&&u.close().catch(r=>{getLogger().error("Error closing the AudioContext",r)}),isMediaStream(r)||l.getTracks().forEach(r=>r.stop()),c.emit("destroyed",null),c.removeAllListeners()};return new Proxy(c,{get:(r,a,s)=>"destroy"===a?destroy:Reflect.get(r,a,s)})},helpers_getUserMedia=r=>{getLogger().info("RTCService.getUserMedia",r);let{audio:a,video:s}=r;if(a||s)return getUserMedia(r)},getMediaConstraints=async r=>{let{audio:a=!0,micId:s}=r,{micLabel:l=""}=r;if(s){let r=await assureDeviceId(s,l,"microphone").catch(r=>null);r&&("boolean"==typeof a&&(a={}),a.deviceId={exact:r})}let{video:c=!1,camId:u}=r,{camLabel:d=""}=r;if(u){let r=await assureDeviceId(u,d,"camera").catch(r=>null);r&&("boolean"==typeof c&&(c={}),c.deviceId={exact:r})}return{audio:a,video:c}},_isAudioLine=r=>/^m=audio/.test(r),_isVideoLine=r=>/^m=video/.test(r),_getCodecPayloadType=r=>{let a=RegExp("a=rtpmap:(\\d+) \\w+\\/\\d+"),s=r.match(a);return s&&2==s.length?s[1]:null},sdpStereoHack=r=>{let a=r.split("\r\n"),s=a.findIndex(r=>/^a=rtpmap/.test(r)&&/opus\/48000/.test(r));if(s<0)return r;let l=_getCodecPayloadType(a[s]),c=RegExp(`a=fmtp:${l}`),u=a.findIndex(r=>c.test(r));return u>=0?/stereo=1;/.test(a[u])||(a[u]+="; stereo=1; sprop-stereo=1"):a[s]+=`\r a=fmtp:${l} stereo=1; sprop-stereo=1`,a.join("\r\n")},sdpMediaOrderHack=(r,a)=>{let s=a.split("\r\n"),l=s.findIndex(_isAudioLine),c=s.findIndex(_isVideoLine);if(l{let c=r.split("\r\n");return c.forEach((r,u)=>{/^a=fmtp:\d*/.test(r)?c[u]+=`;x-google-max-bitrate=${a};x-google-min-bitrate=${s};x-google-start-bitrate=${l}`:/^a=mid:(1|video)/.test(r)&&(c[u]+=`\r b=AS:${a}`)}),c.join("\r\n")};let RTCPeer=class RTCPeer{constructor(r,a){this.call=r,this.type=a,this.uuid=(0,f.Z)(),this._negotiating=!1,this.options=r.options,this.logger.debug("New Peer with type:",this.type,"Options:",this.options),this._onIce=this._onIce.bind(this)}get logger(){return getLogger()}get localStream(){return this._localStream}set localStream(r){this._localStream=r}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 r=this._getSenderByKind("video");return(null==r?void 0:r.track)||null}get localAudioTrack(){let r=this._getSenderByKind("audio");return(null==r?void 0:r.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:r={}}=this.options,a=Object.assign({bundlePolicy:"max-compat",iceServers:this.call.iceServers,sdpSemantics:"unified-plan"},r);return this.logger.debug("RTC config",a),a}get localSdp(){var r,a;return null===(a=null===(r=this.instance)||void 0===r?void 0:r.localDescription)||void 0===a?void 0:a.sdp}stopTrackSender(r){var a;try{let s=this._getSenderByKind(r);if(!s)return this.logger.info(`There is not a '${r}' sender to stop.`);s.track&&(stopTrack(s.track),null===(a=this._localStream)||void 0===a||a.removeTrack(s.track))}catch(a){this.logger.error("RTCPeer stopTrackSender error",r,a)}}async restoreTrackSender(r){var a;try{let s=this._getSenderByKind(r);if(!s)return this.logger.info(`There is not a '${r}' sender to restore.`);if(s.track&&"ended"!==s.track.readyState)return this.logger.info(`There is already an active ${r} track.`);let l=await getMediaConstraints(this.options),c=await helpers_getUserMedia({[r]:l[r]});if(c&&streamIsValid(c)){let l=c.getTracks().find(a=>a.kind===r);l&&(await s.replaceTrack(l),null===(a=this._localStream)||void 0===a||a.addTrack(l))}}catch(a){this.logger.error("RTCPeer restoreTrackSender error",r,a)}}getDeviceId(r){try{let a=this._getSenderByKind(r);if(!a||!a.track)return null;let{deviceId:s=null}=a.track.getSettings();return s}catch(a){return this.logger.error("RTCPeer getDeviceId error",r,a),null}}getTrackSettings(r){try{let a=this._getSenderByKind(r);if(!a||!a.track)return null;return a.track.getSettings()}catch(a){return this.logger.error("RTCPeer getTrackSettings error",r,a),null}}getDeviceLabel(r){try{let a=this._getSenderByKind(r);if(!a||!a.track)return null;return a.track.label}catch(a){return this.logger.error("RTCPeer getDeviceLabel error",r,a),null}}restartIceWithRelayOnly(){try{let r=this.instance.getConfiguration();if("relay"===r.iceTransportPolicy)return this.logger.warn("RTCPeer already with iceTransportPolicy relay only");let a=Object.assign(Object.assign({},r),{iceTransportPolicy:"relay"});this.instance.setConfiguration(a),this.instance.restartIce()}catch(r){this.logger.error("RTCPeer restartIce error",r)}}async applyMediaConstraints(r,a){try{let s=this._getSenderByKind(r);if(!s||!s.track)return this.logger.info("No sender to apply constraints",r,a);if("live"===s.track.readyState){let l=Object.assign(Object.assign({},s.track.getConstraints()),a),c=this.getDeviceId(r);c&&!this.options.screenShare&&(l.deviceId={exact:c}),this.logger.info(`Apply ${r} constraints`,this.call.id,l),await s.track.applyConstraints(l)}}catch(s){this.logger.error("Error applying constraints",r,a)}}_getSenderByKind(r){return this.instance.getSenders?this.instance.getSenders().find(({track:a})=>a&&a.kind===r):(this.logger.warn("RTCPeerConnection.getSenders() not available."),null)}_getReceiverByKind(r){return this.instance.getReceivers?this.instance.getReceivers().find(({track:a})=>a&&a.kind===r):(this.logger.warn("RTCPeerConnection.getReceivers() not available."),null)}async startNegotiation(r=!1){var a,s;if(this._negotiating)return this.logger.warn("Skip twice onnegotiationneeded!");this._negotiating=!0;try{if((this.options.additionalDevice||this.options.screenShare)&&(null===(s=null===(a=this.instance)||void 0===a?void 0:a.getTransceivers)||void 0===s||s.call(a).forEach(r=>{r.direction="sendonly"})),this.instance.removeEventListener("icecandidate",this._onIce),this.instance.addEventListener("icecandidate",this._onIce),this.isOffer){this.logger.debug("Trying to generate offer");let r={voiceActivityDetection:!1};this._supportsAddTransceiver()||(r.offerToReceiveAudio=this.options.negotiateAudio,r.offerToReceiveVideo=this.options.negotiateVideo);let a=await this.instance.createOffer(r);await this._setLocalDescription(a)}if(this.isAnswer){this.logger.debug("Trying to generate answer"),await this._setRemoteDescription({sdp:this.options.remoteSdp,type:"offer"});let r=await this.instance.createAnswer({voiceActivityDetection:!1});await this._setLocalDescription(r)}r&&this._sdpReady()}catch(r){this.logger.error(`Error creating ${this.type}:`,r)}}onRemoteBye({code:r,message:a}){this._rejectStartMethod({code:r,message:a}),this.stop()}async onRemoteSdp(r){try{let a=this.isOffer?"answer":"offer";await this._setRemoteDescription({sdp:r,type:a}),this.isOffer&&this._resolveStartMethod()}catch(r){this.logger.error(`Error handling remote SDP on call ${this.call.id}:`,r),this.call.hangup(),this._rejectStartMethod(r)}}_setupRTCPeerConnection(){this.instance||(this.instance=RTCPeerConnection(this.config),this._attachListeners())}async start(){return new Promise(async(r,a)=>{this._resolveStartMethod=r,this._rejectStartMethod=a;try{this._localStream=await this._retrieveLocalStream()}catch(r){return this._rejectStartMethod(r),this.call.setState("hangup")}this._setupRTCPeerConnection();let s=!1;if(this._localStream&&streamIsValid(this._localStream)){let r=this._localStream.getAudioTracks();this.logger.debug("Local audio tracks: ",r);let a=this._localStream.getVideoTracks();if(this.logger.debug("Local video tracks: ",a),s=!!(r.length||a.length),this.isOffer&&"function"==typeof this.instance.addTransceiver){let s={direction:this.options.negotiateAudio?"sendrecv":"sendonly",streams:[this._localStream]};this.logger.debug("Applying audioTransceiverParams",s),r.forEach(r=>{this.instance.addTransceiver(r,s)});let l={direction:this.options.negotiateVideo?"sendrecv":"sendonly",streams:[this._localStream]};if(this.isSimulcast&&(l.sendEncodings=["0","1","2"].map(r=>({active:!0,rid:r,scaleResolutionDownBy:6*Number(r)||1}))),this.logger.debug("Applying videoTransceiverParams",l),a.forEach(r=>{this.instance.addTransceiver(r,l)}),this.isSfu){let{msStreamsNumber:r=5}=this.options;this.logger.debug("Add ",r,"recvonly MS Streams"),l.direction="recvonly";for(let a=0;athis.instance.addTrack(r,s)),a.forEach(r=>this.instance.addTrack(r,s))}else this.instance.addStream(this._localStream)}this.isOffer?(this.options.negotiateAudio&&this._checkMediaToNegotiate("audio"),this.options.negotiateVideo&&this._checkMediaToNegotiate("video"),this._supportsAddTransceiver()||s||this.startNegotiation()):this.startNegotiation()})}detachAndStop(){var r;"function"==typeof(null===(r=this.instance)||void 0===r?void 0:r.getTransceivers)&&this.instance.getTransceivers().forEach(r=>{r.sender.track&&r.sender.track.stop(),r.receiver.track&&r.receiver.track.stop()}),this.stop()}stop(){var r,a,s;null===(r=this._localStream)||void 0===r||r.getTracks().forEach(r=>r.stop()),null===(a=this._remoteStream)||void 0===a||a.getTracks().forEach(r=>r.stop()),null===(s=this.instance)||void 0===s||s.close()}_supportsAddTransceiver(){return"function"==typeof this.instance.addTransceiver}_checkMediaToNegotiate(r){let a=this._getSenderByKind(r);if(!a&&this._supportsAddTransceiver()){let a=this.instance.addTransceiver(r,{direction:"recvonly"});this.logger.debug("Add transceiver",r,a)}}async _sdpReady(){if(clearTimeout(this._iceTimeout),this._iceTimeout=null,!this.instance.localDescription)return;let{sdp:r}=this.instance.localDescription;if(-1===r.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(r){this._rejectStartMethod(r)}}_onIce(r){this._iceTimeout||(this._iceTimeout=setTimeout(()=>this._sdpReady(),this.options.iceGatheringTimeout)),r.candidate?(this.logger.debug("IceCandidate:",r.candidate),this.call.emit("icecandidate",r)):this._sdpReady()}_setLocalDescription(r){let{useStereo:a,googleMaxBitrate:s,googleMinBitrate:l,googleStartBitrate:c}=this.options;return r.sdp&&a&&(r.sdp=sdpStereoHack(r.sdp)),r.sdp&&s&&l&&c&&(r.sdp=sdpBitrateHack(r.sdp,s,l,c)),this.instance.setLocalDescription(r)}_setRemoteDescription(r){r.sdp&&this.options.useStereo&&(r.sdp=sdpStereoHack(r.sdp)),r.sdp&&this.instance.localDescription&&(r.sdp=sdpMediaOrderHack(r.sdp,this.instance.localDescription.sdp));let a=sdpToJsonHack(r);return this.logger.debug("REMOTE SDP \n",`Type: ${r.type}`,"\n\n",r.sdp),this.instance.setRemoteDescription(a)}async _retrieveLocalStream(){if(streamIsValid(this.options.localStream))return this.options.localStream;let r=await getMediaConstraints(this.options);return helpers_getUserMedia(r)}_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",r=>{this.call.emit("track",r),this.isSfu,this._remoteStream=r.streams[0]}),this.instance.addEventListener("addstream",r=>{r.stream&&(this._remoteStream=r.stream)})}};var t6=s(97582);let vertoEventWorker=function*(r){getLogger().debug("vertoEventWorker started");let{channels:a,instance:s,initialState:l}=r,{swEventChannel:c}=a,{rtcPeerId:u}=l;if(!u)throw Error("Missing rtcPeerId for roomSubscribedWorker");for(;;){let r=yield take(c,r=>{var a;return"webrtc.message"===r.type&&(null===(a=r.payload.params)||void 0===a?void 0:a.callID)===u}),{id:a,method:l,params:d={}}=r.payload,{callID:p,nodeId:f}=d,m=s.getRTCPeerById(p);if(!m){getLogger().warn(`RTCPeer '${p}' not found for method: '${l}'`,d);continue}let b=s.peer;switch(l){case"verto.media":case"verto.answer":if(m.uuid===(null==b?void 0:b.uuid)){let r="verto.media"===l?"early":"active";s.setState(r)}(null==d?void 0:d.sdp)&&m.onRemoteSdp(d.sdp),yield put(eE.executeAction({method:"video.message",params:{message:VertoResult(a,l),node_id:f}}));break;case"verto.bye":yield call(s.onVertoBye,{rtcPeerId:p,byeCause:null==d?void 0:d.cause,byeCauseCode:null==d?void 0:d.causeCode,redirectDestination:null==d?void 0:d.redirectDestination}),yield put(eE.executeAction({method:"video.message",params:{message:VertoResult(a,l),node_id:f}}));break;case"verto.ping":{let{nodeId:r}=d,a=(0,t6._T)(d,["nodeId"]);yield put(eE.executeAction({method:"video.message",params:{message:ek(a),node_id:r}}));break}case"verto.mediaParams":{if(!p||!d.mediaParams){getLogger().warn("Invalid mediaParams event",d);break}let{audio:r,video:a}=d.mediaParams;m&&a&&m.applyMediaConstraints("video",a),m&&r&&m.applyMediaConstraints("audio",r);break}default:return getLogger().warn(`Unknown Verto method: ${l}`,d)}}getLogger().trace("vertoEventWorker ended")},roomSubscribedWorker=function*(r){getLogger().debug("roomSubscribedWorker started");let{channels:a,instance:s,initialState:l}=r,{swEventChannel:c,pubSubChannel:u}=a,{rtcPeerId:d}=l;if(!d)throw Error("Missing rtcPeerId for roomSubscribedWorker");let p=yield take(c,r=>"video.room.subscribed"===r.type&&r.payload.call_id===d);s._attachListeners(p.payload.room_session.id),s.applyEmitterTransforms(),s.setActiveRTCPeer(d),yield put(eK.upsert({id:p.payload.call_id,roomId:p.payload.room_session.room_id,roomSessionId:p.payload.room_session.id,memberId:p.payload.member_id,previewUrl:p.payload.room_session.preview_url})),yield put(u,{type:"video.room.joined",payload:p.payload}),getLogger().debug("roomSubscribedWorker ended",d)},promoteDemoteWorker=function*(r){getLogger().debug("promoteDemoteWorker started");let{channels:a,instance:s,initialState:l}=r,{swEventChannel:c}=a,{rtcPeerId:u}=l;if(!u)throw Error("Missing rtcPeerId for promoteDemoteWorker");let d=yield take(c,r=>("video.member.promoted"===r.type||"video.member.demoted"===r.type)&&r.payload.member_id===s.memberId);getLogger().debug("promoteDemoteWorker:",d.type,d.payload),yield put(eU.updateAuthState(d.payload.authorization));let p=yield io_c3792963_select(t2.getAuthState);if(!p)throw Error(`Invalid authState for '${d.type}'`);let{audio_allowed:f,video_allowed:m}=p;switch(d.type){case"video.member.promoted":s.updateMediaOptions({audio:"both"===f,video:"both"===m,negotiateAudio:"none"!==f,negotiateVideo:"none"!==m});break;case"video.member.demoted":s.updateMediaOptions({audio:!1,video:!1,negotiateAudio:"none"!==f,negotiateVideo:"none"!==m})}s._triggerNewRTCPeer(),getLogger().debug("promoteDemoteWorker ended",u)},t9={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},re=Object.assign(Object.assign({},t9),{noiseSuppression:!1,autoGainControl:!1,googAutoGainControl:!1}),rt={width:{ideal:1280,min:320},height:{ideal:720,min:180},aspectRatio:{ideal:16/9}},rr={destinationNumber:"room",remoteCallerName:"Outbound Call",remoteCallerNumber:"",callerName:"",callerNumber:"",audio:t9,video:rt,useStereo:!1,attach:!1,screenShare:!1,additionalDevice:!1,userVariables:{},requestTimeout:1e4,autoApplyMediaParams:!0,iceGatheringTimeout:2e3};let BaseConnection=class BaseConnection extends e5{constructor(r){super(r),this.gotEarly=!1,this.doReinvite=!1,this._eventsPrefix="video",this.state="new",this.prevState="new",this.rtcPeerMap=new Map,this.onVertoBye=r=>{let{rtcPeerId:a,byeCause:s="NORMAL_CLEARING",byeCauseCode:l="16",redirectDestination:c}=r;this.cause=String(s),this.causeCode=String(l);let u=this.getRTCPeerById(a);if(!u)return this.logger.warn("Invalid RTCPeer to hangup",r);if(c&&u.localSdp){this.logger.debug("Redirect Destination to:",c,"for RTCPeer:",u.uuid),this.executeInvite(u.localSdp,u.uuid,c);return}u.onRemoteBye({code:this.causeCode,message:this.cause}),this.activeRTCPeerId===(null==u?void 0:u.uuid)&&this.setState("hangup")},this.options=Object.assign(Object.assign({},rr),r),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 r;return(null===(r=this.peer)||void 0===r?void 0:r.uuid)||""}get localStream(){var r;return null===(r=this.peer)||void 0===r?void 0:r.localStream}set localStream(r){this.peer&&(this.peer.localStream=r)}get remoteStream(){var r;return null===(r=this.peer)||void 0===r?void 0:r.remoteStream}get iceServers(){var r,a;return null!==(a=null===(r=this.options)||void 0===r?void 0:r.iceServers)&&void 0!==a?a:this.select(t2.getIceServers)}get component(){return this.select(r=>e1.getComponent(r,this.callId))||{}}dialogParams(r){let{destinationNumber:a,attach:s,callerName:l,callerNumber:c,remoteCallerName:u,remoteCallerNumber:d,userVariables:p,screenShare:f,additionalDevice:m,pingSupported:b=!0}=this.options;return{dialogParams:{id:r,destinationNumber:a,attach:s,callerName:l,callerNumber:c,remoteCallerName:u,remoteCallerNumber:d,userVariables:p,screenShare:f,additionalDevice:m,pingSupported:b,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 r;return!!(null===(r=this.peer)||void 0===r?void 0:r.hasAudioReceiver)}get withVideo(){var r;return!!(null===(r=this.peer)||void 0===r?void 0:r.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(r){if(!r){this.logger.warn("Invalid RTCPeer",r);return}if(this.logger.debug("Set RTCPeer",r.uuid,r),this.rtcPeerMap.set(r.uuid,r),this.peer&&this.callId!==r.uuid){let r=this.peer.uuid;this.logger.debug(">>> Stop old RTCPeer",r),this.peer.detachAndStop()}this.logger.debug(">>> Replace RTCPeer with",r.uuid),this.activeRTCPeerId=r.uuid}getRTCPeerById(r){let a=this.rtcPeerMap.get(r);return a}appendRTCPeer(r){return this.rtcPeerMap.set(r.uuid,r)}setActiveRTCPeer(r){this.peer=this.getRTCPeerById(r)}vertoExecute(r){return this.execute({method:"video.message",params:r})}async _triggerNewRTCPeer(){this.logger.debug("_triggerNewRTCPeer Start");try{this.logger.debug("Build a new RTCPeer");let r=new RTCPeer(this,"offer");this.appendRTCPeer(r),this.logger.debug("Run workers for the new RTCPeer",r.uuid),this.runRTCPeerWorkers(r.uuid),this.logger.debug("Trigger start for the new RTCPeer!"),await r.start()}catch(r){this.logger.error("Error building new RTCPeer to promote/demote",r)}}updateCamera(r){return this.updateConstraints({video:Object.assign({aspectRatio:16/9},r)})}updateMicrophone(r){return this.updateConstraints({audio:r})}manageSendersWithConstraints(r){return!1===r.audio&&(this.logger.info("Switching off the microphone"),this.stopOutboundAudio()),!1===r.video&&(this.logger.info("Switching off the camera"),this.stopOutboundVideo()),r.audio||r.video}updateConstraints(r,{attempt:a=0}={}){return a>1?Promise.reject(Error("Failed to update constraints")):new Promise(async(s,l)=>{var c;try{let u;if(!this.peer)return l(Error("Invalid RTCPeerConnection."));if(!Object.keys(r).length)return l(Error("Invalid audio/video constraints."));this.logger.debug("updateConstraints trying constraints",this.__uuid,r);let d=this.manageSendersWithConstraints(r);if(!d){this.logger.debug("Either `video` and `audio` (or both) constraints were set to `false` so their corresponding senders (if any) were stopped");return}try{u=await getUserMedia(r)}catch(u){if(u instanceof DOMException&&"Concurrent mic process limit."===u.message){let l={};null===(c=this.localStream)||void 0===c||c.getTracks().forEach(a=>{var s;l[a.kind]=a.getConstraints(),void 0!==r[a.kind]&&(this.logger.debug("updateConstraints stop old tracks to retrieve new ones"),stopTrack(a),null===(s=this.localStream)||void 0===s||s.removeTrack(a))});try{return s(this.updateConstraints(r,{attempt:a+1}))}catch(r){return this.logger.error("Restoring previous constraints"),s(this.updateConstraints(l,{attempt:a+1}))}}return this.logger.error("updateConstraints",u),l(u)}this.logger.debug("updateConstraints got stream",u),this.localStream||(this.localStream=new MediaStream);let{instance:p}=this.peer,f=u.getTracks();this.logger.debug(`updateConstraints got ${f.length} tracks`);for(let r=0;rs.track&&s.track.kind===a.kind?(this.logger.debug("Found transceiver by sender"),!0):l.track&&l.track.kind===a.kind?(this.logger.debug("Found transceiver by receiver"),!0):null===r&&(this.logger.debug("Found disassociated transceiver"),!0));s&&s.sender?(this.logger.debug("updateConstraints got transceiver",s.currentDirection,s.mid),await s.sender.replaceTrack(a),this.logger.debug("updateConstraints replaceTrack"),s.direction="sendrecv",this.logger.debug("updateConstraints set to sendrecv"),this.localStream.getTracks().forEach(r=>{var s;r.kind===a.kind&&r.id!==a.id&&(this.logger.debug("updateConstraints stop old track and apply new one - "),stopTrack(r),null===(s=this.localStream)||void 0===s||s.removeTrack(r))}),this.localStream.addTrack(a)):(this.logger.debug("updateConstraints no transceiver found. addTrack and start dancing!"),this.peer.type="offer",this.doReinvite=!0,this.localStream.addTrack(a),p.addTrack(a,this.localStream)),this.logger.debug("updateConstraints simply update mic/cam"),"audio"===a.kind?this.options.micId=a.getSettings().deviceId:"video"===a.kind&&(this.options.camId=a.getSettings().deviceId)}this.logger.debug("updateConstraints done"),s()}catch(r){this.logger.error("updateConstraints",r),l(r)}})}runRTCPeerWorkers(r){this.runWorker("vertoEventWorker",{worker:vertoEventWorker,initialState:{rtcPeerId:r}});let a=!(this.options.additionalDevice||this.options.screenShare);a&&(this.runWorker("roomSubscribedWorker",{worker:roomSubscribedWorker,initialState:{rtcPeerId:r}}),this.runWorker("promoteDemoteWorker",{worker:promoteDemoteWorker,initialState:{rtcPeerId:r}}))}invite(){return new Promise(async(r,a)=>{this.direction="outbound",this.peer=new RTCPeer(this,"offer");try{this.runRTCPeerWorkers(this.peer.uuid),await this.peer.start(),r(this)}catch(r){this.logger.error("Invite error",r),a(r)}})}answer(){return new Promise(async(r,a)=>{this.direction="inbound",this.peer=new RTCPeer(this,"answer");try{await this.peer.start(),r(this)}catch(r){this.logger.error("Answer error",r),a(r)}})}onLocalSDPReady(r){if(!r.instance.localDescription)throw this.logger.error("Missing localDescription",r),Error("Invalid RTCPeerConnection localDescription");let{type:a,sdp:s}=r.instance.localDescription,l=this._mungeSDP(s);switch(this.logger.debug("LOCAL SDP \n",`Type: ${a}`,"\n\n",l),a){case"offer":if(r.instance.remoteDescription)return this.executeUpdateMedia(l,r.uuid);return this.executeInvite(l,r.uuid);case"answer":this.logger.warn("Unhandled verto.answer");break;default:return this.logger.error(`Unknown SDP type: '${a}' on call ${this.id}`)}}async executeInvite(r,a,s){let l=this.getRTCPeerById(a);if(!l||l.instance.remoteDescription)throw Error(`RTCPeer '${a}' already has a remoteDescription. Invalid invite.`);"new"===this.state&&this.setState("requesting");try{let l=this.options.screenShare?{layout:this.options.layout,positions:this.options.positions}:{},c=ev(Object.assign(Object.assign(Object.assign({},this.dialogParams(a)),l),{sdp:r})),u=[];u=this.options.screenShare?["video.room.screenshare"]:this.options.additionalDevice?["video.room.additionaldevice"]:this.getSubscriptions();let d=await this.vertoExecute({message:c,node_id:s,subscribe:u});this.logger.debug("Invite response",d)}catch(r){throw this.setState("hangup"),r.jsonrpc}}async executeUpdateMedia(r,a){try{let s=ew(Object.assign(Object.assign({},this.dialogParams(a)),{sdp:r,action:"updateMedia"})),l=await this.vertoExecute({message:s});if(l.sdp||this.logger.error("UpdateMedia invalid SDP answer",l),this.logger.debug("UpdateMedia response",l),!this.peer)return this.logger.error("Invalid RTCPeer to updateMedia");await this.peer.onRemoteSdp(l.sdp)}catch(r){throw this.logger.error("UpdateMedia error",r),r.jsonrpc}}async hangup(r){let a=null!=r?r:this.callId;if(!a)throw Error("Invalid RTCPeer ID to hangup");try{let r=eS(this.dialogParams(a));await this.vertoExecute({message:r})}catch(r){this.logger.error("Hangup error:",r)}finally{if(a!==this.callId)return this.logger.warn("Prevent setState hangup",a,this.callId);this.setState("hangup")}}dtmf(r){let a=this.callId;if(!a)throw Error("Invalid RTCPeer ID to send DTMF");let s=eO(Object.assign(Object.assign({},this.dialogParams(a)),{dtmf:r}));this.vertoExecute({message:s})}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(r){switch(this.prevState=this.state,this.state=r,this.logger.trace(`Call ${this.id} state change from ${this.prevState} to ${this.state}`),this.emit(this.state,this),r){case"purge":case"destroy":this._finalize();break;case"hangup":this.setState("destroy")}}updateMediaOptions(r){this.logger.debug("updateMediaOptions",Object.assign({},r)),this.options=Object.assign(Object.assign({},this.options),r),this._checkDefaultMediaConstraints()}_mungeSDP(r){return r}_checkDefaultMediaConstraints(){!0===this.options.video&&(this.options.video=rt),!0===this.options.audio&&(this.options.audio=this.options.screenShare?re:t9)}_finalize(){this.rtcPeerMap.forEach(r=>{r.stop()}),this.rtcPeerMap.clear(),this.destroy()}};function e(r){this.message=r}e.prototype=Error(),e.prototype.name="InvalidCharacterError";var rn="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var a=String(r).replace(/=+$/,"");if(a.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,l,c=0,u=0,d="";l=a.charAt(u++);~l&&(s=c%4?64*s+l:l,c++%4)&&(d+=String.fromCharCode(255&s>>(-2*c&6))))l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(l);return d};function t(r){var a,s=r.replace(/-/g,"+").replace(/_/g,"/");switch(s.length%4){case 0:break;case 2:s+="==";break;case 3:s+="=";break;default:throw"Illegal base64url string!"}try{return a=s,decodeURIComponent(rn(a).replace(/(.)/g,function(r,a){var s=a.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}catch(r){return rn(s)}}function n(r){this.message=r}function o(r,a){if("string"!=typeof r)throw new n("Invalid token specified");var s=!0===(a=a||{}).header?0:1;try{return JSON.parse(t(r.split(".")[s]))}catch(r){throw new n("Invalid token specified: "+r.message)}}n.prototype=Error(),n.prototype.name="InvalidTokenError";var ro=o,ri=Object.defineProperty,ra=Object.defineProperties,rs=Object.getOwnPropertyDescriptors,rl=Object.getOwnPropertySymbols,rc=Object.prototype.hasOwnProperty,ru=Object.prototype.propertyIsEnumerable,index_esm_defNormalProp=(r,a,s)=>a in r?ri(r,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[a]=s,index_esm_spreadValues=(r,a)=>{for(var s in a||(a={}))rc.call(a,s)&&index_esm_defNormalProp(r,s,a[s]);if(rl)for(var s of rl(a))ru.call(a,s)&&index_esm_defNormalProp(r,s,a[s]);return r},index_esm_spreadProps=(r,a)=>ra(r,rs(a)),index_esm_objRest=(r,a)=>{var s={};for(var l in r)rc.call(r,l)&&0>a.indexOf(l)&&(s[l]=r[l]);if(null!=r&&rl)for(var l of rl(r))0>a.indexOf(l)&&ru.call(r,l)&&(s[l]=r[l]);return s},index_esm_export=(r,a)=>{for(var s in a)ri(r,s,{get:a[s],enumerable:!0})},index_esm_publicField=(r,a,s)=>(index_esm_defNormalProp(r,"symbol"!=typeof a?a+"":a,s),s),rd={};index_esm_export(rd,{ChatMember:()=>rP,ChatMessage:()=>rx,Client:()=>Client2}),Object.keys(e7).map(r=>`member.updated.${r}`);var addSDKPrefix=r=>`sw-sdk-${r}`,buildVideo=()=>{let r=document.createElement("video");return r.muted=!0,r.autoplay=!0,r.playsInline=!0,r.addEventListener("pause",()=>{r.play().catch(a=>{getLogger().error("Video Element Paused",r,a)})}),r},waitForVideoReady=({element:r})=>new Promise(a=>{r.addEventListener("canplay",function listener(){r.removeEventListener("canplay",listener),a()}),r.addEventListener("resize",function listener(){r.removeEventListener("resize",listener),a()})}),_getLocationStyles=({x:r,y:a,width:s,height:l})=>({top:`${a}%`,left:`${r}%`,width:`${s}%`,height:`${l}%`}),_buildLayer=({location:r})=>{let{top:a,left:s,width:l,height:c}=_getLocationStyles(r),u=document.createElement("div");return u.style.position="absolute",u.style.overflow="hidden",u.style.top=a,u.style.left=s,u.style.width=l,u.style.height=c,u},makeLayoutChangedHandler=({localOverlay:r,rootElement:a})=>async({layout:s,myMemberId:l,localStream:c})=>{getLogger().debug("Process layout.changed");try{let{layers:u=[]}=s,d=u.find(({member_id:r})=>r===l),p=r.domElement;if(r.status=d?"visible":"hidden",!d){getLogger().debug("Location not found"),p&&(getLogger().debug("Current layer not visible"),r.hide());return}if(!p){getLogger().debug("Build myLayer"),(p=_buildLayer({location:d})).id=r.id;let s=buildVideo();s.srcObject=c,s.disablePictureInPicture=!0,s.style.width="100%",s.style.height="100%",s.style.pointerEvents="none",p.appendChild(s);let l=a.querySelector(".mcuLayers"),u=null==l?void 0:l.querySelector(`#${p.id}`);l&&!u&&(l.appendChild(p),r.domElement=p);return}let{top:f,left:m,width:b,height:g}=_getLocationStyles(d);getLogger().debug("Update myLayer:",f,m,b,g);let y=c.getVideoTracks().filter(r=>r.enabled&&"live"===r.readyState).length>0;y&&r.setLocalOverlayMediaStream(c),p.style.opacity=y?"1":"0",p.style.top=f,p.style.left=m,p.style.width=b,p.style.height=g}catch(r){getLogger().error("Layout Changed Error",r)}},cleanupElement=r=>{for(;r.firstChild;)r.removeChild(r.firstChild)},setVideoMediaTrack=({track:r,element:a})=>{a.srcObject=new MediaStream([r]),r.addEventListener("ended",()=>{a.srcObject=null,a.remove()})},createRootElementResizeObserver=({video:r,rootElement:a,paddingWrapper:s})=>{let computePaddingWrapperWidth=(a,s)=>{let l=r.videoWidth/r.videoHeight;return l>a/s?"100%":`${s*l}px`},l=r.videoHeight/r.videoWidth*100,c=index_esm_debounce(({width:r,height:a})=>{if(s){let c=a/r*100;s.style.paddingBottom=`${c>l?l:c}%`,s.style.width=computePaddingWrapperWidth(r,a)}},100),u=new ResizeObserver(r=>{r.forEach(r=>{if(r.contentBoxSize){let{inlineSize:a,blockSize:s}=Array.isArray(r.contentBoxSize)?r.contentBoxSize[0]:r.contentBoxSize;c({width:a,height:s})}else r.contentRect&&c({width:r.contentRect.width,height:r.contentRect.height})})});return{start:()=>u.observe(a),stop:()=>u.disconnect()}},setAudioMediaTrack=({track:r,element:a})=>(a.autoplay=!0,a.playsinline=!0,a.srcObject=new MediaStream([r]),r.addEventListener("ended",()=>{a.srcObject=null,a.remove()}),a),rp=eE.createAction("swJs/audioSetSpeakerAction"),makeVideoElementSaga=({rootElement:r,applyLocalVideoOverlay:a})=>function*({instance:s,runSaga:l}){try{let c;let u=new Map,d=buildVideo(),p={status:"hidden",get id(){return addSDKPrefix(s.id)},get domElement(){return u.get(this.id)},set domElement(element){element?(getLogger().debug("Set localOverlay",element),u.set(this.id,element)):(getLogger().debug("Remove localOverlay"),u.delete(this.id))},hide(){if(!this.domElement)return getLogger().warn("Missing localOverlay to hide");this.domElement.style.opacity="0"},show(){return this.domElement?"hidden"===this.status?getLogger().info("localOverlay not visible"):void(this.domElement.style.opacity="1"):getLogger().warn("Missing localOverlay to show")},setLocalOverlayMediaStream(r){if(!this.domElement)return getLogger().warn("Missing localOverlay to set the local overlay stream");let a=this.domElement.querySelector("video");a&&(a.srcObject=r)}},f=makeLayoutChangedHandler({rootElement:r,localOverlay:p});s.on("layout.changed",r=>{var a;getLogger().debug("Received layout.changed"),(null==(a=s.peer)?void 0:a.hasVideoSender)&&s.localStream?f({layout:r.layout,localStream:s.localStream,myMemberId:s.memberId}):p.hide()}),s.on("room.subscribed",r=>{var a;let l=null==(a=r.room_session.members)?void 0:a.find(r=>r.id===s.memberId);if(null==l?void 0:l.audio_muted)try{s.stopOutboundAudio()}catch(r){getLogger().error("Error handling audio_muted",r)}if(null==l?void 0:l.video_muted)try{s.stopOutboundVideo()}catch(r){getLogger().error("Error handling video_muted",r)}s.localStream&&p.setLocalOverlayMediaStream(s.localStream)}),s.on("member.updated.video_muted",r=>{try{let{member:a}=r;a.id===s.memberId&&"video_muted"in a&&(a.video_muted?p.hide():p.show())}catch(r){getLogger().error("Error handling video_muted",r)}}),s.on("track",function(s){"video"===s.track.kind&&(c=l(videoElementSetupWorker,{applyLocalVideoOverlay:a,rootElement:r,track:s.track,element:d}))}),s.once("destroy",()=>{cleanupElement(r),u.clear(),null==c||c.cancel()})}catch(r){getLogger().error("videoElementSaga",r)}},makeAudioElementSaga=({speakerId:r})=>function*({instance:a,runSaga:s}){if("undefined"==typeof Audio){getLogger().warn("`Audio` is not supported on this environment.");return}try{let l;let c=new Audio;a.on("track",function(u){"audio"===u.track.kind&&(l=s(audioElementSetupWorker,{track:u.track,element:c,speakerId:r,room:a}))}),a.once("destroy",()=>{null==l||l.cancel()})}catch(r){getLogger().error("audioElementSaga",r)}};function*audioElementActionsWatcher({element:r,room:a}){let s=eE.getCustomSagaActionType(a.__uuid,rp);for(;;){let l=yield take([s]);try{if(l.type===s){let s=yield call(setMediaElementSinkId,r,l.payload);a.settleCustomSagaTrigger({dispatchId:l.dispatchId,payload:s,kind:"resolve"})}}catch(r){a.settleCustomSagaTrigger({dispatchId:l.dispatchId,payload:r,kind:"reject"}),getLogger().error(r)}}}function*audioElementSetupWorker({track:r,element:a,speakerId:s,room:l}){setAudioMediaTrack({track:r,element:a}),s&&setMediaElementSinkId(a,s).catch(()=>{}),yield fork(audioElementActionsWatcher,{element:a,room:l})}function*videoElementSetupWorker({rootElement:r,applyLocalVideoOverlay:a=!0,track:s,element:l}){try{if(setVideoMediaTrack({element:l,track:s}),l.style.width="100%",l.style.maxHeight="100%",!a){r.appendChild(l);return}if(r.querySelector(".mcuContent")){getLogger().debug("MCU Content already there");return}let c=document.createElement("div");c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.right="0",c.style.bottom="0",c.appendChild(l);let u=document.createElement("div");u.classList.add("paddingWrapper"),u.style.paddingBottom="56.25%",u.style.position="relative",u.style.width="100%",u.appendChild(c);let d=document.createElement("div");d.classList.add("mcuLayers"),d.style.display="none",u.appendChild(d);let p=document.createElement("div");p.classList.add("mcuContent"),p.style.position="relative",p.style.width="100%",p.style.height="100%",p.style.margin="0 auto",p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",p.appendChild(u),r.style.width="100%",r.style.height="100%",r.appendChild(p),l.readyState===HTMLMediaElement.HAVE_NOTHING&&(getLogger().debug("Wait for the MCU to be ready"),yield call(waitForVideoReady,{element:l}));let f=createRootElementResizeObserver({rootElement:r,video:l,paddingWrapper:u});f.start(),s.addEventListener("ended",()=>{f&&f.stop()}),d.style.display="block"}catch(r){getLogger().error("Handle video track error",r)}}var rf={errors:"onError",responses:"onSuccess"},rh={echoCancellation:!0,noiseSuppression:!1,autoGainControl:!1,googAutoGainControl:!1},rm=extendComponent(class extends BaseConnection{join(){return super.invite()}leave(){return super.hangup()}},{audioMute:e6.audioMuteMember,audioUnmute:e6.audioUnmuteMember,videoMute:e6.videoMuteMember,videoUnmute:e6.videoUnmuteMember,setMicrophoneVolume:e6.setInputVolumeMember,setInputVolume:e6.setInputVolumeMember,setInputSensitivity:e6.setInputSensitivityMember}),rb=extendComponent(class extends BaseConnection{join(){return super.invite()}leave(){return super.hangup()}},{audioMute:e6.audioMuteMember,audioUnmute:e6.audioUnmuteMember,videoMute:e6.videoMuteMember,videoUnmute:e6.videoUnmuteMember,setInputVolume:e6.setInputVolumeMember,setMicrophoneVolume:e6.setInputVolumeMember,setInputSensitivity:e6.setInputSensitivityMember}),index_esm_noop=()=>{},rg="video.memberList.updated",ry=toInternalEventName({event:rg}),r_=(r=>{let a=r.split("."),s=a[0];return r.split(".").reduce((r,a)=>(r.push(a),a===s&&r.push(en),r),[]).join(".")})(ry),rv=["video.room.joined","video.member.joined","video.member.left","video.member.updated"],isMemberListEvent=r=>rv.includes(r),getMemberListEventsToSubscribe=r=>validateEventsToSubscribe(rv).filter(a=>!r.includes(a)),shouldHandleMemberList=r=>r.some(r=>r.includes(ry)),getMembersFromAction=r=>"video.room.joined"===r.type?r.payload.room_session.members:[r.payload.member],getUpdatedMembers=({action:r,memberList:a})=>{let s=getMembersFromAction(r);return"video.member.left"===r.type?s.forEach(r=>{a.delete(r.id)}):s.forEach(r=>{a.set(r.id,r)}),Array.from(a.values())},initMemberListSubscriptions=(r,a)=>{let s=getMemberListEventsToSubscribe(a);s.forEach(a=>{r.once(a,index_esm_noop)});let eventBridgeHandler=({members:a})=>{r.emit(rg,{members:a})};return r.on(r_,eventBridgeHandler),{cleanup:()=>{r.off(r_,eventBridgeHandler)}}};function*membersListUpdatedWatcher({pubSubChannel:r}){let a=new Map;function*worker(s){let l="video.room.joined"===s.type?s.payload.room_session.id:s.payload.room_session_id,c=getUpdatedMembers({action:s,memberList:a});yield put(r,{type:r_,payload:{room_session_id:l,members:c}})}for(;;){let a=yield take(r,({type:r})=>isMemberListEvent(r));yield fork(worker,a)}}var memberListUpdatedWorker=function*({channels:{pubSubChannel:r},instance:a}){let s=a.getSubscriptions();if(!shouldHandleMemberList(s))return;let{cleanup:l}=initMemberListSubscriptions(a,s);yield fork(membersListUpdatedWatcher,{pubSubChannel:r}),a.once("destroy",()=>{l()})},index_esm_memberPositionWorker=function*(r){if(!r.initialState)throw Error("[memberPositionWorker] Missing initialState");yield fork(tY.memberPositionWorker,r)},childMemberJoinedWorker=function*(r){getLogger().trace("childMemberJoinedWorker started");let{channels:a,instance:s,initialState:l}=r,{swEventChannel:c}=a,{parentId:u}=l;if(!u)throw Error("Missing parentId for childMemberJoinedWorker");let d=yield take(c,r=>"video.member.joined"===r.type&&r.payload.member.parent_id===u),{member:p}=d.payload;if(null==p?void 0:p.parent_id){s._attachListeners(p.id),s.applyEmitterTransforms();let r=yield io_c3792963_select(e1.getComponent,p.parent_id);r&&(yield put(eK.upsert({id:s.callId,roomId:d.payload.room_id,roomSessionId:d.payload.room_session_id,memberId:p.id})))}getLogger().trace("childMemberJoinedWorker ended")},rS=extendComponent(class extends BaseConnection{constructor(){super(...arguments),index_esm_publicField(this,"_screenShareList",new Set),index_esm_publicField(this,"_deviceList",new Set)}get screenShareList(){return Array.from(this._screenShareList)}get deviceList(){return Array.from(this._deviceList)}get interactivityMode(){return this.select(({session:r})=>{var a;let{authState:s}=r;return null!=(a=null==s?void 0:s.join_as)?a:""})}get permissions(){return this.select(({session:r})=>{var a,s;let{authState:l}=r;return null!=(s=null==(a=null==l?void 0:l.room)?void 0:a.scopes)?s:[]})}getEmitterTransforms(){return new Map([[["video.room.joined"],{type:"roomSession",instanceFactory:()=>({}),payloadTransform:r=>r,nestedFieldsToProcess:{recordings:{eventTransformType:"roomSessionRecording",processInstancePayload:r=>({recording:r})},playbacks:{eventTransformType:"roomSessionPlayback",processInstancePayload:r=>({playback:r})},streams:{eventTransformType:"roomSessionStream",processInstancePayload:r=>({stream:r})}}}],[[toLocalEvent("video.recording.list")],{type:"roomSessionRecordingList",instanceFactory:r=>({}),payloadTransform:r=>r,nestedFieldsToProcess:{recordings:{eventTransformType:"roomSessionRecording",processInstancePayload:r=>({recording:r})}}}],[[toLocalEvent("video.playback.list")],{type:"roomSessionPlaybackList",instanceFactory:r=>({}),payloadTransform:r=>r,nestedFieldsToProcess:{playbacks:{eventTransformType:"roomSessionPlayback",processInstancePayload:r=>({playback:r})}}}],[[toLocalEvent("video.recording.start"),"video.recording.started","video.recording.updated","video.recording.ended"],{type:"roomSessionRecording",instanceFactory:r=>e6.createRoomSessionRecordingObject({store:this.store,emitter:this.emitter}),payloadTransform:r=>toExternalJSON(index_esm_spreadProps(index_esm_spreadValues({},r.recording),{room_session_id:this.roomSessionId}))}],[[toLocalEvent("video.playback.start"),"video.playback.started","video.playback.updated","video.playback.ended"],{type:"roomSessionPlayback",instanceFactory:r=>e6.createRoomSessionPlaybackObject({store:this.store,emitter:this.emitter}),payloadTransform:r=>toExternalJSON(index_esm_spreadProps(index_esm_spreadValues({},r.playback),{room_session_id:this.roomSessionId}))}],[[toLocalEvent("video.stream.list")],{type:"roomSessionStreamList",instanceFactory:r=>({}),payloadTransform:r=>r,nestedFieldsToProcess:{streams:{eventTransformType:"roomSessionStream",processInstancePayload:r=>({stream:r})}}}],[[toLocalEvent("video.stream.start"),"video.stream.started","video.stream.ended"],{type:"roomSessionStream",instanceFactory:r=>e6.createRoomSessionStreamObject({store:this.store,emitter:this.emitter}),payloadTransform:r=>toExternalJSON(index_esm_spreadProps(index_esm_spreadValues({},r.stream),{room_session_id:this.roomSessionId}))}]])}getCompoundEvents(){return new Map([...tY.MEMBER_POSITION_COMPOUND_EVENTS])}attachPreConnectWorkers(){this.runWorker("memberListUpdated",{worker:memberListUpdatedWorker})}attachOnSubscribedWorkers(r){this.runWorker("memberPositionWorker",{worker:index_esm_memberPositionWorker,initialState:r})}async createScreenShareObject(r={}){return this.startScreenShare(r)}async startScreenShare(r={}){var a;let{autoJoin:s=!0,audio:l=!1,video:c=!0,layout:u,positions:d}=r,p=await getDisplayMedia({audio:!0===l?rh:l,video:c}),f=index_esm_spreadProps(index_esm_spreadValues({},this.options),{screenShare:!0,recoverCall:!1,localStream:p,remoteStream:void 0,userVariables:index_esm_spreadProps(index_esm_spreadValues({},(null==(a=this.options)?void 0:a.userVariables)||{}),{memberCallId:this.callId,memberId:this.memberId}),layout:u,positions:d}),m=connect({store:this.store,Component:rm,componentListeners:rf})(f);p.getVideoTracks().forEach(r=>{r.addEventListener("ended",()=>{m&&m.active&&m.leave()})}),m.once("destroy",()=>{m.emit("room.left"),this._screenShareList.delete(m)});try{return m.runWorker("childMemberJoinedWorker",{worker:childMemberJoinedWorker,initialState:{parentId:this.memberId}}),this._screenShareList.add(m),s&&await m.join(),m}catch(r){throw this.logger.error("ScreenShare Error",r),r}}addCamera(r={}){let{autoJoin:a=!0}=r,s=index_esm_objRest(r,["autoJoin"]);return this.addDevice({autoJoin:a,video:s})}addMicrophone(r={}){let{autoJoin:a=!0}=r,s=index_esm_objRest(r,["autoJoin"]);return this.addDevice({autoJoin:a,audio:s})}async addDevice(r={}){var a;let{autoJoin:s=!0,audio:l=!1,video:c=!1}=r;if(!l&&!c)throw TypeError("At least one of `audio` or `video` must be requested.");let u=index_esm_spreadProps(index_esm_spreadValues({},this.options),{localStream:void 0,remoteStream:void 0,audio:l,video:c,additionalDevice:!0,recoverCall:!1,userVariables:index_esm_spreadProps(index_esm_spreadValues({},(null==(a=this.options)?void 0:a.userVariables)||{}),{memberCallId:this.callId,memberId:this.memberId})}),d=connect({store:this.store,Component:rb,componentListeners:rf})(u);d.once("destroy",()=>{d.emit("room.left"),this._deviceList.delete(d)});try{return d.runWorker("childMemberJoinedWorker",{worker:childMemberJoinedWorker,initialState:{parentId:this.memberId}}),this._deviceList.add(d),s&&await d.join(),d}catch(r){throw this.logger.error("RoomDevice Error",r),r}}join(){return super.invite()}leave(){return this.hangup()}updateSpeaker({deviceId:r}){return this.triggerCustomSaga(rp(r))}async hangup(r){return this._screenShareList.forEach(r=>{r.leave()}),this._deviceList.forEach(r=>{r.leave()}),super.hangup(r)}_finalize(){this._screenShareList.clear(),this._deviceList.clear(),super._finalize()}getLayoutList(){return this.getLayouts()}getMemberList(){return this.getMembers()}},{audioMute:e6.audioMuteMember,audioUnmute:e6.audioUnmuteMember,videoMute:e6.videoMuteMember,videoUnmute:e6.videoUnmuteMember,deaf:e6.deafMember,undeaf:e6.undeafMember,setInputVolume:e6.setInputVolumeMember,setOutputVolume:e6.setOutputVolumeMember,setMicrophoneVolume:e6.setInputVolumeMember,setSpeakerVolume:e6.setOutputVolumeMember,setInputSensitivity:e6.setInputSensitivityMember,removeMember:e6.removeMember,removeAllMembers:e6.removeAllMembers,getMembers:e6.getMembers,getLayouts:e6.getLayouts,setLayout:e6.setLayout,setPositions:e6.setPositions,setMemberPosition:e6.setMemberPosition,hideVideoMuted:e6.hideVideoMuted,showVideoMuted:e6.showVideoMuted,getRecordings:e6.getRecordings,startRecording:e6.startRecording,getPlaybacks:e6.getPlaybacks,play:e6.play,setHideVideoMuted:e6.setHideVideoMuted,getMeta:e6.getMeta,setMeta:e6.setMeta,updateMeta:e6.updateMeta,deleteMeta:e6.deleteMeta,getMemberMeta:e6.getMemberMeta,setMemberMeta:e6.setMemberMeta,updateMemberMeta:e6.updateMemberMeta,deleteMemberMeta:e6.deleteMemberMeta,promote:e6.promote,demote:e6.demote,getStreams:e6.getStreams,startStream:e6.startStream}),createBaseRoomSessionObject=r=>{let a=connect({store:r.store,customSagas:r.customSagas,Component:rS,componentListeners:rf})(r);return a},videoManagerWorker=function*(r){getLogger().trace("videoManagerWorker started");let{channels:a}=r,{swEventChannel:s,pubSubChannel:l}=a;for(;;){let r=yield take(s,r=>r.type.startsWith("video-manager."));yield put(l,r)}},rw=class extends e8{constructor(r){super(r),index_esm_publicField(this,"_eventsPrefix","video-manager"),this.runWorker("videoManagerWorker",{worker:videoManagerWorker})}getEmitterTransforms(){return new Map([[["video-manager.rooms.subscribed"],{type:"roomSession",instanceFactory:({rooms:r})=>({rooms:r.map(r=>toExternalJSON(r))}),payloadTransform:({rooms:r})=>({rooms:r.map(r=>toExternalJSON(r))})}],[["video-manager.room.started","video-manager.room.added","video-manager.room.updated","video-manager.room.ended","video-manager.room.deleted"],{type:"roomSession",instanceFactory:r=>toExternalJSON(r),payloadTransform:r=>toExternalJSON(r)}]])}},createVideoManagerObject=r=>{let a=connect({store:r.store,Component:rw,componentListeners:{errors:"onError",responses:"onSuccess"}})(r),s=new Proxy(a,{get:(r,a,s)=>"_eventsNamespace"===a?"":"eventChannel"===a?"video-manager.rooms":Reflect.get(r,a,s)});return s},rO=class extends e4{constructor(){super(...arguments),index_esm_publicField(this,"_videoManager"),index_esm_publicField(this,"_chat"),index_esm_publicField(this,"_pubSub")}get rooms(){return{makeRoomObject:r=>{let{rootElement:a,applyLocalVideoOverlay:s=!0,stopCameraWhileMuted:l=!0,stopMicrophoneWhileMuted:c=!0}=r,u=index_esm_objRest(r,["rootElement","applyLocalVideoOverlay","stopCameraWhileMuted","stopMicrophoneWhileMuted"]),d=[];d.push(makeAudioElementSaga({speakerId:u.speakerId})),a&&d.push(makeVideoElementSaga({rootElement:a,applyLocalVideoOverlay:s}));let p=createBaseRoomSessionObject(index_esm_spreadProps(index_esm_spreadValues({},u),{store:this.store,emitter:this.emitter,customSagas:d}));return c&&p.on("member.updated.audio_muted",({member:r})=>{try{r.id===p.memberId&&"audio_muted"in r&&(r.audio_muted?p.stopOutboundAudio():p.restoreOutboundAudio())}catch(r){this.logger.error("Error handling audio_muted",r)}}),l&&p.on("member.updated.video_muted",({member:r})=>{try{r.id===p.memberId&&"video_muted"in r&&(r.video_muted?p.stopOutboundVideo():p.restoreOutboundVideo())}catch(r){this.logger.error("Error handling video_muted",r)}}),p}}}get chat(){return this._chat||(this._chat=tW.createBaseChatObject({store:this.store,emitter:this.options.emitter})),this._chat}get pubSub(){return this._pubSub||(this._pubSub=tz.createBasePubSubObject({store:this.store,emitter:this.options.emitter})),this._pubSub}get videoManager(){return this._videoManager||(this._videoManager=createVideoManagerObject(this.options)),this._videoManager}reauthenticate(r){this.store.dispatch(eE.reauthAction({token:r}))}},rk=class extends eG{constructor(r){let a;try{a=ro(r.token,{header:!0})}catch(r){}super(index_esm_spreadProps(index_esm_spreadValues({},r),{host:(null==a?void 0:a.ch)||r.host})),this.options=r,index_esm_publicField(this,"WebSocketConstructor",WebSocket),index_esm_publicField(this,"agent","@signalwire/js/browser/3.17.0")}get allowHijack(){return this.options._hijack}async retrieveRelayProtocol(){var r;if(!this.allowHijack)return"";let a=this.getRoomNameFromJWT();return a?(this.logger.info("Hijacking: search protocol for",a),null!=(r=window.sessionStorage.getItem(a))?r:""):""}async persistRelayProtocol(){if(!this.allowHijack)return;let r=this.getRoomNameFromJWT();r&&(this.logger.info("Hijacking: persist protocol",r,this.relayProtocol),window.sessionStorage.setItem(r,this.relayProtocol))}getRoomNameFromJWT(){try{let r=ro(this.options.token);return null==r?void 0:r.r}catch(r){return""}}},createClient=r=>{let a=index_esm_spreadProps(index_esm_spreadValues({},r),{emitter:getEventEmitter()}),s=configureStore2({userOptions:a,SessionConstructor:rk}),l=connect({store:s,Component:rO,componentListeners:{errors:"onError",responses:"onSuccess"}})(a);return l},rE=["subscribe","publish","getMessages","getMembers","getMemberState","getAllowedChannels","setMemberState"],Client2=function(r){let a=createClient(r),createInterceptor=r=>async(...s)=>(await a.connect(),a.chat[r](...s)),s={_session:a,disconnect:()=>a.disconnect()};return new Proxy(a.chat,{get:(r,a,l)=>a in s?s[a]:rE.includes(a)?createInterceptor(a):Reflect.get(r,a,l)})},rP=tW.ChatMember,rx=tW.ChatMessage,rj={};index_esm_export(rj,{Client:()=>Client3,PubSubMessage:()=>rM});var rC=["getAllowedChannels","subscribe","publish"],Client3=function(r){let a=createClient(r),createInterceptor=r=>async(...s)=>(await a.connect(),a.pubSub[r](...s)),s={_session:a,disconnect:()=>a.disconnect()};return new Proxy(a.pubSub,{get:(r,a,l)=>a in s?s[a]:rC.includes(a)?createInterceptor(a):Reflect.get(r,a,l)})},rM=tz.PubSubMessage,rT={};index_esm_export(rT,{RoomSession:()=>RoomSession,createClient:()=>createClient,createRoomObject:()=>createRoomObject,joinRoom:()=>joinRoom});var rA={aspectRatio:{ideal:16/9}},createRoomObject=r=>new Promise(async(a,s)=>{let l;let{audio:c=!0,video:u=!0,iceServers:d,rootElementId:p,applyLocalVideoOverlay:f=!0,autoJoin:m=!1,stopCameraWhileMuted:b=!0,stopMicrophoneWhileMuted:g=!0,speakerId:y}=r,_=index_esm_objRest(r,["audio","video","iceServers","rootElementId","applyLocalVideoOverlay","autoJoin","stopCameraWhileMuted","stopMicrophoneWhileMuted","speakerId"]),v=createClient(index_esm_spreadValues({},_));if(await v.connect(),!v)return;if(p){let r=document.getElementById(p);r?l=r:(l=document.body,getLogger().warn(`We couldn't find an element with id: ${p}: using 'document.body' instead.`))}let S=v.rooms.makeRoomObject({audio:c,video:!0===u?rA:u,negotiateAudio:!0,negotiateVideo:!0,iceServers:d,rootElement:l,applyLocalVideoOverlay:f,stopCameraWhileMuted:b,stopMicrophoneWhileMuted:g,speakerId:y});S.once("destroy",()=>{S.emit("room.left"),v.disconnect()});let join=()=>new Promise(async(r,a)=>{try{S.once("room.subscribed",a=>{r(S)}),await S.join()}catch(r){getLogger().error("Join",r),v.disconnect(),a(r)}}),w=new Proxy(S,{get:(r,a,s)=>"join"===a?join:Reflect.get(r,a,s)});if(m)try{await w.join(),a(w)}catch(r){s(r)}else a(w)}),joinRoom=r=>createRoomObject(index_esm_spreadProps(index_esm_spreadValues({},r),{autoJoin:!0})),getJoinMediaParams=r=>{let{authState:a,audio:s=!0,video:l=!0,sendAudio:c,sendVideo:u,receiveAudio:d,receiveVideo:p}=r;getLogger().debug("getJoinMediaParams options",index_esm_spreadValues({},r));let{audio_allowed:f,video_allowed:m,join_as:b}=a,g="member"===(null!=b?b:"member"),y=g&&"both"===f,_=g&&"both"===m,v="none"!==f,S="none"!==m,w=!!(null!=c?c:s),O=!!(null!=u?u:l),k=!!(null!=d?d:s),E=!!(null!=p?p:l);return!y&&w&&getLogger().info("Not allowed to send audio on this room. Default values will be used."),!_&&O&&getLogger().info("Not allowed to send video on this room. Default values will be used."),!v&&k&&getLogger().info("Not allowed to receive video from the room. Default values will be used."),!S&&E&&getLogger().info("Not allowed to receive video from the room. Default values will be used."),{mustSendAudio:y&&w,mustSendVideo:_&&O,mustRecvAudio:v&&k,mustRecvVideo:S&&E}},checkMediaParams=r=>Object.values(r).some(Boolean),rR=["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"],RoomSession=function(r){let{audio:a=!0,video:s=!0,iceServers:l,rootElement:c,applyLocalVideoOverlay:u=!0,stopCameraWhileMuted:d=!0,stopMicrophoneWhileMuted:p=!0,speakerId:f}=r,m=index_esm_objRest(r,["audio","video","iceServers","rootElement","applyLocalVideoOverlay","stopCameraWhileMuted","stopMicrophoneWhileMuted","speakerId"]);["audio","video"].forEach(a=>{a in r&&getLogger().warn(`The '${a}' parameter on the RoomSession constructor is deprecated. Set it on the '.join()' function instead.`)});let b=createClient(m),g=b.rooms.makeRoomObject({negotiateAudio:!0,negotiateVideo:!0,iceServers:l,rootElement:c,applyLocalVideoOverlay:u,stopCameraWhileMuted:d,stopMicrophoneWhileMuted:p,speakerId:f});g.once("destroy",()=>{g.emit("room.left"),b.disconnect()});let y={join:r=>new Promise(async(l,c)=>{var u,d;try{g.attachPreConnectWorkers(),await b.connect();let p=null!=(u=null==r?void 0:r.audio)?u:a,f=null!=(d=null==r?void 0:r.video)?d:s,m=b._sessionAuthState,y=getJoinMediaParams(index_esm_spreadValues({authState:m,sendAudio:!!a,sendVideo:!!s},r));if(!checkMediaParams(y))return b.disconnect(),c(Error(`Invalid arguments to join the room. The token used has join_as: '${m.join_as}'. ${JSON.stringify(r,null,2)} `));g.updateMediaOptions({audio:!!y.mustSendAudio&&(p||!0),video:!!y.mustSendVideo&&(f||!0),negotiateAudio:y.mustRecvAudio,negotiateVideo:y.mustRecvVideo}),g.once("room.subscribed",r=>{g.attachOnSubscribedWorkers(r),l(g)}),await g.join()}catch(r){getLogger().error("RoomSession Join",r),b.disconnect(),c(r)}})};return new Proxy(g,{get(r,a,s){if(a in y)return y[a];if(!r.active&&rR.includes(a))throw Error(`Tried to access the property/method "${a}" before the room was connected. Please call roomSession.join() first.`);return Reflect.get(r,a,s)}})},rL={};index_esm_export(rL,{checkCameraPermissions:()=>checkCameraPermissions,checkMicrophonePermissions:()=>checkMicrophonePermissions,checkPermissions:()=>checkPermissions,checkSpeakerPermissions:()=>checkSpeakerPermissions,createCameraDeviceWatcher:()=>createCameraDeviceWatcher,createDeviceWatcher:()=>createDeviceWatcher,createMicrophoneAnalyzer:()=>createMicrophoneAnalyzer,createMicrophoneDeviceWatcher:()=>createMicrophoneDeviceWatcher,createSpeakerDeviceWatcher:()=>createSpeakerDeviceWatcher,enumerateDevices:()=>enumerateDevices,getCameraDevices:()=>getCameraDevices,getCameraDevicesWithPermissions:()=>getCameraDevicesWithPermissions,getDevices:()=>getDevices,getDevicesWithPermissions:()=>getDevicesWithPermissions,getDisplayMedia:()=>getDisplayMedia,getMicrophoneDevices:()=>getMicrophoneDevices,getMicrophoneDevicesWithPermissions:()=>getMicrophoneDevicesWithPermissions,getSpeakerDevices:()=>getSpeakerDevices,getSpeakerDevicesWithPermissions:()=>getSpeakerDevicesWithPermissions,getSupportedConstraints:()=>getSupportedConstraints,getUserMedia:()=>getUserMedia,requestPermissions:()=>requestPermissions,setMediaElementSinkId:()=>setMediaElementSinkId,stopStream:()=>stopStream,stopTrack:()=>stopTrack,supportsGetDisplayMedia:()=>supportsGetDisplayMedia,supportsGetUserMedia:()=>supportsGetUserMedia,supportsMediaDevices:()=>supportsMediaDevices,supportsMediaOutput:()=>supportsMediaOutput})},26729:function(r){"use strict";var a=Object.prototype.hasOwnProperty,s="~";function Events(){}function EE(r,a,s){this.fn=r,this.context=a,this.once=s||!1}function addListener(r,a,l,c,u){if("function"!=typeof l)throw TypeError("The listener must be a function");var d=new EE(l,c||r,u),p=s?s+a:a;return r._events[p]?r._events[p].fn?r._events[p]=[r._events[p],d]:r._events[p].push(d):(r._events[p]=d,r._eventsCount++),r}function clearEvent(r,a){0==--r._eventsCount?r._events=new Events:delete r._events[a]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),new Events().__proto__||(s=!1)),EventEmitter.prototype.eventNames=function(){var r,l,c=[];if(0===this._eventsCount)return c;for(l in r=this._events)a.call(r,l)&&c.push(s?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(r)):c},EventEmitter.prototype.listeners=function(r){var a=s?s+r:r,l=this._events[a];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,u=l.length,d=Array(u);c=0&&s<=d.levels.SILENT){if(u=s,!1!==l&&persistLevelIfPossible(s),replaceLoggingMethods.call(d,s,a),typeof console===r&&s=0||(c[s]=r[s]);return c}function _objectWithoutProperties(r,a){if(null==r)return{};var s,l,c=_objectWithoutPropertiesLoose(r,a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _assertThisInitialized(r){if(void 0===r)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _possibleConstructorReturn(r,a){if(a&&("object"==typeof a||"function"==typeof a))return a;if(void 0!==a)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(r)}function _createSuper(r){var a=_isNativeReflectConstruct();return function(){var s,l=_getPrototypeOf(r);if(a){var c=_getPrototypeOf(this).constructor;s=Reflect.construct(l,arguments,c)}else s=l.apply(this,arguments);return _possibleConstructorReturn(this,s)}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var s=Object.prototype.toString.call(r).slice(8,-1);return"Object"===s&&r.constructor&&(s=r.constructor.name),"Map"===s||"Set"===s?Array.from(r):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var s=0,l=Array(a);s1&&void 0!==arguments[1]?arguments[1]:function(){return{}},s=function(s){function i(r,s){var l;return _classCallCheck(this,i),(l=c.call(this,r,s)).state=a(_objectSpread2({},s.state)),l.updateStateProps=l.updateStateProps.bind(_assertThisInitialized(l)),l}_inherits(i,s);var c=_createSuper(i);return _createClass(i,[{key:"componentDidMount",value:function(){this.context.subscribe(this.updateStateProps)}},{key:"shouldComponentUpdate",value:function(r,a){return!_(a,this.state)||!_(r,this.props)}},{key:"componentWillUnmount",value:function(){this.context.unsubscribe(this.updateStateProps)}},{key:"updateStateProps",value:function(){this.setState(a(_objectSpread2({},this.context.state)))}},{key:"render",value:function(){var a=this,s=w(this.state,this.props);return l.createElement(r,_extends({ref:function(r){a.instance=r}},s,{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)}}]),i}(l.Component);return _defineProperty(s,"contextType",O),_defineProperty(s,"propTypes",{children:f.children}),_defineProperty(s,"defaultProps",{children:null}),s}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function e(r,a,s,l,c,u){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==u){var d=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 d.name="Invariant Violation",d}}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:emptyFunctionWithReset,resetWarningCache:emptyFunction};return r.PropTypes=r,r},c=createCommonjsModule(function(r){r.exports=factoryWithThrowingShims()}),u="loading",d="success",p="error",f={children:c.oneOfType([c.arrayOf(c.node),c.node]),direction:c.oneOf(["forward","backward"]),height:function(r,a){var s=r[a];return"vertical"!==r.orientation||null!==s&&"number"==typeof s?null:Error("Missing required property '".concat(a,"' when orientation is vertical. You must supply a number representing the height in pixels"))},orientation:c.oneOf(["horizontal","vertical"]),isBgImage:function(r,a){return!0===r[a]&&"img"===r.tag?Error("HTML img elements should not have a backgroundImage. Please use ".concat(a," for other block-level HTML tags, like div, a, section, etc...")):null}},boundedRange=function(r){var a=r.min;return Math.min(r.max,Math.max(a,r.x))},m=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],b=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).handleOnClick=s.handleOnClick.bind(_assertThisInitialized(s)),s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props,s=a.carouselStore,l=a.currentSlide,c=a.onClick,u=a.step,d=a.infinite,p=a.visibleSlides,f=a.totalSlides-p,m=Math.max(l-u,0);d&&(m=0===l?f:m),s.setStoreState({currentSlide:m,isPlaying:!1},null!==c&&c.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.className),s=(r.currentSlide,r.disabled,r.onClick,r.step,r.totalSlides,r.visibleSlides,r.infinite),c=_objectWithoutProperties(r,m),u=cn(["buttonBack___1mlaL","carousel__back-button",a]),d=t.setDisabled(this.props.disabled,this.props.currentSlide,s);return l.createElement("button",_extends({type:"button","aria-label":"previous",className:u,onClick:this.handleOnClick,disabled:d},c),this.props.children)}}],[{key:"setDisabled",value:function(r,a,s){return null!==r?r:0===a&&!s}}]),t}(l.Component);_defineProperty(b,"propTypes",{carouselStore:c.object.isRequired,children:f.children.isRequired,className:c.string,currentSlide:c.number.isRequired,disabled:c.bool,onClick:c.func,step:c.number.isRequired,totalSlides:c.number.isRequired,visibleSlides:c.number.isRequired,infinite:c.bool}),_defineProperty(b,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1});var g=createCommonjsModule(function(r,a){var s={}.toString,l="undefined"!=typeof window?window.Node:Function;r.exports=a=function(r){var a=typeof r;if("object"!=a)return a;if("object"==(a=c[s.call(r)]))return r instanceof Map?"map":r instanceof Set?"set":"object";if(a)return a;if(r instanceof l)switch(r.nodeType){case 1:return"element";case 3:return"text-node";case 9:return"document";case 11:return"document-fragment";default:return"dom-node"}};var c=a.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"}}),y=(g.types,{});y.number=function(r,a){return r!=r&&a!=a},y.function=function(r,a,s){return r.toString()===a.toString()&&y.object(r,a,s)&&equal(r.prototype,a.prototype)},y.date=function(r,a){return+r==+a},y.regexp=function(r,a){return r.toString()===a.toString()},y.element=function(r,a){return r.outerHTML===a.outerHTML},y.textnode=function(r,a){return r.textContent===a.textContent},y.arguments=y["bit-array"]=y.array=memoGaurd(arrayEqual),y.object=memoGaurd(objectEqual);var _=equal,isMergeableObject=function(r){return isNonNullObject(r)&&!isSpecial(r)},v="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;deepmerge.all=function(r,a){if(!Array.isArray(r))throw Error("first argument should be an array");return r.reduce(function(r,s){return deepmerge(r,s,a)},{})};var S,w=deepmerge,O=l.createContext(),deepFreeze=function e(r){return Object.freeze(r),Object.getOwnPropertyNames(r).forEach(function(a){!r.hasOwnProperty(a)||null===r[a]||"object"!=typeof r[a]&&"function"!=typeof r[a]||Object.isFrozen(r[a])||e(r[a])}),r},k={masterSpinnerFinished:!1},E=function(){function e(r){_classCallCheck(this,e),this.state=deepFreeze(w(k,r)),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 _createClass(e,[{key:"setStoreState",value:function(r,a){this.state=deepFreeze(w(this.state,r)),this.updateSubscribers(a)}},{key:"getStoreState",value:function(){return w({},this.state)}},{key:"subscribe",value:function(r){this.subscriptions.push(r)}},{key:"unsubscribe",value:function(r){var a=this.subscriptions.indexOf(r);-1!==a&&this.subscriptions.splice(a,1)}},{key:"updateSubscribers",value:function(r){this.subscriptions.forEach(function(r){return r()}),"function"==typeof r&&r(this.getStoreState())}},{key:"subscribeMasterSpinner",value:function(r){-1===Object.keys(this.masterSpinnerSubscriptions).indexOf(r)&&(this.masterSpinnerSubscriptions[r]={success:!1,error:!1,complete:!1})}},{key:"unsubscribeMasterSpinner",value:function(r){return -1!==Object.keys(this.masterSpinnerSubscriptions).indexOf(r)&&(this.setMasterSpinnerFinished(),delete this.masterSpinnerSubscriptions[r])}},{key:"unsubscribeAllMasterSpinner",value:function(){this.masterSpinnerSubscriptions={},this.setMasterSpinnerFinished()}},{key:"masterSpinnerSuccess",value:function(r){this.masterSpinnerSubscriptions[r].success=!0,this.masterSpinnerSubscriptions[r].complete=!0,this.setMasterSpinnerFinished()}},{key:"masterSpinnerError",value:function(r){this.masterSpinnerSubscriptions[r].error=!0,this.masterSpinnerSubscriptions[r].complete=!0,this.setMasterSpinnerFinished()}},{key:"setMasterSpinnerFinished",value:function(){this.setStoreState({masterSpinnerFinished:this.isMasterSpinnerFinished()})}},{key:"isMasterSpinnerFinished",value:function(){var r=this;return 0===Object.keys(this.masterSpinnerSubscriptions).filter(function(a){return!0!==r.masterSpinnerSubscriptions[a].complete}).length}}]),e}(),P=["children","className","currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPageScrollLocked","isPlaying","lockOnWindowScroll","naturalSlideHeight","naturalSlideWidth","orientation","playDirection","step","dragStep","tag","totalSlides","touchEnabled","dragEnabled","visibleSlides","infinite","isIntrinsicHeight"],x=(_defineProperty(S=function(r){function t(r){if(_classCallCheck(this,t),l=a.call(this,r),r.isIntrinsicHeight&&"horizontal"!==r.orientation)throw Error('isIntrinsicHeight can only be used in "horizontal" orientation. See Readme for more information.');var s,l,c={currentSlide:r.currentSlide,disableAnimation:r.disableAnimation,disableKeyboard:r.disableKeyboard,hasMasterSpinner:r.hasMasterSpinner,imageErrorCount:0,imageSuccessCount:0,interval:r.interval,isPageScrollLocked:r.isPageScrollLocked,isPlaying:r.isPlaying,lockOnWindowScroll:r.lockOnWindowScroll,masterSpinnerThreshold:0,naturalSlideHeight:r.naturalSlideHeight,naturalSlideWidth:r.naturalSlideWidth,orientation:r.orientation,playDirection:r.playDirection,privateUnDisableAnimation:!1,slideSize:100/r.totalSlides*(s=r.visibleSlides)/s,slideTraySize:100*r.totalSlides/r.visibleSlides,step:r.step,dragStep:r.dragStep,totalSlides:r.totalSlides,touchEnabled:r.touchEnabled,dragEnabled:r.dragEnabled,visibleSlides:r.visibleSlides,infinite:r.infinite,isIntrinsicHeight:r.isIntrinsicHeight};return l.carouselStore=new E(c),l}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"componentDidUpdate",value:function(r){var a,s=this,l={};["currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPlaying","naturalSlideHeight","naturalSlideWidth","lockOnWindowScroll","orientation","playDirection","step","dragStep","totalSlides","touchEnabled","dragEnabled","visibleSlides"].forEach(function(a){r[a]!==s.props[a]&&(l[a]=s.props[a])}),this.props.currentSlide===r.currentSlide||this.props.disableAnimation||(l.disableAnimation=!0,l.privateUnDisableAnimation=!0),this.props.totalSlides===r.totalSlides&&this.props.visibleSlides===r.visibleSlides||(l.slideSize=100/this.props.totalSlides*(a=this.props.visibleSlides)/a,l.slideTraySize=100*this.props.totalSlides/this.props.visibleSlides),this.carouselStore.state.currentSlide>=this.props.totalSlides&&(l.currentSlide=Math.max(this.props.totalSlides-1,0)),Object.keys(l).length>0&&this.carouselStore.setStoreState(l)}},{key:"componentWillUnmount",value:function(){this.carouselStore.unsubscribeAllMasterSpinner()}},{key:"getStore",value:function(){return this.carouselStore}},{key:"render",value:function(){var r=this.props,a=(r.children,r.className,r.currentSlide,r.disableAnimation,r.disableKeyboard,r.hasMasterSpinner,r.interval,r.isPageScrollLocked,r.isPlaying,r.lockOnWindowScroll,r.naturalSlideHeight,r.naturalSlideWidth,r.orientation,r.playDirection,r.step,r.dragStep,r.tag),s=(r.totalSlides,r.touchEnabled,r.dragEnabled,r.visibleSlides,r.infinite,r.isIntrinsicHeight,_objectWithoutProperties(r,P)),c=cn(["carousel",this.props.className]);return l.createElement(a,_extends({className:c},s),l.createElement(O.Provider,{value:this.carouselStore},this.props.children))}}]),t}(l.Component),"propTypes",{children:f.children.isRequired,className:c.string,currentSlide:c.number,disableAnimation:c.bool,disableKeyboard:c.bool,hasMasterSpinner:c.bool,interval:c.number,isPageScrollLocked:c.bool,isPlaying:c.bool,lockOnWindowScroll:c.bool,naturalSlideHeight:c.number.isRequired,naturalSlideWidth:c.number.isRequired,orientation:f.orientation,playDirection:f.direction,step:c.number,dragStep:c.number,tag:c.string,totalSlides:c.number.isRequired,touchEnabled:c.bool,dragEnabled:c.bool,visibleSlides:c.number,infinite:c.bool,isIntrinsicHeight:c.bool}),_defineProperty(S,"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}),S);O.Consumer;var j,C,M,T,A,R,L=WithStore(b,function(r){return{currentSlide:r.currentSlide,step:r.step,totalSlides:r.totalSlides,visibleSlides:r.visibleSlides,infinite:r.infinite}}),I=["carouselStore","className","currentSlide","disabled","onClick","totalSlides"],D=WithStore((_defineProperty(j=function(r){function t(){var r;return _classCallCheck(this,t),(r=a.call(this)).handleOnClick=r.handleOnClick.bind(_assertThisInitialized(r)),r}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props,s=a.carouselStore,l=a.onClick;s.setStoreState({currentSlide:0,isPlaying:!1},null!==l&&l.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.className),s=r.currentSlide,c=r.disabled,u=(r.onClick,r.totalSlides,_objectWithoutProperties(r,I)),d=cn(["buttonFirst___2rhFr","carousel__first-button",a]);return l.createElement("button",_extends({type:"button","aria-label":"first",className:d,onClick:this.handleOnClick,disabled:null!==c?c:0===s},u),this.props.children)}}]),t}(l.Component),"propTypes",{carouselStore:c.object.isRequired,children:f.children.isRequired,className:c.string,currentSlide:c.number.isRequired,disabled:c.bool,onClick:c.func,totalSlides:c.number.isRequired}),_defineProperty(j,"defaultProps",{className:null,disabled:null,onClick:null}),j),function(r){return{currentSlide:r.currentSlide,totalSlides:r.totalSlides}}),N=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],W=WithStore((_defineProperty(C=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).handleOnClick=s.handleOnClick.bind(_assertThisInitialized(s)),s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props,s=a.currentSlide,l=a.onClick,c=a.step,u=a.carouselStore,d=a.infinite,p=a.totalSlides-a.visibleSlides,f=Math.min(c+s,p);d&&(f=p===s?0:f),u.setStoreState({currentSlide:f,isPlaying:!1},null!==l&&l.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.className),s=r.currentSlide,c=r.disabled,u=(r.onClick,r.step,r.totalSlides),d=r.visibleSlides,p=r.infinite,f=_objectWithoutProperties(r,N),m=cn(["buttonNext___2mOCa","carousel__next-button",a]),b=t.setDisabled(c,s,d,u,p);return l.createElement("button",_extends({type:"button","aria-label":"next",className:m,onClick:this.handleOnClick,disabled:b},f),this.props.children)}}],[{key:"setDisabled",value:function(r,a,s,l,c){return null!==r?r:a>=l-s&&!c}}]),t}(l.PureComponent),"propTypes",{carouselStore:c.object.isRequired,children:f.children.isRequired,className:c.string,currentSlide:c.number.isRequired,disabled:c.bool,onClick:c.func,step:c.number.isRequired,totalSlides:c.number.isRequired,visibleSlides:c.number.isRequired,infinite:c.bool}),_defineProperty(C,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1}),C),function(r){return{currentSlide:r.currentSlide,step:r.step,totalSlides:r.totalSlides,visibleSlides:r.visibleSlides,infinite:r.infinite}}),F=["carouselStore","className","currentSlide","disabled","onClick","totalSlides","visibleSlides"],V=WithStore((_defineProperty(M=function(r){function t(){var r;return _classCallCheck(this,t),(r=a.call(this)).handleOnClick=r.handleOnClick.bind(_assertThisInitialized(r)),r}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props,s=a.carouselStore,l=a.onClick,c=a.totalSlides,u=a.visibleSlides;s.setStoreState({currentSlide:c-u,isPlaying:!1},null!==l&&l.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.className),s=r.currentSlide,c=r.disabled,u=(r.onClick,r.totalSlides),d=r.visibleSlides,p=_objectWithoutProperties(r,F),f=cn(["buttonLast___2yuh0","carousel__last-button",a]);return l.createElement("button",_extends({type:"button","aria-label":"last",className:f,onClick:this.handleOnClick,disabled:null!==c?c:s>=u-d},p),this.props.children)}}]),t}(l.Component),"propTypes",{carouselStore:c.object.isRequired,children:f.children.isRequired,className:c.string,currentSlide:c.number.isRequired,disabled:c.bool,onClick:c.func,totalSlides:c.number.isRequired,visibleSlides:c.number.isRequired}),_defineProperty(M,"defaultProps",{className:null,disabled:null,onClick:null}),M),function(r){return{currentSlide:r.currentSlide,totalSlides:r.totalSlides,visibleSlides:r.visibleSlides}}),q=["carouselStore","children","childrenPaused","childrenPlaying","className","isPlaying","onClick"],U=WithStore((_defineProperty(T=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).handleOnClick=s.handleOnClick.bind(_assertThisInitialized(s)),s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props.onClick;this.props.carouselStore.setStoreState({isPlaying:!this.props.isPlaying},null!==a&&a.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.children,r.childrenPaused),s=r.childrenPlaying,c=r.className,u=r.isPlaying,d=(r.onClick,_objectWithoutProperties(r,q)),p=cn(["buttonNext___3Lm3s","carousel__play-button",c]);return l.createElement("button",_extends({type:"button","aria-label":"play",className:p,onClick:this.handleOnClick},d),u&&s,!u&&a,this.props.children)}}]),t}(l.PureComponent),"propTypes",{carouselStore:c.object.isRequired,children:c.node,childrenPaused:c.node,childrenPlaying:c.node,className:c.string,isPlaying:c.bool.isRequired,onClick:c.func}),_defineProperty(T,"defaultProps",{children:null,childrenPaused:null,childrenPlaying:null,className:null,onClick:null}),T),function(r){return{isPlaying:r.isPlaying}}),B={dot:"dot___3c3SI"},z=["carouselStore","children","className","currentSlide","disabled","onClick","selected","slide","totalSlides","visibleSlides"],H=WithStore((_defineProperty(A=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).handleOnClick=s.handleOnClick.bind(_assertThisInitialized(s)),s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"handleOnClick",value:function(r){var a=this.props,s=a.carouselStore,l=a.onClick,c=a.slide,u=a.totalSlides,d=a.visibleSlides;s.setStoreState({currentSlide:c>=u-d?u-d:c,isPlaying:!1},null!==l&&l.call(this,r))}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.children,r.className),s=r.currentSlide,c=r.disabled,u=(r.onClick,r.selected),d=r.slide,p=(r.totalSlides,r.visibleSlides),f=_objectWithoutProperties(r,z),m=d>=s&&d=a&&b=s-c?s-c:b;m.push(l.createElement(H,{key:b,slide:v,selected:_,disabled:!!u&&_},l.createElement("span",{className:cn["carousel__dot-group-dot"]},this.props.dotNumbers&&b+1)))}return m}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.children),s=r.className,c=(r.currentSlide,r.dotNumbers,r.totalSlides,r.visibleSlides,r.disableActiveDots,r.showAsSelectedForCurrentSlideOnly,r.renderDots,_objectWithoutProperties(r,K)),u=cn([G.DotGroup,"carousel__dot-group",s]);return l.createElement("div",_extends({className:u},c),this.renderDots(),a)}}]),t}(l.Component),"propTypes",{children:f.children,className:c.string,currentSlide:c.number.isRequired,carouselStore:c.object.isRequired,totalSlides:c.number.isRequired,visibleSlides:c.number.isRequired,dotNumbers:c.bool,disableActiveDots:c.bool,showAsSelectedForCurrentSlideOnly:c.bool,renderDots:c.func}),_defineProperty(R,"defaultProps",{children:null,className:null,dotNumbers:!1,disableActiveDots:!0,showAsSelectedForCurrentSlideOnly:!1,renderDots:null}),R),function(r){return{currentSlide:r.currentSlide,totalSlides:r.totalSlides,visibleSlides:r.visibleSlides}}),Z={image:"image___xtQGH"},Y=["src","alt"],Q=["carouselStore","children","className","hasMasterSpinner","isBgImage","onError","onLoad","renderError","renderLoading","style","tag"],$=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).state={imageStatus:u},s.handleImageLoad=s.handleImageLoad.bind(_assertThisInitialized(s)),s.handleImageError=s.handleImageError.bind(_assertThisInitialized(s)),s.image=null,s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"componentDidMount",value:function(){t.subscribeMasterSpinner(this.props),this.initImage()}},{key:"componentDidUpdate",value:function(r){r.src!==this.props.src&&(t.unsubscribeMasterSpinner(r),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:u}),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 r=this.image.src;this.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.image.src=r}}},{key:"handleImageLoad",value:function(r){this.setState({imageStatus:d}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerSuccess(this.props.src),this.props.onLoad&&this.props.onLoad(r)}},{key:"handleImageError",value:function(r){this.setState({imageStatus:p}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerError(this.props.src),this.props.onError&&this.props.onError(r)}},{key:"tempTag",value:function(){return"img"===this.props.tag?"div":this.props.tag}},{key:"customRender",value:function(r){return"function"==typeof this.props[r]?this.props[r]():this.props.children}},{key:"renderLoading",value:function(r){var a=this.tempTag(),s=cn([Z.image,Z.imageLoading,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--loading",this.props.className]);return l.createElement(a,_extends({className:s},r),this.customRender("renderLoading"))}},{key:"renderError",value:function(r){var a=this.tempTag(),s=cn([Z.image,Z.imageError,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--error",this.props.className]);return l.createElement(a,_extends({className:s},r),this.customRender("renderError"))}},{key:"renderSuccess",value:function(r){var a=this.props,s=a.style,c=a.tag,u=cn([Z.image,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--success",this.props.className]),d=_extends({},s),p=r;if("img"!==c){var f=r.src;r.alt,p=_objectWithoutProperties(r,Y),d=_extends({},s,{backgroundImage:'url("'.concat(f,'")'),backgroundSize:"cover"})}return l.createElement(c,_extends({className:u,style:d},p),this.props.children)}},{key:"render",value:function(){var r=this.props,a=(r.carouselStore,r.children,r.className,r.hasMasterSpinner,r.isBgImage,r.onError,r.onLoad,r.renderError,r.renderLoading,r.style,r.tag,_objectWithoutProperties(r,Q));switch(this.state.imageStatus){case u:return this.renderLoading(a);case d:return this.renderSuccess(a);case p:return this.renderError(a);default:throw Error("unknown value for this.state.imageStatus")}}}],[{key:"subscribeMasterSpinner",value:function(r){r.hasMasterSpinner&&r.carouselStore.subscribeMasterSpinner(r.src)}},{key:"unsubscribeMasterSpinner",value:function(r){r.hasMasterSpinner&&r.carouselStore.unsubscribeMasterSpinner(r.src)}}]),t}(l.Component);_defineProperty($,"propTypes",{alt:c.string,carouselStore:c.object.isRequired,children:f.children,className:c.string,hasMasterSpinner:c.bool.isRequired,isBgImage:f.isBgImage,onError:c.func,onLoad:c.func,renderError:c.func,renderLoading:c.func,src:c.string.isRequired,style:c.object,tag:c.string}),_defineProperty($,"defaultProps",{alt:"",children:null,className:null,isBgImage:!1,onError:null,onLoad:null,renderError:null,renderLoading:null,style:null,tag:"img"});var ee,et,er,en,eo=WithStore($,function(r){return{hasMasterSpinner:r.hasMasterSpinner,orientation:r.orientation}}),ei=["className"],ea=(_defineProperty(ee=function(r){function t(){return _classCallCheck(this,t),a.apply(this,arguments)}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"render",value:function(){var r=this.props,a=r.className,s=_objectWithoutProperties(r,ei),c=cn(["spinner___27VUp","carousel__spinner",a]);return l.createElement("div",_extends({className:c},s))}}]),t}(l.PureComponent),"propTypes",{className:c.string}),_defineProperty(ee,"defaultProps",{className:null}),ee),es={container:"container___2O72F",overlay:"overlay___IV4qY",hover:"hover___MYy31",zoom:"zoom___3kqYk",imageLoadingSpinnerContainer:"imageLoadingSpinnerContainer___3UIPD"},el=["alt","bgImageProps","bgImageTag","carouselStore","className","imageClassName","overlayClassName","isPinchZoomEnabled","spinner","src","srcZoomed","tag"],ec=WithStore((_defineProperty(et=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).state={isImageLoading:!0,isHovering:!1,isZooming:!1,x:null,y:null,scale:1},s.tpCache={},s.handleImageComplete=s.handleImageComplete.bind(_assertThisInitialized(s)),s.handleOnMouseMove=s.handleOnMouseMove.bind(_assertThisInitialized(s)),s.handleOnMouseOut=s.handleOnMouseOut.bind(_assertThisInitialized(s)),s.handleOnMouseOver=s.handleOnMouseOver.bind(_assertThisInitialized(s)),s.handleOnTouchEnd=s.handleOnTouchEnd.bind(_assertThisInitialized(s)),s.handleOnTouchMove=s.handleOnTouchMove.bind(_assertThisInitialized(s)),s.handleOnTouchStart=s.handleOnTouchStart.bind(_assertThisInitialized(s)),s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"componentDidUpdate",value:function(r,a){!1===a.isZooming&&!0===this.state.isZooming&&this.props.carouselStore.setStoreState({isPageScrollLocked:!0}),!0===a.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(r){if(!this.state.isZooming){var a=pct(r.nativeEvent.offsetX/r.target.offsetWidth*100),s=pct(r.nativeEvent.offsetY/r.target.offsetHeight*100);this.setState({x:a,y:s})}}},{key:"handleOnTouchStart",value:function(r){var a=this;this.props.isPinchZoomEnabled&&(_toConsumableArray(r.targetTouches).forEach(function(r){a.tpCache[r.identifier]={clientX:r.clientX,clientY:r.clientY}}),this.setState(function(r){return{isZooming:r.isZooming||Object.keys(a.tpCache).length>1}}))}},{key:"handleOnTouchMove",value:function(r){var a=this;if(this.state.isZooming){r.persist();var s=_toConsumableArray(r.targetTouches).filter(function(r){return a.tpCache[r.identifier]}).slice(0,2);if(2===s.length){r.stopPropagation();var l=r.target.getBoundingClientRect(),c=s[0].identifier,u=s[1].identifier,d={x1:this.tpCache[c].clientX,y1:this.tpCache[c].clientY,x2:this.tpCache[u].clientX,y2:this.tpCache[u].clientY};d.distance=t.distanceBetweenTwoTouches(_objectSpread2({},d));var p=t.midpointBetweenTwoTouches(_objectSpread2({},d));d.cx=p.x,d.cy=p.y;var f={x1:s[0].clientX,y1:s[0].clientY,x2:s[1].clientX,y2:s[1].clientY};f.distance=t.distanceBetweenTwoTouches(_objectSpread2({},f));var m=t.midpointBetweenTwoTouches(_objectSpread2({},f));f.cx=m.x,f.cy=m.y;var b=pct(boundedRange({min:0,max:100,x:(f.cx-l.left)/l.width*100})),g=pct(boundedRange({min:0,max:100,x:(f.cy-l.top)/l.height*100})),h=function(r){return boundedRange({min:1,max:3,x:r.scale+(f.distance-d.distance)/100})};this.setState(function(r){return{isZooming:1!==h(r),scale:h(r),x:b,y:g}})}}}},{key:"handleOnTouchEnd",value:function(r){var a=this;this.props.isPinchZoomEnabled&&(_toConsumableArray(r.changedTouches).forEach(function(r){delete a.tpCache[r.identifier]}),0===Object.keys(this.tpCache).length&&this.setState({isZooming:!1}))}},{key:"renderLoading",value:function(){if(this.state.isImageLoading){var r=this.props.spinner;return l.createElement("div",{className:cn([es.imageLoadingSpinnerContainer,"carousel__image-loading-spinner-container"])},r&&r(),!r&&l.createElement(ea,null))}return null}},{key:"render",value:function(){var r=this.props,a=r.alt,s=r.bgImageProps,c=r.bgImageTag,u=(r.carouselStore,r.className),d=r.imageClassName,p=r.overlayClassName,f=(r.isPinchZoomEnabled,r.spinner,r.src),m=r.srcZoomed,b=r.tag,g=_objectWithoutProperties(r,el),y=cn([es.container,u]),_=cn([es.image,"carousel__zoom-image",d]),v=cn([es.overlay,"carousel__zoom-image-overlay",this.state.isHovering&&es.hover,this.state.isZooming&&es.zoom,this.state.isHovering&&"carousel__zoom-image-overlay--hovering",this.state.isZooming&&"carousel__zoom-image-overlay--zooming",p]),S={};return(this.state.isHovering||this.state.isZooming)&&(S.transformOrigin="".concat(this.state.x," ").concat(this.state.y),S.transform="scale(".concat(this.state.scale,")")),l.createElement(b,_extends({className:y},g),l.createElement(eo,_extends({alt:a,className:_,tag:c,src:f,onLoad:this.handleImageComplete,onError:this.handleImageComplete},s)),l.createElement(eo,{className:v,tag:"div",src:m||f,style:S,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(r){var a=r.x1,s=r.y1;return{x:(a+r.x2)/2,y:(s+r.y2)/2}}},{key:"distanceBetweenTwoTouches",value:function(r){var a=r.x1,s=r.y1;return Math.sqrt(Math.pow(r.x2-a,2)+Math.pow(r.y2-s,2))}}]),t}(l.Component),"propTypes",{alt:c.string,bgImageProps:c.object,bgImageTag:c.string,carouselStore:c.object.isRequired,className:c.string,imageClassName:c.string,overlayClassName:c.string,spinner:c.func,src:c.string.isRequired,srcZoomed:c.string,tag:c.string,isPinchZoomEnabled:c.bool}),_defineProperty(et,"defaultProps",{alt:void 0,bgImageProps:{},bgImageTag:"div",className:null,imageClassName:null,overlayClassName:null,isPinchZoomEnabled:!0,spinner:null,srcZoomed:null,tag:"div"}),et),function(){return{}}),eu={slide:"slide___3-Nqo",slideHorizontal:"slideHorizontal___1NzNV",slideInner:"slideInner___2mfX9",focusRing:"focusRing___1airF"},ed=["ariaLabel","carouselStore","children","className","classNameHidden","classNameVisible","currentSlide","index","innerClassName","innerTag","naturalSlideHeight","naturalSlideWidth","onBlur","onFocus","orientation","slideSize","style","tabIndex","tag","totalSlides","visibleSlides","isIntrinsicHeight"],ep=WithStore((_defineProperty(er=function(r){function t(r){var s;return _classCallCheck(this,t),(s=a.call(this,r)).handleOnFocus=s.handleOnFocus.bind(_assertThisInitialized(s)),s.handleOnBlur=s.handleOnBlur.bind(_assertThisInitialized(s)),s.state={focused:!1},s}_inherits(t,r);var a=_createSuper(t);return _createClass(t,[{key:"isVisible",value:function(){var r=this.props,a=r.currentSlide,s=r.index,l=r.visibleSlides;return s>=a&&s=s.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(r,a){var s=this.props.trayProps;s&&"function"==typeof s[r]&&(a.persist(),s[r](a))}},{key:"handleOnMouseDown",value:function(r){if(!this.props.dragEnabled)return void this.callCallback("onMouseDown",r);r.preventDefault(),this.fakeOnDragStart({screenX:r.screenX,screenY:r.screenY,mouseDrag:!0}),this.callCallback("onMouseDown",r)}},{key:"handleOnMouseMove",value:function(r){this.state.isBeingMouseDragged&&(this.setState({cancelNextClick:!0}),r.preventDefault(),this.fakeOnDragMove(r.screenX,r.screenY))}},{key:"handleOnMouseUp",value:function(r){this.state.isBeingMouseDragged&&(r.preventDefault(),this.fakeOnDragEnd())}},{key:"handleOnClickCapture",value:function(r){if(!this.state.cancelNextClick)return void this.callCallback("onClickCapture",r);r.preventDefault(),this.setState({cancelNextClick:!1}),this.callCallback("onClickCapture",r)}},{key:"handleOnTouchStart",value:function(r){if(!this.props.touchEnabled)return void this.callCallback("onTouchStart",r);"vertical"===this.props.orientation&&r.preventDefault();var a=r.targetTouches[0];this.fakeOnDragStart({screenX:a.screenX,screenY:a.screenY,touchDrag:!0}),this.callCallback("onTouchStart",r)}},{key:"handleDocumentScroll",value:function(){var r=this;this.props.touchEnabled&&(this.isDocumentScrolling=!0,window.clearTimeout(this.scrollStopTimer),this.scrollStopTimer=window.setTimeout(function(){r.isDocumentScrolling=!1},66))}},{key:"handleOnTouchMove",value:function(r){if(!this.props.touchEnabled||this.props.lockOnWindowScroll&&this.isDocumentScrolling)return void this.callCallback("onTouchMove",r);window.cancelAnimationFrame.call(window,this.moveTimer);var a=r.targetTouches[0];a&&(this.fakeOnDragMove(a.screenX,a.screenY),this.callCallback("onTouchMove",r))}},{key:"forward",value:function(){var r=this.props;return Math.min(r.currentSlide+r.step,r.totalSlides-r.visibleSlides)}},{key:"backward",value:function(){var r=this.props;return Math.max(r.currentSlide-r.step,0)}},{key:"handleOnKeyDown",value:function(r){var a=r.keyCode,s=this.props,l=s.carouselStore,c=s.currentSlide,u=s.disableKeyboard,d=s.totalSlides,p=s.visibleSlides,f={};!0===u||d<=p||(37===a&&(r.preventDefault(),this.focus(),f.currentSlide=Math.max(0,c-1),f.isPlaying=!1),39===a&&(r.preventDefault(),this.focus(),f.currentSlide=Math.min(d-p,c+1),f.isPlaying=!1),l.setStoreState(f))}},{key:"playForward",value:function(){var r=this.props,a=r.carouselStore,s=r.currentSlide;a.setStoreState({currentSlide:this.forward()===s?0:this.forward()})}},{key:"playBackward",value:function(){var r=this.props,a=r.carouselStore,s=r.currentSlide,l=r.totalSlides,c=r.visibleSlides;a.setStoreState({currentSlide:this.backward()===s?l-c:this.backward()})}},{key:"play",value:function(){var r=this.props.playDirection;this.interval=setInterval("forward"===r?this.playForward:this.playBackward,this.props.interval)}},{key:"stop",value:function(){window.clearInterval(this.interval),this.interval=null}},{key:"lockScroll",value:function(){var r=new ef;this.scrollParent=r.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(r){this.state.preventingVerticalScroll&&(r.preventDefault(),r.stopImmediatePropagation())}},{key:"computeCurrentSlide",value:function(){var r=t.slideSizeInPx(this.props.orientation,this.sliderTrayElement.clientWidth,this.sliderTrayElement.clientHeight,this.props.totalSlides),a=t.slidesMoved(this.props.moveThreshold,this.props.orientation,this.state.deltaX,this.state.deltaY,r,this.props.dragStep),s=this.props.totalSlides-Math.min(this.props.totalSlides,this.props.visibleSlides),l=boundedRange({min:0,max:s,x:this.props.currentSlide+a});this.props.infinite&&(this.props.currentSlide>=s&&a>0&&(l=0),0===this.props.currentSlide&&a<0&&(l=s)),this.props.carouselStore.setStoreState({currentSlide:l})}},{key:"focus",value:function(){this.sliderElement.focus()}},{key:"handleOnTouchEnd",value:function(r){this.endTouchMove(),this.callCallback("onTouchEnd",r)}},{key:"handleOnTouchCancel",value:function(r){this.endTouchMove(),this.callCallback("onTouchCancel",r)}},{key:"endTouchMove",value:function(){this.props.touchEnabled&&this.fakeOnDragEnd()}},{key:"renderMasterSpinner",value:function(){var r=this.props,a=r.hasMasterSpinner,s=r.masterSpinnerFinished,c=r.spinner;return a&&!s?("function"==typeof this.props.onMasterSpinner&&this.props.onMasterSpinner(),l.createElement("div",{className:cn([eh.masterSpinnerContainer,"carousel__master-spinner-container"])},c&&c(),!c&&l.createElement(ea,null))):null}},{key:"render",value:function(){var r=this,a=this.props,s=a.ariaLabel,c=(a.carouselStore,a.children),u=a.className,d=a.classNameAnimation,p=a.classNameTray,f=a.classNameTrayWrap,m=a.currentSlide,b=a.disableAnimation,g=(a.disableKeyboard,a.dragEnabled,a.hasMasterSpinner,a.interval,a.isPageScrollLocked,a.isPlaying,a.lockOnWindowScroll,a.masterSpinnerFinished,a.moveThreshold,a.naturalSlideHeight),y=a.naturalSlideWidth,_=(a.onMasterSpinner,a.orientation),v=(a.playDirection,a.privateUnDisableAnimation,a.slideSize),S=a.slideTraySize,w=(a.spinner,a.style),O=a.tabIndex,k=(a.totalSlides,a.touchEnabled,a.trayProps),E=a.trayTag,P=a.visibleSlides,x=a.isIntrinsicHeight,j=_objectWithoutProperties(a,em),C=_extends({},w),M={};"vertical"===_&&(M.height=0,M.paddingBottom=pct(100*g*P/y),M.width=pct(100));var T={},A=pct(-(v*m*1));(this.state.isBeingTouchDragged||this.state.isBeingMouseDragged||b)&&(T.transition="none"),x&&(T.display="flex",T.alignItems="stretch"),"vertical"===_?(T.transform="translateY(".concat(A,") translateY(").concat(this.state.deltaY,"px)"),T.width=pct(100),T.flexDirection="column"):(T.width=pct(S),T.transform="translateX(".concat(A,") translateX(").concat(this.state.deltaX,"px)"),T.flexDirection="row");var R=cn(["vertical"===_?eh.verticalSlider:eh.horizontalSlider,"carousel__slider","vertical"===_?"carousel__slider--vertical":"carousel__slider--horizontal",u]),L=cn([eh.sliderTrayWrap,"carousel__slider-tray-wrapper","vertical"===_?eh.verticalSlideTrayWrap:eh.horizontalTrayWrap,"vertical"===_?"carousel__slider-tray-wrap--vertical":"carousel__slider-tray-wrap--horizontal",f]),I=cn([eh.sliderTray,d||eh.sliderAnimation,"carousel__slider-tray","vertical"===_?eh.verticalTray:eh.horizontalTray,"vertical"===_?"carousel__slider-tray--vertical":"carousel__slider-tray--horizontal",p]),D=(j.dragStep,j.step,j.infinite,j.preventVerticalScrollOnTouch,j.preventingVerticalScroll,j.horizontalPixelThreshold,j.verticalPixelThreshold,_objectWithoutProperties(j,eb)),N=(k.className,k.onClickCapture,k.onMouseDown,k.onTouchCancel,k.onTouchEnd,k.onTouchMove,k.onTouchStart,k.ref,k.style,_objectWithoutProperties(k,eg));return l.createElement("div",_extends({ref:function(a){r.sliderElement=a},className:R,"aria-live":"polite","aria-label":s,style:C,tabIndex:null!==O?O:0,onKeyDown:this.handleOnKeyDown,role:"listbox"},D),l.createElement("div",{className:L,style:M},l.createElement(E,_extends({ref:this.getSliderRef,className:I,style:T,onTouchStart:this.handleOnTouchStart,onTouchMove:this.handleOnTouchMove,onTouchEnd:this.handleOnTouchEnd,onTouchCancel:this.handleOnTouchCancel,onMouseDown:this.handleOnMouseDown,onClickCapture:this.handleOnClickCapture},N),c),this.renderMasterSpinner()))}}],[{key:"slideSizeInPx",value:function(r,a,s,l){return("horizontal"===r?a:s)/l}},{key:"slidesMoved",value:function(r,a,s,l,c,u){var d="horizontal"===a?s:l,p=Math.max(Math.abs(d)>=c*r?u:0,Math.abs(Math.round(d/c)));if(d<0)return p;var f=-p;return 0===f?0:f}}]),t}(l.Component),"propTypes",{ariaLabel:c.string,carouselStore:c.object.isRequired,children:c.node.isRequired,className:c.string,classNameAnimation:c.string,classNameTray:c.string,classNameTrayWrap:c.string,currentSlide:c.number.isRequired,disableAnimation:c.bool,disableKeyboard:c.bool,dragEnabled:c.bool.isRequired,dragStep:c.number,hasMasterSpinner:c.bool.isRequired,infinite:c.bool,interval:c.number.isRequired,isPageScrollLocked:c.bool.isRequired,isPlaying:c.bool.isRequired,lockOnWindowScroll:c.bool.isRequired,preventVerticalScrollOnTouch:c.bool,horizontalPixelThreshold:c.number,verticalPixelThreshold:c.number,masterSpinnerFinished:c.bool.isRequired,moveThreshold:c.number,naturalSlideHeight:c.number.isRequired,naturalSlideWidth:c.number.isRequired,onMasterSpinner:c.func,orientation:f.orientation.isRequired,playDirection:f.direction.isRequired,privateUnDisableAnimation:c.bool,slideSize:c.number.isRequired,slideTraySize:c.number.isRequired,spinner:c.func,step:c.number.isRequired,style:c.object,tabIndex:c.number,totalSlides:c.number.isRequired,touchEnabled:c.bool.isRequired,trayProps:c.shape({className:c.string,onClickCapture:c.func,onMouseDown:c.func,onTouchCancel:c.func,onTouchEnd:c.func,onTouchMove:c.func,onTouchStart:c.func,ref:c.shape({}),style:c.string}),trayTag:c.string,visibleSlides:c.number,isIntrinsicHeight:c.bool}),_defineProperty(en,"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}),en),function(r){return{currentSlide:r.currentSlide,disableAnimation:r.disableAnimation,privateUnDisableAnimation:r.privateUnDisableAnimation,disableKeyboard:r.disableKeyboard,dragEnabled:r.dragEnabled,hasMasterSpinner:r.hasMasterSpinner,infinite:r.infinite,interval:r.interval,isPageScrollLocked:r.isPageScrollLocked,isPlaying:r.isPlaying,lockOnWindowScroll:r.lockOnWindowScroll,preventingVerticalScroll:r.preventingVerticalScroll,masterSpinnerFinished:r.masterSpinnerFinished,naturalSlideHeight:r.naturalSlideHeight,naturalSlideWidth:r.naturalSlideWidth,orientation:r.orientation,playDirection:r.playDirection,slideSize:r.slideSize,slideTraySize:r.slideTraySize,step:r.step,dragStep:r.dragStep,totalSlides:r.totalSlides,touchEnabled:r.touchEnabled,visibleSlides:r.visibleSlides,isIntrinsicHeight:r.isIntrinsicHeight}})},71651:function(r,a,s){r.exports=s(14031)},57831:function(r,a,s){"use strict";let l;var c,u,d=s(48764).Buffer;function bind(r,a){return function(){return r.apply(a,arguments)}}let{toString:p}=Object.prototype,{getPrototypeOf:f}=Object,m=(c=Object.create(null),r=>{let a=p.call(r);return c[a]||(c[a]=a.slice(8,-1).toLowerCase())}),kindOfTest=r=>(r=r.toLowerCase(),a=>m(a)===r),typeOfTest=r=>a=>typeof a===r,{isArray:b}=Array,g=typeOfTest("undefined");function isBuffer(r){return null!==r&&!g(r)&&null!==r.constructor&&!g(r.constructor)&&v(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}let y=kindOfTest("ArrayBuffer");function isArrayBufferView(r){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&y(r.buffer)}let _=typeOfTest("string"),v=typeOfTest("function"),S=typeOfTest("number"),isObject=r=>null!==r&&"object"==typeof r,isPlainObject=r=>{if("object"!==m(r))return!1;let a=f(r);return(null===a||a===Object.prototype||null===Object.getPrototypeOf(a))&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},w=kindOfTest("Date"),O=kindOfTest("File"),k=kindOfTest("Blob"),E=kindOfTest("FileList"),P=kindOfTest("URLSearchParams");function forEach(r,a,{allOwnKeys:s=!1}={}){let l,c;if(null!=r){if("object"!=typeof r&&(r=[r]),b(r))for(l=0,c=r.length;l0;)if(a===(s=l[c]).toLowerCase())return s;return null}let x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:s.g,isContextDefined=r=>!g(r)&&r!==x;function merge(){let{caseless:r}=isContextDefined(this)&&this||{},a={},assignValue=(s,l)=>{let c=r&&findKey(a,l)||l;isPlainObject(a[c])&&isPlainObject(s)?a[c]=merge(a[c],s):isPlainObject(s)?a[c]=merge({},s):b(s)?a[c]=s.slice():a[c]=s};for(let r=0,a=arguments.length;ru&&r instanceof u),C=kindOfTest("HTMLFormElement"),M=(({hasOwnProperty:r})=>(a,s)=>r.call(a,s))(Object.prototype),T=kindOfTest("RegExp"),reduceDescriptors=(r,a)=>{let s=Object.getOwnPropertyDescriptors(r),l={};forEach(s,(s,c)=>{!1!==a(s,c,r)&&(l[c]=s)}),Object.defineProperties(r,l)};var A={isArray:b,isArrayBuffer:y,isBuffer,isFormData:r=>{let a="[object FormData]";return r&&("function"==typeof FormData&&r instanceof FormData||p.call(r)===a||v(r.toString)&&r.toString()===a)},isArrayBufferView,isString:_,isNumber:S,isBoolean:r=>!0===r||!1===r,isObject,isPlainObject,isUndefined:g,isDate:w,isFile:O,isBlob:k,isRegExp:T,isFunction:v,isStream:r=>isObject(r)&&v(r.pipe),isURLSearchParams:P,isTypedArray:j,isFileList:E,forEach,merge,extend:(r,a,s,{allOwnKeys:l}={})=>(forEach(a,(a,l)=>{s&&v(a)?r[l]=bind(a,s):r[l]=a},{allOwnKeys:l}),r),trim:r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:r=>(65279===r.charCodeAt(0)&&(r=r.slice(1)),r),inherits:(r,a,s,l)=>{r.prototype=Object.create(a.prototype,l),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),s&&Object.assign(r.prototype,s)},toFlatObject:(r,a,s,l)=>{let c,u,d;let p={};if(a=a||{},null==r)return a;do{for(u=(c=Object.getOwnPropertyNames(r)).length;u-- >0;)d=c[u],(!l||l(d,r,a))&&!p[d]&&(a[d]=r[d],p[d]=!0);r=!1!==s&&f(r)}while(r&&(!s||s(r,a))&&r!==Object.prototype);return a},kindOf:m,kindOfTest,endsWith:(r,a,s)=>{r=String(r),(void 0===s||s>r.length)&&(s=r.length),s-=a.length;let l=r.indexOf(a,s);return -1!==l&&l===s},toArray:r=>{if(!r)return null;if(b(r))return r;let a=r.length;if(!S(a))return null;let s=Array(a);for(;a-- >0;)s[a]=r[a];return s},forEachEntry:(r,a)=>{let s;let l=r&&r[Symbol.iterator],c=l.call(r);for(;(s=c.next())&&!s.done;){let l=s.value;a.call(r,l[0],l[1])}},matchAll:(r,a)=>{let s;let l=[];for(;null!==(s=r.exec(a));)l.push(s);return l},isHTMLForm:C,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors,freezeMethods:r=>{reduceDescriptors(r,(a,s)=>{if(v(r)&&-1!==["arguments","caller","callee"].indexOf(s))return!1;let l=r[s];if(v(l)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},toObjectSet:(r,a)=>{let s={};return(r=>{r.forEach(r=>{s[r]=!0})})(b(r)?r:String(r).split(a)),s},toCamelCase:r=>r.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,a,s){return a.toUpperCase()+s}),noop:()=>{},toFiniteNumber:(r,a)=>Number.isFinite(r=+r)?r:a,findKey,global:x,isContextDefined,toJSONObject:r=>{let a=Array(10),visit=(r,s)=>{if(isObject(r)){if(a.indexOf(r)>=0)return;if(!("toJSON"in r)){a[s]=r;let l=b(r)?[]:{};return forEach(r,(r,a)=>{let c=visit(r,s+1);g(c)||(l[a]=c)}),a[s]=void 0,l}}return r};return visit(r,0)}};function AxiosError(r,a,s,l,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),s&&(this.config=s),l&&(this.request=l),c&&(this.response=c)}A.inherits(AxiosError,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:A.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let R=AxiosError.prototype,L={};["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(r=>{L[r]={value:r}}),Object.defineProperties(AxiosError,L),Object.defineProperty(R,"isAxiosError",{value:!0}),AxiosError.from=(r,a,s,l,c,u)=>{let d=Object.create(R);return A.toFlatObject(r,d,function(r){return r!==Error.prototype},r=>"isAxiosError"!==r),AxiosError.call(d,r.message,a,s,l,c),d.cause=r,d.name=r.name,u&&Object.assign(d,u),d};var I="object"==typeof self?self.FormData:window.FormData;function isVisitable(r){return A.isPlainObject(r)||A.isArray(r)}function removeBrackets(r){return A.endsWith(r,"[]")?r.slice(0,-2):r}function renderKey(r,a,s){return r?r.concat(a).map(function(r,a){return r=removeBrackets(r),!s&&a?"["+r+"]":r}).join(s?".":""):a}function isFlatArray(r){return A.isArray(r)&&!r.some(isVisitable)}let D=A.toFlatObject(A,{},null,function(r){return/^is[A-Z]/.test(r)});function isSpecCompliant(r){return r&&A.isFunction(r.append)&&"FormData"===r[Symbol.toStringTag]&&r[Symbol.iterator]}function toFormData(r,a,s){if(!A.isObject(r))throw TypeError("target must be an object");a=a||new(I||FormData),s=A.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(r,a){return!A.isUndefined(a[r])});let l=s.metaTokens,c=s.visitor||defaultVisitor,u=s.dots,p=s.indexes,f=s.Blob||"undefined"!=typeof Blob&&Blob,m=f&&isSpecCompliant(a);if(!A.isFunction(c))throw TypeError("visitor must be a function");function convertValue(r){if(null===r)return"";if(A.isDate(r))return r.toISOString();if(!m&&A.isBlob(r))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(r)||A.isTypedArray(r)?m&&"function"==typeof Blob?new Blob([r]):d.from(r):r}function defaultVisitor(r,s,c){let d=r;if(r&&!c&&"object"==typeof r){if(A.endsWith(s,"{}"))s=l?s:s.slice(0,-2),r=JSON.stringify(r);else if(A.isArray(r)&&isFlatArray(r)||A.isFileList(r)||A.endsWith(s,"[]")&&(d=A.toArray(r)))return s=removeBrackets(s),d.forEach(function(r,l){A.isUndefined(r)||null===r||a.append(!0===p?renderKey([s],l,u):null===p?s:s+"[]",convertValue(r))}),!1}return!!isVisitable(r)||(a.append(renderKey(c,s,u),convertValue(r)),!1)}let b=[],g=Object.assign(D,{defaultVisitor,convertValue,isVisitable});function build(r,s){if(!A.isUndefined(r)){if(-1!==b.indexOf(r))throw Error("Circular reference detected in "+s.join("."));b.push(r),A.forEach(r,function(r,l){let u=!(A.isUndefined(r)||null===r)&&c.call(a,r,A.isString(l)?l.trim():l,s,g);!0===u&&build(r,s?s.concat(l):[l])}),b.pop()}}if(!A.isObject(r))throw TypeError("data must be an object");return build(r),a}function encode$1(r){let a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\x00"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(r){return a[r]})}function AxiosURLSearchParams(r,a){this._pairs=[],r&&toFormData(r,this,a)}let N=AxiosURLSearchParams.prototype;function encode(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(r,a,s){let l;if(!a)return r;let c=s&&s.encode||encode,u=s&&s.serialize;if(l=u?u(a,s):A.isURLSearchParams(a)?a.toString():new AxiosURLSearchParams(a,s).toString(c)){let a=r.indexOf("#");-1!==a&&(r=r.slice(0,a)),r+=(-1===r.indexOf("?")?"?":"&")+l}return r}N.append=function(r,a){this._pairs.push([r,a])},N.toString=function(r){let a=r?function(a){return r.call(this,a,encode$1)}:encode$1;return this._pairs.map(function(r){return a(r[0])+"="+a(r[1])},"").join("&")};let InterceptorManager=class InterceptorManager{constructor(){this.handlers=[]}use(r,a,s){return this.handlers.push({fulfilled:r,rejected:a,synchronous:!!s&&s.synchronous,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){A.forEach(this.handlers,function(a){null!==a&&r(a)})}};var W={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},F="undefined"!=typeof URLSearchParams?URLSearchParams:AxiosURLSearchParams,V=FormData;let q=("undefined"==typeof navigator||"ReactNative"!==(l=navigator.product)&&"NativeScript"!==l&&"NS"!==l)&&"undefined"!=typeof window&&"undefined"!=typeof document,U="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var B={classes:{URLSearchParams:F,FormData:V,Blob},isStandardBrowserEnv:q,isStandardBrowserWebWorkerEnv:U,protocols:["http","https","file","blob","url","data"]};function toURLEncodedForm(r,a){return toFormData(r,new B.classes.URLSearchParams,Object.assign({visitor:function(r,a,s,l){return B.isNode&&A.isBuffer(r)?(this.append(a,r.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},a))}function parsePropPath(r){return A.matchAll(/\w+|\[(\w*)]/g,r).map(r=>"[]"===r[0]?"":r[1]||r[0])}function arrayToObject(r){let a,s;let l={},c=Object.keys(r),u=c.length;for(a=0;a=r.length;if(c=!c&&A.isArray(s)?s.length:c,d)return A.hasOwnProp(s,c)?s[c]=[s[c],a]:s[c]=a,!u;s[c]&&A.isObject(s[c])||(s[c]=[]);let p=buildPath(r,a,s[c],l);return p&&A.isArray(s[c])&&(s[c]=arrayToObject(s[c])),!u}if(A.isFormData(r)&&A.isFunction(r.entries)){let a={};return A.forEachEntry(r,(r,s)=>{buildPath(parsePropPath(r),s,a,0)}),a}return null}let z={"Content-Type":void 0};function stringifySafely(r,a,s){if(A.isString(r))try{return(a||JSON.parse)(r),A.trim(r)}catch(r){if("SyntaxError"!==r.name)throw r}return(s||JSON.stringify)(r)}let H={transitional:W,adapter:["xhr","http"],transformRequest:[function(r,a){let s;let l=a.getContentType()||"",c=l.indexOf("application/json")>-1,u=A.isObject(r);u&&A.isHTMLForm(r)&&(r=new FormData(r));let d=A.isFormData(r);if(d)return c&&c?JSON.stringify(formDataToJSON(r)):r;if(A.isArrayBuffer(r)||A.isBuffer(r)||A.isStream(r)||A.isFile(r)||A.isBlob(r))return r;if(A.isArrayBufferView(r))return r.buffer;if(A.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();if(u){if(l.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(r,this.formSerializer).toString();if((s=A.isFileList(r))||l.indexOf("multipart/form-data")>-1){let a=this.env&&this.env.FormData;return toFormData(s?{"files[]":r}:r,a&&new a,this.formSerializer)}}return u||c?(a.setContentType("application/json",!1),stringifySafely(r)):r}],transformResponse:[function(r){let a=this.transitional||H.transitional,s=a&&a.forcedJSONParsing,l="json"===this.responseType;if(r&&A.isString(r)&&(s&&!this.responseType||l)){let s=a&&a.silentJSONParsing;try{return JSON.parse(r)}catch(r){if(!s&&l){if("SyntaxError"===r.name)throw AxiosError.from(r,AxiosError.ERR_BAD_RESPONSE,this,null,this.response);throw r}}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};A.forEach(["delete","get","head"],function(r){H.headers[r]={}}),A.forEach(["post","put","patch"],function(r){H.headers[r]=A.merge(z)});let G=A.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 parseHeaders=r=>{let a,s,l;let c={};return r&&r.split("\n").forEach(function(r){l=r.indexOf(":"),a=r.substring(0,l).trim().toLowerCase(),s=r.substring(l+1).trim(),!a||c[a]&&G[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)}),c};let X=Symbol("internals");function normalizeHeader(r){return r&&String(r).trim().toLowerCase()}function normalizeValue(r){return!1===r||null==r?r:A.isArray(r)?r.map(normalizeValue):String(r)}function parseTokens(r){let a;let s=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;a=l.exec(r);)s[a[1]]=a[2];return s}function isValidHeaderName(r){return/^[-_a-zA-Z]+$/.test(r.trim())}function matchHeaderValue(r,a,s,l){if(A.isFunction(l))return l.call(this,a,s);if(A.isString(a)){if(A.isString(l))return -1!==a.indexOf(l);if(A.isRegExp(l))return l.test(a)}}function formatHeader(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,a,s)=>a.toUpperCase()+s)}function buildAccessors(r,a){let s=A.toCamelCase(" "+a);["get","set","has"].forEach(l=>{Object.defineProperty(r,l+s,{value:function(r,s,c){return this[l].call(this,a,r,s,c)},configurable:!0})})}let AxiosHeaders=class AxiosHeaders{constructor(r){r&&this.set(r)}set(r,a,s){let l=this;function setHeader(r,a,s){let c=normalizeHeader(a);if(!c)throw Error("header name must be a non-empty string");let u=A.findKey(l,c);u&&void 0!==l[u]&&!0!==s&&(void 0!==s||!1===l[u])||(l[u||a]=normalizeValue(r))}let setHeaders=(r,a)=>A.forEach(r,(r,s)=>setHeader(r,s,a));return A.isPlainObject(r)||r instanceof this.constructor?setHeaders(r,a):A.isString(r)&&(r=r.trim())&&!isValidHeaderName(r)?setHeaders(parseHeaders(r),a):null!=r&&setHeader(a,r,s),this}get(r,a){if(r=normalizeHeader(r)){let s=A.findKey(this,r);if(s){let r=this[s];if(!a)return r;if(!0===a)return parseTokens(r);if(A.isFunction(a))return a.call(this,r,s);if(A.isRegExp(a))return a.exec(r);throw TypeError("parser must be boolean|regexp|function")}}}has(r,a){if(r=normalizeHeader(r)){let s=A.findKey(this,r);return!!(s&&(!a||matchHeaderValue(this,this[s],s,a)))}return!1}delete(r,a){let s=this,l=!1;function deleteHeader(r){if(r=normalizeHeader(r)){let c=A.findKey(s,r);c&&(!a||matchHeaderValue(s,s[c],c,a))&&(delete s[c],l=!0)}}return A.isArray(r)?r.forEach(deleteHeader):deleteHeader(r),l}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(r){let a=this,s={};return A.forEach(this,(l,c)=>{let u=A.findKey(s,c);if(u){a[u]=normalizeValue(l),delete a[c];return}let d=r?formatHeader(c):String(c).trim();d!==c&&delete a[c],a[d]=normalizeValue(l),s[d]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){let a=Object.create(null);return A.forEach(this,(s,l)=>{null!=s&&!1!==s&&(a[l]=r&&A.isArray(s)?s.join(", "):s)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,a])=>r+": "+a).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...a){let s=new this(r);return a.forEach(r=>s.set(r)),s}static accessor(r){let a=this[X]=this[X]={accessors:{}},s=a.accessors,l=this.prototype;function defineAccessor(r){let a=normalizeHeader(r);s[a]||(buildAccessors(l,r),s[a]=!0)}return A.isArray(r)?r.forEach(defineAccessor):defineAccessor(r),this}};function transformData(r,a){let s=this||H,l=a||s,c=AxiosHeaders.from(l.headers),u=l.data;return A.forEach(r,function(r){u=r.call(s,u,c.normalize(),a?a.status:void 0)}),c.normalize(),u}function isCancel(r){return!!(r&&r.__CANCEL__)}function CanceledError(r,a,s){AxiosError.call(this,null==r?"canceled":r,AxiosError.ERR_CANCELED,a,s),this.name="CanceledError"}function settle(r,a,s){let l=s.config.validateStatus;!s.status||!l||l(s.status)?r(s):a(new AxiosError("Request failed with status code "+s.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),A.freezeMethods(AxiosHeaders.prototype),A.freezeMethods(AxiosHeaders),A.inherits(CanceledError,AxiosError,{__CANCEL__:!0});var K=B.isStandardBrowserEnv?{write:function(r,a,s,l,c,u){let d=[];d.push(r+"="+encodeURIComponent(a)),A.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),A.isString(l)&&d.push("path="+l),A.isString(c)&&d.push("domain="+c),!0===u&&d.push("secure"),document.cookie=d.join("; ")},read:function(r){let a=document.cookie.match(RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function isAbsoluteURL(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function combineURLs(r,a){return a?r.replace(/\/+$/,"")+"/"+a.replace(/^\/+/,""):r}function buildFullPath(r,a){return r&&!isAbsoluteURL(a)?combineURLs(r,a):a}var J=B.isStandardBrowserEnv?function(){let r;let a=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");function resolveURL(r){let l=r;return a&&(s.setAttribute("href",l),l=s.href),s.setAttribute("href",l),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}return r=resolveURL(window.location.href),function(a){let s=A.isString(a)?resolveURL(a):a;return s.protocol===r.protocol&&s.host===r.host}}():function(){return!0};function parseProtocol(r){let a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return a&&a[1]||""}function speedometer(r,a){let s;r=r||10;let l=Array(r),c=Array(r),u=0,d=0;return a=void 0!==a?a:1e3,function(p){let f=Date.now(),m=c[d];s||(s=f),l[u]=p,c[u]=f;let b=d,g=0;for(;b!==u;)g+=l[b++],b%=r;if((u=(u+1)%r)===d&&(d=(d+1)%r),f-s{let u=c.loaded,d=c.lengthComputable?c.total:void 0,p=u-s,f=l(p),m=u<=d;s=u;let b={loaded:u,total:d,progress:d?u/d:void 0,bytes:p,rate:f||void 0,estimated:f&&d&&m?(d-u)/f:void 0,event:c};b[a?"download":"upload"]=!0,r(b)}}let Z="undefined"!=typeof XMLHttpRequest;var Y=Z&&function(r){return new Promise(function(a,s){let l,c=r.data,u=AxiosHeaders.from(r.headers).normalize(),d=r.responseType;function done(){r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}A.isFormData(c)&&(B.isStandardBrowserEnv||B.isStandardBrowserWebWorkerEnv)&&u.setContentType(!1);let p=new XMLHttpRequest;if(r.auth){let a=r.auth.username||"",s=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";u.set("Authorization","Basic "+btoa(a+":"+s))}let f=buildFullPath(r.baseURL,r.url);function onloadend(){if(!p)return;let l=AxiosHeaders.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),c=d&&"text"!==d&&"json"!==d?p.response:p.responseText,u={data:c,status:p.status,statusText:p.statusText,headers:l,config:r,request:p};settle(function(r){a(r),done()},function(r){s(r),done()},u),p=null}if(p.open(r.method.toUpperCase(),buildURL(f,r.params,r.paramsSerializer),!0),p.timeout=r.timeout,"onloadend"in p?p.onloadend=onloadend:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(onloadend)},p.onabort=function(){p&&(s(new AxiosError("Request aborted",AxiosError.ECONNABORTED,r,p)),p=null)},p.onerror=function(){s(new AxiosError("Network Error",AxiosError.ERR_NETWORK,r,p)),p=null},p.ontimeout=function(){let a=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",l=r.transitional||W;r.timeoutErrorMessage&&(a=r.timeoutErrorMessage),s(new AxiosError(a,l.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,r,p)),p=null},B.isStandardBrowserEnv){let a=(r.withCredentials||J(f))&&r.xsrfCookieName&&K.read(r.xsrfCookieName);a&&u.set(r.xsrfHeaderName,a)}void 0===c&&u.setContentType(null),"setRequestHeader"in p&&A.forEach(u.toJSON(),function(r,a){p.setRequestHeader(a,r)}),A.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),d&&"json"!==d&&(p.responseType=r.responseType),"function"==typeof r.onDownloadProgress&&p.addEventListener("progress",progressEventReducer(r.onDownloadProgress,!0)),"function"==typeof r.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",progressEventReducer(r.onUploadProgress)),(r.cancelToken||r.signal)&&(l=a=>{p&&(s(!a||a.type?new CanceledError(null,r,p):a),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));let m=parseProtocol(f);if(m&&-1===B.protocols.indexOf(m)){s(new AxiosError("Unsupported protocol "+m+":",AxiosError.ERR_BAD_REQUEST,r));return}p.send(c||null)})};let Q={http:null,xhr:Y};A.forEach(Q,(r,a)=>{if(r){try{Object.defineProperty(r,"name",{value:a})}catch(r){}Object.defineProperty(r,"adapterName",{value:a})}});var $={getAdapter:r=>{let a,s;r=A.isArray(r)?r:[r];let{length:l}=r;for(let c=0;cr instanceof AxiosHeaders?r.toJSON():r;function mergeConfig(r,a){a=a||{};let s={};function getMergedValue(r,a,s){return A.isPlainObject(r)&&A.isPlainObject(a)?A.merge.call({caseless:s},r,a):A.isPlainObject(a)?A.merge({},a):A.isArray(a)?a.slice():a}function mergeDeepProperties(r,a,s){return A.isUndefined(a)?A.isUndefined(r)?void 0:getMergedValue(void 0,r,s):getMergedValue(r,a,s)}function valueFromConfig2(r,a){if(!A.isUndefined(a))return getMergedValue(void 0,a)}function defaultToConfig2(r,a){return A.isUndefined(a)?A.isUndefined(r)?void 0:getMergedValue(void 0,r):getMergedValue(void 0,a)}function mergeDirectKeys(s,l,c){return c in a?getMergedValue(s,l):c in r?getMergedValue(void 0,s):void 0}let l={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:(r,a)=>mergeDeepProperties(headersToObject(r),headersToObject(a),!0)};return A.forEach(Object.keys(r).concat(Object.keys(a)),function(c){let u=l[c]||mergeDeepProperties,d=u(r[c],a[c],c);A.isUndefined(d)&&u!==mergeDirectKeys||(s[c]=d)}),s}let ee="1.2.3",et={};["object","boolean","number","function","string","symbol"].forEach((r,a)=>{et[r]=function(s){return typeof s===r||"a"+(a<1?"n ":" ")+r}});let er={};et.transitional=function(r,a,s){function formatMessage(r,a){return"[Axios v"+ee+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(s,l,c)=>{if(!1===r)throw new AxiosError(formatMessage(l," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!er[l]&&(er[l]=!0,console.warn(formatMessage(l," has been deprecated since v"+a+" and will be removed in the near future"))),!r||r(s,l,c)}};var en={assertOptions:function(r,a,s){if("object"!=typeof r)throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);let l=Object.keys(r),c=l.length;for(;c-- >0;){let u=l[c],d=a[u];if(d){let a=r[u],s=void 0===a||d(a,u,r);if(!0!==s)throw new AxiosError("option "+u+" must be "+s,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(!0!==s)throw new AxiosError("Unknown option "+u,AxiosError.ERR_BAD_OPTION)}},validators:et};let eo=en.validators;let Axios=class Axios{constructor(r){this.defaults=r,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}request(r,a){let s,l,c;"string"==typeof r?(a=a||{}).url=r:a=r||{},a=mergeConfig(this.defaults,a);let{transitional:u,paramsSerializer:d,headers:p}=a;void 0!==u&&en.assertOptions(u,{silentJSONParsing:eo.transitional(eo.boolean),forcedJSONParsing:eo.transitional(eo.boolean),clarifyTimeoutError:eo.transitional(eo.boolean)},!1),void 0!==d&&en.assertOptions(d,{encode:eo.function,serialize:eo.function},!0),a.method=(a.method||this.defaults.method||"get").toLowerCase(),(s=p&&A.merge(p.common,p[a.method]))&&A.forEach(["delete","get","head","post","put","patch","common"],r=>{delete p[r]}),a.headers=AxiosHeaders.concat(s,p);let f=[],m=!0;this.interceptors.request.forEach(function(r){("function"!=typeof r.runWhen||!1!==r.runWhen(a))&&(m=m&&r.synchronous,f.unshift(r.fulfilled,r.rejected))});let b=[];this.interceptors.response.forEach(function(r){b.push(r.fulfilled,r.rejected)});let g=0;if(!m){let r=[dispatchRequest.bind(this),void 0];for(r.unshift.apply(r,f),r.push.apply(r,b),c=r.length,l=Promise.resolve(a);g{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](r);s._listeners=null}),this.promise.then=r=>{let a;let l=new Promise(r=>{s.subscribe(r),a=r}).then(r);return l.cancel=function(){s.unsubscribe(a)},l},r(function(r,l,c){s.reason||(s.reason=new CanceledError(r,l,c),a(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;let a=this._listeners.indexOf(r);-1!==a&&this._listeners.splice(a,1)}static source(){let r;let a=new CancelToken(function(a){r=a});return{token:a,cancel:r}}};function spread(r){return function(a){return r.apply(null,a)}}function isAxiosError(r){return A.isObject(r)&&!0===r.isAxiosError}let ei={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};function createInstance(r){let a=new Axios(r),s=bind(Axios.prototype.request,a);return A.extend(s,Axios.prototype,a,{allOwnKeys:!0}),A.extend(s,a,null,{allOwnKeys:!0}),s.create=function(a){return createInstance(mergeConfig(r,a))},s}Object.entries(ei).forEach(([r,a])=>{ei[a]=r});let ea=createInstance(H);ea.Axios=Axios,ea.CanceledError=CanceledError,ea.CancelToken=CancelToken,ea.isCancel=isCancel,ea.VERSION=ee,ea.toFormData=toFormData,ea.AxiosError=AxiosError,ea.Cancel=ea.CanceledError,ea.all=function(r){return Promise.all(r)},ea.spread=spread,ea.isAxiosError=isAxiosError,ea.mergeConfig=mergeConfig,ea.AxiosHeaders=AxiosHeaders,ea.formToJSON=r=>formDataToJSON(A.isHTMLForm(r)?new FormData(r):r),ea.HttpStatusCode=ei,ea.default=ea,r.exports=ea},53194:function(r,a,s){r.exports=s(28773)},28773:function(r,a,s){"use strict";a.getMDXComponent=getMDXComponent;var l=_interopRequireWildcard(s(67294)),c=_interopRequireWildcard(s(85893)),u=_interopRequireWildcard(s(73935));function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var a=new WeakMap,s=new WeakMap;return(_getRequireWildcardCache=function(r){return r?s:a})(r)}function _interopRequireWildcard(r,a){if(!a&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var s=_getRequireWildcardCache(a);if(s&&s.has(r))return s.get(r);var l={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&Object.prototype.hasOwnProperty.call(r,u)){var d=c?Object.getOwnPropertyDescriptor(r,u):null;d&&(d.get||d.set)?Object.defineProperty(l,u,d):l[u]=r[u]}return l.default=r,s&&s.set(r,l),l}function getMDXComponent(r,a){let s=getMDXExport(r,a);return s.default}function getMDXExport(r,a){let s={React:l,ReactDOM:u,_jsx_runtime:c,...a},d=Function(...Object.keys(s),r);return d(...Object.values(s))}},61563:function(r,a,s){"use strict";s.d(a,{_E:function(){return MdxRenderer}});var l=s(67294),c=s(71986),u=s(53194),d=s(52181);function _object_without_properties(r,a){if(null==r)return{};var s,l,c=_object_without_properties_loose(r,a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function _object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var p=(0,l.createContext)({}),MarkdownProvider=function(r){var a=r.children,s=_object_without_properties(r,["children"]);return l.createElement(p.Provider,{value:s},a)},useMarkdown=function(){try{return(0,l.useContext)(p)}catch(r){return{}}};function _define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _object_spread(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function link_object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var renderLink=function(r){var a=r.children,s=link_object_without_properties(r,["children"]),u=useMarkdown().link,d=void 0===u?{}:u;return l.createElement(c.Link,_object_spread({isInline:!0},s,d),a)};function list_define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function _extends(){return(_extends=Object.assign||function(r){for(var a=1;a=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(c[s]=r[s])}return c}function text_object_without_properties_loose(r,a){if(null==r)return{};var s,l,c={},u=Object.keys(r);for(l=0;l=0||(c[s]=r[s]);return c}var renderText=function(r,a){var s=r.children,u=text_object_without_properties(r,["children"]),d=useMarkdown(),p=d.paragraph,f=void 0===p?{}:p,m=d[a];return l.createElement(c.Text,text_object_spread({as:a,variant:{h1:"text-header-4XL",h2:"text-header-3XL",h3:"text-header-2XL",h4:"text-header-XL",h5:"text-header-L",h6:"text-header-M"}[a]},f,m,u),s)};function components_define_property(r,a,s){return a in r?Object.defineProperty(r,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[a]=s,r}function components_object_spread(r){for(var a=1;ar.length)&&(a=r.length);for(var s=0,l=Array(a);s