@cliniq360/eigi-chat 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ var EigiChatInternal=function(e){"use strict";var t=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,r(t)),u=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},d=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(qn){i(qn)}},o=e=>{try{s(n.throw(e))}catch(qn){i(qn)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,h,m={exports:{}},g={};var v,y,b=(h||(h=1,m.exports=function(){if(p)return g;p=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==n.key&&(i=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:i,ref:void 0!==n?n:null,props:r}}return g.Fragment=t,g.jsx=n,g.jsxs=n,g}()),m.exports),w={exports:{}},k={};function S(){if(v)return k;v=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var w=b.prototype=new y;w.constructor=b,h(w,g.prototype),w.isPureReactComponent=!0;var S=Array.isArray;function _(){}var E={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function C(t,n,r){var i=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:r}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var M=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function O(n,r,i,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,d=!1;if(null===n)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(n.$$typeof){case e:case t:d=!0;break;case u:return O((d=n._init)(n._payload),r,i,a,o)}}if(d)return o=o(n),d=""===a?"."+P(n,0):a,S(o)?(i="",null!=d&&(i=d.replace(M,"$&/")+"/"),O(o,r,i,"",function(e){return e})):null!=o&&(T(o)&&(l=o,c=i+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(M,"$&/")+"/")+d,o=C(l.type,c,l.props)),r.push(o)),1;d=0;var p,h=""===a?".":a+":";if(S(n))for(var m=0;m<n.length;m++)d+=O(a=n[m],r,i,s=h+P(a,m),o);else if("function"==typeof(m=null===(p=n)||"object"!=typeof p?null:"function"==typeof(p=f&&p[f]||p["@@iterator"])?p:null))for(n=m.call(n),m=0;!(a=n.next()).done;)d+=O(a=a.value,r,i,s=h+P(a,m++),o);else if("object"===s){if("function"==typeof n.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,i,a,o);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}function A(e,t,n){if(null==e)return e;var r=[],i=0;return O(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},I={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return k.Activity=d,k.Children=I,k.Component=g,k.Fragment=n,k.Profiler=i,k.PureComponent=b,k.StrictMode=r,k.Suspense=l,k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,k.__COMPILER_RUNTIME={__proto__:null,c:function(e){return E.H.useMemoCache(e)}},k.cache=function(e){return function(){return e.apply(null,arguments)}},k.cacheSignal=function(){return null},k.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=h({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)!x.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return C(e.type,i,r)},k.createContext=function(e){return(e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:a,_context:e},e},k.createElement=function(e,t,n){var r,i={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)x.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(i[r]=t[r]);var o=arguments.length-2;if(1===o)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===i[r]&&(i[r]=o[r]);return C(e,a,i)},k.createRef=function(){return{current:null}},k.forwardRef=function(e){return{$$typeof:s,render:e}},k.isValidElement=T,k.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},k.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},k.startTransition=function(e){var t=E.T,n={};E.T=n;try{var r=e(),i=E.S;null!==i&&i(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(_,L)}catch(a){L(a)}finally{null!==t&&null!==n.types&&(t.types=n.types),E.T=t}},k.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},k.use=function(e){return E.H.use(e)},k.useActionState=function(e,t,n){return E.H.useActionState(e,t,n)},k.useCallback=function(e,t){return E.H.useCallback(e,t)},k.useContext=function(e){return E.H.useContext(e)},k.useDebugValue=function(){},k.useDeferredValue=function(e,t){return E.H.useDeferredValue(e,t)},k.useEffect=function(e,t){return E.H.useEffect(e,t)},k.useEffectEvent=function(e){return E.H.useEffectEvent(e)},k.useId=function(){return E.H.useId()},k.useImperativeHandle=function(e,t,n){return E.H.useImperativeHandle(e,t,n)},k.useInsertionEffect=function(e,t){return E.H.useInsertionEffect(e,t)},k.useLayoutEffect=function(e,t){return E.H.useLayoutEffect(e,t)},k.useMemo=function(e,t){return E.H.useMemo(e,t)},k.useOptimistic=function(e,t){return E.H.useOptimistic(e,t)},k.useReducer=function(e,t,n){return E.H.useReducer(e,t,n)},k.useRef=function(e){return E.H.useRef(e)},k.useState=function(e){return E.H.useState(e)},k.useSyncExternalStore=function(e,t,n){return E.H.useSyncExternalStore(e,t,n)},k.useTransition=function(){return E.H.useTransition()},k.version="19.2.3",k}function _(){return y||(y=1,w.exports=S()),w.exports}var E=_();const x=f(E);var C,T,M={exports:{}},P={},O={exports:{}},A={};function N(){return T||(T=1,O.exports=(C||(C=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<a&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<a&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function k(e){if(m=!1,w(e),!h)if(null!==n(l))h=!0,_||(_=!0,S());else{var t=n(c);null!==t&&A(k,t.startTime-e)}}var S,_=!1,E=-1,x=5,C=-1;function T(){return!(!g&&e.unstable_now()-C<x)}function M(){if(g=!1,_){var t=e.unstable_now();C=t;var i=!0;try{e:{h=!1,m&&(m=!1,y(E),E=-1),p=!0;var a=f;try{t:{for(w(t),d=n(l);null!==d&&!(d.expirationTime>t&&T());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,w(t),i=!0;break t}d===n(l)&&r(l),w(t)}else r(l);d=n(l)}if(null!==d)i=!0;else{var u=n(c);null!==u&&A(k,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?S():_=!1}}}if("function"==typeof b)S=function(){b(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,O=P.port2;P.port1.onmessage=M,S=function(){O.postMessage(null)}}else S=function(){v(M,0)};function A(t,n){E=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(l)&&r===n(c)&&(m?(y(E),E=-1):m=!0,A(k,a-o))):(r.sortIndex=s,t(l,r),h||p||(h=!0,_||(_=!0,S()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(A)),A)),O.exports}var L,I,j,R,D={exports:{}},F={};function B(){if(L)return F;L=1;var e=_();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return F.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,F.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:i,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},F.flushSync=function(e){var t=a.T,n=r.p;try{if(a.T=null,r.p=2,e)return e()}finally{a.T=t,r.p=n,r.d.f()}},F.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},F.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},F.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:i,integrity:a,fetchPriority:s}):"script"===n&&r.d.X(e,{crossOrigin:i,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},F.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},F.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},F.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},F.requestFormReset=function(e){r.d.r(e)},F.unstable_batchedUpdates=function(e,t){return e(t)},F.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},F.useFormStatus=function(){return a.H.useHostTransitionStatus()},F.version="19.2.3",F}function z(){if(I)return D.exports;return I=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),D.exports=B(),D.exports}
2
+ /**
3
+ * @license React
4
+ * react-dom-client.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */function U(){if(j)return P;j=1;var e=N(),t=_(),n=z();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function o(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function l(e){if(a(e)!==e)throw Error(r(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var u=Object.assign,d=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),C=Symbol.for("react.memo_cache_sentinel"),T=Symbol.iterator;function M(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}var O=Symbol.for("react.client.reference");function A(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===O?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case h:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList";case x:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case p:return"Portal";case y:return e.displayName||"Context";case v:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:A(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return A(e(t))}catch(n){}}return null}var L=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},F=[],B=-1;function U(e){return{current:e}}function V(e){0>B||(e.current=F[B],F[B]=null,B--)}function $(e,t){B++,F[B]=e.current,e.current=t}var W,q,H=U(null),J=U(null),G=U(null),Q=U(null);function Y(e,t){switch($(G,t),$(J,e),$(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=kd(t=wd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(H),$(H,e)}function K(){V(H),V(J),V(G)}function X(e){null!==e.memoizedState&&$(Q,e);var t=H.current,n=kd(t,e.type);t!==n&&($(J,e),$(H,n))}function Z(e){J.current===e&&(V(H),V(J)),Q.current===e&&(V(Q),hf._currentValue=D)}function ee(e){if(void 0===W)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);W=t&&t[1]||"",q=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+W+e+q}var te=!1;function ne(e,t){if(!e||te)return"";te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(i){var r=i}Reflect.construct(e,[],n)}else{try{n.call()}catch(a){r=a}e.call(n.prototype)}}else{try{throw Error()}catch(o){r=o}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(1!==r||1!==i)do{if(r--,0>--i||l[r]!==c[i]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=i);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function re(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&null!==t?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return ne(e.type,!1);case 11:return ne(e.type.render,!1);case 1:return ne(e.type,!0);case 31:return ee("Activity");default:return""}}function ie(e){try{var t="",n=null;do{t+=re(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var ae=Object.prototype.hasOwnProperty,oe=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,le=e.unstable_shouldYield,ce=e.unstable_requestPaint,ue=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,me=e.unstable_LowPriority,ge=e.unstable_IdlePriority,ve=e.log,ye=e.unstable_setDisableYieldValue,be=null,we=null;function ke(e){if("function"==typeof ve&&ye(e),we&&"function"==typeof we.setStrictMode)try{we.setStrictMode(be,e)}catch(t){}}var Se=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_e(e)/Ee|0)|0},_e=Math.log,Ee=Math.LN2;var xe=256,Ce=262144,Te=4194304;function Me(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~a)?i=Me(r):0!==(o&=s)?i=Me(o):n||0!==(n=s&~e)&&(i=Me(n)):0!==(s=r&~a)?i=Me(s):0!==o?i=Me(o):n||0!==(n=r&~e)&&(i=Me(n)),0===i?0:0!==t&&t!==i&&0===(t&a)&&((a=i&-i)>=(n=t&-t)||32===a&&4194048&n)?t:i}function Oe(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ae(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ne(){var e=Te;return!(62914560&(Te<<=1))&&(Te=4194304),e}function Le(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Se(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Re(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Se(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function De(e,t){var n=t&-t;return 0!==((n=42&n?1:Fe(n))&(e.suspendedLanes|t))?0:n}function Fe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Be(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function ze(){var e=R.p;return 0!==e?e:void 0===(e=window.event)?32:Of(e.type)}function Ue(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var Ve=Math.random().toString(36).slice(2),$e="__reactFiber$"+Ve,We="__reactProps$"+Ve,qe="__reactContainer$"+Ve,He="__reactEvents$"+Ve,Je="__reactListeners$"+Ve,Ge="__reactHandles$"+Ve,Qe="__reactResources$"+Ve,Ye="__reactMarker$"+Ve;function Ke(e){delete e[$e],delete e[We],delete e[He],delete e[Je],delete e[Ge]}function Xe(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qe]||n[$e]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Bd(e);null!==e;){if(n=e[$e])return n;e=Bd(e)}return t}n=(e=n).parentNode}return null}function Ze(e){if(e=e[$e]||e[qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function et(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function tt(e){var t=e[Qe];return t||(t=e[Qe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Ye]=!0}var rt=new Set,it={};function at(e,t){ot(e,t),ot(e+"Capture",t)}function ot(e,t){for(it[e]=t,e=0;e<t.length;e++)rt.add(t[e])}var st=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lt={},ct={};function ut(e,t,n){if(i=t,ae.call(ct,i)||!ae.call(lt,i)&&(st.test(i)?ct[i]=!0:(lt[i]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var i}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function ft(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function mt(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ht(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function vt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(sr){return e.body}}var yt=/[\n"\\]/g;function bt(e){return e.replace(yt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wt(e,t,n,r,i,a,o,s){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?St(e,o,pt(t)):null!=n?St(e,o,pt(n)):null!=r&&e.removeAttribute("value"),null==i&&null!=a&&(e.defaultChecked=!!a),null!=i&&(e.checked=i&&"function"!=typeof i&&"symbol"!=typeof i),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+pt(s):e.removeAttribute("name")}function kt(e,t,n,r,i,a,o,s){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return void mt(e);n=null!=n?""+pt(n):"",t=null!=t?""+pt(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:i)&&"symbol"!=typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o),mt(e)}function St(e,t,n){"number"===t&&vt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function _t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function Et(e,t,n){null==t||((t=""+pt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+pt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function xt(e,t,n,i){if(null==t){if(null!=i){if(null!=n)throw Error(r(92));if(L(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}null==n&&(n=""),t=n}n=pt(t),e.defaultValue=n,(i=e.textContent)===n&&""!==i&&null!==i&&(e.value=i),mt(e)}function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Tt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Tt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Pt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var i in n)!n.hasOwnProperty(i)||null!=t&&t.hasOwnProperty(i)||(0===i.indexOf("--")?e.setProperty(i,""):"float"===i?e.cssFloat="":e[i]="");for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&Mt(e,a,i)}else for(var o in t)t.hasOwnProperty(o)&&Mt(e,o,t[o])}function Ot(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var At=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Nt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lt(e){return Nt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function It(){}var jt=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Dt=null,Ft=null;function Bt(e){var t=Ze(e);if(t&&(e=t.stateNode)){var n=e[We]||null;e:switch(e=t.stateNode,t.type){case"input":if(wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+bt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[We]||null;if(!a)throw Error(r(90));wt(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(i=n[t]).form===e.form&&gt(i)}break e;case"textarea":Et(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&_t(e,!!n.multiple,t,!1)}}}var zt=!1;function Ut(e,t,n){if(zt)return e(t,n);zt=!0;try{return e(t)}finally{if(zt=!1,(null!==Dt||null!==Ft)&&(nu(),Dt&&(t=Dt,e=Ft,Ft=Dt=null,Bt(t),e)))for(t=0;t<e.length;t++)Bt(e[t])}}function Vt(e,t){var n=e.stateNode;if(null===n)return null;var i=n[We]||null;if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var $t=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Wt=!1;if($t)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Wt=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch(sr){Wt=!1}var Ht=null,Jt=null,Gt=null;function Qt(){if(Gt)return Gt;var e,t,n=Jt,r=n.length,i="value"in Ht?Ht.value:Ht.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Gt=i.slice(e,1<t?1-t:void 0)}function Yt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kt(){return!0}function Xt(){return!1}function Zt(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Kt:Xt,this.isPropagationStopped=Xt,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kt)},persist:function(){},isPersistent:Kt}),t}var en,tn,nn,rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=Zt(rn),on=u({},rn,{view:0,detail:0}),sn=Zt(on),ln=u({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&"mousemove"===e.type?(en=e.screenX-nn.screenX,tn=e.screenY-nn.screenY):tn=en=0,nn=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),cn=Zt(ln),un=Zt(u({},ln,{dataTransfer:0})),dn=Zt(u({},on,{relatedTarget:0})),fn=Zt(u({},rn,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=Zt(u({},rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),hn=Zt(u({},rn,{data:0})),mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=vn[e])&&!!t[e]}function bn(){return yn}var wn=Zt(u({},on,{key:function(e){if(e.key){var t=mn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Yt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bn,charCode:function(e){return"keypress"===e.type?Yt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Yt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kn=Zt(u({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Sn=Zt(u({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bn})),_n=Zt(u({},rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),En=Zt(u({},ln,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),xn=Zt(u({},rn,{newState:0,oldState:0})),Cn=[9,13,27,32],Tn=$t&&"CompositionEvent"in window,Mn=null;$t&&"documentMode"in document&&(Mn=document.documentMode);var Pn=$t&&"TextEvent"in window&&!Mn,On=$t&&(!Tn||Mn&&8<Mn&&11>=Mn),An=String.fromCharCode(32),Nn=!1;function Ln(e,t){switch(e){case"keyup":return-1!==Cn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function In(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var jn=!1;var Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function Fn(e,t,n,r){Dt?Ft?Ft.push(r):Ft=[r]:Dt=r,0<(t=od(t,"onChange")).length&&(n=new an("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bn=null,zn=null;function Un(e){Xu(e,0)}function Vn(e){if(gt(et(e)))return e}function $n(e,t){if("change"===e)return t}var Wn=!1;if($t){var qn;if($t){var Hn="oninput"in document;if(!Hn){var Jn=document.createElement("div");Jn.setAttribute("oninput","return;"),Hn="function"==typeof Jn.oninput}qn=Hn}else qn=!1;Wn=qn&&(!document.documentMode||9<document.documentMode)}function Gn(){Bn&&(Bn.detachEvent("onpropertychange",Qn),zn=Bn=null)}function Qn(e){if("value"===e.propertyName&&Vn(zn)){var t=[];Fn(t,zn,e,Rt(e)),Ut(Un,t)}}function Yn(e,t,n){"focusin"===e?(Gn(),zn=n,(Bn=t).attachEvent("onpropertychange",Qn)):"focusout"===e&&Gn()}function Kn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Vn(zn)}function Xn(e,t){if("click"===e)return Vn(t)}function Zn(e,t){if("input"===e||"change"===e)return Vn(t)}var er="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function tr(e,t){if(er(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ae.call(t,i)||!er(e[i],t[i]))return!1}return!0}function nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rr(e,t){var n,r=nr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nr(r)}}function ir(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ir(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ar(e){for(var t=vt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=vt((e=t.contentWindow).document)}return t}function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var lr=$t&&"documentMode"in document&&11>=document.documentMode,cr=null,ur=null,dr=null,fr=!1;function pr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;fr||null==cr||cr!==vt(r)||("selectionStart"in(r=cr)&&or(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},dr&&tr(dr,r)||(dr=r,0<(r=od(ur,"onSelect")).length&&(t=new an("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=cr)))}function hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:hr("Animation","AnimationEnd"),animationiteration:hr("Animation","AnimationIteration"),animationstart:hr("Animation","AnimationStart"),transitionrun:hr("Transition","TransitionRun"),transitionstart:hr("Transition","TransitionStart"),transitioncancel:hr("Transition","TransitionCancel"),transitionend:hr("Transition","TransitionEnd")},gr={},vr={};function yr(e){if(gr[e])return gr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in vr)return gr[e]=n[t];return e}$t&&(vr=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var br=yr("animationend"),wr=yr("animationiteration"),kr=yr("animationstart"),Sr=yr("transitionrun"),_r=yr("transitionstart"),Er=yr("transitioncancel"),xr=yr("transitionend"),Cr=new Map,Tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,t){Cr.set(e,t),at(t,[e])}Tr.push("scrollEnd");var Pr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Or=[],Ar=0,Nr=0;function Lr(){for(var e=Ar,t=Nr=Ar=0;t<e;){var n=Or[t];Or[t++]=null;var r=Or[t];Or[t++]=null;var i=Or[t];Or[t++]=null;var a=Or[t];if(Or[t++]=null,null!==r&&null!==i){var o=r.pending;null===o?i.next=i:(i.next=o.next,o.next=i),r.pending=i}0!==a&&Dr(n,i,a)}}function Ir(e,t,n,r){Or[Ar++]=e,Or[Ar++]=t,Or[Ar++]=n,Or[Ar++]=r,Nr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function jr(e,t,n,r){return Ir(e,t,n,r),Fr(e)}function Rr(e,t){return Ir(e,null,null,t),Fr(e)}function Dr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var i=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(i=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,i&&null!==t&&(i=31-Se(n),null===(r=(e=a.hiddenUpdates)[i])?e[i]=[t]:r.push(t),t.lane=536870912|n),a):null}function Fr(e){if(50<Jc)throw Jc=0,Gc=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Br={};function zr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(e,t,n,r){return new zr(e,t,n,r)}function Vr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return null===n?((n=Ur(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function qr(e,t,n,i,a,o){var s=0;if(i=e,"function"==typeof e)Vr(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,H.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case x:return(e=Ur(31,n,t,a)).elementType=x,e.lanes=o,e;case h:return Hr(n.children,a,o,t);case m:s=8,a|=24;break;case g:return(e=Ur(12,n,t,2|a)).elementType=g,e.lanes=o,e;case w:return(e=Ur(13,n,t,a)).elementType=w,e.lanes=o,e;case k:return(e=Ur(19,n,t,a)).elementType=k,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case y:s=10;break e;case v:s=9;break e;case b:s=11;break e;case S:s=14;break e;case E:s=16,i=null;break e}s=29,n=Error(r(130,null===e?"null":typeof e,"")),i=null}return(t=Ur(s,n,t,a)).elementType=e,t.type=i,t.lanes=o,t}function Hr(e,t,n,r){return(e=Ur(7,e,r,t)).lanes=n,e}function Jr(e,t,n){return(e=Ur(6,e,null,t)).lanes=n,e}function Gr(e){var t=Ur(18,null,null,0);return t.stateNode=e,t}function Qr(e,t,n){return(t=Ur(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yr=new WeakMap;function Kr(e,t){if("object"==typeof e&&null!==e){var n=Yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:ie(t)},Yr.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var Xr=[],Zr=0,ei=null,ti=0,ni=[],ri=0,ii=null,ai=1,oi="";function si(e,t){Xr[Zr++]=ti,Xr[Zr++]=ei,ei=e,ti=t}function li(e,t,n){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ii=e;var r=ai;e=oi;var i=32-Se(r)-1;r&=~(1<<i),n+=1;var a=32-Se(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ai=1<<32-Se(t)+i|n<<i|r,oi=a+e}else ai=1<<a|n<<i|r,oi=e}function ci(e){null!==e.return&&(si(e,1),li(e,1,0))}function ui(e){for(;e===ei;)ei=Xr[--Zr],Xr[Zr]=null,ti=Xr[--Zr],Xr[Zr]=null;for(;e===ii;)ii=ni[--ri],ni[ri]=null,oi=ni[--ri],ni[ri]=null,ai=ni[--ri],ni[ri]=null}function di(e,t){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ai=t.id,oi=t.overflow,ii=e}var fi=null,pi=null,hi=!1,mi=null,gi=!1,vi=Error(r(519));function yi(e){throw Ei(Kr(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),vi}function bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[We]=r,n){case"dialog":Zu("cancel",t),Zu("close",t);break;case"iframe":case"object":case"embed":Zu("load",t);break;case"video":case"audio":for(n=0;n<Yu.length;n++)Zu(Yu[n],t);break;case"source":Zu("error",t);break;case"img":case"image":case"link":Zu("error",t),Zu("load",t);break;case"details":Zu("toggle",t);break;case"input":Zu("invalid",t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Zu("invalid",t);break;case"textarea":Zu("invalid",t),xt(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||fd(t.textContent,n)?(null!=r.popover&&(Zu("beforetoggle",t),Zu("toggle",t)),null!=r.onScroll&&Zu("scroll",t),null!=r.onScrollEnd&&Zu("scrollend",t),null!=r.onClick&&(t.onclick=It),t=!0):t=!1,t||yi(e,!0)}function wi(e){for(fi=e.return;fi;)switch(fi.tag){case 5:case 31:case 13:return void(gi=!1);case 27:case 3:return void(gi=!0);default:fi=fi.return}}function ki(e){if(e!==fi)return!1;if(!hi)return wi(e),hi=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Sd(e.type,e.memoizedProps)),t=!t),t&&pi&&yi(e),wi(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Fd(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Fd(e)}else 27===n?(n=pi,Pd(e.type)?(e=Dd,Dd=null,pi=e):pi=n):pi=fi?Rd(e.stateNode.nextSibling):null;return!0}function Si(){pi=fi=null,hi=!1}function _i(){var e=mi;return null!==e&&(null===Lc?Lc=e:Lc.push.apply(Lc,e),mi=null),e}function Ei(e){null===mi?mi=[e]:mi.push(e)}var xi=U(null),Ci=null,Ti=null;function Mi(e,t,n){$(xi,t._currentValue),t._currentValue=n}function Pi(e){e._currentValue=xi.current,V(xi)}function Oi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ai(e,t,n,i){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var o=a.dependencies;if(null!==o){var s=a.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Oi(o.return,n,e),i||(s=null);break e}o=l.next}}else if(18===a.tag){if(null===(s=a.return))throw Error(r(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),Oi(s,n,e),s=null}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}}function Ni(e,t,n,i){e=null;for(var a=t,o=!1;null!==a;){if(!o)if(524288&a.flags)o=!0;else if(262144&a.flags)break;if(10===a.tag){var s=a.alternate;if(null===s)throw Error(r(387));if(null!==(s=s.memoizedProps)){var l=a.type;er(a.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(a===Q.current){if(null===(s=a.alternate))throw Error(r(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(hf):e=[hf])}a=a.return}null!==e&&Ai(t,e,n,i),t.flags|=262144}function Li(e){for(e=e.firstContext;null!==e;){if(!er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ii(e){Ci=e,Ti=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function ji(e){return Di(Ci,e)}function Ri(e,t){return null===Ci&&Ii(e),Di(e,t)}function Di(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Ti){if(null===e)throw Error(r(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return n}var Fi="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Bi=e.unstable_scheduleCallback,zi=e.unstable_NormalPriority,Ui={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vi(){return{controller:new Fi,data:new Map,refCount:0}}function $i(e){e.refCount--,0===e.refCount&&Bi(zi,function(){e.controller.abort()})}var Wi=null,qi=0,Hi=0,Ji=null;function Gi(){if(0===--qi&&null!==Wi){null!==Ji&&(Ji.status="fulfilled");var e=Wi;Wi=null,Hi=0,Ji=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Qi=I.S;I.S=function(e,t){Rc=ue(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Wi){var n=Wi=[];qi=0,Hi=qu(),Ji={status:"pending",value:void 0,then:function(e){n.push(e)}}}qi++,t.then(Gi,Gi)}(0,t),null!==Qi&&Qi(e,t)};var Yi=U(null);function Ki(){var e=Yi.current;return null!==e?e:vc.pooledCache}function Xi(e,t){$(Yi,null===t?Yi.current:t.pool)}function Zi(){var e=Ki();return null===e?null:{parent:Ui._currentValue,pool:e}}var ea=Error(r(460)),ta=Error(r(474)),na=Error(r(542)),ra={then:function(){}};function ia(e){return"fulfilled"===(e=e.status)||"rejected"===e}function aa(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(It,It),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e;default:if("string"==typeof t.status)t.then(It,It);else{if(null!==(e=vc)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e}throw sa=t,ea}}function oa(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw sa=t,ea;throw t}}var sa=null;function la(){if(null===sa)throw Error(r(459));var e=sa;return sa=null,e}function ca(e){if(e===ea||e===na)throw Error(r(483))}var ua=null,da=0;function fa(e){var t=da;return da+=1,null===ua&&(ua=[]),aa(ua,e,t)}function pa(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function ha(e,t){if(t.$$typeof===d)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ma(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=$r(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Jr(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===h?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===E&&oa(i)===t.type)?(pa(t=a(t,n.props),n),t.return=e,t):(pa(t=qr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qr(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Hr(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Jr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case f:return pa(n=qr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case p:return(t=Qr(t,e.mode,n)).return=e,t;case E:return m(e,t=oa(t),n)}if(L(t)||M(t))return(t=Hr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,fa(t),n);if(t.$$typeof===y)return m(e,Ri(e,t),n);ha(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case f:return n.key===i?c(e,t,n,r):null;case p:return n.key===i?u(e,t,n,r):null;case E:return g(e,t,n=oa(n),r)}if(L(n)||M(n))return null!==i?null:d(e,t,n,r,null);if("function"==typeof n.then)return g(e,t,fa(n),r);if(n.$$typeof===y)return g(e,t,Ri(e,n),r);ha(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case f:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case p:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case E:return v(e,t,n,r=oa(r),i)}if(L(r)||M(r))return d(t,e=e.get(n)||null,r,i,null);if("function"==typeof r.then)return v(e,t,n,fa(r),i);if(r.$$typeof===y)return v(e,t,n,Ri(t,r),i);ha(t,r)}return null}function b(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===h&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case f:e:{for(var w=u.key;null!==c;){if(c.key===w){if((w=u.type)===h){if(7===c.tag){n(l,c.sibling),(d=a(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===w||"object"==typeof w&&null!==w&&w.$$typeof===E&&oa(w)===c.type){n(l,c.sibling),pa(d=a(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===h?((d=Hr(u.props.children,l.mode,d,u.key)).return=l,l=d):(pa(d=qr(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case p:e:{for(w=u.key;null!==c;){if(c.key===w){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=a(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Qr(u,l.mode,d)).return=l,l=d}return s(l);case E:return b(l,c,u=oa(u),d)}if(L(u))return function(r,a,s,l){for(var c=null,u=null,d=a,f=a=0,p=null;null!==d&&f<s.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var h=g(r,d,s[f],l);if(null===h){null===d&&(d=p);break}e&&d&&null===h.alternate&&t(r,d),a=o(h,a,f),null===u?c=h:u.sibling=h,u=h,d=p}if(f===s.length)return n(r,d),hi&&si(r,f),c;if(null===d){for(;f<s.length;f++)null!==(d=m(r,s[f],l))&&(a=o(d,a,f),null===u?c=d:u.sibling=d,u=d);return hi&&si(r,f),c}for(d=i(d);f<s.length;f++)null!==(p=v(d,r,f,s[f],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?f:p.key),a=o(p,a,f),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(r,e)}),hi&&si(r,f),c}(l,c,u,d);if(M(u)){if("function"!=typeof(w=M(u)))throw Error(r(150));return function(a,s,l,c){if(null==l)throw Error(r(151));for(var u=null,d=null,f=s,p=s=0,h=null,y=l.next();null!==f&&!y.done;p++,y=l.next()){f.index>p?(h=f,f=null):h=f.sibling;var b=g(a,f,y.value,c);if(null===b){null===f&&(f=h);break}e&&f&&null===b.alternate&&t(a,f),s=o(b,s,p),null===d?u=b:d.sibling=b,d=b,f=h}if(y.done)return n(a,f),hi&&si(a,p),u;if(null===f){for(;!y.done;p++,y=l.next())null!==(y=m(a,y.value,c))&&(s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return hi&&si(a,p),u}for(f=i(f);!y.done;p++,y=l.next())null!==(y=v(f,a,p,y.value,c))&&(e&&null!==y.alternate&&f.delete(null===y.key?p:y.key),s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return e&&f.forEach(function(e){return t(a,e)}),hi&&si(a,p),u}(l,c,u=w.call(u),d)}if("function"==typeof u.then)return b(l,c,fa(u),d);if(u.$$typeof===y)return b(l,c,Ri(l,u),d);ha(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=a(c,u)).return=l,l=d):(n(l,c),(d=Jr(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,r){try{da=0;var i=b(e,t,n,r);return ua=null,i}catch(o){if(o===ea||o===na)throw o;var a=Ur(29,o,null,e.mode);return a.lanes=r,a.return=e,a}}}var ga=ma(!0),va=ma(!1),ya=!1;function ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&gc){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Fr(e),Dr(e,null,n),t}return Ir(e,r,t,n),Fr(e)}function _a(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}function Ea(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xa=!1;function Ca(){if(xa){if(null!==Ji)throw Ji}}function Ta(e,t,n,r){xa=!1;var i=e.updateQueue;ya=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==a){var f=i.baseState;for(o=0,d=c=l=null,s=a;;){var p=-536870913&s.lane,h=p!==s.lane;if(h?(bc&p)===p:(r&p)===p){0!==p&&p===Hi&&(xa=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;p=t;var v=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){f=m.call(v,f,p);break e}f=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(v,f,p):m))break e;f=u({},f,p);break e;case 2:ya=!0}}null!==(p=s.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=i.callbacks)?i.callbacks=[p]:h.push(p))}else h={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=h,l=f):d=d.next=h,o|=p;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}null===d&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,null===a&&(i.shared.lanes=0),Tc|=o,e.lanes=o,e.memoizedState=f}}function Ma(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function Pa(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Ma(n[e],t)}var Oa=U(null),Aa=U(0);function Na(e,t){$(Aa,e=xc),$(Oa,t),xc=e|t.baseLanes}function La(){$(Aa,xc),$(Oa,Oa.current)}function Ia(){xc=Aa.current,V(Oa),V(Aa)}var ja=U(null),Ra=null;function Da(e){var t=e.alternate;$(Va,1&Va.current),$(ja,e),null===Ra&&(null===t||null!==Oa.current||null!==t.memoizedState)&&(Ra=e)}function Fa(e){$(Va,Va.current),$(ja,e),null===Ra&&(Ra=e)}function Ba(e){22===e.tag?($(Va,Va.current),$(ja,e),null===Ra&&(Ra=e)):za()}function za(){$(Va,Va.current),$(ja,ja.current)}function Ua(e){V(ja),Ra===e&&(Ra=null),V(Va)}var Va=U(0);function $a(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Id(n)||jd(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wa=0,qa=null,Ha=null,Ja=null,Ga=!1,Qa=!1,Ya=!1,Ka=0,Xa=0,Za=null,eo=0;function to(){throw Error(r(321))}function no(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!er(e[n],t[n]))return!1;return!0}function ro(e,t,n,r,i,a){return Wa=a,qa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=null===e||null===e.memoizedState?bs:ws,Ya=!1,a=n(r,i),Ya=!1,Qa&&(a=ao(t,n,r,i)),io(e),a}function io(e){I.H=ys;var t=null!==Ha&&null!==Ha.next;if(Wa=0,Ja=Ha=qa=null,Ga=!1,Xa=0,Za=null,t)throw Error(r(300));null===e||Rs||null!==(e=e.dependencies)&&Li(e)&&(Rs=!0)}function ao(e,t,n,i){qa=e;var a=0;do{if(Qa&&(Za=null),Xa=0,Qa=!1,25<=a)throw Error(r(301));if(a+=1,Ja=Ha=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}I.H=ks,o=t(n,i)}while(Qa);return o}function oo(){var e=I.H,t=e.useState()[0];return t="function"==typeof t.then?po(t):t,e=e.useState()[0],(null!==Ha?Ha.memoizedState:null)!==e&&(qa.flags|=1024),t}function so(){var e=0!==Ka;return Ka=0,e}function lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function co(e){if(Ga){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Ga=!1}Wa=0,Ja=Ha=qa=null,Qa=!1,Xa=Ka=0,Za=null}function uo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e,Ja}function fo(){if(null===Ha){var e=qa.alternate;e=null!==e?e.memoizedState:null}else e=Ha.next;var t=null===Ja?qa.memoizedState:Ja.next;if(null!==t)Ja=t,Ha=e;else{if(null===e){if(null===qa.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Ha=e).memoizedState,baseState:Ha.baseState,baseQueue:Ha.baseQueue,queue:Ha.queue,next:null},null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e}return Ja}function po(e){var t=Xa;return Xa+=1,null===Za&&(Za=[]),e=aa(Za,e,t),t=qa,null===(null===Ja?t.memoizedState:Ja.next)&&(t=t.alternate,I.H=null===t||null===t.memoizedState?bs:ws),e}function ho(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return po(e);if(e.$$typeof===y)return ji(e)}throw Error(r(438,String(e)))}function mo(e){var t=null,n=qa.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=qa.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=C;return t.index++,n}function go(e,t){return"function"==typeof t?t(e):t}function vo(e){return yo(fo(),Ha,e)}function yo(e,t,n){var i=e.queue;if(null===i)throw Error(r(311));i.lastRenderedReducer=n;var a=e.baseQueue,o=i.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,i.pending=null}if(o=e.baseState,null===a)e.memoizedState=o;else{var l=s=null,c=null,u=t=a.next,d=!1;do{var f=-536870913&u.lane;if(f!==u.lane?(bc&f)===f:(Wa&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Hi&&(d=!0);else{if((Wa&p)===p){u=u.next,p===Hi&&(d=!0);continue}f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=o):c=c.next=f,qa.lanes|=p,Tc|=p}f=u.action,Ya&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,s=o):c=c.next=p,qa.lanes|=f,Tc|=f;u=u.next}while(null!==u&&u!==t);if(null===c?s=o:c.next=l,!er(o,e.memoizedState)&&(Rs=!0,d&&null!==(n=Ji)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,i.lastRenderedState=o}return null===a&&(i.lanes=0),[e.memoizedState,i.dispatch]}function bo(e){var t=fo(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{o=e(o,s.action),s=s.next}while(s!==a);er(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function wo(e,t,n){var i=qa,a=fo(),o=hi;if(o){if(void 0===n)throw Error(r(407));n=n()}else n=t();var s=!er((Ha||a).memoizedState,n);if(s&&(a.memoizedState=n,Rs=!0),a=a.queue,qo(_o.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||null!==Ja&&1&Ja.memoizedState.tag){if(i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,a,n,t),null),null===vc)throw Error(r(349));o||127&Wa||ko(i,t,n)}return n}function ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=qa.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function So(e,t,n,r){t.value=n,t.getSnapshot=r,Eo(t)&&xo(e)}function _o(e,t,n){return n(function(){Eo(t)&&xo(e)})}function Eo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!er(e,n)}catch(r){return!0}}function xo(e){var t=Rr(e,2);null!==t&&Kc(t,e,2)}function Co(e){var t=uo();if("function"==typeof e){var n=e;if(e=n(),Ya){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t}function To(e,t,n,r){return e.baseState=n,yo(e,Ha,"function"==typeof r?r:go)}function Mo(e,t,n,i,a){if(ms(e))throw Error(r(485));if(null!==(e=t.action)){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==I.T?n(!0):o.isTransition=!1,i(o),null===(n=t.pending)?(o.next=t.pending=o,Po(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Po(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),l=I.S;null!==l&&l(o,s),Oo(e,t,s)}catch(c){No(e,t,c)}finally{null!==a&&null!==o.types&&(a.types=o.types),I.T=a}}else try{Oo(e,t,a=n(i,r))}catch(u){No(e,t,u)}}function Oo(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Ao(e,t,n)},function(n){return No(e,t,n)}):Ao(e,t,n)}function Ao(e,t,n){t.status="fulfilled",t.value=n,Lo(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Po(e,n)))}function No(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Lo(t),t=t.next}while(t!==r)}e.action=null}function Lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Io(e,t){return t}function jo(e,t){if(hi){var n=vc.formState;if(null!==n){e:{var r=qa;if(hi){if(pi){t:{for(var i=pi,a=gi;8!==i.nodeType;){if(!a){i=null;break t}if(null===(i=Rd(i.nextSibling))){i=null;break t}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){pi=Rd(i.nextSibling),r="F!"===i.data;break e}}yi(r)}r=!1}r&&(t=n[0])}}return(n=uo()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:t},n.queue=r,n=fs.bind(null,qa,r),r.dispatch=n,r=Co(!1),a=hs.bind(null,qa,!1,r.queue),i={state:t,dispatch:null,action:e,pending:null},(r=uo()).queue=i,n=Mo.bind(null,qa,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ro(e){return Do(fo(),Ha,e)}function Do(e,t,n){if(t=yo(e,t,Io)[0],e=vo(go)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=po(t)}catch(o){if(o===ea)throw na;throw o}else r=t;var i=(t=fo()).queue,a=i.dispatch;return n!==t.memoizedState&&(qa.flags|=2048,zo(9,{destroy:void 0},Fo.bind(null,i,n),null)),[r,a,e]}function Fo(e,t){e.action=t}function Bo(e){var t=fo(),n=Ha;if(null!==n)return Do(t,n,e);fo(),t=t.memoizedState;var r=(n=fo()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=qa.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Uo(){return fo().memoizedState}function Vo(e,t,n,r){var i=uo();qa.flags|=e,i.memoizedState=zo(1|t,{destroy:void 0},n,void 0===r?null:r)}function $o(e,t,n,r){var i=fo();r=void 0===r?null:r;var a=i.memoizedState.inst;null!==Ha&&null!==r&&no(r,Ha.memoizedState.deps)?i.memoizedState=zo(t,a,n,r):(qa.flags|=e,i.memoizedState=zo(1|t,a,n,r))}function Wo(e,t){Vo(8390656,8,e,t)}function qo(e,t){$o(2048,8,e,t)}function Ho(e){var t=fo().memoizedState;return function(e){qa.flags|=4;var t=qa.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&gc)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Jo(e,t){return $o(4,2,e,t)}function Go(e,t){return $o(4,4,e,t)}function Qo(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Yo(e,t,n){n=null!=n?n.concat([e]):null,$o(4,4,Qo.bind(null,t,e),n)}function Ko(){}function Xo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&no(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&no(t,r[1]))return r[0];if(r=e(),Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function es(e,t,n){return void 0===n||1073741824&Wa&&!(261930&bc)?e.memoizedState=t:(e.memoizedState=n,e=Yc(),qa.lanes|=e,Tc|=e,n)}function ts(e,t,n,r){return er(n,t)?n:null!==Oa.current?(e=es(e,n,r),er(e,t)||(Rs=!0),e):42&Wa&&(!(1073741824&Wa)||261930&bc)?(e=Yc(),qa.lanes|=e,Tc|=e,t):(Rs=!0,e.memoizedState=n)}function ns(e,t,n,r,i){var a=R.p;R.p=0!==a&&8>a?a:8;var o,s,l,c=I.T,u={};I.T=u,hs(e,!1,t,n);try{var d=i(),f=I.S;if(null!==f&&f(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)ps(e,t,(o=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<s.length;e++)(0,s[e])(o)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),Qc());else ps(e,t,r,Qc())}catch(p){ps(e,t,{then:function(){},status:"rejected",reason:p},Qc())}finally{R.p=a,null!==c&&null!==u.types&&(c.types=u.types),I.T=c}}function rs(){}function is(e,t,n,i){if(5!==e.tag)throw Error(r(476));var a=as(e).queue;ns(e,a,t,D,null===n?rs:function(){return os(e),n(i)})}function as(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:D},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function os(e){var t=as(e);null===t.next&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},Qc())}function ss(){return ji(hf)}function ls(){return fo().memoizedState}function cs(){return fo().memoizedState}function us(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Qc(),r=Sa(t,e=ka(n),n);return null!==r&&(Kc(r,t,n),_a(r,t,n)),t={cache:Vi()},void(e.payload=t)}t=t.return}}function ds(e,t,n){var r=Qc();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e)?gs(t,n):null!==(n=jr(e,t,n,r))&&(Kc(n,e,r),vs(n,t,r))}function fs(e,t,n){ps(e,t,n,Qc())}function ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))gs(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,er(s,o))return Ir(e,t,i,0),null===vc&&Lr(),!1}catch(l){}if(null!==(n=jr(e,t,i,r)))return Kc(n,e,r),vs(n,t,r),!0}return!1}function hs(e,t,n,i){if(i={lane:2,revertLane:qu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(t)throw Error(r(479))}else null!==(t=jr(e,n,i,2))&&Kc(t,e,2)}function ms(e){var t=e.alternate;return e===qa||null!==t&&t===qa}function gs(e,t){Qa=Ga=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}var ys={readContext:ji,use:ho,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useLayoutEffect:to,useInsertionEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useSyncExternalStore:to,useId:to,useHostTransitionStatus:to,useFormState:to,useActionState:to,useOptimistic:to,useMemoCache:to,useCacheRefresh:to};ys.useEffectEvent=to;var bs={readContext:ji,use:ho,useCallback:function(e,t){return uo().memoizedState=[e,void 0===t?null:t],e},useContext:ji,useEffect:Wo,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Vo(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){Vo(4,2,e,t)},useMemo:function(e,t){var n=uo();t=void 0===t?null:t;var r=e();if(Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=uo();if(void 0!==n){var i=n(t);if(Ya){ke(!0);try{n(t)}finally{ke(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ds.bind(null,qa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},uo().memoizedState=e},useState:function(e){var t=(e=Co(e)).queue,n=fs.bind(null,qa,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ko,useDeferredValue:function(e,t){return es(uo(),e,t)},useTransition:function(){var e=Co(!1);return e=ns.bind(null,qa,e.queue,!0,!1),uo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=qa,a=uo();if(hi){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===vc)throw Error(r(349));127&bc||ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Wo(_o.bind(null,i,o,e),[e]),i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,o,n,t),null),n},useId:function(){var e=uo(),t=vc.identifierPrefix;if(hi){var n=oi;t="_"+t+"R_"+(n=(ai&~(1<<32-Se(ai)-1)).toString(32)+n),0<(n=Ka++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=eo++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ss,useFormState:jo,useActionState:jo,useOptimistic:function(e){var t=uo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hs.bind(null,qa,!0,n),n.dispatch=t,[e,t]},useMemoCache:mo,useCacheRefresh:function(){return uo().memoizedState=us.bind(null,qa)},useEffectEvent:function(e){var t=uo(),n={impl:e};return t.memoizedState=n,function(){if(2&gc)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},ws={readContext:ji,use:ho,useCallback:Xo,useContext:ji,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Go,useMemo:Zo,useReducer:vo,useRef:Uo,useState:function(){return vo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){return ts(fo(),Ha.memoizedState,e,t)},useTransition:function(){var e=vo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Ro,useActionState:Ro,useOptimistic:function(e,t){return To(fo(),0,e,t)},useMemoCache:mo,useCacheRefresh:cs};ws.useEffectEvent=Ho;var ks={readContext:ji,use:ho,useCallback:Xo,useContext:ji,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Go,useMemo:Zo,useReducer:bo,useRef:Uo,useState:function(){return bo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=fo();return null===Ha?es(n,e,t):ts(n,Ha.memoizedState,e,t)},useTransition:function(){var e=bo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Bo,useActionState:Bo,useOptimistic:function(e,t){var n=fo();return null!==Ha?To(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mo,useCacheRefresh:cs};function Ss(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}ks.useEffectEvent=Ho;var _s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=ka(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=ka(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qc(),r=ka(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=Sa(e,r,n))&&(Kc(t,e,n),_a(t,e,n))}};function Es(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!tr(n,r)||!tr(i,a))}function xs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_s.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=u({},n)),e)void 0===n[i]&&(n[i]=e[i]);return n}function Ts(e){Pr(e)}function Ms(e){console.error(e)}function Ps(e){Pr(e)}function Os(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function As(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ns(e,t,n){return(n=ka(n)).tag=3,n.payload={element:null},n.callback=function(){Os(e,t)},n}function Ls(e){return(e=ka(e)).tag=3,e}function Is(e,t,n,r){var i=n.type.getDerivedStateFromError;if("function"==typeof i){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){As(t,n,r)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){As(t,n,r),"function"!=typeof i&&(null===Bc?Bc=new Set([this]):Bc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var js=Error(r(461)),Rs=!1;function Ds(e,t,n,r){t.child=null===e?va(t,null,n,r):ga(t,e.child,n,r)}function Fs(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var s in r)"ref"!==s&&(o[s]=r[s])}else o=r;return Ii(t),r=ro(e,t,n,o,a,i),s=so(),null===e||Rs?(hi&&s&&ci(t),t.flags|=1,Ds(e,t,r,i),t.child):(lo(e,t,i),sl(e,t,i))}function Bs(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||Vr(a)||void 0!==a.defaultProps||null!==n.compare?((e=qr(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,zs(e,t,a,r,i))}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:tr)(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,(e=$r(a,r)).ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(tr(a,r)&&e.ref===t.ref){if(Rs=!1,t.pendingProps=r=a,!ll(e,i))return t.lanes=e.lanes,sl(e,t,i);131072&e.flags&&(Rs=!0)}}return Js(e,t,n,r,i)}function Us(e,t,n,r){var i=r.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(a=null!==a?a.baseLanes|n:n,null!==e){for(r=t.child=e.child,i=0;null!==r;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return $s(e,t,a,n,r)}if(!(536870912&n))return r=t.lanes=536870912,$s(e,t,null!==a?a.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Xi(0,null!==a?a.cachePool:null),null!==a?Na(t,a):La(),Ba(t)}else null!==a?(Xi(0,a.cachePool),Na(t,a),za(),t.memoizedState=null):(null!==e&&Xi(0,null),La(),za());return Ds(e,t,i,n),t.child}function Vs(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $s(e,t,n,r,i){var a=Ki();return a=null===a?null:{parent:Ui._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&Xi(0,null),La(),Ba(t),null!==e&&Ni(e,t,r,!0),t.childLanes=i,null}function Ws(e,t){return(t=nl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function qs(e,t,n){return ga(t,e.child,null,n),(e=Ws(t,t.pendingProps)).flags|=2,Ua(t),t.memoizedState=null,e}function Hs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Js(e,t,n,r,i){return Ii(t),n=ro(e,t,n,r,void 0,i),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Ds(e,t,n,i),t.child):(lo(e,t,i),sl(e,t,i))}function Gs(e,t,n,r,i,a){return Ii(t),t.updateQueue=null,n=ao(t,r,n,i),io(e),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Ds(e,t,n,a),t.child):(lo(e,t,a),sl(e,t,a))}function Qs(e,t,n,r,i){if(Ii(t),null===t.stateNode){var a=Br,o=n.contextType;"object"==typeof o&&null!==o&&(a=ji(o)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=_s,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},ba(t),o=n.contextType,a.context="object"==typeof o&&null!==o?ji(o):Br,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(Ss(t,n,o,r),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&_s.enqueueReplaceState(a,a.state,null),Ta(t,r,a,i),Ca(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=Cs(n,s);a.props=l;var c=a.context,u=n.contextType;o=Br,"object"==typeof u&&null!==u&&(o=ji(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s||c!==o)&&xs(t,a,r,o),ya=!1;var f=t.memoizedState;a.state=f,Ta(t,r,a,i),Ca(),c=t.memoizedState,s||f!==c||ya?("function"==typeof d&&(Ss(t,n,d,r),c=t.memoizedState),(l=ya||Es(t,n,l,r,f,c,o))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=o,r=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,wa(e,t),u=Cs(n,o=t.memoizedProps),a.props=u,d=t.pendingProps,f=a.context,c=n.contextType,l=Br,"object"==typeof c&&null!==c&&(l=ji(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||f!==l)&&xs(t,a,r,l),ya=!1,f=t.memoizedState,a.state=f,Ta(t,r,a,i),Ca();var p=t.memoizedState;o!==d||f!==p||ya||null!==e&&null!==e.dependencies&&Li(e.dependencies)?("function"==typeof s&&(Ss(t,n,s,r),p=t.memoizedState),(u=ya||Es(t,n,u,r,f,p,l)||null!==e&&null!==e.dependencies&&Li(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hs(e,t),r=!!(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=ga(t,e.child,null,i),t.child=ga(t,null,n,i)):Ds(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Ys(e,t,n,r){return Si(),t.flags|=256,Ds(e,t,n,r),t.child}var Ks={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xs(e){return{baseLanes:e,cachePool:Zi()}}function Zs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Oc),e}function el(e,t,n){var i,a=t.pendingProps,o=!1,s=!!(128&t.flags);if((i=s)||(i=(null===e||null!==e.memoizedState)&&!!(2&Va.current)),i&&(o=!0,t.flags&=-129),i=!!(32&t.flags),t.flags&=-33,null===e){if(hi){if(o?Da(t):za(),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Gr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return jd(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,o?(za(),l=nl({mode:"hidden",children:l},o=t.mode),a=Hr(a,o,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(null,a)):(Da(t),tl(t,l))}var c=e.memoizedState;if(null!==c&&null!==(l=c.dehydrated)){if(s)256&t.flags?(Da(t),t.flags&=-257,t=rl(e,t,n)):null!==t.memoizedState?(za(),t.child=e.child,t.flags|=128,t=null):(za(),l=a.fallback,o=t.mode,a=nl({mode:"visible",children:a.children},o),(l=Hr(l,o,n,null)).flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,ga(t,e.child,null,n),(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,t=Vs(null,a));else if(Da(t),jd(l)){if(i=l.nextSibling&&l.nextSibling.dataset)var u=i.dgst;i=u,(a=Error(r(419))).stack="",a.digest=i,Ei({value:a,source:null,stack:null}),t=rl(e,t,n)}else if(Rs||Ni(e,t,n,!1),i=0!==(n&e.childLanes),Rs||i){if(null!==(i=vc)&&(0!==(a=De(i,n))&&a!==c.retryLane))throw c.retryLane=a,Rr(e,a),Kc(i,e,a),js;Id(l)||cu(),t=rl(e,t,n)}else Id(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,pi=Rd(l.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=tl(t,a.children)).flags|=4096);return t}return o?(za(),l=a.fallback,o=t.mode,u=(c=e.child).sibling,(a=$r(c,{mode:"hidden",children:a.children})).subtreeFlags=65011712&c.subtreeFlags,null!==u?l=$r(u,l):(l=Hr(l,o,n,null)).flags|=2,l.return=t,a.return=t,a.sibling=l,t.child=a,Vs(null,a),a=t.child,null===(l=e.child.memoizedState)?l=Xs(n):(null!==(o=l.cachePool)?(c=Ui._currentValue,o=o.parent!==c?{parent:c,pool:c}:o):o=Zi(),l={baseLanes:l.baseLanes|n,cachePool:o}),a.memoizedState=l,a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(e.child,a)):(Da(t),e=(n=e.child).sibling,(n=$r(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return(t=nl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function nl(e,t){return(e=Ur(22,e,null,t)).lanes=0,e}function rl(e,t,n){return ga(t,e.child,null,n),(e=tl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function il(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Oi(e.return,t,n)}function al(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Va.current,s=!!(2&o);if(s?(o=1&o|2,t.flags|=128):o&=1,$(Va,o),Ds(e,t,r,n),r=hi?ti:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&il(e,n,t);else if(19===e.tag)il(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===$a(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===$a(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case"together":al(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Tc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Ni(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=$r(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$r(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ll(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Li(e))}function cl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Rs=!0;else{if(!(ll(e,n)||128&t.flags))return Rs=!1,function(e,t,n){switch(t.tag){case 3:Y(t,t.stateNode.containerInfo),Mi(0,Ui,e.memoizedState.cache),Si();break;case 27:case 5:X(t);break;case 4:Y(t,t.stateNode.containerInfo);break;case 10:Mi(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Fa(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Da(t),t.flags|=128,null):0!==(n&t.child.childLanes)?el(e,t,n):(Da(t),null!==(e=sl(e,t,n))?e.sibling:null);Da(t);break;case 19:var i=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Ni(e,t,n,!1),r=0!==(n&t.childLanes)),i){if(r)return ol(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),$(Va,Va.current),r)break;return null;case 22:return t.lanes=0,Us(e,t,n,t.pendingProps);case 24:Mi(0,Ui,e.memoizedState.cache)}return sl(e,t,n)}(e,t,n);Rs=!!(131072&e.flags)}else Rs=!1,hi&&1048576&t.flags&&li(t,ti,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=oa(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var a=e.$$typeof;if(a===b){t.tag=11,t=Fs(null,t,e,i,n);break e}if(a===S){t.tag=14,t=Bs(null,t,e,i,n);break e}}throw t=A(e)||e,Error(r(306,t,""))}Vr(e)?(i=Cs(e,i),t.tag=1,t=Qs(null,t,e,i,n)):(t.tag=0,t=Js(null,t,e,i,n))}return t;case 0:return Js(e,t,t.type,t.pendingProps,n);case 1:return Qs(e,t,i=t.type,a=Cs(i,t.pendingProps),n);case 3:e:{if(Y(t,t.stateNode.containerInfo),null===e)throw Error(r(387));i=t.pendingProps;var o=t.memoizedState;a=o.element,wa(e,t),Ta(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Mi(0,Ui,i),i!==o.cache&&Ai(t,[Ui],n,!0),Ca(),i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ys(e,t,i,n);break e}if(i!==a){Ei(a=Kr(Error(r(424)),t)),t=Ys(e,t,i,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(pi=Rd(e.firstChild),fi=t,hi=!0,mi=null,gi=!0,n=va(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Si(),i===a){t=sl(e,t,n);break e}Ds(e,t,i,n)}t=t.child}return t;case 26:return Hs(e,t),null===e?(n=Gd(t.type,null,t.pendingProps,null))?t.memoizedState=n:hi||(n=t.type,e=t.pendingProps,(i=bd(G.current).createElement(n))[$e]=t,i[We]=e,md(i,n,e),nt(i),t.stateNode=i):t.memoizedState=Gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),null===e&&hi&&(i=t.stateNode=zd(t.type,t.pendingProps,G.current),fi=t,gi=!0,a=pi,Pd(t.type)?(Dd=a,pi=Rd(i.firstChild)):pi=a),Ds(e,t,t.pendingProps.children,n),Hs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&hi&&((a=i=pi)&&(null!==(i=function(e,t,n,r){for(;1===e.nodeType;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(null==i.href||""===i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===a)return e}if(null===(e=Rd(e.nextSibling)))break}return null}(i,t.type,t.pendingProps,gi))?(t.stateNode=i,fi=t,pi=Rd(i.firstChild),gi=!1,a=!0):a=!1),a||yi(t)),X(t),a=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,i=o.children,Sd(a,o)?i=null:null!==s&&Sd(a,s)&&(t.flags|=32),null!==t.memoizedState&&(a=ro(e,t,oo,null,null,n),hf._currentValue=a),Hs(e,t),Ds(e,t,i,n),t.child;case 6:return null===e&&hi&&((e=n=pi)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}(n,t.pendingProps,gi))?(t.stateNode=n,fi=t,pi=null,e=!0):e=!1),e||yi(t)),null;case 13:return el(e,t,n);case 4:return Y(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=ga(t,null,i,n):Ds(e,t,i,n),t.child;case 11:return Fs(e,t,t.type,t.pendingProps,n);case 7:return Ds(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ds(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Mi(0,t.type,i.value),Ds(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,Ii(t),i=i(a=ji(a)),t.flags|=1,Ds(e,t,i,n),t.child;case 14:return Bs(e,t,t.type,t.pendingProps,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return function(e,t,n){var i=t.pendingProps,a=!!(128&t.flags);if(t.flags&=-129,null===e){if(hi){if("hidden"===i.mode)return e=Ws(t,i),t.lanes=536870912,Vs(null,e);if(Fa(t),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Gr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return t.lanes=536870912,null}return Ws(t,i)}var o=e.memoizedState;if(null!==o){var s=o.dehydrated;if(Fa(t),a)if(256&t.flags)t.flags&=-257,t=qs(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Rs||Ni(e,t,n,!1),a=0!==(n&e.childLanes),Rs||a){if(null!==(i=vc)&&0!==(s=De(i,n))&&s!==o.retryLane)throw o.retryLane=s,Rr(e,s),Kc(i,e,s),js;cu(),t=qs(e,t,n)}else e=o.treeContext,pi=Rd(s.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=Ws(t,i)).flags|=4096;return t}return(e=$r(e.child,{mode:i.mode,children:i.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Us(e,t,n,t.pendingProps);case 24:return Ii(t),i=ji(Ui),null===e?(null===(a=Ki())&&(a=vc,o=Vi(),a.pooledCache=o,o.refCount++,null!==o&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:i,cache:a},ba(t),Mi(0,Ui,a)):(0!==(e.lanes&n)&&(wa(e,t),Ta(t,null,null,n),Ca()),a=e.memoizedState,o=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),Mi(0,Ui,i)):(i=o.cache,Mi(0,Ui,i),i!==a.cache&&Ai(t,[Ui],n,!0))),Ds(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&i)===i)if(e.stateNode.complete)e.flags|=8192;else{if(!ou())throw sa=ra,ta;e.flags|=8192}}else e.flags&=-16777217}function fl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!lf(t)){if(!ou())throw sa=ra,ta;e.flags|=8192}}function pl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ne():536870912,e.lanes|=t,Ac|=t)}function hl(e,t){if(!hi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ml(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=65011712&i.subtreeFlags,r|=65011712&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var i=t.pendingProps;switch(ui(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return ml(t),null;case 3:return n=t.stateNode,i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Pi(Ui),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ki(t)?ul(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,_i())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return null===e?(ul(t),null!==o?(ml(t),fl(t,o)):(ml(t),dl(t,a,0,0,n))):o?o!==e.memoizedState?(ul(t),ml(t),fl(t,o)):(ml(t),t.flags&=-16777217):((e=e.memoizedProps)!==i&&ul(t),ml(t),dl(t,a,0,0,n)),null;case 27:if(Z(t),n=G.current,a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}e=H.current,ki(t)?bi(t):(e=zd(a,i,n),t.stateNode=e,ul(t))}return ml(t),null;case 5:if(Z(t),a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}if(o=H.current,ki(t))bi(t);else{var s=bd(G.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":(o=s.createElement("div")).innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o="string"==typeof i.is?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o="string"==typeof i.is?s.createElement(a,{is:i.is}):s.createElement(a)}}o[$e]=t,o[We]=i;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)o.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(md(o,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ul(t)}}return ml(t),dl(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if("string"!=typeof i&&null===t.stateNode)throw Error(r(166));if(e=G.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,null!==(a=fi))switch(a.tag){case 27:case 5:i=a.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==i&&!0===i.suppressHydrationWarning||fd(e.nodeValue,n)))||yi(t,!0)}else(e=bd(e).createTextNode(i))[$e]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(i=ki(t),null!==n){if(null===e){if(!i)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ua(t),t):(Ua(t),null);if(128&t.flags)throw Error(r(558))}return ml(t),null;case 13:if(i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ki(t),null!==i&&null!==i.dehydrated){if(null===e){if(!a)throw Error(r(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(r(317));a[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(Ua(t),t):(Ua(t),null)}return Ua(t),128&t.flags?(t.lanes=n,t):(n=null!==i,e=null!==e&&null!==e.memoizedState,n&&(a=null,null!==(i=t.child).alternate&&null!==i.alternate.memoizedState&&null!==i.alternate.memoizedState.cachePool&&(a=i.alternate.memoizedState.cachePool.pool),o=null,null!==i.memoizedState&&null!==i.memoizedState.cachePool&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),ml(t),null);case 4:return K(),null===e&&nd(t.stateNode.containerInfo),ml(t),null;case 10:return Pi(t.type),ml(t),null;case 19:if(V(Va),null===(i=t.memoizedState))return ml(t),null;if(a=!!(128&t.flags),null===(o=i.rendering))if(a)hl(i,!1);else{if(0!==Cc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=$a(e))){for(t.flags|=128,hl(i,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Wr(n,e),n=n.sibling;return $(Va,1&Va.current|2),hi&&si(t,i.treeForkCount),t.child}e=e.sibling}null!==i.tail&&ue()>Dc&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=$a(o))){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),hl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate&&!hi)return ml(t),null}else 2*ue()-i.renderingStartTime>Dc&&536870912!==n&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}return null!==i.tail?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ue(),e.sibling=null,n=Va.current,$(Va,a?1&n|2:1&n),hi&&si(t,i.treeForkCount),e):(ml(t),null);case 22:case 23:return Ua(t),Ia(),i=null!==t.memoizedState,null!==e?null!==e.memoizedState!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?!!(536870912&n)&&!(128&t.flags)&&(ml(t),6&t.subtreeFlags&&(t.flags|=8192)):ml(t),null!==(n=t.updateQueue)&&pl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),i=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),null!==e&&V(Yi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Pi(Ui),ml(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function vl(e,t){switch(ui(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Pi(Ui),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(null!==t.memoizedState){if(Ua(t),null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ua(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return V(Va),null;case 4:return K(),null;case 10:return Pi(t.type),null;case 22:case 23:return Ua(t),Ia(),null!==e&&V(Yi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Pi(Ui),null;default:return null}}function yl(e,t){switch(ui(t),t.tag){case 3:Pi(Ui),K();break;case 26:case 27:case 5:Z(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ua(t);break;case 13:Ua(t);break;case 19:V(Va);break;case 10:Pi(t.type);break;case 22:case 23:Ua(t),Ia(),null!==e&&V(Yi);break;case 24:Pi(Ui)}}function bl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(s){Cu(t,t.return,s)}}function wl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,i=t;var l=n,c=s;try{c()}catch(u){Cu(i,l,u)}}}r=r.next}while(r!==a)}}catch(u){Cu(t,t.return,u)}}function kl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Pa(t,n)}catch(r){Cu(e,e.return,r)}}}function Sl(e,t,n){n.props=Cs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Cu(e,t,r)}}function _l(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(i){Cu(e,t,i)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(i){Cu(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(a){Cu(e,t,a)}else n.current=null}function xl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Cu(e,e.return,i)}}function Cl(e,t,n){try{var i=e.stateNode;!function(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,s=null,l=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:i.hasOwnProperty(h)||pd(e,t,h,null,i,f)}}for(var p in i){var h=i[p];if(f=n[p],i.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":o=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":s=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:h!==f&&pd(e,t,p,h,i,f)}}return void wt(e,s,l,c,u,d,o,a);case"select":for(o in h=s=l=p=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":h=c;default:i.hasOwnProperty(o)||pd(e,t,o,null,i,c)}for(a in i)if(o=i[a],c=n[a],i.hasOwnProperty(a)&&(null!=o||null!=c))switch(a){case"value":p=o;break;case"defaultValue":l=o;break;case"multiple":s=o;default:o!==c&&pd(e,t,a,o,i,c)}return t=l,n=s,i=h,void(null!=p?_t(e,!!n,p,!1):!!i!=!!n&&(null!=t?_t(e,!!n,t,!0):_t(e,!!n,n?[]:"",!1)));case"textarea":for(l in h=p=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!i.hasOwnProperty(l))switch(l){case"value":case"children":break;default:pd(e,t,l,null,i,a)}for(s in i)if(a=i[s],o=n[s],i.hasOwnProperty(s)&&(null!=a||null!=o))switch(s){case"value":p=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(r(91));break;default:a!==o&&pd(e,t,s,a,i,o)}return void Et(e,p,h);case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&null!=p&&!i.hasOwnProperty(m))if("selected"===m)e.selected=!1;else pd(e,t,m,null,i,p);for(c in i)if(p=i[c],h=n[c],i.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h))if("selected"===c)e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p;else pd(e,t,c,p,i,h);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!i.hasOwnProperty(g)&&pd(e,t,g,null,i,p);for(u in i)if(p=i[u],h=n[u],i.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(r(137,t));break;default:pd(e,t,u,p,i,h)}return;default:if(Ot(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!i.hasOwnProperty(v)&&hd(e,t,v,void 0,i,p);for(d in i)p=i[d],h=n[d],!i.hasOwnProperty(d)||p===h||void 0===p&&void 0===h||hd(e,t,d,p,i,h);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!i.hasOwnProperty(y)&&pd(e,t,y,null,i,p);for(f in i)p=i[f],h=n[f],!i.hasOwnProperty(f)||p===h||null==p&&null==h||pd(e,t,f,p,i,h)}(i,e.type,n,t),i[We]=t}catch(a){Cu(e,e.return,a)}}function Tl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Pd(e.type)||4===e.tag}function Ml(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Pd(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Pl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=It));else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Pl(e,t,n),e=e.sibling;null!==e;)Pl(e,t,n),e=e.sibling}function Ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Ol(e,t,n),e=e.sibling;null!==e;)Ol(e,t,n),e=e.sibling}function Al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);md(t,r,n),t[$e]=e,t[We]=n}catch(a){Cu(e,e.return,a)}}var Nl=!1,Ll=!1,Il=!1,jl="function"==typeof WeakSet?WeakSet:Set,Rl=null;function Dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Kl(e,n),4&r&&bl(5,n);break;case 1:if(Kl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(o){Cu(n,n.return,o)}else{var i=Cs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Cu(n,n.return,s)}}64&r&&kl(n),512&r&&_l(n,n.return);break;case 3:if(Kl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Pa(e,t)}catch(o){Cu(n,n.return,o)}}break;case 27:null===t&&4&r&&Al(n);case 26:case 5:Kl(e,n),null===t&&4&r&&xl(n),512&r&&_l(n,n.return);break;case 12:Kl(e,n);break;case 31:Kl(e,n),4&r&&$l(e,n);break;case 13:Kl(e,n),4&r&&Wl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Ou.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Nl)){t=null!==t&&null!==t.memoizedState||Ll,i=Nl;var a=Ll;Nl=r,(Ll=t)&&!a?Zl(e,n,!!(8772&n.subtreeFlags)):Kl(e,n),Nl=i,Ll=a}break;case 30:break;default:Kl(e,n)}}function Fl(e){var t=e.alternate;null!==t&&(e.alternate=null,Fl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Bl=null,zl=!1;function Ul(e,t,n){for(n=n.child;null!==n;)Vl(e,t,n),n=n.sibling}function Vl(e,t,n){if(we&&"function"==typeof we.onCommitFiberUnmount)try{we.onCommitFiberUnmount(be,n)}catch(a){}switch(n.tag){case 26:Ll||El(n,t),Ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Ll||El(n,t);var r=Bl,i=zl;Pd(n.type)&&(Bl=n.stateNode,zl=!1),Ul(e,t,n),Ud(n.stateNode),Bl=r,zl=i;break;case 5:Ll||El(n,t);case 6:if(r=Bl,i=zl,Bl=null,Ul(e,t,n),zl=i,null!==(Bl=r))if(zl)try{(9===Bl.nodeType?Bl.body:"HTML"===Bl.nodeName?Bl.ownerDocument.body:Bl).removeChild(n.stateNode)}catch(o){Cu(n,t,o)}else try{Bl.removeChild(n.stateNode)}catch(o){Cu(n,t,o)}break;case 18:null!==Bl&&(zl?(Od(9===(e=Bl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gf(e)):Od(Bl,n.stateNode));break;case 4:r=Bl,i=zl,Bl=n.stateNode.containerInfo,zl=!0,Ul(e,t,n),Bl=r,zl=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),Ll||wl(4,n,t),Ul(e,t,n);break;case 1:Ll||(El(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&Sl(n,t,r)),Ul(e,t,n);break;case 21:Ul(e,t,n);break;case 22:Ll=(r=Ll)||null!==n.memoizedState,Ul(e,t,n),Ll=r;break;default:Ul(e,t,n)}}function $l(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Gf(e)}catch(n){Cu(t,t.return,n)}}}function Wl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Gf(e)}catch(n){Cu(t,t.return,n)}}function ql(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new jl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new jl),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Au.bind(null,e,t);t.then(r,r)}})}function Hl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var a=n[i],o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(Pd(l.type)){Bl=l.stateNode,zl=!1;break e}break;case 5:Bl=l.stateNode,zl=!1;break e;case 3:case 4:Bl=l.stateNode.containerInfo,zl=!0;break e}l=l.return}if(null===Bl)throw Error(r(160));Vl(o,s,a),Bl=null,zl=!1,null!==(o=a.alternate)&&(o.return=null),a.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Gl(t,e),t=t.sibling}var Jl=null;function Gl(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Hl(t,e),Ql(e),4&i&&(wl(3,e,e.return),bl(3,e),wl(5,e,e.return));break;case 1:Hl(t,e),Ql(e),512&i&&(Ll||null===n||El(n,n.return)),64&i&&Nl&&(null!==(e=e.updateQueue)&&(null!==(i=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?i:n.concat(i))));break;case 26:var a=Jl;if(Hl(t,e),Ql(e),512&i&&(Ll||null===n||El(n,n.return)),4&i){var o=null!==n?n.memoizedState:null;if(i=e.memoizedState,null===n)if(null===i)if(null===e.stateNode){e:{i=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(i){case"title":(!(o=a.getElementsByTagName("title")[0])||o[Ye]||o[$e]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=a.createElement(i),a.head.insertBefore(o,a.querySelector("head > title"))),md(o,i,n),o[$e]=e,nt(o),i=o;break e;case"link":var s=of("link","href",a).get(i+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((o=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;case"meta":if(s=of("meta","content",a).get(i+(n.content||"")))for(l=0;l<s.length;l++)if((o=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;default:throw Error(r(468,i))}o[$e]=e,nt(o),i=o}e.stateNode=i}else sf(a,e.type,e.stateNode);else e.stateNode=ef(a,i,e.memoizedProps);else o!==i?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===i?sf(a,e.type,e.stateNode):ef(a,i,e.memoizedProps)):null===i&&null!==e.stateNode&&Cl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Hl(t,e),Ql(e),512&i&&(Ll||null===n||El(n,n.return)),null!==n&&4&i&&Cl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Hl(t,e),Ql(e),512&i&&(Ll||null===n||El(n,n.return)),32&e.flags){a=e.stateNode;try{Ct(a,"")}catch(m){Cu(e,e.return,m)}}4&i&&null!=e.stateNode&&Cl(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&i&&(Il=!0);break;case 6:if(Hl(t,e),Ql(e),4&i){if(null===e.stateNode)throw Error(r(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(m){Cu(e,e.return,m)}}break;case 3:if(af=null,a=Jl,Jl=Wd(t.containerInfo),Hl(t,e),Jl=a,Ql(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{Gf(t.containerInfo)}catch(m){Cu(e,e.return,m)}Il&&(Il=!1,Yl(e));break;case 4:i=Jl,Jl=Wd(e.stateNode.containerInfo),Hl(t,e),Ql(e),Jl=i;break;case 12:default:Hl(t,e),Ql(e);break;case 31:case 19:Hl(t,e),Ql(e),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 13:Hl(t,e),Ql(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(jc=ue()),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=Nl,d=Ll;if(Nl=u||a,Ll=d||c,Hl(t,e),Ll=d,Nl=u,Ql(e),8192&i)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||Nl||Ll||Xl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(o=c.stateNode,a)"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;l.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(m){Cu(c,c.return,m)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(m){Cu(c,c.return,m)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;a?Ad(h,!0):Ad(c.stateNode,!1)}catch(m){Cu(c,c.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&i&&(null!==(i=e.updateQueue)&&(null!==(n=i.retryQueue)&&(i.retryQueue=null,ql(e,n))));case 30:case 21:}}function Ql(e){var t=e.flags;if(2&t){try{for(var n,i=e.return;null!==i;){if(Tl(i)){n=i;break}i=i.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var a=n.stateNode;Ol(e,Ml(e),a);break;case 5:var o=n.stateNode;32&n.flags&&(Ct(o,""),n.flags&=-33),Ol(e,Ml(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Pl(e,Ml(e),s);break;default:throw Error(r(161))}}catch(l){Cu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Yl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Yl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Kl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Dl(e,t.alternate,t),t=t.sibling}function Xl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:wl(4,t,t.return),Xl(t);break;case 1:El(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&Sl(t,t.return,n),Xl(t);break;case 27:Ud(t.stateNode);case 26:case 5:El(t,t.return),Xl(t);break;case 22:null===t.memoizedState&&Xl(t);break;default:Xl(t)}e=e.sibling}}function Zl(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Zl(i,a,n),bl(4,a);break;case 1:if(Zl(i,a,n),"function"==typeof(i=(r=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(c){Cu(r,r.return,c)}if(null!==(i=(r=a).updateQueue)){var s=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(null!==l)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Ma(l[i],s)}catch(c){Cu(r,r.return,c)}}n&&64&o&&kl(a),_l(a,a.return);break;case 27:Al(a);case 26:case 5:Zl(i,a,n),n&&null===r&&4&o&&xl(a),_l(a,a.return);break;case 12:Zl(i,a,n);break;case 31:Zl(i,a,n),n&&4&o&&$l(i,a);break;case 13:Zl(i,a,n),n&&4&o&&Wl(i,a);break;case 22:null===a.memoizedState&&Zl(i,a,n),_l(a,a.return);break;case 30:break;default:Zl(i,a,n)}t=t.sibling}}function ec(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&$i(n))}function tc(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e))}function nc(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)rc(e,t,n,r),t=t.sibling}function rc(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:nc(e,t,n,r),2048&i&&bl(9,t);break;case 1:case 31:case 13:default:nc(e,t,n,r);break;case 3:nc(e,t,n,r),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e)));break;case 12:if(2048&i){nc(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"==typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Cu(t,t.return,l)}}else nc(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,null!==t.memoizedState?2&a._visibility?nc(e,t,n,r):ac(e,t):2&a._visibility?nc(e,t,n,r):(a._visibility|=2,ic(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&i&&ec(o,t);break;case 24:nc(e,t,n,r),2048&i&&tc(t.alternate,t)}}function ic(e,t,n,r,i){for(i=i&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var a=e,o=t,s=n,l=r,c=o.flags;switch(o.tag){case 0:case 11:case 15:ic(a,o,s,l,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?2&u._visibility?ic(a,o,s,l,i):ac(a,o):(u._visibility|=2,ic(a,o,s,l,i)),i&&2048&c&&ec(o.alternate,o);break;case 24:ic(a,o,s,l,i),i&&2048&c&&tc(o.alternate,o);break;default:ic(a,o,s,l,i)}t=t.sibling}}function ac(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:ac(n,r),2048&i&&ec(r.alternate,r);break;case 24:ac(n,r),2048&i&&tc(r.alternate,r);break;default:ac(n,r)}t=t.sibling}}var oc=8192;function sc(e,t,n){if(e.subtreeFlags&oc)for(e=e.child;null!==e;)lc(e,t,n),e=e.sibling}function lc(e,t,n){switch(e.tag){case 26:sc(e,t,n),e.flags&oc&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var i=Qd(r.href),a=t.querySelector(Yd(i));if(a)return null!==(t=a._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=uf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,void nt(a);a=t.ownerDocument||t,r=Kd(r),(i=Vd.get(i))&&nf(r,i),nt(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),md(a,"link",r),n.instance=a}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=uf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Jl,e.memoizedState,e.memoizedProps);break;case 5:default:sc(e,t,n);break;case 3:case 4:var r=Jl;Jl=Wd(e.stateNode.containerInfo),sc(e,t,n),Jl=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=oc,oc=16777216,sc(e,t,n),oc=r):sc(e,t,n))}}function cc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function uc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)dc(e),e=e.sibling}function dc(e){switch(e.tag){case 0:case 11:case 15:uc(e),2048&e.flags&&wl(9,e,e.return);break;case 3:case 12:default:uc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,fc(e)):uc(e)}}function fc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:wl(8,t,t.return),fc(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,fc(t));break;default:fc(t)}e=e.sibling}}function pc(e,t){for(;null!==Rl;){var n=Rl;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Rl=r;else e:for(n=e;null!==Rl;){var i=(r=Rl).sibling,a=r.return;if(Fl(r),r===n){Rl=null;break e}if(null!==i){i.return=a,Rl=i;break e}Rl=a}}}var hc={getCacheForType:function(e){var t=ji(Ui),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ji(Ui).controller.signal}},mc="function"==typeof WeakMap?WeakMap:Map,gc=0,vc=null,yc=null,bc=0,wc=0,kc=null,Sc=!1,_c=!1,Ec=!1,xc=0,Cc=0,Tc=0,Mc=0,Pc=0,Oc=0,Ac=0,Nc=null,Lc=null,Ic=!1,jc=0,Rc=0,Dc=1/0,Fc=null,Bc=null,zc=0,Uc=null,Vc=null,$c=0,Wc=0,qc=null,Hc=null,Jc=0,Gc=null;function Qc(){return 2&gc&&0!==bc?bc&-bc:null!==I.T?qu():ze()}function Yc(){if(0===Oc)if(536870912&bc&&!hi)Oc=536870912;else{var e=Ce;!(3932160&(Ce<<=1))&&(Ce=262144),Oc=e}return null!==(e=ja.current)&&(e.flags|=32),Oc}function Kc(e,t,n){(e!==vc||2!==wc&&9!==wc)&&null===e.cancelPendingCommit||(iu(e,0),tu(e,bc,Oc,!1)),Ie(e,n),2&gc&&e===vc||(e===vc&&(!(2&gc)&&(Mc|=n),4===Cc&&tu(e,bc,Oc,!1)),Fu(e))}function Xc(e,t,n){if(6&gc)throw Error(r(327));for(var i=!n&&!(127&t)&&0===(t&e.expiredLanes)||Oe(e,t),a=i?function(e,t){var n=gc;gc|=2;var i=su(),a=lu();vc!==e||bc!==t?(Fc=null,Dc=ue()+500,iu(e,t)):_c=Oe(e,t);e:for(;;)try{if(0!==wc&&null!==yc){t=yc;var o=kc;t:switch(wc){case 1:wc=0,kc=null,mu(e,t,o,1);break;case 2:case 9:if(ia(o)){wc=0,kc=null,hu(t);break}t=function(){2!==wc&&9!==wc||vc!==e||(wc=7),Fu(e)},o.then(t,t);break e;case 3:wc=7;break e;case 4:wc=5;break e;case 7:ia(o)?(wc=0,kc=null,hu(t)):(wc=0,kc=null,mu(e,t,o,7));break;case 5:var s=null;switch(yc.tag){case 26:s=yc.memoizedState;case 5:case 27:var l=yc;if(s?lf(s):l.stateNode.complete){wc=0,kc=null;var c=l.sibling;if(null!==c)yc=c;else{var u=l.return;null!==u?(yc=u,gu(u)):yc=null}break t}}wc=0,kc=null,mu(e,t,o,5);break;case 6:wc=0,kc=null,mu(e,t,o,6);break;case 8:ru(),Cc=6;break e;default:throw Error(r(462))}}fu();break}catch(d){au(e,d)}return Ti=Ci=null,I.H=i,I.A=a,gc=n,null!==yc?0:(vc=null,bc=0,Lr(),Cc)}(e,t):uu(e,t,!0),o=i;;){if(0===a){_c&&!i&&tu(e,t,0,!1);break}if(n=e.current.alternate,!o||eu(n)){if(2===a){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;a=Nc;var c=l.current.memoizedState.isDehydrated;if(c&&(iu(l,s).flags|=256),2!==(s=uu(l,s,!1))){if(Ec&&!c){l.errorRecoveryDisabledLanes|=o,Mc|=o,a=4;break e}o=Lc,Lc=a,null!==o&&(null===Lc?Lc=o:Lc.push.apply(Lc,o))}a=s}if(o=!1,2!==a)continue}}if(1===a){iu(e,0),tu(e,t,0,!0);break}e:{switch(i=e,o=a){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:tu(i,t,Oc,!Sc);break e;case 2:Lc=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(a=jc+300-ue())){if(tu(i,t,Oc,!Sc),0!==Pe(i,0,!0))break e;$c=t,i.timeoutHandle=Ed(Zc.bind(null,i,n,Lc,Fc,Ic,t,Oc,Mc,Ac,Sc,o,"Throttled",-0,0),a)}else Zc(i,n,Lc,Fc,Ic,t,Oc,Mc,Ac,Sc,o,null,-0,0)}break}a=uu(e,t,!1),o=!1}Fu(e)}function Zc(e,t,n,r,i,a,o,s,l,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){lc(t,a,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:It});var h=(62914560&a)===a?jc-ue():(4194048&a)===a?Rc-ue():0;if(null!==(h=function(e,t){return e.stylesheets&&0===e.count&&ff(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===cf&&(cf=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&gd(d)&&(o+=u*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--r,t+=8*(a+o)/(i.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var i=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>cf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(d,h)))return $c=a,e.cancelPendingCommit=h(yu.bind(null,e,t,a,n,r,i,o,s,l,u,d,null,f,p)),void tu(e,a,o,!c)}yu(e,t,a,n,r,i,o,s,l)}function eu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!er(a(),i))return!1}catch(o){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tu(e,t,n,r){t&=~Pc,t&=~Mc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Se(i),o=1<<a;r[a]=-1,i&=~o}0!==n&&je(e,n,t)}function nu(){return!!(6&gc)||(Bu(0),!1)}function ru(){if(null!==yc){if(0===wc)var e=yc.return;else Ti=Ci=null,co(e=yc),ua=null,da=0,e=yc;for(;null!==e;)yl(e.alternate,e),e=e.return;yc=null}}function iu(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,xd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),$c=0,ru(),vc=e,yc=n=$r(e.current,null),bc=t,wc=0,kc=null,Sc=!1,_c=Oe(e,t),Ec=!1,Ac=Oc=Pc=Mc=Tc=Cc=0,Lc=Nc=null,Ic=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var i=31-Se(r),a=1<<i;t|=e[i],r&=~a}return xc=t,Lr(),n}function au(e,t){qa=null,I.H=ys,t===ea||t===na?(t=la(),wc=3):t===ta?(t=la(),wc=4):wc=t===js?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,kc=t,null===yc&&(Cc=1,Os(e,Kr(t,e.current)))}function ou(){var e=ja.current;return null===e||((4194048&bc)===bc?null===Ra:!!((62914560&bc)===bc||536870912&bc)&&e===Ra)}function su(){var e=I.H;return I.H=ys,null===e?ys:e}function lu(){var e=I.A;return I.A=hc,e}function cu(){Cc=4,Sc||(4194048&bc)!==bc&&null!==ja.current||(_c=!0),!(134217727&Tc)&&!(134217727&Mc)||null===vc||tu(vc,bc,Oc,!1)}function uu(e,t,n){var r=gc;gc|=2;var i=su(),a=lu();vc===e&&bc===t||(Fc=null,iu(e,t)),t=!1;var o=Cc;e:for(;;)try{if(0!==wc&&null!==yc){var s=yc,l=kc;switch(wc){case 8:ru(),o=6;break e;case 3:case 2:case 9:case 6:null===ja.current&&(t=!0);var c=wc;if(wc=0,kc=null,mu(e,s,l,c),n&&_c){o=0;break e}break;default:c=wc,wc=0,kc=null,mu(e,s,l,c)}}du(),o=Cc;break}catch(u){au(e,u)}return t&&e.shellSuspendCounter++,Ti=Ci=null,gc=r,I.H=i,I.A=a,null===yc&&(vc=null,bc=0,Lr()),o}function du(){for(;null!==yc;)pu(yc)}function fu(){for(;null!==yc&&!le();)pu(yc)}function pu(e){var t=cl(e.alternate,e,xc);e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gs(n,t,t.pendingProps,t.type,void 0,bc);break;case 11:t=Gs(n,t,t.pendingProps,t.type.render,t.ref,bc);break;case 5:co(t);default:yl(n,t),t=cl(n,t=yc=Wr(t,xc),xc)}e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function mu(e,t,n,i){Ti=Ci=null,co(t),ua=null,da=0;var a=t.return;try{if(function(e,t,n,i,a){if(n.flags|=32768,null!==i&&"object"==typeof i&&"function"==typeof i.then){if(null!==(t=n.alternate)&&Ni(t,n,a,!0),null!==(n=ja.current)){switch(n.tag){case 31:case 13:return null===Ra?cu():null===n.alternate&&0===Cc&&(Cc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([i]):t.add(i),Tu(e,i,a)),!1;case 22:return n.flags|=65536,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([i]):n.add(i),Tu(e,i,a)),!1}throw Error(r(435,n.tag))}return Tu(e,i,a),cu(),!1}if(hi)return null!==(t=ja.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==vi&&Ei(Kr(e=Error(r(422),{cause:i}),n))):(i!==vi&&Ei(Kr(t=Error(r(423),{cause:i}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,i=Kr(i,n),Ea(e,a=Ns(e.stateNode,i,a)),4!==Cc&&(Cc=2)),!1;var o=Error(r(520),{cause:i});if(o=Kr(o,n),null===Nc?Nc=[o]:Nc.push(o),4!==Cc&&(Cc=2),null===t)return!0;i=Kr(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,Ea(n,e=Ns(n.stateNode,i,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Bc&&Bc.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,Is(a=Ls(a),e,n,i),Ea(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,bc))return Cc=1,Os(e,Kr(n,e.current)),void(yc=null)}catch(o){if(null!==a)throw yc=a,o;return Cc=1,Os(e,Kr(n,e.current)),void(yc=null)}32768&t.flags?(hi||1===i?e=!0:_c||536870912&bc?e=!1:(Sc=e=!0,(2===i||9===i||3===i||6===i)&&(null!==(i=ja.current)&&13===i.tag&&(i.flags|=16384))),vu(t,e)):gu(t)}function gu(e){var t=e;do{if(32768&t.flags)return void vu(t,Sc);e=t.return;var n=gl(t.alternate,t,xc);if(null!==n)return void(yc=n);if(null!==(t=t.sibling))return void(yc=t);yc=t=e}while(null!==t);0===Cc&&(Cc=5)}function vu(e,t){do{var n=vl(e.alternate,e);if(null!==n)return n.flags&=32767,void(yc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(yc=e);yc=e=n}while(null!==e);Cc=6,yc=null}function yu(e,t,n,i,a,o,s,l,c){e.cancelPendingCommit=null;do{_u()}while(0!==zc);if(6&gc)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,function(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Se(n),d=1<<u;s[u]=0,l[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&je(e,r,0),0!==a&&0===i&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,o|=Nr,s,l,c),e===vc&&(yc=vc=null,bc=0),Vc=t,Uc=e,$c=n,Wc=o,qc=a,Hc=i,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,oe(he,function(){return Eu(),null})):(e.callbackNode=null,e.callbackPriority=0),i=!!(13878&t.flags),13878&t.subtreeFlags||i){i=I.T,I.T=null,a=R.p,R.p=2,s=gc,gc|=4;try{!function(e,t){if(e=e.containerInfo,vd=_f,or(e=ar(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch(g){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||0!==a&&3!==f.nodeType||(l=s+a),f!==o||0!==i&&3!==f.nodeType||(c=s+i),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===a&&(l=s),p===o&&++d===i&&(c=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yd={focusedElem:e,selectionRange:n},_f=!1,Rl=t;null!==Rl;)if(e=(t=Rl).child,1028&t.subtreeFlags&&null!==e)e.return=t,Rl=e;else for(;null!==Rl;){switch(o=(t=Rl).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(a=e[n]).ref.impl=a.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==o){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var m=Cs(n.type,a);e=i.getSnapshotBeforeUpdate(m,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(v){Cu(n,n.return,v)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Nd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Rl=e;break}Rl=t.return}}(e,t)}finally{gc=s,R.p=a,I.T=i}}zc=1,bu(),wu(),ku()}}function bu(){if(1===zc){zc=0;var e=Uc,t=Vc,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=I.T,I.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Gl(t,e);var a=yd,o=ar(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&ir(s.ownerDocument.documentElement,s)){if(null!==l&&or(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=s.textContent.length,m=Math.min(l.start,h),g=void 0===l.end?m:Math.min(l.end,h);!p.extend&&m>g&&(o=g,g=m,m=o);var v=rr(s,m),y=rr(s,g);if(v&&y&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=d.createRange();b.setStart(v.node,v.offset),p.removeAllRanges(),m>g?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(d=[],p=s;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var w=d[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}_f=!!vd,yd=vd=null}finally{gc=i,R.p=r,I.T=n}}e.current=t,zc=2}}function wu(){if(2===zc){zc=0;var e=Uc,t=Vc,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=I.T,I.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Dl(e,t.alternate,t)}finally{gc=i,R.p=r,I.T=n}}zc=3}}function ku(){if(4===zc||3===zc){zc=0,ce();var e=Uc,t=Vc,n=$c,r=Hc;10256&t.subtreeFlags||10256&t.flags?zc=5:(zc=0,Vc=Uc=null,Su(e,e.pendingLanes));var i=e.pendingLanes;if(0===i&&(Bc=null),Be(n),t=t.stateNode,we&&"function"==typeof we.onCommitFiberRoot)try{we.onCommitFiberRoot(be,t,void 0,!(128&~t.current.flags))}catch(l){}if(null!==r){t=I.T,i=R.p,R.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,R.p=i}}3&$c&&_u(),Fu(e),i=e.pendingLanes,261930&n&&42&i?e===Gc?Jc++:(Jc=0,Gc=e):Jc=0,Bu(0)}}function Su(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,$i(t)))}function _u(){return bu(),wu(),ku(),Eu()}function Eu(){if(5!==zc)return!1;var e=Uc,t=Wc;Wc=0;var n=Be($c),i=I.T,a=R.p;try{R.p=32>n?32:n,I.T=null,n=qc,qc=null;var o=Uc,s=$c;if(zc=0,Vc=Uc=null,$c=0,6&gc)throw Error(r(331));var l=gc;if(gc|=4,dc(o.current),rc(o,o.current,s,n),gc=l,Bu(0,!1),we&&"function"==typeof we.onPostCommitFiberRoot)try{we.onPostCommitFiberRoot(be,o)}catch(c){}return!0}finally{R.p=a,I.T=i,Su(e,t)}}function xu(e,t,n){t=Kr(n,t),null!==(e=Sa(e,t=Ns(e.stateNode,t,2),2))&&(Ie(e,2),Fu(e))}function Cu(e,t,n){if(3===e.tag)xu(e,e,n);else for(;null!==t;){if(3===t.tag){xu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Bc||!Bc.has(r))){e=Kr(n,e),null!==(r=Sa(t,n=Ls(2),2))&&(Is(n,r,t,e),Ie(r,2),Fu(r));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new mc;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(Ec=!0,i.add(n),e=Mu.bind(null,e,t,n),t.then(e,e))}function Mu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,vc===e&&(bc&n)===n&&(4===Cc||3===Cc&&(62914560&bc)===bc&&300>ue()-jc?!(2&gc)&&iu(e,0):Pc|=n,Ac===bc&&(Ac=0)),Fu(e)}function Pu(e,t){0===t&&(t=Ne()),null!==(e=Rr(e,t))&&(Ie(e,t),Fu(e))}function Ou(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Pu(e,n)}function Au(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==i&&i.delete(t),Pu(e,n)}var Nu=null,Lu=null,Iu=!1,ju=!1,Ru=!1,Du=0;function Fu(e){e!==Lu&&null===e.next&&(null===Lu?Nu=Lu=e:Lu=Lu.next=e),ju=!0,Iu||(Iu=!0,Td(function(){6&gc?oe(fe,zu):Uu()}))}function Bu(e,t){if(!Ru&&ju){Ru=!0;do{for(var n=!1,r=Nu;null!==r;){if(0!==e){var i=r.pendingLanes;if(0===i)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Se(42|e)+1)-1,a=201326741&(a&=i&~(o&~s))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Wu(r,a))}else a=bc,!(3&(a=Pe(r,r===vc?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Oe(r,a)||(n=!0,Wu(r,a));r=r.next}}while(n);Ru=!1}}function zu(){Uu()}function Uu(){ju=Iu=!1;var e=0;0!==Du&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==_d&&(_d=e,!0);return _d=null,!1}()&&(e=Du);for(var t=ue(),n=null,r=Nu;null!==r;){var i=r.next,a=Vu(r,t);0===a?(r.next=null,null===n?Nu=i:n.next=i,null===i&&(Lu=n)):(n=r,(0!==e||3&a)&&(ju=!0)),r=i}0!==zc&&5!==zc||Bu(e),0!==Du&&(Du=0)}function Vu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-Se(a),s=1<<o,l=i[o];-1===l?0!==(s&n)&&0===(s&r)||(i[o]=Ae(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(n=bc,n=Pe(e,e===(t=vc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===wc||9===wc)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&se(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Oe(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&se(r),Be(n)){case 2:case 8:n=pe;break;case 32:default:n=he;break;case 268435456:n=ge}return r=$u.bind(null,e),n=oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&se(r),e.callbackPriority=2,e.callbackNode=null,2}function $u(e,t){if(0!==zc&&5!==zc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_u()&&e.callbackNode!==n)return null;var r=bc;return 0===(r=Pe(e,e===vc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Xc(e,r,t),Vu(e,ue()),null!=e.callbackNode&&e.callbackNode===n?$u.bind(null,e):null)}function Wu(e,t){if(_u())return null;Xc(e,t,!0)}function qu(){if(0===Du){var e=Hi;0===e&&(e=xe,!(261888&(xe<<=1))&&(xe=256)),Du=e}return Du}function Hu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Lt(""+e)}function Ju(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Gu=0;Gu<Tr.length;Gu++){var Qu=Tr[Gu];Mr(Qu.toLowerCase(),"on"+(Qu[0].toUpperCase()+Qu.slice(1)))}Mr(br,"onAnimationEnd"),Mr(wr,"onAnimationIteration"),Mr(kr,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(Sr,"onTransitionRun"),Mr(_r,"onTransitionStart"),Mr(Er,"onTransitionCancel"),Mr(xr,"onTransitionEnd"),ot("onMouseEnter",["mouseout","mouseover"]),ot("onMouseLeave",["mouseout","mouseover"]),ot("onPointerEnter",["pointerout","pointerover"]),ot("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ku=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function Xu(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}}}}function Zu(e,t){var n=t[He];void 0===n&&(n=t[He]=new Set);var r=e+"__bubble";n.has(r)||(rd(t,e,2,!1),n.add(r))}function ed(e,t,n){var r=0;t&&(r|=4),rd(n,e,r,t)}var td="_reactListening"+Math.random().toString(36).slice(2);function nd(e){if(!e[td]){e[td]=!0,rt.forEach(function(t){"selectionchange"!==t&&(Ku.has(t)||ed(t,!1,e),ed(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[td]||(t[td]=!0,ed("selectionchange",!1,t))}}function rd(e,t,n,r){switch(Of(t)){case 2:var i=Ef;break;case 8:i=xf;break;default:i=Cf}n=i.bind(null,t,n,e),i=void 0,!Wt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function id(e,t,n,r,i){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===i)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===i)return;s=s.return}for(;null!==l;){if(null===(s=Xe(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){r=o=s;continue e}l=l.parentNode}}r=r.return}Ut(function(){var r=o,i=Rt(n),s=[];e:{var l=Cr.get(e);if(void 0!==l){var c=an,u=e;switch(e){case"keypress":if(0===Yt(n))break e;case"keydown":case"keyup":c=wn;break;case"focusin":u="focus",c=dn;break;case"focusout":u="blur",c=dn;break;case"beforeblur":case"afterblur":c=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=un;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Sn;break;case br:case wr:case kr:c=fn;break;case xr:c=_n;break;case"scroll":case"scrollend":c=sn;break;case"wheel":c=En;break;case"copy":case"cut":case"paste":c=pn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kn;break;case"toggle":case"beforetoggle":c=xn}var d=!!(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var g=m;if(h=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===h||null===p||null!=(g=Vt(m,p))&&d.push(ad(m,g,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,i),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===jt||!(u=n.relatedTarget||n.fromElement)||!Xe(u)&&!u[qe])&&(c||l)&&(l=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?Xe(u):null)&&(f=a(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=cn,g="onMouseLeave",p="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=kn,g="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:et(c),h=null==u?l:et(u),(l=new d(g,m+"leave",c,n,i)).target=f,l.relatedTarget=h,g=null,Xe(i)===r&&((d=new d(p,m+"enter",u,n,i)).target=h,d.relatedTarget=f,g=d),f=g,c&&u)e:{for(d=sd,m=u,h=0,g=p=c;g;g=d(g))h++;g=0;for(var v=m;v;v=d(v))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break e}p=d(p),m=d(m)}d=null}else d=null;null!==c&&ld(s,l,c,d,!1),null!==u&&null!==f&&ld(s,f,u,d,!0)}if("select"===(c=(l=r?et(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var y=$n;else if(Dn(l))if(Wn)y=Zn;else{y=Kn;var b=Yn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&Ot(r.elementType)&&(y=$n):y=Xn;switch(y&&(y=y(e,r))?Fn(s,y,n,i):(b&&b(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&St(l,"number",l.value)),b=r?et(r):window,e){case"focusin":(Dn(b)||"true"===b.contentEditable)&&(cr=b,ur=r,dr=null);break;case"focusout":dr=ur=cr=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,pr(s,n,i);break;case"selectionchange":if(lr)break;case"keydown":case"keyup":pr(s,n,i)}var w;if(Tn)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else jn?Ln(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(On&&"ko"!==n.locale&&(jn||"onCompositionStart"!==k?"onCompositionEnd"===k&&jn&&(w=Qt()):(Jt="value"in(Ht=i)?Ht.value:Ht.textContent,jn=!0)),0<(b=od(r,k)).length&&(k=new hn(k,e,null,n,i),s.push({event:k,listeners:b}),w?k.data=w:null!==(w=In(n))&&(k.data=w))),(w=Pn?function(e,t){switch(e){case"compositionend":return In(t);case"keypress":return 32!==t.which?null:(Nn=!0,An);case"textInput":return(e=t.data)===An&&Nn?null:e;default:return null}}(e,n):function(e,t){if(jn)return"compositionend"===e||!Tn&&Ln(e,t)?(e=Qt(),Gt=Jt=Ht=null,jn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return On&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(k=od(r,"onBeforeInput")).length&&(b=new hn("onBeforeInput","beforeinput",null,n,i),s.push({event:b,listeners:k}),b.data=w)),function(e,t,n,r,i){if("submit"===t&&n&&n.stateNode===i){var a=Hu((i[We]||null).action),o=r.submitter;o&&null!==(t=(t=o[We]||null)?Hu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new an("action","action",null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Du){var e=o?Ju(i,o):new FormData(i);is(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else"function"==typeof a&&(s.preventDefault(),e=o?Ju(i,o):new FormData(i),is(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}(s,e,r,n,i)}Xu(s,t)})}function ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function od(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;if(5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=Vt(e,n))&&r.unshift(ad(e,i,a)),null!=(i=Vt(e,t))&&r.push(ad(e,i,a))),3===e.tag)return r;e=e.return}return[]}function sd(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function ld(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===r)break;5!==s&&26!==s&&27!==s||null===c||(l=c,i?null!=(c=Vt(n,a))&&o.unshift(ad(n,c,l)):i||null!=(c=Vt(n,a))&&o.push(ad(n,c,l))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var cd=/\r\n?/g,ud=/\u0000|\uFFFD/g;function dd(e){return("string"==typeof e?e:""+e).replace(cd,"\n").replace(ud,"")}function fd(e,t){return t=dd(t),dd(e)===t}function pd(e,t,n,i,a,o){switch(n){case"children":"string"==typeof i?"body"===t||"textarea"===t&&""===i||Ct(e,i):("number"==typeof i||"bigint"==typeof i)&&"body"!==t&&Ct(e,""+i);break;case"className":dt(e,"class",i);break;case"tabIndex":dt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,i);break;case"style":Pt(e,i,o);break;case"data":if("object"!==t){dt(e,"data",i);break}case"src":case"href":if(""===i&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==i||"function"==typeof i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if("function"==typeof i){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof o&&("formAction"===n?("input"!==t&&pd(e,t,"name",a.name,a,null),pd(e,t,"formEncType",a.formEncType,a,null),pd(e,t,"formMethod",a.formMethod,a,null),pd(e,t,"formTarget",a.formTarget,a,null)):(pd(e,t,"encType",a.encType,a,null),pd(e,t,"method",a.method,a,null),pd(e,t,"target",a.target,a,null))),null==i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"onClick":null!=i&&(e.onclick=It);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"muted":e.muted=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==i||"function"==typeof i||"boolean"==typeof i||"symbol"==typeof i){e.removeAttribute("xlink:href");break}n=Lt(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===i?e.setAttribute(n,""):!1!==i&&null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":null==i||"function"==typeof i||"symbol"==typeof i||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Zu("beforetoggle",e),Zu("toggle",e),ut(e,"popover",i);break;case"xlinkActuate":ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ut(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ut(e,n=At.get(n)||n,i)}}function hd(e,t,n,i,a,o){switch(n){case"style":Pt(e,i,o);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof i?Ct(e,i):("number"==typeof i||"bigint"==typeof i)&&Ct(e,""+i);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"onClick":null!=i&&(e.onclick=It);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:it.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(o=null!=(o=e[We]||null)?o[n]:null)&&e.removeEventListener(t,o,a),"function"!=typeof i)?n in e?e[n]=i:!0===i?e.setAttribute(n,""):ut(e,n,i):("function"!=typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,a)))}}function md(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Zu("error",e),Zu("load",e);var i,a=!1,o=!1;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(null!=s)switch(i){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,i,s,n,null)}}return o&&pd(e,t,"srcSet",n.srcSet,n,null),void(a&&pd(e,t,"src",n.src,n,null));case"input":Zu("invalid",e);var l=i=s=o=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":o=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:pd(e,t,a,d,n,null)}}return void kt(e,i,l,c,u,s,o,!1);case"select":for(o in Zu("invalid",e),a=s=i=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":i=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:pd(e,t,o,l,n,null)}return t=i,n=s,e.multiple=!!a,void(null!=t?_t(e,!!a,t,!1):null!=n&&_t(e,!!a,n,!0));case"textarea":for(s in Zu("invalid",e),i=o=a=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":a=l;break;case"defaultValue":o=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(r(91));break;default:pd(e,t,s,l,n,null)}return void xt(e,a,o,i);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else pd(e,t,c,a,n,null);return;case"dialog":Zu("beforetoggle",e),Zu("toggle",e),Zu("cancel",e),Zu("close",e);break;case"iframe":case"object":Zu("load",e);break;case"video":case"audio":for(a=0;a<Yu.length;a++)Zu(Yu[a],e);break;case"image":Zu("error",e),Zu("load",e);break;case"details":Zu("toggle",e);break;case"embed":case"source":case"link":Zu("error",e),Zu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,u,a,n,null)}return;default:if(Ot(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&hd(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&pd(e,t,l,a,n,null))}function gd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var vd=null,yd=null;function bd(e){return 9===e.nodeType?e:e.ownerDocument}function wd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kd(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Sd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var _d=null;var Ed="function"==typeof setTimeout?setTimeout:void 0,xd="function"==typeof clearTimeout?clearTimeout:void 0,Cd="function"==typeof Promise?Promise:void 0,Td="function"==typeof queueMicrotask?queueMicrotask:void 0!==Cd?function(e){return Cd.resolve(null).then(e).catch(Md)}:Ed;function Md(e){setTimeout(function(){throw e})}function Pd(e){return"head"===e}function Od(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)||"/&"===n){if(0===r)return e.removeChild(i),void Gf(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)Ud(e.ownerDocument.documentElement);else if("head"===n){Ud(n=e.ownerDocument.head);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ye]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=o}}else"body"===n&&Ud(e.ownerDocument.body);n=i}while(n);Gf(t)}function Ad(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Nd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nd(n),Ke(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Ld(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}function Id(e){return"$?"===e.data||"$~"===e.data}function jd(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Rd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Dd=null;function Fd(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Rd(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Bd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function zd(e,t,n){switch(t=bd(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function Ud(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ke(e)}var Vd=new Map,$d=new Set;function Wd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var qd=R.d;R.d={f:function(){var e=qd.f(),t=nu();return e||t},r:function(e){var t=Ze(e);null!==t&&5===t.tag&&"form"===t.type?os(t):qd.r(e)},D:function(e){qd.D(e),Jd("dns-prefetch",e,null)},C:function(e,t){qd.C(e,t),Jd("preconnect",e,t)},L:function(e,t,n){qd.L(e,t,n);var r=Hd;if(r&&e&&t){var i='link[rel="preload"][as="'+bt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(i+='[imagesrcset="'+bt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(i+='[imagesizes="'+bt(n.imageSizes)+'"]')):i+='[href="'+bt(e)+'"]';var a=i;switch(t){case"style":a=Qd(e);break;case"script":a=Xd(e)}Vd.has(a)||(e=u({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Vd.set(a,e),null!==r.querySelector(i)||"style"===t&&r.querySelector(Yd(a))||"script"===t&&r.querySelector(Zd(a))||(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}},m:function(e,t){qd.m(e,t);var n=Hd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+bt(r)+'"][href="'+bt(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Xd(e)}if(!Vd.has(a)&&(e=u({rel:"modulepreload",href:e},t),Vd.set(a,e),null===n.querySelector(i))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Zd(a)))return}md(r=n.createElement("link"),"link",e),nt(r),n.head.appendChild(r)}}},X:function(e,t){qd.X(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}},S:function(e,t,n){qd.S(e,t,n);var r=Hd;if(r&&e){var i=tt(r).hoistableStyles,a=Qd(e);t=t||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Yd(a)))s.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vd.get(a))&&nf(e,n);var l=o=r.createElement("link");nt(l),md(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,tf(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}},M:function(e,t){qd.M(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0,type:"module"},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}};var Hd="undefined"==typeof document?null:document;function Jd(e,t,n){var r=Hd;if(r&&"string"==typeof t&&t){var i=bt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"==typeof n&&(i+='[crossorigin="'+n+'"]'),$d.has(i)||($d.add(i),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(i)&&(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}}function Gd(e,t,n,i){var a,o,s,l,c=(c=G.current)?Wd(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Qd(n.href),(i=(n=tt(c).hoistableStyles).get(t))||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Qd(n.href);var u=tt(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Yd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Vd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Vd.set(e,n),u||(a=c,o=e,s=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=a.createElement("link"),l.preload=o,o.addEventListener("load",function(){return l.loading|=1}),o.addEventListener("error",function(){return l.loading|=2}),md(o,"link",s),nt(o),a.head.appendChild(o))))),t&&null===i)throw Error(r(528,""));return d}if(t&&null!==i)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Xd(n),(i=(n=tt(c).hoistableScripts).get(t))||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Qd(e){return'href="'+bt(e)+'"'}function Yd(e){return'link[rel="stylesheet"]['+e+"]"}function Kd(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function Xd(e){return'[src="'+bt(e)+'"]'}function Zd(e){return"script[async]"+e}function ef(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+bt(n.href)+'"]');if(i)return t.instance=i,nt(i),i;var a=u({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return nt(i=(e.ownerDocument||e).createElement("style")),md(i,"style",a),tf(i,n.precedence,e),t.instance=i;case"stylesheet":a=Qd(n.href);var o=e.querySelector(Yd(a));if(o)return t.state.loading|=4,t.instance=o,nt(o),o;i=Kd(n),(a=Vd.get(a))&&nf(i,a),nt(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),md(o,"link",i),t.state.loading|=4,tf(o,n.precedence,e),t.instance=o;case"script":return o=Xd(n.src),(a=e.querySelector(Zd(o)))?(t.instance=a,nt(a),a):(i=n,(a=Vd.get(o))&&rf(i=u({},n),a),nt(a=(e=e.ownerDocument||e).createElement("script")),md(a,"link",i),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(i=t.instance,t.state.loading|=4,tf(i,n.precedence,e));return t.instance}function tf(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function nf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function rf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var af=null;function of(e,t,n){if(null===af){var r=new Map,i=af=new Map;i.set(n,r)}else(r=(i=af).get(n))||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ye]||a[$e]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function sf(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function lf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var cf=0;function uf(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ff(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var df=null;function ff(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,df=new Map,t.forEach(pf,e),df=null,uf.call(e))}function pf(e,t){if(!(4&t.state.loading)){var n=df.get(e);if(n)var r=n.get(null);else{n=new Map,df.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}o=(i=t.instance).getAttribute("data-precedence"),(a=n.get(o)||r)===r&&n.set(null,i),n.set(o,i),this.count++,r=uf.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var hf={$$typeof:y,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function mf(e,t,n,r,i,a,o,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function gf(e,t,n,r,i,a,o,s,l,c,u,d){return e=new mf(e,t,n,o,l,c,u,d,s),t=1,!0===a&&(t|=24),a=Ur(3,null,null,t),e.current=a,a.stateNode=e,(t=Vi()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ba(a),e}function vf(e){return e?e=Br:Br}function yf(e,t,n,r,i,a){i=vf(i),null===r.context?r.context=i:r.pendingContext=i,(r=ka(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=Sa(e,r,t))&&(Kc(n,0,t),_a(n,e,t))}function bf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function wf(e,t){bf(e,t),(e=e.alternate)&&bf(e,t)}function kf(e){if(13===e.tag||31===e.tag){var t=Rr(e,67108864);null!==t&&Kc(t,0,67108864),wf(e,67108864)}}function Sf(e){if(13===e.tag||31===e.tag){var t=Qc(),n=Rr(e,t=Fe(t));null!==n&&Kc(n,0,t),wf(e,t)}}var _f=!0;function Ef(e,t,n,r){var i=I.T;I.T=null;var a=R.p;try{R.p=2,Cf(e,t,n,r)}finally{R.p=a,I.T=i}}function xf(e,t,n,r){var i=I.T;I.T=null;var a=R.p;try{R.p=8,Cf(e,t,n,r)}finally{R.p=a,I.T=i}}function Cf(e,t,n,r){if(_f){var i=Tf(r);if(null===i)id(e,t,r,Mf,n),Bf(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Nf=zf(Nf,e,t,n,r,i),!0;case"dragenter":return Lf=zf(Lf,e,t,n,r,i),!0;case"mouseover":return If=zf(If,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return jf.set(a,zf(jf.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Rf.set(a,zf(Rf.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Bf(e,r),4&t&&-1<Ff.indexOf(e)){for(;null!==i;){var a=Ze(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=Me(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-Se(o);s.entanglements[1]|=l,o&=~l}Fu(a),!(6&gc)&&(Dc=ue()+500,Bu(0))}}break;case 31:case 13:null!==(s=Rr(a,2))&&Kc(s,0,2),nu(),wf(a,2)}if(null===(a=Tf(r))&&id(e,t,r,Mf,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else id(e,t,r,null,n)}}function Tf(e){return Pf(e=Rt(e))}var Mf=null;function Pf(e){if(Mf=null,null!==(e=Xe(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=o(t)))return e;e=null}else if(31===n){if(null!==(e=s(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mf=e,null}function Of(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case fe:return 2;case pe:return 8;case he:case me:return 32;case ge:return 268435456;default:return 32}default:return 32}}var Af=!1,Nf=null,Lf=null,If=null,jf=new Map,Rf=new Map,Df=[],Ff="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Bf(e,t){switch(e){case"focusin":case"focusout":Nf=null;break;case"dragenter":case"dragleave":Lf=null;break;case"mouseover":case"mouseout":If=null;break;case"pointerover":case"pointerout":jf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rf.delete(t.pointerId)}}function zf(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=Ze(t))&&kf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Uf(e){var t=Xe(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=o(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(31===t){if(null!==(t=s(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Vf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.nativeEvent);if(null!==n)return null!==(t=Ze(n))&&kf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);jt=r,n.target.dispatchEvent(r),jt=null,t.shift()}return!0}function $f(e,t,n){Vf(e)&&n.delete(t)}function Wf(){Af=!1,null!==Nf&&Vf(Nf)&&(Nf=null),null!==Lf&&Vf(Lf)&&(Lf=null),null!==If&&Vf(If)&&(If=null),jf.forEach($f),Rf.forEach($f)}function qf(t,n){t.blockedOn===n&&(t.blockedOn=null,Af||(Af=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Wf)))}var Hf=null;function Jf(t){Hf!==t&&(Hf=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hf===t&&(Hf=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],i=t[e+2];if("function"!=typeof r){if(null===Pf(r||n))continue;break}var a=Ze(n);null!==a&&(t.splice(e,3),e-=3,is(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gf(e){function t(t){return qf(t,e)}null!==Nf&&qf(Nf,e),null!==Lf&&qf(Lf,e),null!==If&&qf(If,e),jf.forEach(t),Rf.forEach(t);for(var n=0;n<Df.length;n++){var r=Df[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Df.length&&null===(n=Df[0]).blockedOn;)Uf(n),null===n.blockedOn&&Df.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[We]||null;if("function"==typeof a)o||Jf(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[We]||null)s=o.formAction;else if(null!==Pf(i))continue}else s=o.action;"function"==typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Jf(n)}}}function Qf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==i&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==i&&(i(),i=null)}}}function Yf(e){this._internalRoot=e}function Kf(e){this._internalRoot=e}Kf.prototype.render=Yf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));yf(t.current,Qc(),e,t,null,null)},Kf.prototype.unmount=Yf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;yf(e.current,2,null,e,null,null),nu(),t[qe]=null}},Kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Df.length&&0!==t&&t<Df[n].priority;n++);Df.splice(n,0,e),0===n&&Uf(e)}};var Xf=t.version;if("19.2.3"!==Xf)throw Error(r(527,Xf,"19.2.3"));R.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,i=t;;){var o=n.return;if(null===o)break;var s=o.alternate;if(null===s){if(null!==(i=o.return)){n=i;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return l(o),e;if(s===i)return l(o),t;s=s.sibling}throw Error(r(188))}if(n.return!==i.return)n=o,i=s;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,i=s;break}if(u===i){c=!0,i=o,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,i=o;break}if(u===i){c=!0,i=s,n=o;break}u=u.sibling}if(!c)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?c(e):null)?null:e.stateNode};var Zf={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ep=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ep.isDisabled&&ep.supportsFiber)try{be=ep.inject(Zf),we=ep}catch(tp){}}return P.createRoot=function(e,t){if(!i(e))throw Error(r(299));var n=!1,a="",o=Ts,s=Ms,l=Ps;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=gf(e,1,!1,null,0,n,a,null,o,s,l,Qf),e[qe]=t.current,nd(e),new Yf(t)},P.hydrateRoot=function(e,t,n){if(!i(e))throw Error(r(299));var a=!1,o="",s=Ts,l=Ms,c=Ps,u=null;return null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.formState&&(u=n.formState)),(t=gf(e,1,!0,t,0,a,o,u,s,l,c,Qf)).context=vf(null),n=t.current,(o=ka(a=Fe(a=Qc()))).callback=null,Sa(n,o,a),n=a,t.current.lanes=n,Ie(t,n),Fu(t),e[qe]=t.current,nd(e),new Kf(t)},P.version="19.2.3",P}var V=(R||(R=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),M.exports=U()),M.exports);const $=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},W=e=>e;const q=e=>{const t=(e=>e?$(e):$)(e),n=e=>function(e,t=W){const n=x.useSyncExternalStore(e.subscribe,x.useCallback(()=>t(e.getState()),[e,t]),x.useCallback(()=>t(e.getInitialState()),[e,t]));return x.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},H=(J=(e,t)=>({isOpen:!1,currentScreen:"welcome",agentId:null,agentConfig:null,configLoading:!1,configError:null,chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,remoteAudioStream:null,openDialog:()=>e({isOpen:!0,currentScreen:"welcome"}),closeDialog:()=>{const{pipecatClient:n,connectionState:r}=t();n&&"disconnected"!==r&&n.disconnect().catch(()=>{}),e({isOpen:!1,currentScreen:"welcome",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,remoteAudioStream:null})},toggleDialog:()=>{const{isOpen:e,openDialog:n,closeDialog:r}=t();e?r():n()},setScreen:t=>e({currentScreen:t}),openChat:()=>e({isOpen:!0,currentScreen:"chat"}),openTalk:()=>e({isOpen:!0,currentScreen:"talk"}),setAgentId:t=>e({agentId:t}),setAgentConfig:t=>e({agentConfig:t,configLoading:!1,configError:null}),setConfigLoading:t=>e({configLoading:t}),setConfigError:t=>e({configError:t,configLoading:!1}),setChatSession:t=>e({chatSession:t,isChatInitialized:!0}),addMessage:t=>e(e=>({messages:[...e.messages,l({id:Date.now()+Math.random(),timestamp:new Date},t)]})),setStreaming:(t,n="")=>e({isStreaming:t,streamingContent:n}),clearMessages:()=>e({messages:[],isChatInitialized:!1,chatSession:null}),setPipecatClient:t=>e({pipecatClient:t}),setConnectionState:t=>e({connectionState:t}),setIsBotReady:t=>e({isBotReady:t}),setIsMicEnabled:t=>e({isMicEnabled:t}),setRemoteAudioStream:t=>e({remoteAudioStream:t}),resetChat:()=>e({chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:""}),resetVoice:()=>e({pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,remoteAudioStream:null}),resetAll:()=>e({isOpen:!1,currentScreen:"welcome",chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,remoteAudioStream:null}),getAgentName:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.agent_name)||"AI Assistant"},getAvatarUrl:()=>{const{agentConfig:e}=t();if(!(null==e?void 0:e.MediaFiles)||!Array.isArray(e.MediaFiles))return null;const n=e.MediaFiles.find(e=>"avatar"===e.fileType);return(null==n?void 0:n.mediaUrl)||null},getPromptToken:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.prompt_access_token)||null},getTheme:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_theme)||{}},getTncConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_tnc_config)||{}},getInterfaceConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_interface)||{}}}),J?q(J):q);var J;const G=(...e)=>{console.log("[EigiChat]",...e)},Q=(...e)=>{console.error("[EigiChat Error]",...e)},Y="https://prod.eigi.ai";function K(e){return d(this,arguments,function*(e,t={}){const n=`${Y}/${e}`,r=l({headers:l({"Content-Type":"application/json"},t.headers)},t);try{G(`📡 API Request: ${t.method||"GET"} ${e}`);const i=yield fetch(n,r);if(!i.ok){const e=yield i.json().catch(()=>({}));throw new Error(e.detail||e.message||`HTTP ${i.status}`)}return yield i.json()}catch(i){throw Q(`API request failed: ${e}`,i),i}})}function X(e){return d(this,null,function*(){G("🔍 Fetching agent config for:",e);const t=yield K(`v1/widgets/agents/${e}`);return G("✅ Agent config fetched:",t.agent_name),t})}function Z(e,t=!0){if(!e||0===Object.keys(e).length)return"";const n=Object.entries(e).filter(([e,t])=>null!=t&&""!==t).map(([e,t])=>`${function(e){return`--widget-${e.replace(/_/g,"-")}`}(e)}: ${function(e,t=""){if("boolean"==typeof e)return e?"1":"0";const n=["opacity","weight","font_weight","z_index","line_height"].some(e=>t.toLowerCase().includes(e));return"number"!=typeof e||n?String(e):`${e}px`}(t,e)}`).join(";\n ");if(!n)return"";return`${t?":host, *":":root"} {\n ${n};\n}`}function ee(e){if(!e||"string"!=typeof e)return null;3===(e=e.replace(/^#/,"")).length&&(e=e.split("").map(e=>e+e).join(""));const t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s,l=(i+a)/2;if(i===a)o=s=0;else{const e=i-a;switch(s=l>.5?e/(2-i-a):e/(i+a),i){case t:o=((n-r)/e+(n<r?6:0))/6;break;case n:o=((r-t)/e+2)/6;break;case r:o=((t-n)/e+4)/6}}return o=Math.round(360*o),s=Math.round(100*s),l=Math.round(100*l),`${o} ${s}% ${l}%`}const te=E.memo(function({theme:e,widgetElement:t}){return E.useEffect(()=>{if(!e||0===Object.keys(e).length)return void G("[Style] No theme provided, skipping injection");const n=void 0!==(null==t?void 0:t.shadow),r=function(e,t=!0){if(!e)return"";const n={"--background":ee(e.background),"--foreground":ee(e.text_primary),"--primary":ee(e.primary_color),"--primary-foreground":ee(e.primary_foreground),"--secondary":ee(e.secondary_color),"--secondary-foreground":ee(e.secondary_foreground),"--accent":ee(e.accent_color),"--accent-foreground":ee(e.accent_foreground),"--muted":ee(e.background_muted||e.background_secondary),"--muted-foreground":ee(e.text_muted),"--border":ee(e.border),"--input":ee(e.input_border||e.border),"--ring":ee(e.border_focus||e.primary_color),"--destructive":ee(e.status_error||"#ef4444"),"--destructive-foreground":"0 0% 100%","--card":ee(e.background),"--card-foreground":ee(e.text_primary),"--popover":ee(e.background_secondary||e.background),"--popover-foreground":ee(e.text_primary),"--radius":e.border_radius||"0.75rem"},r=Object.entries(n).filter(([e,t])=>null!=t).map(([e,t])=>`${e}: ${t}`).join(";\n ");return r?`${t?":host, *":":root"} {\n ${r};\n}`:""}(e,n),i=[r,Z(e,n)].filter(Boolean).join("\n\n");if(i)if(G("[Style] Injecting theme CSS, Shadow DOM:",n),n&&(null==t?void 0:t.injectThemeCSS))t.injectThemeCSS(i),G("[Style] ✅ Theme CSS injected via custom element method");else if(null==t?void 0:t.injectThemeCSS)t.injectThemeCSS(i),G("[Style] Theme CSS injected via mock element");else{const e="eigi-chat-theme";let t=document.getElementById(e);t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.textContent=i,G("[Style] Theme CSS injected into document head (fallback)")}else G("[Style] No CSS generated from theme")},[e,t]),null});function ne(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ne(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function re(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ne(e))&&(r&&(r+=" "),r+=t);return r}const ie=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ae=re,oe=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),se="-",le=[],ce=e=>{const t=fe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return de(e);const n=e.split(se),r=""===n[0]&&n.length>1?1:0;return ue(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||le}return n[e]||le}}},ue=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=ue(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(se):e.slice(t).join(se),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},de=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),fe=e=>{const{theme:t,classGroups:n}=e;return pe(n,t)},pe=(e,t)=>{const n=oe();for(const r in e){const i=e[r];he(i,n,r,t)}return n},he=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];me(i,t,n,r)}},me=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?ye(e,t,n,r):ve(e,t,n,r):ge(e,t,n)},ge=(e,t,n)=>{(""===e?t:be(t,e)).classGroupId=n},ve=(e,t,n,r)=>{we(e)?he(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},ye=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];he(a,be(t,e),n,r)}},be=(e,t)=>{let n=e;const r=t.split(se),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=oe(),n.nextPart.set(e,t)),n=t}return n},we=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ke=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},Se=[],_e=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ee=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,a=0;const o=e.length;for(let u=0;u<o;u++){const o=e[u];if(0===r&&0===i){if(":"===o){t.push(e.slice(a,u)),a=u+1;continue}if("/"===o){n=u;continue}}"["===o?r++:"]"===o?r--:"("===o?i++:")"===o&&i--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return _e(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_e(Se,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},xe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const a=e[i],o="["===a[0],s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ce=/\s+/,Te=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Te(e[r]))&&(n&&(n+=" "),n+=t);return n},Me=(e,...t)=>{let n,r,i,a;const o=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Ce);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=e+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=e+(l.length>0?" "+l:l);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:a(u).join(":"),v=d?g+"!":g,y=v+m;if(o.indexOf(y)>-1)continue;o.push(y);const b=i(m,h);for(let n=0;n<b.length;++n){const e=b[n];o.push(v+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return i(e,a),a};return a=s=>{const c=t.reduce((e,t)=>t(e),e());return n=(e=>l({cache:ke(e.cacheSize),parseClassName:Ee(e),sortModifiers:xe(e)},ce(e)))(c),r=n.cache.get,i=n.cache.set,a=o,o(s)},(...e)=>a(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=Te(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Pe=[],Oe=e=>{const t=t=>t[e]||Pe;return t.isThemeGetter=!0,t},Ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ne=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Le=/^\d+\/\d+$/,Ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,je=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Re=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,De=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Be=e=>Le.test(e),ze=e=>!!e&&!Number.isNaN(Number(e)),Ue=e=>!!e&&Number.isInteger(Number(e)),Ve=e=>e.endsWith("%")&&ze(e.slice(0,-1)),$e=e=>Ie.test(e),We=()=>!0,qe=e=>je.test(e)&&!Re.test(e),He=()=>!1,Je=e=>De.test(e),Ge=e=>Fe.test(e),Qe=e=>!Ke(e)&&!rt(e),Ye=e=>ut(e,ht,He),Ke=e=>Ae.test(e),Xe=e=>ut(e,mt,qe),Ze=e=>ut(e,gt,ze),et=e=>ut(e,ft,He),tt=e=>ut(e,pt,Ge),nt=e=>ut(e,yt,Je),rt=e=>Ne.test(e),it=e=>dt(e,mt),at=e=>dt(e,vt),ot=e=>dt(e,ft),st=e=>dt(e,ht),lt=e=>dt(e,pt),ct=e=>dt(e,yt,!0),ut=(e,t,n)=>{const r=Ae.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},dt=(e,t,n=!1)=>{const r=Ne.exec(e);return!!r&&(r[1]?t(r[1]):n)},ft=e=>"position"===e||"percentage"===e,pt=e=>"image"===e||"url"===e,ht=e=>"length"===e||"size"===e||"bg-size"===e,mt=e=>"length"===e,gt=e=>"number"===e,vt=e=>"family-name"===e,yt=e=>"shadow"===e,bt=Me(()=>{const e=Oe("color"),t=Oe("font"),n=Oe("text"),r=Oe("font-weight"),i=Oe("tracking"),a=Oe("leading"),o=Oe("breakpoint"),s=Oe("container"),l=Oe("spacing"),c=Oe("radius"),u=Oe("shadow"),d=Oe("inset-shadow"),f=Oe("text-shadow"),p=Oe("drop-shadow"),h=Oe("blur"),m=Oe("perspective"),g=Oe("aspect"),v=Oe("ease"),y=Oe("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",rt,Ke],w=()=>[rt,Ke,l],k=()=>[Be,"full","auto",...w()],S=()=>[Ue,"none","subgrid",rt,Ke],_=()=>["auto",{span:["full",Ue,rt,Ke]},Ue,rt,Ke],E=()=>[Ue,"auto",rt,Ke],x=()=>["auto","min","max","fr",rt,Ke],C=()=>["auto",...w()],T=()=>[Be,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,rt,Ke],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ot,et,{position:[rt,Ke]}],O=()=>["auto","cover","contain",st,Ye,{size:[rt,Ke]}],A=()=>[Ve,it,Xe],N=()=>["","none","full",c,rt,Ke],L=()=>["",ze,it,Xe],I=()=>[ze,Ve,ot,et],j=()=>["","none",h,rt,Ke],R=()=>["none",ze,rt,Ke],D=()=>["none",ze,rt,Ke],F=()=>[ze,rt,Ke],B=()=>[Be,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$e],breakpoint:[$e],color:[We],container:[$e],"drop-shadow":[$e],ease:["in","out","in-out"],font:[Qe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$e],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$e],shadow:[$e],spacing:["px",ze],text:[$e],"text-shadow":[$e],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Be,Ke,rt,g]}],container:["container"],columns:[{columns:[ze,Ke,rt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Ue,"auto",rt,Ke]}],basis:[{basis:[Be,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,Be,"auto","initial","none",Ke]}],grow:[{grow:["",ze,rt,Ke]}],shrink:[{shrink:["",ze,rt,Ke]}],order:[{order:[Ue,"first","last","none",rt,Ke]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":x()}],"auto-rows":[{"auto-rows":x()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[s,"screen",...T()]}],"min-w":[{"min-w":[s,"screen","none",...T()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",n,it,Xe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,rt,Ze]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ve,Ke]}],"font-family":[{font:[at,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,rt,Ke]}],"line-clamp":[{"line-clamp":[ze,"none",rt,Ze]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",rt,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",rt,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",rt,Xe]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[ze,"auto",rt,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",rt,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ue,rt,Ke],radial:["",rt,Ke],conic:[Ue,rt,Ke]},lt,tt]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[ze,rt,Ke]}],"outline-w":[{outline:["",ze,it,Xe]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,ct,nt]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,ct,nt]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[ze,Xe]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,ct,nt]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[ze,rt,Ke]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[rt,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",rt,Ke]}],filter:[{filter:["","none",rt,Ke]}],blur:[{blur:j()}],brightness:[{brightness:[ze,rt,Ke]}],contrast:[{contrast:[ze,rt,Ke]}],"drop-shadow":[{"drop-shadow":["","none",p,ct,nt]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",ze,rt,Ke]}],"hue-rotate":[{"hue-rotate":[ze,rt,Ke]}],invert:[{invert:["",ze,rt,Ke]}],saturate:[{saturate:[ze,rt,Ke]}],sepia:[{sepia:["",ze,rt,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",rt,Ke]}],"backdrop-blur":[{"backdrop-blur":j()}],"backdrop-brightness":[{"backdrop-brightness":[ze,rt,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[ze,rt,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,rt,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,rt,Ke]}],"backdrop-invert":[{"backdrop-invert":["",ze,rt,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[ze,rt,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[ze,rt,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,rt,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",rt,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",rt,Ke]}],ease:[{ease:["linear","initial",v,rt,Ke]}],delay:[{delay:[ze,rt,Ke]}],animate:[{animate:["none",y,rt,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,rt,Ke]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:R()}],"rotate-x":[{"rotate-x":R()}],"rotate-y":[{"rotate-y":R()}],"rotate-z":[{"rotate-z":R()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[rt,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",rt,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",rt,Ke]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[ze,it,Xe,Ze]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function wt(...e){return bt(re(e))}const kt=(St="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",_t={variants:{variant:{default:"text-white shadow-sm hover:opacity-90",secondary:"shadow-sm hover:opacity-90",destructive:"text-white shadow-sm hover:opacity-90",outline:"border bg-transparent shadow-sm hover:opacity-80",ghost:"hover:opacity-80",link:"underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-md px-8 text-base",xl:"h-14 rounded-lg px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-8 w-8","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if(null==(null==_t?void 0:_t.variants))return ae(St,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:r}=_t,i=Object.keys(n).map(t=>{const i=null==e?void 0:e[t],a=null==r?void 0:r[t];if(null===i)return null;const o=ie(i)||ie(a);return n[t][o]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),o=null==_t||null===(t=_t.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let n=t,{class:i,className:o}=n,s=u(n,["class","className"]);return Object.entries(s).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes(l(l({},r),a)[t]):l(l({},r),a)[t]===n})?[...e,i,o]:e},[]);return ae(St,i,o,null==e?void 0:e.class,null==e?void 0:e.className)});var St,_t;const Et=E.forwardRef((e,t)=>{var n=e,{className:r,variant:i,size:a,style:o}=n,s=u(n,["className","variant","size","style"]);return b.jsx("button",l({className:wt(kt({variant:i,size:a,className:r})),ref:t,style:l(c(l({},(()=>{switch(i){case"default":return{backgroundColor:"var(--widget-button-primary-bg, #3B82F6)",color:"var(--widget-button-primary-text, #FFFFFF)"};case"secondary":return{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"};case"destructive":return{backgroundColor:"var(--widget-button-destructive-bg, #DC2626)",color:"var(--widget-button-destructive-text, #FFFFFF)"};case"outline":return{borderColor:"var(--widget-border, #E5E7EB)",color:"var(--widget-text-primary, #111827)"};case"ghost":return{color:"var(--widget-text-primary, #111827)"};default:return{}}})()),{borderRadius:"var(--widget-border-radius-small, 8px)",fontFamily:"var(--widget-font-family, inherit)"}),o)},s))});Et.displayName="Button";const xt=E.forwardRef((e,t)=>{var n=e,{className:r,src:i,alt:a,fallback:o,size:s="md"}=n,d=u(n,["className","src","alt","fallback","size"]);const[f,p]=E.useState(!1),h={sm:"h-10 w-10 text-sm",md:"h-16 w-16 text-lg",lg:"h-24 w-24 text-2xl",xl:"h-32 w-32 text-3xl","2xl":"h-40 w-40 text-4xl"};return b.jsx("div",c(l({ref:t,className:wt("relative flex shrink-0 overflow-hidden rounded-full",h[s]||h.md,r),style:{backgroundColor:"var(--widget-background-secondary, #F3F4F6)"}},d),{children:i&&!f?b.jsx("img",{src:i,alt:a||"Avatar",onError:()=>{p(!0)},className:"aspect-square h-full w-full object-cover"}):b.jsx("span",{className:"flex h-full w-full items-center justify-center font-semibold",style:{color:"var(--widget-text-secondary, #6B7280)"},children:o||(a?a.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"AI")})}))});xt.displayName="Avatar";const Ct=E.forwardRef((e,t)=>{var n=e,{status:r="idle"}=n,i=u(n,["status"]);const a={idle:{ring:"ring-2 ring-offset-2",ringColor:"var(--widget-border, #E5E7EB)"},connecting:{ring:"ring-4 ring-offset-2 animate-pulse",ringColor:"var(--widget-status-connecting, #F59E0B)"},listening:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-success, #10B981)"},speaking:{ring:"ring-4 ring-offset-4 animate-pulse",ringColor:"var(--widget-primary-color, #3B82F6)"},error:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-error, #DC2626)"}},o=a[r]||a.idle;return b.jsx("div",{className:wt(o.ring),style:{"--tw-ring-color":o.ringColor,"--tw-ring-offset-color":"var(--widget-background, #FFFFFF)",borderRadius:"9999px"},children:b.jsx(xt,l({ref:t},i))})});function Tt(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Mt(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Tt(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Tt(e[t],null)}}}}function Pt(...e){return E.useCallback(Mt(...e),e)}function Ot(e){const t=At(e),n=E.forwardRef((e,n)=>{const r=e,{children:i}=r,a=u(r,["children"]),o=E.Children.toArray(i),s=o.find(Lt);if(s){const e=s.props.children,r=o.map(t=>t===s?E.Children.count(e)>1?E.Children.only(null):E.isValidElement(e)?e.props.children:null:t);return b.jsx(t,c(l({},a),{ref:n,children:E.isValidElement(e)?E.cloneElement(e,void 0,r):null}))}return b.jsx(t,c(l({},a),{ref:n,children:i}))});return n.displayName=`${e}.Slot`,n}function At(e){const t=E.forwardRef((e,t)=>{const n=e,{children:r}=n,i=u(n,["children"]);if(E.isValidElement(r)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(r),n=function(e,t){const n=l({},t);for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{const t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]=l(l({},i),a):"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return l(l({},e),n)}(i,r.props);return r.type!==E.Fragment&&(n.ref=t?Mt(t,e):e),E.cloneElement(r,n)}return E.Children.count(r)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Ct.displayName="AvatarWithStatus",z();var Nt=Symbol("radix.slottable");function Lt(e){return E.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Nt}var It=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Ot(`Primitive.${t}`),r=E.forwardRef((e,r)=>{const i=e,{asChild:a}=i,o=u(i,["asChild"]),s=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),b.jsx(s,c(l({},o),{ref:r}))});return r.displayName=`Primitive.${t}`,c(l({},e),{[t]:r})},{}),jt=(null==globalThis?void 0:globalThis.document)?E.useLayoutEffect:()=>{};var Rt=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef("none"),o=e?"mounted":"unmounted",[s,l]=function(e,t){return E.useReducer((e,n)=>{const r=t[e][n];return null!=r?r:e},e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const e=Dt(r.current);a.current="mounted"===s?e:"none"},[s]),jt(()=>{const t=r.current,n=i.current;if(n!==e){const r=a.current,o=Dt(t);if(e)l("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),jt(()=>{var e;if(t){let n;const o=null!=(e=t.ownerDocument.defaultView)?e:window,s=e=>{const a=Dt(r.current).includes(CSS.escape(e.animationName));if(e.target===t&&a&&(l("ANIMATION_END"),!i.current)){const e=t.style.animationFillMode;t.style.animationFillMode="forwards",n=o.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=e)})}},c=e=>{e.target===t&&(a.current=Dt(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{o.clearTimeout(n),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:E.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),i="function"==typeof n?n({present:r.isPresent}):E.Children.only(n),a=Pt(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof n||r.isPresent?E.cloneElement(i,{ref:a}):null};function Dt(e){return(null==e?void 0:e.animationName)||"none"}function Ft(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>{const i=n(e)[`__scope${r}`];return l(l({},t),i)},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Bt(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}Rt.displayName="Presence";var zt=E.createContext(void 0);function Ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}var Vt="ScrollArea",[$t]=function(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>E.createContext(e));return function(n){const r=(null==n?void 0:n[e])||t;return E.useMemo(()=>({[`__scope${e}`]:c(l({},n),{[e]:r})}),[n,r])}};return r.scopeName=e,[function(t,r){const i=E.createContext(r),a=n.length;n=[...n,r];const o=t=>{var n;const r=t,{scope:o,children:s}=r,l=u(r,["scope","children"]),c=(null==(n=null==o?void 0:o[e])?void 0:n[a])||i,d=E.useMemo(()=>l,Object.values(l));return b.jsx(c.Provider,{value:d,children:s})};return o.displayName=t+"Provider",[o,function(n,o){var s;const l=(null==(s=null==o?void 0:o[e])?void 0:s[a])||i,c=E.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Ft(r,...t)]}(Vt),[Wt,qt]=$t(Vt),Ht=E.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,type:i="hover",dir:a,scrollHideDelay:o=600}=n,s=u(n,["__scopeScrollArea","type","dir","scrollHideDelay"]),[d,f]=E.useState(null),[p,h]=E.useState(null),[m,g]=E.useState(null),[v,y]=E.useState(null),[w,k]=E.useState(null),[S,_]=E.useState(0),[x,C]=E.useState(0),[T,M]=E.useState(!1),[P,O]=E.useState(!1),A=Pt(t,e=>f(e)),N=function(e){const t=E.useContext(zt);return e||t||"ltr"}(a);return b.jsx(Wt,{scope:r,type:i,dir:N,scrollHideDelay:o,scrollArea:d,viewport:p,onViewportChange:h,content:m,onContentChange:g,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:T,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:k,scrollbarYEnabled:P,onScrollbarYEnabledChange:O,onCornerWidthChange:_,onCornerHeightChange:C,children:b.jsx(It.div,c(l({dir:N},s),{ref:A,style:l({position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":x+"px"},e.style)}))})});Ht.displayName=Vt;var Jt="ScrollAreaViewport",Gt=E.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,children:i,nonce:a}=n,o=u(n,["__scopeScrollArea","children","nonce"]),s=qt(Jt,r),d=Pt(t,E.useRef(null),s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),b.jsx(It.div,c(l({"data-radix-scroll-area-viewport":""},o),{ref:d,style:l({overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden"},e.style),children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:i})}))]})});Gt.displayName=Jt;var Qt="ScrollAreaScrollbar",Yt=E.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=qt(Qt,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,d="horizontal"===e.orientation;return E.useEffect(()=>(d?o(!0):s(!0),()=>{d?o(!1):s(!1)}),[d,o,s]),"hover"===a.type?b.jsx(Kt,c(l({},i),{ref:t,forceMount:r})):"scroll"===a.type?b.jsx(Xt,c(l({},i),{ref:t,forceMount:r})):"auto"===a.type?b.jsx(Zt,c(l({},i),{ref:t,forceMount:r})):"always"===a.type?b.jsx(en,c(l({},i),{ref:t})):null});Yt.displayName=Qt;var Kt=E.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=qt(Qt,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),s(!0)},r=()=>{t=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),b.jsx(Rt,{present:r||o,children:b.jsx(Zt,c(l({"data-state":o?"visible":"hidden"},i),{ref:t}))})}),Xt=E.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=qt(Qt,e.__scopeScrollArea),o="horizontal"===e.orientation,s=wn(()=>f("SCROLL_END"),100),[d,f]=(p="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},E.useReducer((e,t)=>{const n=h[e][t];return null!=n?n:e},p));var p,h;return E.useEffect(()=>{if("idle"===d){const e=window.setTimeout(()=>f("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[d,a.scrollHideDelay,f]),E.useEffect(()=>{const e=a.viewport,t=o?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(f("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,o,f,s]),b.jsx(Rt,{present:r||"hidden"!==d,children:b.jsx(en,c(l({"data-state":"hidden"===d?"hidden":"visible"},i),{ref:t,onPointerEnter:Ut(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Ut(e.onPointerLeave,()=>f("POINTER_LEAVE"))}))})}),Zt=E.forwardRef((e,t)=>{const n=qt(Qt,e.__scopeScrollArea),r=e,{forceMount:i}=r,a=u(r,["forceMount"]),[o,s]=E.useState(!1),d="horizontal"===e.orientation,f=wn(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;s(d?e:t)}},10);return kn(n.viewport,f),kn(n.content,f),b.jsx(Rt,{present:i||o,children:b.jsx(en,c(l({"data-state":o?"visible":"hidden"},a),{ref:t}))})}),en=E.forwardRef((e,t)=>{const n=e,{orientation:r="vertical"}=n,i=u(n,["orientation"]),a=qt(Qt,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[d,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=hn(d.viewport,d.content),h=c(l({},i),{sizes:d,onSizesChange:f,hasThumb:Boolean(p>0&&p<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:e=>s.current=e});function m(e,t){return function(e,t,n,r="ltr"){const i=mn(n),a=i/2,o=t||a,s=i-o,l=n.scrollbar.paddingStart+o,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return vn([l,c],d)(e)}(e,s.current,d,t)}return"horizontal"===r?b.jsx(tn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=gn(a.viewport.scrollLeft,d,a.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=m(e,a.dir))}})):"vertical"===r?b.jsx(nn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=gn(a.viewport.scrollTop,d);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=m(e))}})):null}),tn=E.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=qt(Qt,e.__scopeScrollArea),[s,d]=E.useState(),f=E.useRef(null),p=Pt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(on,c(l({"data-orientation":"horizontal"},a),{ref:p,sizes:r,style:l({bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":mn(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),yn(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:pn(s.paddingLeft),paddingEnd:pn(s.paddingRight)}})}}))}),nn=E.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=qt(Qt,e.__scopeScrollArea),[s,d]=E.useState(),f=E.useRef(null),p=Pt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(on,c(l({"data-orientation":"vertical"},a),{ref:p,sizes:r,style:l({top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":mn(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),yn(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:pn(s.paddingTop),paddingEnd:pn(s.paddingBottom)}})}}))}),[rn,an]=$t(Qt),on=E.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,sizes:i,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:d,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m}=n,g=u(n,["__scopeScrollArea","sizes","hasThumb","onThumbChange","onThumbPointerUp","onThumbPointerDown","onThumbPositionChange","onDragScroll","onWheelScroll","onResize"]),v=qt(Qt,r),[y,w]=E.useState(null),k=Pt(t,e=>w(e)),S=E.useRef(null),_=E.useRef(""),x=v.viewport,C=i.content-i.viewport,T=Bt(h),M=Bt(f),P=wn(m,10);function O(e){if(S.current){const t=e.clientX-S.current.left,n=e.clientY-S.current.top;p({x:t,y:n})}}return E.useEffect(()=>{const e=e=>{const t=e.target;(null==y?void 0:y.contains(t))&&T(e,C)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,y,C,T]),E.useEffect(M,[i,M]),kn(y,P),kn(v.content,P),b.jsx(rn,{scope:r,scrollbar:y,hasThumb:a,onThumbChange:Bt(o),onThumbPointerUp:Bt(s),onThumbPositionChange:M,onThumbPointerDown:Bt(d),children:b.jsx(It.div,c(l({},g),{ref:k,style:l({position:"absolute"},g.style),onPointerDown:Ut(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),S.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),O(e)}}),onPointerMove:Ut(e.onPointerMove,O),onPointerUp:Ut(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})}))})}),sn="ScrollAreaThumb",ln=E.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=an(sn,e.__scopeScrollArea);return b.jsx(Rt,{present:r||a.hasThumb,children:b.jsx(cn,l({ref:t},i))})}),cn=E.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,style:i}=n,a=u(n,["__scopeScrollArea","style"]),o=qt(sn,r),s=an(sn,r),{onThumbPositionChange:d}=s,f=Pt(t,e=>s.onThumbChange(e)),p=E.useRef(void 0),h=wn(()=>{p.current&&(p.current(),p.current=void 0)},100);return E.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(h(),!p.current){const t=bn(e,d);p.current=t,d()}};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,h,d]),b.jsx(It.div,c(l({"data-state":s.hasThumb?"visible":"hidden"},a),{ref:f,style:l({width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)"},i),onPointerDownCapture:Ut(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;s.onThumbPointerDown({x:n,y:r})}),onPointerUp:Ut(e.onPointerUp,s.onThumbPointerUp)}))});ln.displayName=sn;var un="ScrollAreaCorner",dn=E.forwardRef((e,t)=>{const n=qt(un,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?b.jsx(fn,c(l({},e),{ref:t})):null});dn.displayName=un;var fn=E.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r}=n,i=u(n,["__scopeScrollArea"]),a=qt(un,r),[o,s]=E.useState(0),[d,f]=E.useState(0),p=Boolean(o&&d);return kn(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),f(t)}),kn(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),s(t)}),p?b.jsx(It.div,c(l({},i),{ref:t,style:l({width:o,height:d,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0},e.style)})):null});function pn(e){return e?parseInt(e,10):0}function hn(e,t){const n=e/t;return isNaN(n)?0:n}function mn(e){const t=hn(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function gn(e,t,n="ltr"){const r=mn(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,o]:[-1*o,0]);return vn([0,o],[0,s])(l)}function vn(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function yn(e,t){return e>0&&e<t}var bn=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function wn(e,t){const n=Bt(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function kn(e,t){const n=Bt(t);jt(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Sn=Ht,_n=Gt,En=dn;const xn=E.forwardRef((e,t)=>{var n=e,{className:r,children:i}=n,a=u(n,["className","children"]);return b.jsxs(Sn,c(l({ref:t,className:wt("relative overflow-hidden",r)},a),{children:[b.jsx(_n,{className:"h-full w-full rounded-[inherit]",children:i}),b.jsx(Cn,{}),b.jsx(En,{})]}))});xn.displayName=Sn.displayName;const Cn=E.forwardRef((e,t)=>{var n=e,{className:r,orientation:i="vertical"}=n,a=u(n,["className","orientation"]);return b.jsx(Yt,c(l({ref:t,orientation:i,className:wt("flex touch-none select-none transition-colors","vertical"===i&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===i&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r)},a),{children:b.jsx(ln,{className:"relative flex-1 rounded-full",style:{backgroundColor:"var(--widget-border, #E5E7EB)"}})}))});Cn.displayName=Yt.displayName;
11
+ /**
12
+ * @license lucide-react v0.553.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const Tn=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Mn=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();
18
+ /**
19
+ * @license lucide-react v0.553.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ var Pn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
25
+ /**
26
+ * @license lucide-react v0.553.0 - ISC
27
+ *
28
+ * This source code is licensed under the ISC license.
29
+ * See the LICENSE file in the root directory of this source tree.
30
+ */const On=E.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:d,iconNode:f}=n,p=u(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return E.createElement("svg",l(l(c(l({ref:t},Pn),{width:i,height:i,stroke:r,strokeWidth:o?24*Number(a)/Number(i):a,className:Mn("lucide",s)}),!d&&!(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(p)&&{"aria-hidden":"true"}),p),[...f.map(([e,t])=>E.createElement(e,t)),...Array.isArray(d)?d:[d]])}),An=(e,t)=>{const n=E.forwardRef((n,r)=>{var i,a=n,{className:o}=a,s=u(a,["className"]);return E.createElement(On,l({ref:r,iconNode:t,className:Mn(`lucide-${i=Tn(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o)},s))});return n.displayName=Tn(e),n},Nn=An("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ln=An("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),In=An("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),jn=An("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Rn=An("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),Dn=An("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Fn=An("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);
31
+ /**
32
+ * @license lucide-react v0.553.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */function Bn({agentName:e,avatarUrl:t,tncEnabled:n,tncContent:r,onTalk:i,onChat:a,onClose:o,className:s}){return b.jsxs("div",{className:wt("flex flex-col h-full w-full animate-fade-in",s),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("div",{className:"flex items-center justify-end p-4",style:{borderBottom:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsx("button",{onClick:o,className:"p-2 rounded-full hover:opacity-80 transition-opacity",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Fn,{className:"h-6 w-6"})})}),b.jsx(xn,{className:"flex-1",children:b.jsxs("div",{className:"flex flex-col items-center px-6 py-8",children:[b.jsx(xt,{src:t,alt:e,size:"2xl",className:"mb-6 shadow-lg"}),b.jsx("h1",{className:"text-2xl font-semibold mb-2 text-center",style:{color:"var(--widget-text-primary, #111827)"},children:"Welcome!"}),b.jsxs("p",{className:"text-lg mb-6 text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:["I'm ",b.jsx("span",{className:"font-medium",children:e})]}),n&&r&&b.jsx("div",{className:"w-full max-w-md mb-6 p-4 rounded-lg",style:{backgroundColor:"var(--widget-background-secondary, #F9FAFB)",border:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",style:{color:"var(--widget-text-secondary, #6B7280)"},children:r})}),n&&b.jsx("p",{className:"text-xs mb-8 text-center max-w-sm",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"By continuing, you agree to the terms above."})]})}),b.jsx("div",{className:"p-6",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsxs("div",{className:"flex gap-4 max-w-md mx-auto",children:[b.jsxs(Et,{onClick:i,variant:"default",size:"xl",className:"flex-1",children:[b.jsx(jn,{className:"h-5 w-5"}),"Talk"]}),b.jsxs(Et,{onClick:a,variant:"secondary",size:"xl",className:"flex-1",children:[b.jsx(Ln,{className:"h-5 w-5"}),"Chat"]})]})})]})}function zn({messages:e,streamingContent:t,isStreaming:n,className:r}){const i=E.useRef(null);return E.useEffect(()=>{var e;null==(e=i.current)||e.scrollIntoView({behavior:"smooth"})},[e,t]),b.jsx(xn,{className:wt("flex-1 px-4",r),children:b.jsxs("div",{className:"py-4 space-y-4",children:[e.map(e=>b.jsx(Un,{message:e},e.id)),n&&t&&b.jsx(Un,{message:{type:"assistant",text:t,isStreaming:!0}}),b.jsx("div",{ref:i})]})})}function Un({message:e}){const t="user"===e.type;e.type;const n="system"===e.type;return"separator"===e.type?b.jsx("div",{className:"flex items-center justify-center py-2",children:b.jsx("div",{className:"px-3 py-1 rounded-full text-xs",style:{backgroundColor:"var(--widget-system-message-bg, #F3F4F6)",color:"var(--widget-system-message-text, #6B7280)"},children:e.text})}):n?b.jsx("div",{className:"flex justify-center",children:b.jsx("div",{className:"max-w-[85%] px-4 py-2 rounded-lg text-sm",style:{backgroundColor:"var(--widget-system-message-bg, #FEF3C7)",color:"var(--widget-system-message-text, #92400E)"},children:e.text})}):b.jsx("div",{className:wt("flex",t?"justify-end":"justify-start"),children:b.jsxs("div",{className:wt("max-w-[85%] px-4 py-3 rounded-2xl text-sm leading-relaxed",t?"rounded-br-md":"rounded-bl-md",e.isTranscript&&"italic opacity-80"),style:{backgroundColor:t?"var(--widget-user-message-bg, #3B82F6)":"var(--widget-bot-message-bg, #F3F4F6)",color:t?"var(--widget-user-message-text, #FFFFFF)":"var(--widget-bot-message-text, #111827)"},children:[e.text,e.isStreaming&&b.jsx("span",{className:"inline-block w-2 h-4 ml-1 animate-pulse bg-current opacity-50"})]})})}function Vn({onSend:e,disabled:t,placeholder:n="Type a message...",className:r}){const[i,a]=E.useState(""),o=E.useRef(null),s=n=>{var r;n.preventDefault(),i.trim()&&!t&&(e(i.trim()),a(""),null==(r=o.current)||r.focus())};return b.jsxs("form",{onSubmit:s,className:wt("flex items-center gap-2 p-4",r),style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",backgroundColor:"var(--widget-background, #FFFFFF)"},children:[b.jsx("input",{ref:o,type:"text",value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s(e))},placeholder:n,disabled:t,className:"flex-1 h-11 px-4 rounded-full outline-none transition-all",style:{backgroundColor:"var(--widget-input-bg, #F9FAFB)",color:"var(--widget-input-text, #111827)",border:"1px solid var(--widget-input-border, #E5E7EB)",fontFamily:"var(--widget-font-family, inherit)",fontSize:"var(--widget-font-size-base, 14px)"}}),b.jsx(Et,{type:"submit",variant:"default",size:"icon",disabled:!i.trim()||t,className:"shrink-0 rounded-full h-11 w-11",children:b.jsx(Dn,{className:"h-5 w-5"})})]})}function $n(e,t,n={}){const{chatSession:r,messages:i,isChatInitialized:a,isStreaming:o,streamingContent:s,setChatSession:u,addMessage:f,setStreaming:p}=H(),h=E.useRef(null),m=E.useRef(null),g=E.useRef(!1),v=E.useCallback(()=>d(null,null,function*(){if(!g.current&&!a&&e&&t){g.current=!0;try{G("🔍 Initializing chat session for agent:",e);const n=yield function(e,t){return d(this,null,function*(){G("🔍 Initializing chat session for agent:",e);const n=yield K(`v1/widgets/chat/sessions?agent_id=${e}`,{method:"POST",headers:{"X-Prompt-Token":t}});return G("✅ Chat session initialized:",n.session_id),n})}(e,t);G("✅ Chat session initialized:",n),u(n),m.current=n.session_id,n.first_message&&f({type:"assistant",text:n.first_message,isTranscript:!1})}catch(n){Q("❌ Failed to initialize chat:",n),f({type:"system",text:`Error: ${n.message}`})}}else G("⏭️ Chat already initialized or initializing, skipping")}),[e,t,a,u,f]),y=E.useCallback(i=>d(null,null,function*(){if(i.trim()&&!o){f({type:"user",text:i,isTranscript:!1});try{h.current=new AbortController,p(!0,""),G("📤 Sending message:",{agentId:e,sessionId:m.current,message:i.substring(0,50)+"..."});const a=yield function(e,t,n,r,i){return d(this,null,function*(){const a=`${Y}/v1/widgets/chat/messages`;G("📤 Sending chat message:",n.substring(0,50)+"...");const o=yield fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":i},body:JSON.stringify({agent_id:e,session_id:t,message:n,metadata:r})});if(!o.ok){const e=yield o.text();throw new Error(`Server error (${o.status}): ${e||"Unknown error"}`)}return{response:o,sessionId:o.headers.get("X-Session-ID")}})}(e,m.current||(null==r?void 0:r.session_id),i,c(l({},n),{agent_id:e}),t);a.sessionId&&(m.current=a.sessionId);const o=a.response.body.getReader(),s=new TextDecoder;let u="";try{for(;;){const{done:e,value:t}=yield o.read();if(e)break;u+=s.decode(t,{stream:!0}),p(!0,u)}}finally{o.releaseLock()}u.trim()&&f({type:"assistant",text:u,isTranscript:!1}),p(!1,""),G("✅ Message sent successfully")}catch(a){"AbortError"!==a.name&&(Q("❌ Failed to send message:",a),f({type:"system",text:`Error: ${a.message}`})),p(!1,"")}}}),[e,t,r,n,o,f,p]),b=E.useCallback(()=>{h.current&&(h.current.abort(),p(!1,""))},[p]);return{messages:i,isStreaming:o,streamingContent:s,isInitialized:a,initializeChat:v,sendMessage:y,cancelStream:b}}function Wn({agentId:e,agentName:t,promptToken:n,metadata:r,onClose:i,onSwitchToTalk:a,className:o}){const{messages:s,isStreaming:l,streamingContent:c,isInitialized:u,initializeChat:d,sendMessage:f}=$n(e,n,r);return E.useEffect(()=>{!u&&n&&d()},[u,n,d]),b.jsxs("div",{className:wt("flex flex-col h-full w-full animate-fade-in",o),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsx("button",{onClick:i,className:"p-2 rounded-full hover:opacity-80 transition-opacity",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Fn,{className:"h-5 w-5"})}),b.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--widget-header-text, #111827)"},children:t}),b.jsx(Et,{onClick:a,variant:"ghost",size:"icon-sm",className:"rounded-full",title:"Switch to voice",children:b.jsx(jn,{className:"h-5 w-5",style:{color:"var(--widget-icon-active, #3B82F6)"}})})]}),b.jsx(zn,{messages:s,streamingContent:c,isStreaming:l,className:"flex-1"}),b.jsx(Vn,{onSend:f,disabled:l,placeholder:"Type a message..."})]})}function qn(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jn(e){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gn(e){var t=function(e){if("object"!=Jn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jn(t)?t:t+""}function Qn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gn(r.key),r)}}function Yn(e,t,n){return t&&Qn(e.prototype,t),n&&Qn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kn(e,t){if(t&&("object"==Jn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xn(e){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zn(e,t){return(Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function er(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zn(e,t)}function tr(e,t,n){return(t=Gn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function rr(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){nr(a,r,i,o,s,"next",e)}function s(e){nr(a,r,i,o,s,"throw",e)}o(void 0)})}}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ar(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ir(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ir(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var or,sr,lr={exports:{}},cr=function(){if(or)return lr.exports;or=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}lr.exports=i,lr.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var o,s;h(e,t,a,{once:!0}),"error"!==t&&(s=i,"function"==typeof(o=e).on&&h(o,"error",s,{once:!0}))})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},lr.exports}(),ur=(sr=cr)&&sr.__esModule&&Object.prototype.hasOwnProperty.call(sr,"default")?sr.default:sr,dr=Object.prototype.hasOwnProperty;function fr(e,t,n){for(n of e.keys())if(pr(n,t))return n}function pr(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&pr(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=fr(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=fr(t,i)))return!1;if(!pr(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(dr.call(e,n)&&++r&&!dr.call(t,n))return!1;if(!(n in t)||!pr(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}const hr={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},mr={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},gr={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},vr={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},yr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class br{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=br.getVersionPrecision(e),i=br.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=br.map([e,t],e=>{const t=a-br.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return br.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];"object"==typeof e&&null!==e&&Object.keys(e).forEach(t=>{n[t]=e[t]})}return e}static getBrowserAlias(e){return hr[e]}static getBrowserTypeByAlias(e){return mr[e]||""}}const wr=/version\/(\d+(\.?_?\d+)+)/i,kr=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=br.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=br.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=br.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=br.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=br.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=br.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=br.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=br.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=br.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=br.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=br.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=br.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=br.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=br.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=br.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=br.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=br.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=br.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=br.getFirstMatch(wr,e)||br.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=br.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=br.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=br.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=br.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=br.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=br.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=br.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=br.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=br.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=br.getFirstMatch(wr,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:br.getFirstMatch(t,e),version:br.getSecondMatch(t,e)}}}];var Sr=[{test:[/Roku\/DVP/],describe(e){const t=br.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:vr.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=br.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:vr.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=br.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=br.getWindowsVersionName(t);return{name:vr.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:vr.iOS},n=br.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=br.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=br.getMacOSVersionName(t),r={name:vr.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=br.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:vr.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=br.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=br.getAndroidVersionName(t),r={name:vr.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=br.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:vr.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=br.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||br.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||br.getFirstMatch(/\bbb(\d+)/i,e);return{name:vr.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=br.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:vr.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=br.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:vr.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:vr.Linux})},{test:[/CrOS/],describe:()=>({name:vr.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=br.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:vr.PlayStation4,version:t}}}],_r=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=br.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:gr.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:gr.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:gr.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:gr.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:gr.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:gr.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:gr.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=br.getFirstMatch(/(ipod|iphone)/i,e);return{type:gr.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:gr.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:gr.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:gr.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:gr.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:gr.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:gr.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:gr.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:gr.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:gr.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:gr.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:gr.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:gr.tv})}],Er=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:yr.Blink};const t=br.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:yr.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:yr.Trident},n=br.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:yr.Presto},n=br.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:yr.Gecko},n=br.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:yr.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:yr.WebKit},n=br.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class xr{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=br.find(kr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=br.find(Sr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=br.find(_r,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=br.find(Er,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return br.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=br.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=br.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=br.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=br.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(br.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
37
+ /*!
38
+ * Bowser - a browser detector
39
+ * https://github.com/lancedikson/bowser
40
+ * MIT License | (c) Dustin Diaz 2012-2015
41
+ * MIT License | (c) Denis Demchenko 2015-2019
42
+ */class Cr{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new xr(e,t)}static parse(e){return new xr(e).getResult()}static get BROWSER_MAP(){return mr}static get ENGINE_MAP(){return yr}static get OS_MAP(){return vr}static get PLATFORMS_MAP(){return gr}}function Tr(){return Date.now()+Math.random().toString()}function Mr(){throw new Error("Method must be implemented in subclass")}function Pr(e,t){return null!=t&&t.proxyUrl?t.proxyUrl+("/"===t.proxyUrl.slice(-1)?"":"/")+e.substring(8):e}function Or(e){return null!=e&&e.callObjectBundleUrlOverride?e.callObjectBundleUrlOverride:Pr("https://c.daily.co/call-machine/versioned/".concat("0.84.0","/static/call-machine-object-bundle.js"),e)}function Ar(e){try{new URL(e)}catch(t){return!1}return!0}const Nr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Lr="8.55.0",Ir=globalThis;function jr(e,t,n){const r=Ir,i=r.__SENTRY__=r.__SENTRY__||{},a=i[Lr]=i[Lr]||{};return a[e]||(a[e]=t())}const Rr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Dr=["debug","info","warn","error","log","assert","trace"],Fr={};function Br(e){if(!("console"in Ir))return e();const t=Ir.console,n={},r=Object.keys(Fr);r.forEach(e=>{const r=Fr[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}const zr=jr("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Rr?Dr.forEach(n=>{t[n]=(...t)=>{e&&Br(()=>{Ir.console[n](`Sentry Logger [${n}]:`,...t)})}}):Dr.forEach(e=>{t[e]=()=>{}}),t}),Ur="?",Vr=/\(error: (.*)\)/,$r=/captureMessage|captureException/;function Wr(e){return e[e.length-1]||{}}const qr="<anonymous>";function Hr(e){try{return e&&"function"==typeof e&&e.name||qr}catch(t){return qr}}function Jr(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch(n){return}}}const Gr={},Qr={};function Yr(e,t){Gr[e]=Gr[e]||[],Gr[e].push(t)}function Kr(e,t){if(!Qr[e]){Qr[e]=!0;try{t()}catch(n){Rr&&zr.error(`Error while instrumenting ${e}`,n)}}}function Xr(e,t){const n=e&&Gr[e];if(n)for(const i of n)try{i(t)}catch(r){Rr&&zr.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Hr(i)}\nError:`,r)}}let Zr=null;function ei(){Zr=Ir.onerror,Ir.onerror=function(e,t,n,r,i){return Xr("error",{column:r,error:i,line:n,msg:e,url:t}),!!Zr&&Zr.apply(this,arguments)},Ir.onerror.__SENTRY_INSTRUMENTED__=!0}let ti=null;function ni(){ti=Ir.onunhandledrejection,Ir.onunhandledrejection=function(e){return Xr("unhandledrejection",e),!ti||ti.apply(this,arguments)},Ir.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function ri(){return ii(Ir),Ir}function ii(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Lr,t[Lr]=t[Lr]||{}}const ai=Object.prototype.toString;function oi(e){switch(ai.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gi(e,Error)}}function si(e,t){return ai.call(e)===`[object ${t}]`}function li(e){return si(e,"ErrorEvent")}function ci(e){return si(e,"DOMError")}function ui(e){return si(e,"String")}function di(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function fi(e){return null===e||di(e)||"object"!=typeof e&&"function"!=typeof e}function pi(e){return si(e,"Object")}function hi(e){return"undefined"!=typeof Event&&gi(e,Event)}function mi(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function gi(e,t){try{return e instanceof t}catch(n){return!1}}function vi(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}const yi=Ir;function bi(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let a=0,o=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<r&&(c=wi(n,u),!("html"===c||a>1&&o+i.length*l+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(s)}catch(n){return"<unknown>"}}function wi(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(yi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i&&i.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&ui(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const e=n.getAttribute(o);e&&r.push(`[${o}="${e}"]`)}return r.join("")}function ki(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function Si(e,t){if(!Array.isArray(e))return"";const n=[];for(let i=0;i<e.length;i++){const t=e[i];try{vi(t)?n.push("[VueViewModel]"):n.push(String(t))}catch(r){n.push("[value cannot be serialized]")}}return n.join(t)}function _i(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!ui(e)&&(si(t,"RegExp")?t.test(e):!!ui(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function Ei(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&Ci(i,r);try{e[t]=i}catch(a){Rr&&zr.log(`Failed to replace method "${t}" in object`,e)}}function xi(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){Rr&&zr.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ci(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,xi(e,"__sentry_original__",t)}catch(n){}}function Ti(e){return e.__sentry_original__}function Mi(e){if(oi(e))return l({message:e.message,name:e.name,stack:e.stack},Oi(e));if(hi(e)){const t=l({type:e.type,target:Pi(e.target),currentTarget:Pi(e.currentTarget)},Oi(e));return"undefined"!=typeof CustomEvent&&gi(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Pi(e){try{return"undefined"!=typeof Element&&gi(e,Element)?bi(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function Oi(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ai(e){return Ni(e,new Map)}function Ni(e,t){if(function(e){if(!pi(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.getOwnPropertyNames(e))void 0!==e[i]&&(r[i]=Ni(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(Ni(e,t))}),r}return e}function Li(){return Date.now()/1e3}const Ii=function(){const{performance:e}=Ir;if(!e||!e.now)return Li;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function ji(){const e=Ir,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(r){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function Ri(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Di(e){const{message:t,event_id:n}=e;if(t)return t;const r=Ri(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Fi(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function Bi(e,t){const n=Ri(e);if(!n)return;const r=n.mechanism;if(n.mechanism=l(l({type:"generic",handled:!0},r),t),t&&"data"in t){const e=l(l({},r&&r.data),t.data);n.mechanism.data=e}}function zi(e){if(function(e){try{return e.__sentry_captured__}catch(t){}}(e))return!0;try{xi(e,"__sentry_captured__",!0)}catch(t){}return!1}var Ui;function Vi(e){return new Wi(t=>{t(e)})}function $i(e){return new Wi((t,n)=>{n(e)})}(()=>{const{performance:e}=Ir;e&&e.now&&(e.now(),e.timing&&e.timing.navigationStart)})(),function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(Ui||(Ui={}));class Wi{constructor(e){Wi.prototype.__init.call(this),Wi.prototype.__init2.call(this),Wi.prototype.__init3.call(this),Wi.prototype.__init4.call(this),this._state=Ui.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new Wi((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(i){r(i)}else n(t)},e=>{if(t)try{n(t(e))}catch(i){r(i)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Wi((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init(){this._resolve=e=>{this._setResult(Ui.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ui.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===Ui.PENDING&&(mi(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ui.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Ui.RESOLVED&&e[1](this._value),this._state===Ui.REJECTED&&e[2](this._value),e[0]=!0)})}}}function qi(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ii(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ji()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Hi(){return ji()}function Ji(){return ji().substring(16)}function Gi(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const r=l({},e);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Gi(r[i],t[i],n-1));return r}const Qi="_sentrySpan";function Yi(e,t){t?xi(e,Qi,t):delete e[Qi]}function Ki(e){return e[Qi]}class Xi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Hi(),spanId:Ji()}}clone(){const e=new Xi;return e._breadcrumbs=[...this._breadcrumbs],e._tags=l({},this._tags),e._extra=l({},this._extra),e._contexts=l({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=l({},this._sdkProcessingMetadata),e._propagationContext=l({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,Yi(e,Ki(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&qi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=l(l({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(l({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=l(l({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(l({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,r]=t instanceof Zi?[t.getScopeData(),t.getRequestSession()]:pi(t)?[e,e.requestSession]:[],{tags:i,extra:a,user:o,contexts:s,level:c,fingerprint:u=[],propagationContext:d}=n||{};return this._tags=l(l({},this._tags),i),this._extra=l(l({},this._extra),a),this._contexts=l(l({},this._contexts),s),o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Yi(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Hi()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r=l({timestamp:Li()},e);return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ki(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Gi(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=l({spanId:Ji()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:ji();if(!this._client)return zr.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,c(l({originalException:e,syntheticException:r},t),{event_id:n}),this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:ji();if(!this._client)return zr.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,c(l({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ji();return this._client?(this._client.captureEvent(e,c(l({},t),{event_id:n}),this),n):(zr.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Zi=Xi;class ea{constructor(e,t){let n,r;n=e||new Zi,r=t||new Zi,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(r){throw this._popScope(),r}return mi(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function ta(){const e=ii(ri());return e.stack=e.stack||new ea(jr("defaultCurrentScope",()=>new Zi),jr("defaultIsolationScope",()=>new Zi))}function na(e){return ta().withScope(e)}function ra(e,t){const n=ta();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function ia(e){return ta().withScope(()=>e(ta().getIsolationScope()))}function aa(e){const t=ii(e);return t.acs?t.acs:{withIsolationScope:ia,withScope:na,withSetScope:ra,withSetIsolationScope:(e,t)=>ia(t),getCurrentScope:()=>ta().getScope(),getIsolationScope:()=>ta().getIsolationScope()}}function oa(){return aa(ri()).getCurrentScope()}function sa(){return aa(ri()).getIsolationScope()}function la(){return oa().getClient()}function ca(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=t;return Ai({trace_id:n,span_id:r,parent_span_id:i})}function ua(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[r,i]]of t)(n[r]||(n[r]=[])).push(Ai(i));return n}const da=/^sentry-/;function fa(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}let pa=!1;function ha(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext();return Ai({parent_span_id:r?t:va(e).parent_span_id,span_id:r?Ji():t,trace_id:n})}function ma(e){return"number"==typeof e?ga(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ga(e.getTime()):Ii()}function ga(e){return e>9999999999?e/1e3:e}function va(e){if("function"==typeof e.getSpanJSON)return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:i,name:a,endTime:o,parentSpanId:s,status:l}=e;return Ai({span_id:t,trace_id:n,data:r,description:a,parent_span_id:s,start_timestamp:ma(i),timestamp:ma(o)||void 0,status:ya(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:ua(e)})}return{span_id:t,trace_id:n}}catch(t){return{}}}function ya(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}function ba(e){return e._sentryRootSpan||e}function wa(){pa||(Br(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),pa=!0)}const ka="production";function Sa(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i=Ai({environment:n.environment||ka,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",i),i}function _a(e){const t=la();if(!t)return{};const n=ba(e),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,a=i&&i.get("sentry.dsc"),o=a&&function(e){const t=function(e){if(e&&(ui(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=fa(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):fa(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.match(da)&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(a);if(o)return o;const s=Sa(e.spanContext().traceId,t),l=va(n),c=l.data||{},u=c["sentry.sample_rate"];null!=u&&(s.sample_rate=`${u}`);const d=c["sentry.source"],f=l.description;return"url"!==d&&f&&(s.transaction=f),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=la(),t=e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}()&&(s.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n))),t.emit("createDsc",s,n),s}const Ea=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function xa(e,t=!1){const{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${r?`${r}/`:r}${o}`}function Ca(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ta(e,t=100,n=1/0){try{return Pa("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ma(e,t=3,n=102400){const r=Ta(e,t);return a=r,i=JSON.stringify(a),~-encodeURI(i).split(/%..|./).length>n?Ma(e,t-1,n):r;var i,a}function Pa(e,t,n=1/0,r=1/0,i=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,o]=i;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(vi(t))return"[VueViewModel]";if(pi(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${Hr(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var n}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===l)return s.replace("object ","");if(a(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return Pa("",c.toJSON(),l-1,r,i)}catch(p){}const u=Array.isArray(t)?[]:{};let d=0;const f=Mi(t);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){u[h]="[MaxProperties ~]";break}const e=f[h];u[h]=Pa(h,e,l-1,r,i),d++}return o(t),u}function Oa(e,t=[]){return[e,t]}function Aa(e,t){const[n,r]=e;return[n,[...r,t]]}function Na(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function La(e){return Ir.__SENTRY__&&Ir.__SENTRY__.encodePolyfill?Ir.__SENTRY__.encodePolyfill(e):(new TextEncoder).encode(e)}function Ia(e){const[t,n]=e;let r=JSON.stringify(t);function i(e){"string"==typeof r?r="string"==typeof e?r+e:[La(r),e]:r.push("string"==typeof e?La(e):e)}for(const o of n){const[e,t]=o;if(i(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)i(t);else{let e;try{e=JSON.stringify(t)}catch(a){e=JSON.stringify(Ta(t))}i(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(r)}function ja(e){const t="string"==typeof e.data?La(e.data):e.data;return[Ai({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const Ra={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Da(e){return Ra[e]}function Fa(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Ba(e,t,n,r=0){return new Wi((i,a)=>{const o=e[r];if(null===t||"function"!=typeof o)i(t);else{const s=o(l({},t),n);Nr&&o.id&&null===s&&zr.log(`Event processor "${o.id}" dropped event`),mi(s)?s.then(t=>Ba(e,t,n,r+1).then(i)).then(null,a):Ba(e,s,n,r+1).then(i).then(null,a)}})}let za,Ua,Va;function $a(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:h,span:m}=t;Wa(e,"extra",n),Wa(e,"tags",r),Wa(e,"user",i),Wa(e,"contexts",a),e.sdkProcessingMetadata=Gi(e.sdkProcessingMetadata,s,2),o&&(e.level=o),h&&(e.transactionName=h),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext=l(l({},e.propagationContext),p)}function Wa(e,t,n){e[t]=Gi(e[t],n,1)}function qa(e,t,n,r,i,a){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,u=c(l({},t),{event_id:t.event_id||n.event_id||ji(),timestamp:t.timestamp||Li()}),d=n.integrations||e.integrations.map(e=>e.name);var f,p;!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:a=250}=t;e.environment=e.environment||n||ka,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i),e.message&&(e.message=ki(e.message,a));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=ki(o.value,a));const s=e.request;s&&s.url&&(s.url=ki(s.url,a))}(u,e),f=u,(p=d).length>0&&(f.sdk=f.sdk||{},f.sdk.integrations=[...f.sdk.integrations||[],...p]),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Ir._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return Va&&n.length===Ua||(Ua=n.length,Va=n.reduce((n,r)=>{za||(za={});const i=za[r];if(i)n[i[0]]=i[1];else{const i=e(r);for(let e=i.length-1;e>=0;e--){const a=i[e],o=a&&a.filename,s=t[r];if(o&&s){n[o]=s,za[r]=[o,s];break}}}return n},{})),Va}(t);try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{n&&e.filename&&(e.debug_id=n[e.filename])})})}catch(r){}}(u,e.stackParser);const h=function(e,t){if(!t)return e;const n=e?e.clone():new Zi;return n.update(t),n}(r,n.captureContext);n.mechanism&&Bi(u,n.mechanism);const m=i?i.getEventProcessors():[],g=jr("globalScope",()=>new Zi).getScopeData();a&&$a(g,a.getScopeData()),h&&$a(g,h.getScopeData());const v=[...n.attachments||[],...g.attachments];return v.length&&(n.attachments=v),function(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;var o,s;!function(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t,c=Ai(n);c&&Object.keys(c).length&&(e.extra=l(l({},c),e.extra));const u=Ai(r);u&&Object.keys(u).length&&(e.tags=l(l({},u),e.tags));const d=Ai(i);d&&Object.keys(d).length&&(e.user=l(l({},d),e.user));const f=Ai(a);f&&Object.keys(f).length&&(e.contexts=l(l({},f),e.contexts)),o&&(e.level=o),s&&"transaction"!==e.type&&(e.transaction=s)}(e,t),r&&function(e,t){e.contexts=l({trace:ha(t)},e.contexts),e.sdkProcessingMetadata=l({dynamicSamplingContext:_a(t)},e.sdkProcessingMetadata);const n=va(ba(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),s=n,(o=e).fingerprint=o.fingerprint?Array.isArray(o.fingerprint)?o.fingerprint:[o.fingerprint]:[],s&&(o.fingerprint=o.fingerprint.concat(s)),o.fingerprint&&!o.fingerprint.length&&delete o.fingerprint,function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata=l(l({},e.sdkProcessingMetadata),t)}(e,a)}(u,g),Ba([...m,...g.eventProcessors],u,n).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(r){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r=l(l(l(l(l({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>l(l({},e),e.data&&{data:Ta(e.data,t,n)}))}),e.user&&{user:Ta(e.user,t,n)}),e.contexts&&{contexts:Ta(e.contexts,t,n)}),e.extra&&{extra:Ta(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ta(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>l(l({},e),e.data&&{data:Ta(e.data,t,n)}))),e.contexts&&e.contexts.flags&&r.contexts&&(r.contexts.flags=Ta(e.contexts.flags,3,n)),r}(e,o,s):e))}function Ha(e,t){return oa().captureEvent(e,t)}function Ja(e){const t=la(),n=sa(),r=oa(),{release:i,environment:a=ka}=t&&t.getOptions()||{},{userAgent:o}=Ir.navigator||{},s=function(e){const t=Ii(),n={sid:ji(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>{return Ai({sid:`${(e=n).sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}});var e}};return e&&qi(n,e),n}(l(l({release:i,environment:a,user:r.getUser()||n.getUser()},o&&{userAgent:o}),e)),c=n.getSession();return c&&"ok"===c.status&&qi(c,{status:"exited"}),Ga(),n.setSession(s),r.setSession(s),s}function Ga(){const e=sa(),t=oa(),n=t.getSession()||e.getSession();n&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),qi(e,t)}(n),Qa(),e.setSession(),t.setSession()}function Qa(){const e=sa(),t=oa(),n=la(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function Ya(e=!1){e?Ga():Qa()}const Ka=[];function Xa(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Za(e,t,n){if(n[t.name])Nr&&zr.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Ka.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),Ka.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}Nr&&zr.log(`Integration installed: ${t.name}`)}}class eo extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const to="Not capturing exception because it's already been captured.";class no{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Ea.exec(e);if(!t)return void Br(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,i="",a="",o="",s=""]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return Ca({host:a,pass:i,path:l,projectId:c,port:o,protocol:n,publicKey:r})}(e):Ca(e);if(t&&function(e){if(!Rr)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(zr.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(zr.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(zr.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(zr.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):Nr&&zr.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t,n){return t||`${r=e,`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`;var r}(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(c(l({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}const t=["enableTracing","tracesSampleRate","tracesSampler"].find(t=>t in e&&null==e[t]);t&&Br(()=>{console.warn(`[Sentry] Deprecation warning: \`${t}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,t,n){const r=ji();if(zi(e))return Nr&&zr.log(to),r;const i=l({event_id:r},t);return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){const i=l({event_id:ji()},n),a=di(e)?e:String(e),o=fi(e)?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(o.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){const r=ji();if(t&&t.originalException&&zi(t.originalException))return Nr&&zr.log(to),r;const i=l({event_id:r},t),a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,a||n)),i.event_id}captureSession(e){"string"!=typeof e.release?Nr&&zr.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),qi(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):Vi(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit("close"),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];Za(this,e,this._integrations),t||Xa(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=Fa(n),a=e.type&&"replay_event"!==e.type?e.type:"event";var o,s;o=e,(s=n&&n.sdk)&&(o.sdk=o.sdk||{},o.sdk.name=o.sdk.name||s.name,o.sdk.version=o.sdk.version||s.version,o.sdk.integrations=[...o.sdk.integrations||[],...s.integrations||[]],o.sdk.packages=[...o.sdk.packages||[],...s.packages||[]]);const c=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return l(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:xa(r)}),i&&{trace:Ai(l({},i))})}(e,i,r,t);return delete e.sdkProcessingMetadata,Oa(c,[[{type:a},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=Aa(n,ja(i));const r=this.sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,n,r){const i=Fa(n);return Oa(l(l({sent_at:(new Date).toISOString()},i&&{sdk:i}),!!r&&t&&{dsn:xa(t)}),["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,i=`${e}:${t}`;Nr&&zr.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,t){const n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(Nr&&zr.error("Error while sending envelope:",e),e)):(Nr&&zr.error("Transport disabled"),Vi({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&Za(e,t,n)}),n}(this,e),Xa(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const a="ok"===e.status;(a&&0===e.errors||a&&n)&&(qi(e,c(l({},n&&{status:"crashed"}),{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new Wi(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n=oa(),r=sa()){const i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),qa(i,e,t,n,this,r).then(e=>{if(null===e)return e;e.contexts=l({trace:ca(n)},e.contexts);const t=function(e,t){const n=t.getPropagationContext();return n.dsc||Sa(n.traceId,e)}(this,n);return e.sdkProcessingMetadata=l({dynamicSamplingContext:t},e.sdkProcessingMetadata),e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{Nr&&(e instanceof eo&&"log"===e.logLevel?zr.log(e.message):zr.warn(e))})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,a=io(e),o=ro(e),s=e.type||"error",u=`before send for type \`${s}\``,d=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;Nr&&zr.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(i);if(o&&"number"==typeof d&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),$i(new eo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const f="replay_event"===s?"replay":s,p=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,p).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",f,e),new eo("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(mi(e))return e.then(e=>{if(!pi(e)&&null!==e)throw new eo(n);return e},e=>{throw new eo(`${t} rejected with ${e}`)});if(!pi(e)&&null!==e)throw new eo(n);return e}(function(e,t,n,r){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o}=t;if(ro(n)&&i)return i(n,r);if(io(n)){if(n.spans&&o){const t=[];for(const r of n.spans){const n=o(r);n?t.push(n):(wa(),e.recordDroppedEvent("before_send","span"))}n.spans=t}if(a){if(n.spans){const e=n.spans.length;n.sdkProcessingMetadata=c(l({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:e})}return a(n,r)}}return n}(this,r,n,t),u)}).then(r=>{if(null===r){if(this.recordDroppedEvent("before_send",f,e),a){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new eo(`${u} returned \`null\`, will not send event.`,"log")}const i=n&&n.getSession();if(!a&&i&&this._updateSessionFromEvent(i,r),a){const e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const o=r.transaction_info;if(a&&o&&r.transaction!==e.transaction){const e="custom";r.transaction_info=c(l({},o),{source:e})}return this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof eo)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new eo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Nr&&zr.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Nr&&zr.log("No outcomes to send"));if(!this._dsn)return void(Nr&&zr.log("No dsn provided, will not send outcomes"));Nr&&zr.log("Sending outcomes:",e);const t=(n=e,Oa((r=this._options.tunnel&&xa(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Li(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function ro(e){return void 0===e.type}function io(e){return"transaction"===e.type}function ao(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return $i(new eo("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new Wi((n,r)=>{let i=t.length;if(!i)return n(!0);const a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{Vi(e).then(()=>{--i||(clearTimeout(a),n(!0))},r)})})}}}(e.bufferSize||64)){let r={};return{send:function(i){const a=[];if(Na(i,(t,n)=>{const i=Da(n);if(function(e,t,n=Date.now()){return((r=e)[t]||r.all||0)>n;var r}(r,i)){const r=oo(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else a.push(t)}),0===a.length)return Vi({});const o=Oa(i[0],a),s=t=>{Na(o,(n,r)=>{const i=oo(n,r);e.recordDroppedEvent(t,Da(r),i)})};return n.add(()=>t({body:Ia(o)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Nr&&zr.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i=l({},e),a=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(a)for(const s of a.trim().split(",")){const[e,t,,,n]=s.split(":",5),a=parseInt(e,10),o=1e3*(isNaN(a)?60:a);if(t)for(const s of t.split(";"))"metric_bucket"===s&&n&&!n.split(";").includes("custom")||(i[s]=r+o);else i.all=r+o}else o?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof eo)return Nr&&zr.error("Skipped sending event because buffer is full."),s("queue_overflow"),Vi({});throw e})},flush:e=>n.drain(e)}}function oo(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const so=100;function lo(e,t){const n=la(),r=sa();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=so}=n.getOptions();if(a<=0)return;const o=l({timestamp:Li()},e),s=i?Br(()=>i(o,t)):o;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,a))}let co;const uo=new WeakMap,fo=()=>({name:"FunctionToString",setupOnce(){co=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ti(this),n=uo.has(la())&&void 0!==t?t:this;return co.apply(n,e)}}catch(sr){}},setup(e){uo.set(e,!0)}}),po=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],ho=(e={})=>({name:"InboundFilters",processEvent(t,n,r){const i=r.getOptions(),a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:po],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return o=t,((s=a).ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(t){}return!1}(o)?(Nr&&zr.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Di(o)}`),1):(l=o,c=s.ignoreErrors,!l.type&&c&&c.length&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch(r){}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),t}(l).some(e=>_i(e,c))?(Nr&&zr.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Di(o)}`),1):function(e){return!(e.type||!e.exception||!e.exception.values||0===e.exception.values.length||e.message||e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(o)?(Nr&&zr.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Di(o)}`),1):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&_i(n,t)}(o,s.ignoreTransactions)?(Nr&&zr.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Di(o)}`),1):function(e,t){if(!t||!t.length)return!1;const n=mo(e);return!!n&&_i(n,t)}(o,s.denyUrls)?(Nr&&zr.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Di(o)}.\nUrl: ${mo(o)}`),1):!function(e,t){if(!t||!t.length)return!0;const n=mo(e);return!n||_i(n,t)}(o,s.allowUrls)&&(Nr&&zr.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Di(o)}.\nUrl: ${mo(o)}`),1)))?null:t;var o,s,l,c}});function mo(e){try{let n;try{n=e.exception.values[0].stacktrace.frames}catch(t){}return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return Nr&&zr.error(`Cannot extract url for event ${Di(e)}`),null}}function go(e,t,n=250,r,i,a,o){if(!(a.exception&&a.exception.values&&o&&gi(o.originalException,Error)))return;const s=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;var l,c;s&&(a.exception.values=(l=vo(e,t,i,o.originalException,r,a.exception.values,s,0),c=n,l.map(e=>(e.value&&(e.value=ki(e.value,c)),e))))}function vo(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let l=[...a];if(gi(r[i],Error)){yo(o,s);const a=e(t,r[i]),c=l.length;bo(a,i,c,s),l=vo(e,t,n,r[i],i,[a,...l],a,c)}return Array.isArray(r.errors)&&r.errors.forEach((r,a)=>{if(gi(r,Error)){yo(o,s);const c=e(t,r),u=l.length;bo(c,`errors[${a}]`,u,s),l=vo(e,t,n,r,i,[c,...l],c,u)}}),l}function yo(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l(l({},e.mechanism),"AggregateError"===e.type&&{is_exception_group:!0}),{exception_id:t})}function bo(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function wo(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ko(){"console"in Ir&&Dr.forEach(function(e){e in Ir.console&&Ei(Ir.console,e,function(t){return Fr[e]=t,function(...t){Xr("console",{args:t,level:e});const n=Fr[e];n&&n.apply(Ir.console,t)}})})}function So(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const _o=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(n=t,(r=e)&&(function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!xo(e,t)||!Eo(e,t))}(n,r)||function(e,t){const n=Co(t),r=Co(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&xo(e,t)&&Eo(e,t))}(n,r)))return Nr&&zr.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}var n,r;return e=t}}};function Eo(e,t){let n=Jr(e),r=Jr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function xo(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(i){return!1}}function Co(e){return e.exception&&e.exception.values&&e.exception.values[0]}function To(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Mo=Ir;function Po(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Oo(e,t){const n="fetch";Yr(n,e),Kr(n,()=>function(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in Mo))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if(Po(Mo.fetch))return!0;let t=!1;const n=Mo.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=Po(e.contentWindow.fetch)),n.head.removeChild(e)}catch(e){Rr&&zr.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}()||Ei(Ir,"fetch",function(t){return function(...n){const r=new Error,{method:i,url:a}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:No(t),method:Ao(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:No(t),method:Ao(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:1e3*Ii(),virtualError:r};return e||Xr("fetch",l({},o)),t.apply(Ir,n).then(t=>d(null,null,function*(){return e?e(t):Xr("fetch",c(l({},o),{endTimestamp:1e3*Ii(),response:t})),t}),e=>{throw Xr("fetch",c(l({},o),{endTimestamp:1e3*Ii(),error:e})),oi(e)&&void 0===e.stack&&(e.stack=r.stack,xi(e,"framesToPop",1)),e})}})}(void 0,t))}function Ao(e,t){return!!e&&"object"==typeof e&&!!e[t]}function No(e){return"string"==typeof e?e:e?Ao(e,"url")?e.url:e.toString?e.toString():"":""}const Lo=Ir,Io=Ir;let jo=0;function Ro(){return jo>0}function Do(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(Ti(e))return e}catch(r){return e}const n=function(...n){try{const r=n.map(e=>Do(e,t));return e.apply(this,r)}catch(r){throw jo++,setTimeout(()=>{jo--}),function(...e){const t=aa(ri());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{var i;e.addEventProcessor(e=>(t.mechanism&&(Fi(e,void 0),Bi(e,t.mechanism)),e.extra=c(l({},e.extra),{arguments:n}),e)),i=r,oa().captureException(i,void 0)}),r}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch(i){}Ci(n,e),xi(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch(i){}return n}const Fo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function Bo(e,t){const n=Uo(e,t),r={type:Wo(t),value:qo(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function zo(e,t){return{exception:{values:[Bo(e,t)]}}}function Uo(e,t){const n=t.stacktrace||t.stack||"",r=(a=t)&&Vo.test(a.message)?1:0,i=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);var a;try{return e(n,r,i)}catch(a){}return[]}const Vo=/Minified React error #\d+;/i;function $o(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Wo(e){const t=e&&e.name;return!t&&$o(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function qo(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:$o(e)&&Array.isArray(e.message)&&2==e.message.length?e.message[1]:t:"No error message"}function Ho(e,t,n,r,i){let a;if(li(t)&&t.error)return zo(e,t.error);if(ci(t)||si(t,"DOMException")){const i=t;if("stack"in t)a=zo(e,t);else{const t=i.name||(ci(i)?"DOMError":"DOMException"),o=i.message?`${t}: ${i.message}`:t;a=Jo(e,o,n,r),Fi(a,o)}return"code"in i&&(a.tags=c(l({},a.tags),{"DOMException.code":`${i.code}`})),a}return oi(t)?zo(e,t):pi(t)||hi(t)?(a=function(e,t,n,r){const i=la(),a=i&&i.getOptions().normalizeDepth,o=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}(t),s={__serialized__:Ma(t,a)};if(o)return{exception:{values:[Bo(e,o)]},extra:s};const l={exception:{values:[{type:hi(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Go(t,{isUnhandledRejection:r})}]},extra:s};if(n){const t=Uo(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}(e,t,n,i),Bi(a,{synthetic:!0}),a):(a=Jo(e,t,n,r),Fi(a,`${t}`),Bi(a,{synthetic:!0}),a)}function Jo(e,t,n,r){const i={};if(r&&n){const r=Uo(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),Bi(i,{synthetic:!0})}if(di(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Go(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Mi(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return ki(r,t);for(let i=n.length;i>0;i--){const e=n.slice(0,i).join(", ");if(!(e.length>t))return i===n.length?e:ki(e,t)}return""}(e),r=t?"promise rejection":"exception";return li(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:hi(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(t){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class Qo extends no{constructor(e){const t=l({parentSpanIsAlwaysRootSpan:!0},e);!function(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:Lr})),version:Lr}),e._metadata=i}(t,"browser",["browser"],Io.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Io.document&&Io.document.addEventListener("visibilitychange",()=>{"hidden"===Io.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=Ho(e,t,n&&n.syntheticException||void 0,r);return Bi(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Vi(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const a=Jo(e,t,r&&r.syntheticException||void 0,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Vi(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Fo&&zr.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){return Oa(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:xa(r)}),[function(e){return[{type:"user_report"},e]}(e)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}const Yo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ko=Ir;let Xo,Zo,es,ts;function ns(){if(!Ko.document)return;const e=Xr.bind(null,"dom"),t=rs(e,!0);Ko.document.addEventListener("click",t,!1),Ko.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Ko[t],r=n&&n.prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Ei(r,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){const r=rs(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(a){}return t.call(this,n,r,i)}}),Ei(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(i){}return e.call(this,t,n,r)}}))})}function rs(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(t){return null}}(n);if(i=n.type,a=r,"keypress"===i&&(!a||!a.tagName||"INPUT"!==a.tagName&&"TEXTAREA"!==a.tagName&&!a.isContentEditable))return;var i,a;xi(n,"_sentryCaptured",!0),r&&!r._sentryId&&xi(r,"_sentryId",ji());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Zo)return!1;try{if(!e.target||e.target._sentryId!==es)return!1}catch(t){}return!0})(n)||(e({event:n,name:o,global:t}),Zo=n.type,es=r?r._sentryId:void 0),clearTimeout(Xo),Xo=Ko.setTimeout(()=>{es=void 0,Zo=void 0},1e3)}}function is(e){const t="history";Yr(t,e),Kr(t,as)}function as(){if(!function(){const e=Lo.chrome,t=e&&e.app&&e.app.runtime,n="history"in Lo&&!!Lo.history.pushState&&!!Lo.history.replaceState;return!t&&n}())return;const e=Ko.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=ts,t=String(n);ts=t,Xr("history",{from:e,to:t})}return e.apply(this,t)}}Ko.onpopstate=function(...t){const n=Ko.location.href,r=ts;if(ts=n,Xr("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(i){}},Ei(Ko.history,"pushState",t),Ei(Ko.history,"replaceState",t)}const os={};function ss(e){os[e]=void 0}const ls="__sentry_xhr_v3__";function cs(){if(!Ko.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,i=1e3*Ii(),a=ui(n[0])?n[0].toUpperCase():void 0,o=function(e){if(ui(e))return e;try{return e.toString()}catch(t){}}(n[1]);if(!a||!o)return e.apply(t,n);t[ls]={method:a,url:o,request_headers:{}},"POST"===a&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[ls];if(e&&4===t.readyState){try{e.status_code=t.status}catch(n){}Xr("xhr",{endTimestamp:1e3*Ii(),startTimestamp:i,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,i]=n,a=t[ls];return a&&ui(r)&&ui(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[ls];return r?(void 0!==n[0]&&(r.body=n[0]),Xr("xhr",{startTimestamp:1e3*Ii(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function us(e,t=function(e){const t=os[e];if(t)return t;let n=Ko[e];if(Po(n))return os[e]=n.bind(Ko);const r=Ko.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const i=t.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(t)}catch(i){Yo&&zr.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n?os[e]=n.bind(Ko):n}("fetch")){let n=0,r=0;return ao(e,function(i){const a=i.body.length;n+=a,r++;const o=l({body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);if(!t)return ss("fetch"),$i("No fetch implementation available");try{return t(e.url,o).then(e=>(n-=a,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(s){return ss("fetch"),n-=a,r--,$i(s)}})}function ds(e,t,n,r){const i={filename:e,function:"<anonymous>"===t?Ur:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const fs=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ps=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hs=/\((\S*)(?::(\d+))(?::(\d+))\)/,ms=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,vs=function(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const i=[],a=e.split("\n");for(let o=n;o<a.length;o++){const e=a[o];if(e.length>1024)continue;const n=Vr.test(e)?e.replace(Vr,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){i.push(t);break}}if(i.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Wr(t).function||"")&&t.pop(),t.reverse(),$r.test(Wr(t).function||"")&&(t.pop(),$r.test(Wr(t).function||"")&&t.pop()),t.slice(0,50).map(e=>c(l({},e),{filename:e.filename||Wr(t).filename,function:e.function||Ur}))}(i.slice(r))}}([30,e=>{const t=fs.exec(e);if(t){const[,e,n,r]=t;return ds(e,Ur,+n,+r)}const n=ps.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=hs.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=ys(n[1]||Ur,n[2]);return ds(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=ms.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=gs.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Ur;return[n,e]=ys(n,e),ds(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),ys=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Ur,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},bs=(e={})=>{const t=l({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";Yr(t,e),Kr(t,ko)}(function(e){return function(t){if(la()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:So(t.level),message:Si(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${Si(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}lo(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(la()!==e)return;let r,i,a="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Fo&&zr.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof a&&(a=[a]);try{const e=n.event,t=(s=e)&&s.target?e.target:e;r=bi(t,{keyAttrs:a,maxStringLength:o}),i=function(e){if(!yi.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}(t)}catch(c){r="<unknown>"}var s;if(0===r.length)return;const l={category:`ui.${n.name}`,message:r};i&&(l.data={"ui.component_name":i}),lo(l,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),Yr("dom",n),Kr("dom",ns)),t.xhr&&(Yr("xhr",function(e){return function(t){if(la()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[ls];if(!n||!r||!i)return;const{method:a,url:o,status_code:s,body:l}=i,c={method:a,url:o,status_code:s},u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r};lo({category:"xhr",data:c,type:"http",level:To(s)},u)}}(e)),Kr("xhr",cs)),t.fetch&&Oo(function(e){return function(t){if(la()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)lo({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response,i=c(l({},t.fetchData),{status_code:e&&e.status}),a={input:t.args,response:e,startTimestamp:n,endTimestamp:r};lo({category:"fetch",data:i,type:"http",level:To(i.status_code)},a)}}}(e)),t.history&&is(function(e){return function(t){if(la()!==e)return;let n=t.from,r=t.to;const i=wo(Io.location.href);let a=n?wo(n):void 0;const o=wo(r);a&&a.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),lo({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){la()===e&&lo({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Di(t)},{event:t})}}(e))}}},ws=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ks=(e={})=>{const t=l({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ei(Io,"setTimeout",Ss),t.setInterval&&Ei(Io,"setInterval",Ss),t.requestAnimationFrame&&Ei(Io,"requestAnimationFrame",_s),t.XMLHttpRequest&&"XMLHttpRequest"in Io&&Ei(XMLHttpRequest.prototype,"send",Es);const e=t.eventTarget;e&&(Array.isArray(e)?e:ws).forEach(xs)}}};function Ss(e){return function(...t){const n=t[0];return t[0]=Do(n,{mechanism:{data:{function:Hr(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function _s(e){return function(t){return e.apply(this,[Do(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Hr(e)},handled:!1,type:"instrument"}})])}}function Es(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ei(n,e,function(t){const n={mechanism:{data:{function:e,handler:Hr(t)},handled:!1,type:"instrument"}},r=Ti(t);return r&&(n.mechanism.data.handler=Hr(r)),Do(t,n)})}),e.apply(this,t)}}function xs(e){const t=Io[e],n=t&&t.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ei(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Do(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Hr(r),target:e},handled:!1,type:"instrument"}}))}catch(a){}return t.apply(this,[n,Do(r,{mechanism:{data:{function:"addEventListener",handler:Hr(r),target:e},handled:!1,type:"instrument"}}),i])}}),Ei(n,"removeEventListener",function(e){return function(t,n,r){try{const i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(i){}return e.call(this,t,n,r)}}))}const Cs=(e={})=>{const t=l({onerror:!0,onunhandledrejection:!0},e);return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){var n;t.onerror&&(n=e,function(){const e="error";Yr(e,e=>{const{stackParser:t,attachStacktrace:r}=Ms();if(la()!==n||Ro())return;const{msg:i,url:a,line:o,column:s,error:l}=e,c=function(e,t,n,r){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},l=s.frames=s.frames||[],c=r,u=n,d=ui(t)&&t.length>0?t:function(){try{return yi.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:Ur,in_app:!0,lineno:u}),e}(Ho(t,l||i,void 0,r,!1),a,o,s);c.level="error",Ha(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}),Kr(e,ei)}(),Ts("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";Yr(t,t=>{const{stackParser:n,attachStacktrace:r}=Ms();if(la()!==e||Ro())return;const i=function(e){if(fi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(t){}return e}(t),a=fi(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Ho(n,i,void 0,r,!0);a.level="error",Ha(a,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}),Kr(t,ni)}()}(e),Ts("onunhandledrejection"))}}};function Ts(e){Fo&&zr.log(`Global Handler attached: ${e}`)}function Ms(){const e=la();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Ps=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,i){const a=i.getOptions();go(Bo,a.stackParser,a.maxValueLength,n,t,e,r)}}};var Os="new",As="loading",Ns="loaded",Ls="joining-meeting",Is="joined-meeting",js="left-meeting",Rs="error",Ds="unknown",Fs="no-room",Bs="end-of-life",zs="connection-error",Us="loaded",Vs="recording-started",$s="recording-stopped",Ws="fullscreen",qs="exited-fullscreen",Hs="input-settings-updated",Js="nonfatal-error",Gs="error",Qs=4096,Ys=102400,Ks="iframe-call-message",Xs="local-screen-start",Zs="daily-method-update-live-streaming-endpoints",el="transmit-log",tl="daily-custom-track",nl={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},rl={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},il={PLAY:"play",PAUSE:"pause"},al=["jpg","png","jpeg"],ol="sip-call-transfer";function sl(){return!ll()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function ll(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function cl(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function ul(){if(ll())return!1;if(!document)return!1;var e=document.createElement("iframe");return!!e.requestFullscreen||!!e.webkitRequestFullscreen}var dl="none",fl=function(){try{var e,t=document.createElement("canvas"),n=!1;(e=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,e=t.getContext("webgl2"));var r=null!=e;return t.remove(),r?n?"software":"hardware":dl}catch(i){return dl}}();function pl(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!ll()&&fl!==dl&&(e?!vl()&&["Chrome","Firefox"].includes(yl()):function(){if(vl())return!1;var e=yl();if("Safari"===e){var t=_l();if(t.major<15||15===t.major&&t.minor<4)return!1}return"Chrome"===e?wl().major>=77:"Firefox"===e?El().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function hl(){if(ll())return!1;if(gl())return!1;if("undefined"==typeof AudioWorkletNode)return!1;switch(yl()){case"Chrome":case"Firefox":return!0;case"Safari":var e=bl();return e.major>17||17===e.major&&e.minor>=4}return!1}function ml(){return cl()&&"undefined"!=typeof MediaStreamTrack&&!function(){var e,t=yl();if(!sl())return!0;switch(t){case"Chrome":return(e=wl()).major&&e.major>0&&e.major<75;case"Firefox":return(e=El()).major<91;case"Safari":return(e=_l()).major<13||13===e.major&&e.minor<1;default:return!0}}()}function gl(){return sl().match(/Linux; Android/)}function vl(){var e,t=sl(),n=t.match(/Mac/)&&(!ll()&&"undefined"!=typeof window&&null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(t.match(/Mobi/)||t.match(/Android/)||n)||!!sl().match(/DailyAnd\//)||void 0}function yl(){if("undefined"!=typeof window){var e=sl();return kl()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1||Sl()?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function bl(){switch(yl()){case"Chrome":return wl();case"Safari":return _l();case"Firefox":return El();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var n=sl().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}()}}function wl(){var e=0,t=0,n=0,r=0,i=!1;if("undefined"!=typeof window){var a=sl(),o=a.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(o)try{e=parseInt(o[1]),t=parseInt(o[2]),n=parseInt(o[3]),r=parseInt(o[4]),i=a.indexOf("OPR/")>-1}catch(s){}}return{major:e,minor:t,build:n,patch:r,opera:i}}function kl(){return!!sl().match(/iPad|iPhone|iPod/i)&&cl()}function Sl(){return sl().indexOf("AppleWebKit/605.1.15")>-1}function _l(){var e=0,t=0,n=0;if("undefined"!=typeof window){var r=sl().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch(i){}else(kl()||Sl())&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function El(){var e=0,t=0;if("undefined"!=typeof window){var n=sl().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}var xl=Yn(function e(){Hn(this,e)},[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Mr()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Mr()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Mr()}},{key:"sendMessageToDailyJs",value:function(e,t){Mr()}},{key:"removeListener",value:function(e){Mr()}}]);function Cl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cl(Object(n),!0).forEach(function(t){tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ml(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ml=function(){return!!e})()}var Pl=function(){function e(){var t,n,r;return Hn(this,e),n=this,r=Xn(r=e),(t=Kn(n,Ml()?Reflect.construct(r,[],Xn(n).constructor):r.apply(n,undefined)))._wrappedListeners={},t._messageCallbacks={},t}return er(e,xl),Yn(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){var r=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callClientId||i.data.callClientId===t)&&(!i.data.from||"module"!==i.data.from)){var a=Tl({},i.data);if(delete a.from,a.callbackStamp&&r._messageCallbacks[a.callbackStamp]){var o=a.callbackStamp;r._messageCallbacks[o].call(n,a),delete r._messageCallbacks[o]}delete a.what,delete a.callbackStamp,e.call(n,a)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){var r=function(r){var i;if(!(!r.data||r.data.what!==Ks||!r.data.action||r.data.from&&"module"!==r.data.from||r.data.callClientId&&t&&r.data.callClientId!==t||null!=r&&null!==(i=r.data)&&void 0!==i&&i.callFrameId)){var a=r.data;e.call(n,a)}};this._wrappedListeners[e]=r,window.addEventListener("message",r)}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){if(!n)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var i=Tl({},e);if(i.what=Ks,i.from="module",i.callClientId=n,t){var a=Tr();this._messageCallbacks[a]=t,i.callbackStamp=a}var o=r?r.contentWindow:window,s=this._callMachineTargetOrigin(r);s&&o.postMessage(i,s)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=Ks,e.callClientId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,n){var r=Tl({},e);r.callClientId=n;var i=t?t.contentWindow:window,a=this._callMachineTargetOrigin(t);a&&i.postMessage(r,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var n=function(n){if(n.data&&"iframe-call-message"===n.data.what&&(!n.data.callClientId||n.data.callClientId===t)&&(!n.data.from||"module"!==n.data.from)){var r=n.data;e(r)}};return this._wrappedListeners[e]=n,window.addEventListener("message",n),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return"file:"===window.location.protocol?"*":window.location.origin}}])}();function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Al(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Al=function(){return!!e})()}var Nl=function(){function e(){var t,n,r;return Hn(this,e),n=this,r=Xn(r=e),t=Kn(n,Al()?Reflect.construct(r,[],Xn(n).constructor):r.apply(n,undefined)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new cr.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new cr.EventEmitter,t._wrappedListeners={},t._messageCallbacks={},t}return er(e,xl),Yn(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){this._addListener(e,global.callMachineToDailyJsEmitter,t,n,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){this._addListener(e,global.dailyJsToCallMachineEmitter,t,n,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t,n){this._sendMessage(e,global.dailyJsToCallMachineEmitter,n,t,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,t){this._sendMessage(e,global.callMachineToDailyJsEmitter,t,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(global.callMachineToDailyJsEmitter.removeListener("message",t),global.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,n,r,i){var a=this,o=function(t){if(t.callClientId===n){if(t.callbackStamp&&a._messageCallbacks[t.callbackStamp]){var i=t.callbackStamp;a._messageCallbacks[i].call(r,t),delete a._messageCallbacks[i]}e.call(r,t)}};this._wrappedListeners[e]=o,t.addListener("message",o)}},{key:"_sendMessage",value:function(e,t,n,r,i){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(n),!0).forEach(function(t){tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);if(a.callClientId=n,r){var o=Tr();this._messageCallbacks[o]=r,a.callbackStamp=o}t.emit("message",a)}}])}(),Ll="replace",Il="shallow-merge",jl=[Ll,Il],Rl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data,r=t.mergeStrategy,i=void 0===r?Ll:r;Hn(this,e),e._validateMergeStrategy(i),e._validateData(n,i),this.mergeStrategy=i,this.data=n}return Yn(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return 0===Object.keys(e).length&&t===Il}},{key:"_validateMergeStrategy",value:function(e){if(!jl.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(jl,"]"))}},{key:"_validateData",value:function(e,t){if(!function(e){if(null==e||"object"!==Jn(e))return!1;var t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var n;try{if(n=JSON.stringify(e),t===Ll){var r=JSON.parse(n);pr(r,e)||console.warn("The meeting session data provided will be modified when serialized.",r,e)}else if(t===Il)for(var i in e)if(Object.hasOwnProperty.call(e,i)&&void 0!==e[i]){var a=JSON.parse(JSON.stringify(e[i]));pr(e[i],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[i])}}catch(o){throw Error("Meeting session data must be serializable to JSON: ".concat(o))}if(n.length>Ys)throw Error("Meeting session data is too large (".concat(n.length," characters). Maximum size suppported is ").concat(Ys,"."))}}])}();function Dl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dl=function(){return!!e})()}function Fl(e){var t="function"==typeof Map?new Map:void 0;return Fl=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Dl())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Zn(i,n.prototype),i}(e,arguments,Xn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Zn(n,e)},Fl(e)}function Bl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Bl=function(){return!!e})()}function zl(e){var t,n=null===(t=window._daily)||void 0===t?void 0:t.pendings;if(n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}var Ul=Yn(function e(t){Hn(this,e),this._currentLoad=null,this._callClientId=t},[{key:"load",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new Vl(n,function(){r(!1)},function(e,n){n||zl(t._callClientId),i(e,n)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),zl(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),Vl=Yn(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Hn(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var e=this;if(!this._currentAttempt){var t=function(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new ql(e._dailyConfig,e._successCallback,t),e._currentAttempt.start())},3e3))};this._currentAttempt=new ql(this._dailyConfig,this._successCallback,t),this._currentAttempt.start()}}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),$l=function(){function e(){return Hn(this,e),t=this,r=arguments,n=Xn(n=e),Kn(t,Bl()?Reflect.construct(n,r||[],Xn(t).constructor):n.apply(t,r));var t,n,r}return er(e,Fl(Error)),Yn(e)}(),Wl=2e4,ql=function(){return Yn(function e(t,n,r){Hn(this,e),this._loadAttemptImpl=ll()||!t.avoidEval?new Hl(t,n,r):new Jl(t,n,r)},[{key:"start",value:(e=rr(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var e}(),Hl=function(){return Yn(function e(t,n,r){Hn(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:(r=rr(function*(){var e=Or(this._dailyConfig);!(yield this._tryLoadFromIOSCache(e))&&this._loadFromNetwork(e)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=rr(function*(e){if(!this._iosCache)return!1;try{var t=yield this._iosCache.get(e);return!!this.cancelled||!!t&&(t.code?(Function('"use strict";'+t.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=t.refetchHeaders,!1))}catch(n){return!1}}),function(e){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(t=rr(function*(e){var t=this;this._networkTimeout=setTimeout(function(){t._networkTimedOut=!0,t._failureCallback({msg:"Timed out (>".concat(Wl," ms) when loading call object bundle ").concat(e),type:"timeout"})},Wl);try{var n=this._refetchHeaders?{headers:this._refetchHeaders}:{},r=yield fetch(e,n);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new $l;var i=yield this._getBundleCodeFromResponse(e,r);if(this.cancelled)throw new $l;Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(e,i,r.headers),this.succeeded=!0,this._successCallback()}catch(a){if(clearTimeout(this._networkTimeout),a instanceof $l||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(e,": ").concat(a),type:a.message})}}),function(e){return t.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=rr(function*(e,t){if(t.ok)return yield t.text();if(this._iosCache&&304===t.status)return(yield this._iosCache.renew(e,t.headers)).code;throw new Error("Received ".concat(t.status," response"))}),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}(),Jl=Yn(function e(t,n,r){Hn(this,e),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r,this._attemptId=Tr(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Or(this._dailyConfig);"object"===("undefined"==typeof document?"undefined":Jn(document))?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){t._stopLoading(),t._failureCallback({msg:"Timed out (>".concat(Wl," ms) when loading call object bundle ").concat(e),type:"timeout"})},Wl);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){t._stopLoading(),t.succeeded=!0,t._successCallback()},r.onerror=function(e){t._stopLoading(),t._failureCallback({msg:"Failed to load call object bundle ".concat(e.target.src),type:e.message})},r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),Gl=function(e,t,n){return!0===Kl(e.local,t,n)},Ql=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===n?"Video":"Audio","Tracks")]()[0]},Yl=function(e,t,n,r){var i=Xl(e,t,n,r);return i&&i.pendingTrack},Kl=function(e,t,n){if(!e)return!1;var r=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?-1===["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)&&i[t].custom?[!0,"staged"].includes(i[t].custom)?r(i[t].custom):r(i[t].custom[n]):r(i[t][n]):!i||r(i.ALL)},Xl=function(e,t,n,r){var i=Object.values(e.streams||{}).filter(function(e){return e.participantId===t&&e.type===n&&e.pendingTrack&&e.pendingTrack.kind===r}).sort(function(e,t){return new Date(t.starttime)-new Date(e.starttime)});return i&&i[0]},Zl=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function ec(e,t){for(var n=t.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var a=i[r],o=0,s=["video","audio"];o<s.length;o++){var l=s[o],c="cam"===a?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),u=e.tracks[c];if(u){var d=e.local?Ql(n,a,l):Yl(n,e.session_id,a,l);"playable"===u.state&&(u.track=d),u.persistentTrack=d}}}function tc(e,t){try{var n=t.getState();for(var r in e.tracks)if(!nc(r)){var i=e.tracks[r].kind;if(i){var a=e.tracks[r];if(a){var o=e.local?Zl(n,r):Yl(n,e.session_id,r,i);"playable"===a.state&&(e.tracks[r].track=o),a.persistentTrack=o}}else console.error("unknown type for custom track")}}catch(s){console.error(s)}}function nc(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function rc(e,t,n){var r=n.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(u){}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(u){}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){}}else{var i=!0;try{var a=r.participants[e.session_id];a&&a.public&&a.public.rtcType&&"peer-to-peer"===a.public.rtcType.impl&&a.private&&!["connected","completed"].includes(a.private.peeringState)&&(i=!1)}catch(u){console.error(u)}if(!i)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(r.streams,e.audio&&Gl(r,e.session_id,"cam-audio")){var o=Yl(r,e.session_id,"cam","audio");o&&(t&&t.audioTrack&&t.audioTrack.id===o.id?e.audioTrack=o:o.muted||(e.audioTrack=o)),e.audioTrack||(e.audio=!1)}if(e.video&&Gl(r,e.session_id,"cam-video")){var s=Yl(r,e.session_id,"cam","video");s&&(t&&t.videoTrack&&t.videoTrack.id===s.id?e.videoTrack=s:s.muted||(e.videoTrack=s)),e.videoTrack||(e.video=!1)}if(e.screen&&Gl(r,e.session_id,"screen-audio")){var l=Yl(r,e.session_id,"screen","audio");l&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===l.id?e.screenAudioTrack=l:l.muted||(e.screenAudioTrack=l))}if(e.screen&&Gl(r,e.session_id,"screen-video")){var c=Yl(r,e.session_id,"screen","video");c&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===c.id?e.screenVideoTrack=c:c.muted||(e.screenVideoTrack=c))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){console.error("unexpected error matching up tracks",u)}}}function ic(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ac=new Map,oc=null;function sc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var lc=new Map,cc=null;function uc(e){var t;dc()?(t=e,ac.has(t)||(ac.set(t,{}),navigator.mediaDevices.enumerateDevices().then(function(e){var n;ac.has(t)&&(ac.get(t).lastDevicesString=JSON.stringify(e),oc||(n=rr(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ic(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ic(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(ac.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==ac.get(r).lastDevicesString&&(ac.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),oc=function(){return n.apply(this,arguments)},navigator.mediaDevices.addEventListener("devicechange",oc)))}).catch(function(){}))):function(e){lc.has(e)||(lc.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){lc.has(e)&&(lc.get(e).lastDevicesString=JSON.stringify(t),cc||(cc=setInterval(rr(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return sc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(lc.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==lc.get(r).lastDevicesString&&(lc.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),3e3)))}))}(e)}function dc(){var e;return ll()||void 0!==(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.ondevicechange)}var fc=new Set;function pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pc(Object(n),!0).forEach(function(t){tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var mc=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),gc=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),vc=Object.values(mc),yc=["v","a","sv","sa","cv","ca"];Object.freeze(vc.reduce(function(e,t,n){return e[t]=yc[n],e},{})),Object.freeze(yc.reduce(function(e,t,n){return e[t]=vc[n],e},{}));var bc=[mc.VIDEO,mc.AUDIO,mc.SCREEN_VIDEO,mc.SCREEN_AUDIO],wc=Object.values(gc),kc=["p","s","t"];Object.freeze(wc.reduce(function(e,t,n){return e[t]=kc[n],e},{})),Object.freeze(kc.reduce(function(e,t,n){return e[t]=wc[n],e},{}));var Sc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.base,r=t.byUserId,i=t.byParticipantId;Hn(this,e),this.base=n,this.byUserId=r,this.byParticipantId=i}return Yn(e,[{key:"clone",value:function(){var t=new e;if(this.base instanceof _c?t.base=this.base.clone():t.base=this.base,void 0!==this.byUserId)for(var n in t.byUserId={},this.byUserId){var r=this.byUserId[n];t.byUserId[n]=r instanceof _c?r.clone():r}if(void 0!==this.byParticipantId)for(var i in t.byParticipantId={},this.byParticipantId){var a=this.byParticipantId[i];t.byParticipantId[i]=a instanceof _c?a.clone():a}return t}},{key:"toJSONObject",value:function(){var e={};if("boolean"==typeof this.base?e.base=this.base:this.base instanceof _c&&(e.base=this.base.toJSONObject()),void 0!==this.byUserId)for(var t in e.byUserId={},this.byUserId){var n=this.byUserId[t];e.byUserId[t]=n instanceof _c?n.toJSONObject():n}if(void 0!==this.byParticipantId)for(var r in e.byParticipantId={},this.byParticipantId){var i=this.byParticipantId[r];e.byParticipantId[r]=i instanceof _c?i.toJSONObject():i}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(void 0!==this.base&&("boolean"==typeof this.base?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),void 0!==this.byUserId)for(var t in e.u={},this.byUserId){var n=this.byUserId[t];e.u[t]="boolean"==typeof n?n:n.toMinifiedJSONObject()}if(void 0!==this.byParticipantId)for(var r in e.p={},this.byParticipantId){var i=this.byParticipantId[r];e.p[r]="boolean"==typeof i?i:i.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof _c&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var t=ar(e,2),n=t[0],r=t[1];return[n,r instanceof _c?r.normalize():r]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var t=ar(e,2),n=t[0],r=t[1];return[n,r instanceof _c?r.normalize():r]}))),this}}],[{key:"fromJSONObject",value:function(t){var n,r,i;if(void 0!==t.base&&(n="boolean"==typeof t.base?t.base:_c.fromJSONObject(t.base)),void 0!==t.byUserId)for(var a in r={},t.byUserId){var o=t.byUserId[a];r[a]="boolean"==typeof o?o:_c.fromJSONObject(o)}if(void 0!==t.byParticipantId)for(var s in i={},t.byParticipantId){var l=t.byParticipantId[s];i[s]="boolean"==typeof l?l:_c.fromJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(t){var n,r,i;if(void 0!==t.b&&(n="boolean"==typeof t.b?t.b:_c.fromMinifiedJSONObject(t.b)),void 0!==t.u)for(var a in r={},t.u){var o=t.u[a];r[a]="boolean"==typeof o?o:_c.fromMinifiedJSONObject(o)}if(void 0!==t.p)for(var s in i={},t.p){var l=t.p[s];i[s]="boolean"==typeof l?l:_c.fromMinifiedJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if("object"!==Jn(e))return[!1,"canReceive must be an object"];for(var t=["base","byUserId","byParticipantId"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return[!1,"canReceive can only contain keys (".concat(t.join(", "),")")];if("base"===i){var a=ar(_c.validateJSONObject(e.base,!0),2),o=a[0],s=a[1];if(!o)return[!1,s]}else{if("object"!==Jn(e[i]))return[!1,"invalid (non-object) value for field '".concat(i,"' in canReceive")];for(var l=0,c=Object.values(e[i]);l<c.length;l++){var u=c[l],d=ar(_c.validateJSONObject(u),2),f=d[0],p=d[1];if(!f)return[!1,p]}}}return[!0]}}])}(),_c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.video,r=t.audio,i=t.screenVideo,a=t.screenAudio,o=t.customVideo,s=t.customAudio;Hn(this,e),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=a,this.customVideo=o,this.customAudio=s}return Yn(e,[{key:"clone",value:function(){var t=new e;return void 0!==this.video&&(t.video=this.video),void 0!==this.audio&&(t.audio=this.audio),void 0!==this.screenVideo&&(t.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(t.screenAudio=this.screenAudio),void 0!==this.customVideo&&(t.customVideo=hc({},this.customVideo)),void 0!==this.customAudio&&(t.customAudio=hc({},this.customAudio)),t}},{key:"toJSONObject",value:function(){var e={};return void 0!==this.video&&(e.video=this.video),void 0!==this.audio&&(e.audio=this.audio),void 0!==this.screenVideo&&(e.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(e.screenAudio=this.screenAudio),void 0!==this.customVideo&&(e.customVideo=hc({},this.customVideo)),void 0!==this.customAudio&&(e.customAudio=hc({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return void 0!==this.video&&(e.v=this.video),void 0!==this.audio&&(e.a=this.audio),void 0!==this.screenVideo&&(e.sv=this.screenVideo),void 0!==this.screenAudio&&(e.sa=this.screenAudio),void 0!==this.customVideo&&(e.cv=hc({},this.customVideo)),void 0!==this.customAudio&&(e.ca=hc({},this.customAudio)),e}},{key:"normalize",value:function(){function e(e,t){return e&&1===Object.keys(e).length&&e["*"]===t}return!(!0!==this.video||!0!==this.audio||!0!==this.screenVideo||!0!==this.screenAudio||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(!1!==this.video||!1!==this.audio||!1!==this.screenVideo||!1!==this.screenAudio||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(t){return new e({video:t,audio:t,screenVideo:t,screenAudio:t,customVideo:{"*":t},customAudio:{"*":t}})}},{key:"fromJSONObject",value:function(t){return new e({video:t.video,audio:t.audio,screenVideo:t.screenVideo,screenAudio:t.screenAudio,customVideo:void 0!==t.customVideo?hc({},t.customVideo):void 0,customAudio:void 0!==t.customAudio?hc({},t.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(t){return new e({video:t.v,audio:t.a,screenVideo:t.sv,screenAudio:t.sa,customVideo:t.cv,customAudio:t.ca})}},{key:"validateJSONObject",value:function(e,t){if("boolean"==typeof e)return[!0];if("object"!==Jn(e))return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var n=Object.keys(e),r=0,i=n;r<i.length;r++){var a=i[r];if(!vc.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(bc.includes(a)){if("boolean"!=typeof e[a])return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if("object"!==Jn(e[a]))return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var o=0,s=Object.values(e[a]);o<s.length;o++)if("boolean"!=typeof s[o])return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(t&&void 0===e[a]["*"])return[!1,'canReceive "base" permission must specify "*" as an entry within \''.concat(a,"'")]}}return t&&n.length!==vc.length?[!1,'canReceive "base" permission must specify all media types: '.concat(vc.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),Ec=["result"],xc=["preserveIframe"];function Cc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(n),!0).forEach(function(t){tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mc=function(){return!!e})()}function Pc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ac={},Nc="video",Lc="voice",Ic=ll()?{data:{}}:{data:{},topology:"none"},jc={present:0,hidden:0},Rc={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Dc=Object.keys(Rc),Fc=["state","volume","simulcastEncodings"],Bc={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},zc={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},Uc={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Vc={customIntegrations:{validate:pu,help:du()},customTrayButtons:{validate:fu,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(zc))},url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return hu(e,Bc)},help:"reactNativeConfig should look like ".concat(JSON.stringify(Bc),", all fields optional")},lang:{validate:function(e){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return nu(e),!0}catch(t){return console.error(t),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalVideo=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.videoTrack=e,n={customTrack:tl};else{if(delete t._sharedTracks.videoTrack,"string"!=typeof e)return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalAudio=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.audioTrack=e,n={customTrack:tl};else{if(delete t._sharedTracks.audioTrack,"string"!=typeof e)return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===Jn(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(e){return ru(e,{allowAllParticipantsKey:!1})},help:uu({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(e,t){try{return t.validateUpdateSendSettings(e),!0}catch(n){return console.error("Failed to validate send settings",n),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){var n;return!!iu(e)&&(t._inputSettings||(t._inputSettings={}),au(e,null===(n=t.properties)||void 0===n?void 0:n.dailyConfig,t._sharedTracks),t._updatePreloadCacheInputSettings(e,!0),!0)},help:cu()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},$c={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var n in e.cam)if("div"!==n&&"video"!==n)return!1;if(e.screen)for(var r in e.screen)if("div"!==r&&"video"!==r)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!ll()&&"avatar"===e)return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var a in e)if("custom"===a){if(!n.includes(e[a])&&!i(e[a],!0))return!1}else{var o=!t&&!r.includes(a),s=!n.includes(e[a]);if(o||s)return!1}return!0};return i(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(ll()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(e){return!1===e},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=ar(n[t],2),i=r[0],a=r[1];switch(i){case"hasPresence":if("boolean"!=typeof a)return!1;break;case"canSend":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var o,s=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=Pc(a);try{for(l.s();!(o=l.n()).done;){var c=o.value;if(!s.includes(c))return!1}}catch(v){l.e(v)}finally{l.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canSend=new Set(a));break;case"canReceive":var u=ar(Sc.validateJSONObject(a),2),d=u[0],f=u[1];if(!d)return console.error(f),!1;break;case"canAdmin":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var p,h=["participants","streaming","transcription"],m=Pc(a);try{for(m.s();!(p=m.n()).done;){var g=p.value;if(!h.includes(g))return!1}}catch(v){m.e(v)}finally{m.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canAdmin=new Set(a));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var e=rr(function*(e){return new Promise(function(t,n){var r=[];e.forEach(function(i){return Promise.resolve(i).then(function(e){t(e)}).catch(function(t){r.push(t),r.length===e.length&&n(r)})})})});return function(t){return e.apply(this,arguments)}}());var Wc=function(){function e(t){var n,r,i,a,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Hn(this,e),i=this,a=Xn(a=e),tr(r=Kn(i,Mc()?Reflect.construct(a,[],Xn(i).constructor):a.apply(i,undefined)),"startListeningForDeviceChanges",function(){uc(r.handleDeviceChange)}),tr(r,"stopListeningForDeviceChanges",function(){!function(e){var t;dc()?(t=e,ac.has(t)&&(ac.delete(t),0===ac.size&&oc&&(navigator.mediaDevices.removeEventListener("devicechange",oc),oc=null))):function(e){lc.has(e)&&(lc.delete(e),0===lc.size&&cc&&(clearInterval(cc),cc=null))}(e)}(r.handleDeviceChange)}),tr(r,"handleDeviceChange",function(e){e=e.map(function(e){return JSON.parse(JSON.stringify(e))}),r.emitDailyJSEvent({action:"available-devices-updated",availableDevices:e})}),tr(r,"handleNativeAppStateChange",(s=rr(function*(e){if("destroyed"===e)return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield r.destroy());var t="active"===e;r.disableReactNativeAutoDeviceManagement("video")||(t?r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!0):(r.camUnmutedBeforeLosingNativeActiveState=r.localVideo(),r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!1)))}),function(e){return s.apply(this,arguments)})),tr(r,"handleNativeAudioFocusChange",function(e){r.disableReactNativeAutoDeviceManagement("audio")||(r._hasNativeAudioFocus=e,r.toggleParticipantAudioBasedOnNativeAudioFocus(),r._hasNativeAudioFocus?r.micUnmutedBeforeLosingNativeAudioFocus&&r.setLocalAudio(!0):(r.micUnmutedBeforeLosingNativeAudioFocus=r.localAudio(),r.setLocalAudio(!1)))}),tr(r,"handleNativeSystemScreenCaptureStop",function(){r.stopScreenShare()}),!ml()&&!ll())throw new Error("WebRTC not supported or suppressed");if(r.strictMode=void 0===l.strictMode||l.strictMode,r.allowMultipleCallInstances=null!==(n=l.allowMultipleCallInstances)&&void 0!==n&&n,Object.keys(Ac).length&&(r._logDuplicateInstanceAttempt(),!r.allowMultipleCallInstances)){if(r.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),r.callClientId=Tr(),Ac[(o=r).callClientId]=o,window._daily.instances[r.callClientId]={},r._sharedTracks={},window._daily.instances[r.callClientId].tracks=r._sharedTracks,l.dailyJsVersion=e.version(),r._iframe=t,r._callObjectMode="none"===l.layout&&!r._iframe,r._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},void 0!==l.showLocalVideo?r._callObjectMode?console.error("showLocalVideo is not available in call object mode"):r._showLocalVideo=!!l.showLocalVideo:r._showLocalVideo=!0,void 0!==l.showParticipantsBar?r._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):r._showParticipantsBar=!!l.showParticipantsBar:r._showParticipantsBar=!0,void 0!==l.customIntegrations?r._callObjectMode?console.error("customIntegrations is not available in call object mode"):r._customIntegrations=l.customIntegrations:r._customIntegrations={},void 0!==l.customTrayButtons?r._callObjectMode?console.error("customTrayButtons is not available in call object mode"):r._customTrayButtons=l.customTrayButtons:r._customTrayButtons={},void 0!==l.activeSpeakerMode?r._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):r._activeSpeakerMode=!!l.activeSpeakerMode:r._activeSpeakerMode=!1,l.receiveSettings?r._callObjectMode?r._receiveSettings=l.receiveSettings:console.error("receiveSettings is only available in call object mode"):r._receiveSettings={},r.validateProperties(l),r.properties=Tc({},l),r._inputSettings||(r._inputSettings={}),r._callObjectLoader=r._callObjectMode?new Ul(r.callClientId):null,r._callState=Os,r._isPreparingToJoin=!1,r._accessState={access:Ds},r._meetingSessionSummary={},r._finalSummaryOfPrevSession={},r._meetingSessionState=yu(Ic,r._callObjectMode),r._nativeInCallAudioMode=Nc,r._participants={},r._isScreenSharing=!1,r._participantCounts=jc,r._rmpPlayerState={},r._waitingParticipants={},r._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},r._activeSpeaker={},r._localAudioLevel=0,r._isLocalAudioLevelObserverRunning=!1,r._remoteParticipantsAudioLevel={},r._isRemoteParticipantsAudioLevelObserverRunning=!1,r._maxAppMessageSize=Qs,r._messageChannel=ll()?new Nl:new Pl,r._iframe&&(r._iframe.requestFullscreen?r._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===r._iframe?(r.emitDailyJSEvent({action:Ws}),r.sendMessageToCallMachine({action:Ws})):(r.emitDailyJSEvent({action:qs}),r.sendMessageToCallMachine({action:qs}))}):r._iframe.webkitRequestFullscreen&&r._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===r._iframe?(r.emitDailyJSEvent({action:Ws}),r.sendMessageToCallMachine({action:Ws})):(r.emitDailyJSEvent({action:qs}),r.sendMessageToCallMachine({action:qs}))})),ll()){var c=r.nativeUtils();c.addAudioFocusChangeListener&&c.removeAudioFocusChangeListener&&c.addAppStateChangeListener&&c.removeAppStateChangeListener&&c.addSystemScreenCaptureStopListener&&c.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),r._hasNativeAudioFocus=!0,c.addAudioFocusChangeListener(r.handleNativeAudioFocusChange),c.addAppStateChangeListener(r.handleNativeAppStateChange),c.addSystemScreenCaptureStopListener(r.handleNativeSystemScreenCaptureStop)}return r._callObjectMode&&r.startListeningForDeviceChanges(),r._messageChannel.addListenerForMessagesFromCallMachine(r.handleMessageFromCallMachine,r.callClientId,r),r}return er(e,ur),Yn(e,[{key:"destroy",value:(z=rr(function*(){var e;try{yield this.leave()}catch(i){}var t=this._iframe;if(t){var n=t.parentElement;n&&n.removeChild(t)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),ll()){var r=this.nativeUtils();r.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),r.removeAppStateChangeListener(this.handleNativeAppStateChange),r.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Ac[this.callClientId],(null===(e=window)||void 0===e||null===(e=e._daily)||void 0===e?void 0:e.instances)&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return z.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(e){var t=e.bodyClass,n=e.cssFile,r=e.cssText;return eu(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(n),bodyClass:t,cssText:r}),this}},{key:"iframe",value:function(){return eu(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return Xc(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return Xc(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var n in t){if(!$c[n])throw new Error("unrecognized updateParticipant property ".concat(n));if($c[n].validate&&!$c[n].validate(t[n],this,this._participants[e]))throw new Error($c[n].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var n in e)n===t&&(n="local"),n&&e[n]&&this.validateParticipantProperties(n,e[n]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:(B=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Xc(this._callObjectMode,"updateWaitingParticipant()"),Jc(this._callState,"updateWaitingParticipant()"),"string"!=typeof t||"object"!==Jn(n))throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(r,i){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:n},function(e){e.error&&i(e.error),e.id||i(new Error("unknown error in updateWaitingParticipant()")),r({id:e.id})})})}),function(){return B.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(F=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Xc(this._callObjectMode,"updateWaitingParticipants()"),Jc(this._callState,"updateWaitingParticipants()"),"object"!==Jn(t))throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(n,r){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},function(e){e.error&&r(e.error),e.ids||r(new Error("unknown error in updateWaitingParticipants()")),n({ids:e.ids})})})}),function(){return F.apply(this,arguments)})},{key:"requestAccess",value:(D=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.access,r=void 0===n?{level:"full"}:n,i=t.name,a=void 0===i?"":i;return Xc(this._callObjectMode,"requestAccess()"),Jc(this._callState,"requestAccess()"),new Promise(function(t,n){e.sendMessageToCallMachine({action:"daily-method-request-access",access:r,name:a},function(e){e.error&&n(e.error),e.access||n(new Error("unknown error in requestAccess()")),t({access:e.access,granted:e.granted})})})}),function(){return D.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"forceDiscardTrack"in t&&(ll()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),t={}):e&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),t={})),this.sendMessageToCallMachine({action:"local-audio",state:e,options:t}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(e){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:e}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"_setAllowLocalAudio",value:function(e){if(this._preloadCache.allowLocalAudio=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:e}),this}},{key:"_setAllowLocalVideo",value:function(e){if(this._preloadCache.allowLocalVideo=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:e}),this}},{key:"getReceiveSettings",value:(R=rr(function*(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).showInheritedValues,r=void 0!==n&&n;if(Xc(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Jn(e)){case"string":return new Promise(function(n){t.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:e,showInheritedValues:r},function(e){n(e.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(e){return R.apply(this,arguments)})},{key:"updateReceiveSettings",value:(j=rr(function*(e){var t=this;if(Xc(this._callObjectMode,"updateReceiveSettings()"),!ru(e,{allowAllParticipantsKey:!0}))throw new Error(uu({allowAllParticipantsKey:!0}));return Jc(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(n){t.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:e},function(e){n({receiveSettings:e.receiveSettings})})})}),function(e){return j.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(e,t){if(e){var n={};if(e.audio){var r,i,a;e.audio.settings&&(!Object.keys(e.audio.settings).length&&t||(n.audio={settings:Tc({},e.audio.settings)})),t&&null!==(r=n.audio)&&void 0!==r&&null!==(r=r.settings)&&void 0!==r&&r.customTrack&&(n.audio.settings={customTrack:this._sharedTracks.audioTrack});var o="none"===(null===(i=e.audio.processor)||void 0===i?void 0:i.type)&&(null===(a=e.audio.processor)||void 0===a?void 0:a._isDefaultWhenNone);if(e.audio.processor&&!o){var s=Tc({},e.audio.processor);delete s._isDefaultWhenNone,n.audio=Tc(Tc({},n.audio),{},{processor:s})}}if(e.video){var l,c,u;e.video.settings&&(!Object.keys(e.video.settings).length&&t||(n.video={settings:Tc({},e.video.settings)})),t&&null!==(l=n.video)&&void 0!==l&&null!==(l=l.settings)&&void 0!==l&&l.customTrack&&(n.video.settings={customTrack:this._sharedTracks.videoTrack});var d="none"===(null===(c=e.video.processor)||void 0===c?void 0:c.type)&&(null===(u=e.video.processor)||void 0===u?void 0:u._isDefaultWhenNone);if(e.video.processor&&!d){var f=Tc({},e.video.processor);delete f._isDefaultWhenNone,n.video=Tc(Tc({},n.video),{},{processor:f})}}return n}}},{key:"getInputSettings",value:function(){var e=this;return eu(),new Promise(function(t){t(e._getInputSettings())})}},{key:"_getInputSettings",value:function(){var e,t,n,r,i,a,o={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(e=(null===(n=this._inputSettings)||void 0===n?void 0:n.video)||o,t=(null===(r=this._inputSettings)||void 0===r?void 0:r.audio)||o):(e=(null===(i=this._preloadCache)||void 0===i||null===(i=i.inputSettings)||void 0===i?void 0:i.video)||o,t=(null===(a=this._preloadCache)||void 0===a||null===(a=a.inputSettings)||void 0===a?void 0:a.audio)||o);var s={audio:t,video:e};return this._prepInputSettingsForSharing(s,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(e,t){var n,r,i,a,o,s,l=this._inputSettings||{},c={};e.video?(c.video={},e.video.settings?(c.video.settings={},t||e.video.settings.customTrack||null===(i=l.video)||void 0===i||!i.settings?c.video.settings=e.video.settings:c.video.settings=Tc(Tc({},l.video.settings),e.video.settings),Object.keys(c.video.settings).length||delete c.video.settings):null!==(n=l.video)&&void 0!==n&&n.settings&&(c.video.settings=l.video.settings),e.video.processor?c.video.processor=e.video.processor:null!==(r=l.video)&&void 0!==r&&r.processor&&(c.video.processor=l.video.processor)):l.video&&(c.video=l.video);e.audio?(c.audio={},e.audio.settings?(c.audio.settings={},t||e.audio.settings.customTrack||null===(s=l.audio)||void 0===s||!s.settings?c.audio.settings=e.audio.settings:c.audio.settings=Tc(Tc({},l.audio.settings),e.audio.settings),Object.keys(c.audio.settings).length||delete c.audio.settings):null!==(a=l.audio)&&void 0!==a&&a.settings&&(c.audio.settings=l.audio.settings),e.audio.processor?c.audio.processor=e.audio.processor:null!==(o=l.audio)&&void 0!==o&&o.processor&&(c.audio.processor=l.audio.processor)):l.audio&&(c.audio=l.audio);this._maybeUpdateInputSettings(c)}},{key:"_devicesFromInputSettings",value:function(e){var t,n,r=(null==e||null===(t=e.video)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.deviceId)||null,i=(null==e||null===(n=e.audio)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.deviceId)||null,a=this._preloadCache.outputDeviceId||null;return{camera:r?{deviceId:r}:{},mic:i?{deviceId:i}:{},speaker:a?{deviceId:a}:{}}}},{key:"updateInputSettings",value:(I=rr(function*(e){var t=this;return eu(),iu(e)?e.video||e.audio?(au(e,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(e,!0),this._getInputSettings()):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-input-settings",inputSettings:e},function(i){if(i.error)r(i.error);else{if(i.returnPreloadCache)return t._updatePreloadCacheInputSettings(e,!0),void n(t._getInputSettings());t._maybeUpdateInputSettings(i.inputSettings),n(t._prepInputSettingsForSharing(i.inputSettings,!0))}})})):this._getInputSettings():(console.error(cu()),Promise.reject(cu()))}),function(e){return I.apply(this,arguments)})},{key:"setBandwidth",value:function(e){var t=e.kbs,n=e.trackConstraints;if(eu(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:n}),this}},{key:"getDailyLang",value:function(){var e=this;if(eu(),this._callMachineInitialized)return new Promise(function(t){e.sendMessageToCallMachine({action:"get-daily-lang"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}},{key:"setDailyLang",value:function(e){return eu(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"setProxyUrl",value:function(e){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:e}),this}},{key:"setIceConfig",value:function(e){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:e}),this}},{key:"meetingSessionSummary",value:function(){return[js,Rs].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(L=rr(function*(){var e=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Jc(this._callState,"getMeetingSession()"),new Promise(function(t){e.sendMessageToCallMachine({action:"get-meeting-session"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return L.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Jc(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";Xc(this._callObjectMode,"setMeetingSessionData()"),Jc(this._callState,"setMeetingSessionData");try{new Rl({data:t=e,mergeStrategy:n})}catch(t){throw console.error(t),t}try{this.sendMessageToCallMachine({action:"set-session-data",data:e,mergeStrategy:n})}catch(t){throw new Error("Error setting meeting session data: ".concat(t))}}},{key:"setUserName",value:function(e,t){var n=this;return this.properties.userName=e,new Promise(function(r){n.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:ll()||!!t&&!!t.thisMeetingOnly},function(e){delete e.action,delete e.callbackStamp,r(e)})})}},{key:"setUserData",value:(N=rr(function*(e){var t=this;try{nu(e)}catch(n){throw console.error(n),n}if(this.properties.userData=e,this._callMachineInitialized)return new Promise(function(r){try{t.sendMessageToCallMachine({action:"set-user-data",userData:e},function(e){delete e.action,delete e.callbackStamp,r(e)})}catch(n){throw new Error("Error setting user data: ".concat(n))}})}),function(e){return N.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(e){if(e&&(e<100||"number"!=typeof e))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(e){var t=this;if("undefined"==typeof AudioWorkletNode&&!ll())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:e},function(e){t._isLocalAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:e}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(e){var t=this;if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:e},function(e){t._isRemoteParticipantsAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:e}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(A=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Xc(this._callObjectMode,"startCamera()"),Qc(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(t)}catch(n){return Promise.reject(n)}else{if(this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(t),this.properties=Tc(Tc({},this.properties),t)}return new Promise(function(t){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"start-camera",properties:Hc(e.properties,e.callClientId),preloadCache:Hc(e._preloadCache,e.callClientId)},function(e){t({camera:e.camera,mic:e.mic,speaker:e.speaker})})})}),function(){return A.apply(this,arguments)})},{key:"validateCustomTrack",value:function(e,t,n){if(n&&n.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(t&&"music"!==t&&"speech"!==t&&!(t instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(n&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(n))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(e instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{track:track,mode:mode,trackName:trackName,ignoreAudioLevel:ignoreAudioLevel};return eu(),Jc(this._callState,"startCustomTrack()"),this.validateCustomTrack(t.track,t.mode,t.trackName),new Promise(function(n,r){e._sharedTracks.customTrack=t.track,t.track=tl,e.sendMessageToCallMachine({action:"start-custom-track",properties:t},function(e){e.error?r({error:e.error}):n(e.mediaTag)})})}},{key:"stopCustomTrack",value:function(e){var t=this;return eu(),Jc(this._callState,"stopCustomTrack()"),new Promise(function(n){t.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:e},function(e){n(e.mediaTag)})})}},{key:"setCamera",value:function(e){var t=this;return tu(),Yc(this._callMachineInitialized,"setCamera()"),new Promise(function(n){t.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:e},function(e){n({device:e.device})})})}},{key:"setAudioDevice",value:(O=rr(function*(e){return tu(),this.nativeUtils().setAudioDevice(e),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(e){return O.apply(this,arguments)})},{key:"cycleCamera",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(n){e.sendMessageToCallMachine({action:"cycle-camera",properties:t},function(e){n({device:e.device})})})}},{key:"cycleMic",value:function(){var e=this;return eu(),new Promise(function(t){e.sendMessageToCallMachine({action:"cycle-mic"},function(e){t({device:e.device})})})}},{key:"getCameraFacingMode",value:function(){var e=this;return tu(),new Promise(function(t){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(e){t(e.facingMode)})})}},{key:"setInputDevicesAsync",value:(P=rr(function*(e){var t=this,n=e.audioDeviceId,r=e.videoDeviceId,i=e.audioSource,a=e.videoSource;if(eu(),void 0!==i&&(n=i),void 0!==a&&(r=a),"boolean"==typeof n&&(this._setAllowLocalAudio(n),n=void 0),"boolean"==typeof r&&(this._setAllowLocalVideo(r),r=void 0),!n&&!r)return yield this.getInputDevices();var o={};return n&&(n instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=n,n=tl,o.audio={settings:{customTrack:n}}):(delete this._sharedTracks.audioTrack,o.audio={settings:{deviceId:n}})),r&&(r instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=r,r=tl,o.video={settings:{customTrack:r}}):(delete this._sharedTracks.videoTrack,o.video={settings:{deviceId:r}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(o,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(e){t.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:n,videoDeviceId:r},function(n){if(delete n.action,delete n.callbackStamp,n.returnPreloadCache)return t._updatePreloadCacheInputSettings(o,!1),void e(t._devicesFromInputSettings(t._inputSettings));e(n)})})}),function(e){return P.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(M=rr(function*(e){var t=this,n=e.outputDeviceId;if(eu(),!n||"string"!=typeof n)throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=n,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(e,r){t.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:n},function(n){if(delete n.action,delete n.callbackStamp,n.error){var i=new Error(n.error.message);return i.type=n.error.type,void r(i)}n.returnPreloadCache?e(t._devicesFromInputSettings(t._inputSettings)):e(n)})})}),function(e){return M.apply(this,arguments)})},{key:"getInputDevices",value:(T=rr(function*(){var e=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(t){e.sendMessageToCallMachine({action:"get-input-devices"},function(n){n.returnPreloadCache?t(e._devicesFromInputSettings(e._inputSettings)):t({camera:n.camera,mic:n.mic,speaker:n.speaker})})})}),function(){return T.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return tu(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(tu(),[Nc,Lc].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&Gc(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:(C=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Xc(this._callObjectMode,"preAuth()"),Qc(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(t)),!t.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(t),this.properties=Tc(Tc({},this.properties),t),new Promise(function(t,n){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"daily-method-preauth",properties:Hc(e.properties,e.callClientId),preloadCache:Hc(e._preloadCache,e.callClientId)},function(r){return r.error?n(r.error):r.access?(e._didPreAuth=!0,void t({access:r.access})):n(new Error("unknown error in preAuth()"))})})}),function(){return C.apply(this,arguments)})},{key:"load",value:(x=rr(function*(e){var t=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(e&&(this.validateProperties(e),this.properties=Tc(Tc({},this.properties),e)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(As),this.emitDailyJSEvent({action:"loading"}),this._callObjectMode?new Promise(function(e,n){t._callObjectLoader.cancel();var r=Date.now();t._callObjectLoader.load(t.properties.dailyConfig,function(n){t._bundleLoadTime=n?"no-op":Date.now()-r,t._updateCallState(Ns),n&&t.emitDailyJSEvent({action:Us}),e()},function(e,r){if(t.emitDailyJSEvent({action:"load-attempt-failed"}),!r){t._updateCallState(Rs),t.resetMeetingDependentVars();var i={action:Gs,errorMsg:e.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:e,bundleUrl:Or(t.properties.dailyConfig)}}};t._maybeSendToSentry(i),t.emitDailyJSEvent(i),n(e.msg)}})}):(this._iframe.src=Pr(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(e,n){t._loadedCallback=function(r){t._callState!==Rs?(t._updateCallState(Ns),(t.properties.cssFile||t.properties.cssText)&&t.loadCss(t.properties),e()):n(r)}}))}}),function(e){return x.apply(this,arguments)})},{key:"join",value:(E=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var n=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(t)}catch(r){return this.updateIsPreparingToJoin(!1),Promise.reject(r)}}else{if(n=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(t.url&&!this._callObjectMode&&t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(t),this.properties=Tc(Tc({},this.properties),t)}return void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._callState===Is||this._callState===Ls?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Ls,!1),this.emitDailyJSEvent({action:"joining-meeting"}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:Hc(this.properties,this.callClientId),preloadCache:Hc(this._preloadCache,this.callClientId)}),new Promise(function(t,r){e._joinedCallback=function(i,a){if(e._callState!==Rs){if(e._updateCallState(Is),i)for(var o in i){if(e._callObjectMode){var s=e._callMachine().store;ec(i[o],s),tc(i[o],s),rc(i[o],e._participants[o],s)}e._participants[o]=Tc({},i[o]),e.toggleParticipantAudioBasedOnNativeAudioFocus()}n&&e.loadCss(e.properties),t(i)}else r(a)}}))}),function(){return E.apply(this,arguments)})},{key:"leave",value:(_=rr(function*(){var e=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(t){e._callState===js||e._callState===Rs?t():e._callObjectLoader&&!e._callObjectLoader.loaded?(e._callObjectLoader.cancel(),e._updateCallState(js),e.resetMeetingDependentVars(),e.emitDailyJSEvent({action:js}),t()):(e._resolveLeave=t,e.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return _.apply(this,arguments)})},{key:"startScreenShare",value:(S=rr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Yc(this._callMachineInitialized,"startScreenShare()"),t.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",t.screenVideoSendSettings),t.mediaStream&&(this._sharedTracks.screenMediaStream=t.mediaStream,t.mediaStream=tl),"undefined"!=typeof DailyNativeUtils&&void 0!==DailyNativeUtils.isIOS&&DailyNativeUtils.isIOS){var n=this.nativeUtils();if(yield n.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Js,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});n.setSystemScreenCaptureStartCallback(function(){n.setSystemScreenCaptureStartCallback(null),e.sendMessageToCallMachine({action:Xs,captureOptions:t})}),n.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Xs,captureOptions:t})}),function(){return S.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Yc(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type;if(t&&"cloud"!==t&&"raw-tracks"!==t&&"local"!==t)throw new Error("invalid type: ".concat(t,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(Tc({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:n,instanceId:r})}},{key:"stopRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Tc({action:"local-recording-stop"},e))}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Tc({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:n,instanceId:r})}},{key:"addLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:Zs,endpointsOp:"add-endpoints",endpoints:t,instanceId:n})}},{key:"removeLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:Zs,endpointsOp:"remove-endpoints",endpoints:t,instanceId:n})}},{key:"stopLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Tc({action:"daily-method-stop-live-streaming"},e))}},{key:"validateDailyConfig",value:function(e){e.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(e.camSimulcastEncodings)),e.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),gl()&&e.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(!(e instanceof Array||Array.isArray(e)))throw new Error("encodings must be an Array");if(!vu(e.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var r=0;r<e.length;r++){var i=e[r];for(var a in this._validateEncodingLayerHasValidProperties(i),i)if(Dc.includes(a)){if("number"!=typeof i[a])throw new Error("".concat(a," must be a number"));if(t){var o=t[a],s=o.min,l=o.max;if(!vu(i[a],s,l))throw new Error("".concat(a," value not in range. valid range: ").concat(s," to ").concat(l))}}else if(!["active","scalabilityMode"].includes(a))throw new Error("Invalid key ".concat(a,", valid keys are:")+Object.values(Dc));if(n&&!i.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(k=rr(function*(e){var t=this,n=e.url,r=e.settings,i=void 0===r?{state:il.PLAY}:r;try{!function(e){if("string"!=typeof e)throw new Error('url parameter must be "string" type')}(n),gu(i),function(e){for(var t in e)if(!Fc.includes(t))throw new Error("Invalid key ".concat(t,", valid keys are: ").concat(Fc));e.simulcastEncodings&&this.validateSimulcastEncodings(e.simulcastEncodings,Rc,!0)}(i)}catch(a){throw console.error("invalid argument Error: ".concat(a)),console.error('startRemoteMediaPlayer arguments must be of the form:\n { url: "playback url",\n settings?:\n {state: "play"|"pause", simulcastEncodings?: [{}] } }'),a}return new Promise(function(e,r){t.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:n,settings:i},function(t){t.error?r({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return k.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(w=rr(function*(e){var t=this;if("string"!=typeof e)throw new Error(" remotePlayerID must be of type string");return new Promise(function(n,r){t.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:e},function(e){e.error?r({error:e.error,errorMsg:e.errorMsg}):n()})})}),function(e){return w.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(b=rr(function*(e){var t=this,n=e.session_id,r=e.settings;try{gu(r)}catch(i){throw console.error("invalid argument Error: ".concat(i)),console.error('updateRemoteMediaPlayer arguments must be of the form:\n session_id: "participant session",\n { settings?: {state: "play"|"pause"} }'),i}return new Promise(function(e,i){t.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:n,settings:r},function(t){t.error?i({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return b.apply(this,arguments)})},{key:"startTranscription",value:function(e){Jc(this._callState,"startTranscription()"),this.sendMessageToCallMachine(Tc({action:"daily-method-start-transcription"},e))}},{key:"updateTranscription",value:function(e){if(Jc(this._callState,"updateTranscription()"),!e)throw new Error("updateTranscription Error: options is mandatory");if("object"!==Jn(e))throw new Error("updateTranscription Error: options must be object type");if(e.participants&&!Array.isArray(e.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(Tc({action:"daily-method-update-transcription"},e))}},{key:"stopTranscription",value:function(e){if(Jc(this._callState,"stopTranscription()"),e&&"object"!==Jn(e))throw new Error("stopTranscription Error: options must be object type");if(e&&!e.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(Tc({action:"daily-method-stop-transcription"},e))}},{key:"startDialOut",value:(y=rr(function*(e){var t=this;Jc(this._callState,"startDialOut()");var n=function(e){if(e){if(!Array.isArray(e))throw new Error("Error starting dial out: audio codec must be an array");if(e.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");e.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: audio codec must be a string");if("OPUS"!==e&&"PCMU"!==e&&"PCMA"!==e&&"G722"!==e)throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!e.sipUri&&!e.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(e.sipUri&&e.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(e.sipUri){if("string"!=typeof e.sipUri)throw new Error("Error starting dial out: sipUri must be a string");if(!e.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(e.video&&"boolean"!=typeof e.video)throw new Error("Error starting dial out: video must be a boolean value");!function(e){if(e&&(n(e.audio),e.video)){if(!Array.isArray(e.video))throw new Error("Error starting dial out: video codec must be an array");if(e.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");e.video.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: video codec must be a string");if("H264"!==e&&"VP8"!==e)throw new Error("Error starting dial out: video codec must be H264 or VP8")})}}(e.codecs)}if(e.phoneNumber){if("string"!=typeof e.phoneNumber)throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(e.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");e.codecs&&n(e.codecs.audio)}if(e.callerId){if("string"!=typeof e.callerId)throw new Error("Error starting dial out: callerId must be a string");if(e.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(e.displayName){if("string"!=typeof e.displayName)throw new Error("Error starting dial out: displayName must be a string");if(e.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(e.userId){if("string"!=typeof e.userId)throw new Error("Error starting dial out: userId must be a string");if(e.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(qc(e),e.permissions&&e.permissions.canReceive){var r=ar(Sc.validateJSONObject(e.permissions.canReceive),2),i=r[0],a=r[1];if(!i)throw new Error(a)}return new Promise(function(n,r){t.sendMessageToCallMachine(Tc({action:"dialout-start"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(e){var t=this;return Jc(this._callState,"stopDialOut()"),new Promise(function(n,r){t.sendMessageToCallMachine(Tc({action:"dialout-stop"},e),function(e){e.error?r(e.error):n(e)})})}},{key:"sipCallTransfer",value:(v=rr(function*(e){var t=this;if(Jc(this._callState,"sipCallTransfer()"),!e)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return e.useSipRefer=!1,mu(e,"sipCallTransfer"),qc(e),new Promise(function(n,r){t.sendMessageToCallMachine(Tc({action:ol},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return v.apply(this,arguments)})},{key:"sipRefer",value:(g=rr(function*(e){var t=this;if(Jc(this._callState,"sipRefer()"),!e)throw new Error("sessionId and toEndPoint are mandatory parameter");return e.useSipRefer=!0,mu(e,"sipRefer"),new Promise(function(n,r){t.sendMessageToCallMachine(Tc({action:ol},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return g.apply(this,arguments)})},{key:"sendDTMF",value:(m=rr(function*(e){var t=this;return Jc(this._callState,"sendDTMF()"),function(e){var t=e.sessionId,n=e.tones;if(!t||!n)throw new Error("sessionId and tones are mandatory parameter");if("string"!=typeof t||"string"!=typeof n)throw new Error("sessionId and tones should be of string type");if(n.length>20)throw new Error("tones string must be upto 20 characters");var r=n.match(/[^0-9A-D*#]/g);if(r&&r[0])throw new Error("".concat(r[0]," is not valid DTMF tone"))}(e),new Promise(function(n,r){t.sendMessageToCallMachine(Tc({action:"send-dtmf"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return m.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var e=this;return this._callState!==Is?Promise.resolve(Tc({stats:{latest:{}}},this._network)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-calc-stats"},function(n){t(Tc(Tc({},e._network),{},{stats:n.stats}))})})}},{key:"testWebsocketConnectivity",value:(h=rr(function*(){var e=this;if(Kc(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(t){return Promise.reject(t)}return new Promise(function(t,n){e.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(e){e.error?n(e.error):t(e.results)})})}),function(){return h.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(e){return e?e instanceof MediaStreamTrack?!!function(e){return e&&"live"===e.readyState&&!((t=e).muted&&!fc.has(t.id));var t}(e)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(p=rr(function*(){var e=this;eu(),Xc(this._callObjectMode,"testCallQuality()"),Yc(this._callMachineInitialized,"testCallQuality()",null,!0),Qc(this._callState,this._isPreparingToJoin,"testCallQuality()");var t=this._testCallAlreadyInProgress,n=function(n){t||(e._testCallInProgress=n)};if(n(!0),this.needsLoad())try{var r=this._callState;yield this.load(),this._callState=r}catch(sr){return n(!1),Promise.reject(sr)}return new Promise(function(t){e.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:e.properties.dailyJsVersion},function(r){var i=r.results,a=i.result,o=qn(i,Ec);if("failed"===a){var s,l=Tc({},o);null!==(s=o.error)&&void 0!==s&&s.details?(o.error.details=JSON.parse(o.error.details),l.error=Tc(Tc({},l.error),{},{details:Tc({},l.error.details)}),l.error.details.duringTest="testCallQuality"):(l.error=l.error?Tc({},l.error):{},l.error.details={duringTest:"testCallQuality"}),e._maybeSendToSentry(l)}n(!1),t(Tc({result:a},o))})})}),function(){return p.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(f=rr(function*(e){var t;ll()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),t=yield this.testPeerToPeerCallQuality(e)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),t=yield this.testCallQuality());var n={result:t.result,secondsElapsed:t.secondsElapsed};return t.data&&(n.data={maxRTT:t.data.maxRoundTripTime,packetLoss:t.data.avgRecvPacketLoss}),n}),function(e){return f.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(d=rr(function*(e){var t=this;if(Kc(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(i){return Promise.reject(i)}var n=e.videoTrack,r=e.duration;if(!this._validateVideoTrackForNetworkTests(n))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=n,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:r},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return d.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){ll()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(u=rr(function*(e){var t=this;if(Kc(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(n){return Promise.reject(n)}if(!this._validateVideoTrackForNetworkTests(e))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=e,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-network-connectivity"},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return u.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var e=this;return new Promise(function(t){e._callState===Is?e.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(e){t(e.cpuStats)}):t({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(e){var t;if(!((null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Dc))}},{key:"_validateVideoSendSettings",value:function(e,t){var n="screenVideo"===e?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],r="Video send settings should be either an object or one of the supported presets: ".concat(n.join());if("string"==typeof t){if(!n.includes(t))throw new Error(r)}else{if("object"!==Jn(t))throw new Error(r);if(!t.maxQuality&&!t.encodings&&void 0===t.allowAdaptiveLayers)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(t.maxQuality&&-1===["low","medium","high"].indexOf(t.maxQuality))throw new Error("maxQuality must be either low, medium or high");if(t.encodings){var i=!1;switch(Object.keys(t.encodings).length){case 1:i=!t.encodings.low;break;case 2:i=!t.encodings.low||!t.encodings.medium;break;case 3:i=!t.encodings.low||!t.encodings.medium||!t.encodings.high;break;default:i=!0}if(i)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");t.encodings.low&&this._validateEncodingLayerHasValidProperties(t.encodings.low),t.encodings.medium&&this._validateEncodingLayerHasValidProperties(t.encodings.medium),t.encodings.high&&this._validateEncodingLayerHasValidProperties(t.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(e){var t=this;if(!e||0===Object.keys(e).length)throw new Error("Send settings must contain at least information for one track!");Object.entries(e).forEach(function(e){var n=ar(e,2),r=n[0],i=n[1];t._validateVideoSendSettings(r,i)})}},{key:"updateSendSettings",value:function(e){var t=this;return this.validateUpdateSendSettings(e),this.needsLoad()?(this._preloadCache.sendSettings=e,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-send-settings",sendSettings:e},function(e){e.error?r(e.error):n(e.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return eu(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return eu(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return eu(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){return Jc(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:(s=rr(function*(){var e=this;if(this._callObjectMode){var t=yield navigator.mediaDevices.enumerateDevices();return"Firefox"===yl()&&bl().major>115&&bl().major<123&&(t=t.filter(function(e){return"audiooutput"!==e.kind})),{devices:t.map(function(e){var t=JSON.parse(JSON.stringify(e));if(!ll()&&"videoinput"===e.kind&&e.getCapabilities){var n,r=e.getCapabilities();t.facing=(null==r||null===(n=r.facingMode)||void 0===n?void 0:n.length)>=1?r.facingMode[0]:void 0}return t})}}return new Promise(function(t){e.sendMessageToCallMachine({action:"enumerate-devices"},function(e){t({devices:e.devices})})})}),function(){return s.apply(this,arguments)})},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(Jc(this._callState,"sendAppMessage()"),JSON.stringify(e).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return eu(),Jc(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(Tc({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return Zc(this._callObjectMode,"setShowNamesMode()"),eu(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Zc(this._callObjectMode,"setShowLocalVideo()"),eu(),Jc(this._callState,"setShowLocalVideo()"),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return Zc(this._callObjectMode,"showLocalVideo()"),eu(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Zc(this._callObjectMode,"setShowParticipantsBar()"),eu(),Jc(this._callState,"setShowParticipantsBar()"),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return Zc(this._callObjectMode,"showParticipantsBar()"),eu(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return eu(),Zc(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(e){return eu(),Zc(this._callObjectMode,"setCustomIntegrations()"),Jc(this._callState,"setCustomIntegrations()"),pu(e)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:e}),this._customIntegrations=e,this):this}},{key:"startCustomIntegrations",value:function(e){var t=this;if(eu(),Zc(this._callObjectMode,"startCustomIntegrations()"),Jc(this._callState,"startCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("startCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:n}),this)}},{key:"stopCustomIntegrations",value:function(e){var t=this;if(eu(),Zc(this._callObjectMode,"stopCustomIntegrations()"),Jc(this._callState,"stopCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:n}),this)}},{key:"customTrayButtons",value:function(){return Zc(this._callObjectMode,"customTrayButtons()"),eu(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(e){return Zc(this._callObjectMode,"updateCustomTrayButtons()"),eu(),Jc(this._callState,"updateCustomTrayButtons()"),fu(e)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:e}),this._customTrayButtons=e,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(zc))),this)}},{key:"theme",value:function(){return Zc(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return Zc(this._callObjectMode,"setTheme()"),new Promise(function(n,r){try{t.validateProperties({theme:e}),t.properties.theme=Tc({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emitDailyJSEvent({action:"theme-updated",theme:t.properties.theme})}catch(i){console.log("could not emit 'theme-updated'",i)}n(t.properties.theme)}catch(i){r(i)}})}},{key:"requestFullscreen",value:(o=rr(function*(){if(eu(),this._iframe&&!document.fullscreenElement&&ul())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(sr){console.log("could not make video call fullscreen",sr)}}),function(){return o.apply(this,arguments)})},{key:"exitFullscreen",value:function(){eu(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(a=rr(function*(){var e=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-sidebar-view"},function(e){t(e.view)})})}),function(){return a.apply(this,arguments)})},{key:"setSidebarView",value:function(e){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:e}),this)}},{key:"room",value:(i=rr(function*(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeRoomConfigDefaults,n=void 0===t||t;return this._accessState.access===Ds||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(t){e.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=rr(function*(){try{var e=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield e.json()).geo}}catch(t){return console.error("geo lookup failed",t),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=rr(function*(e){var t=this;return eu(),Jc(this._callState,"setNetworkTopology()"),new Promise(function(n,r){t.sendMessageToCallMachine({action:"set-network-topology",opts:e},function(e){e.error?r({error:e.error}):n({workerId:e.workerId})})})}),function(e){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=rr(function*(){var e=this;return new Promise(function(t,n){e.needsLoad()&&t({topology:"none"}),e.sendMessageToCallMachine({action:"get-network-topology"},function(e){e.error?n({error:e.error}):t({topology:e.topology})})})}),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(e){if(eu(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(e,t){return ur.prototype.on.call(this,e,t)}},{key:"once",value:function(e,t){return ur.prototype.once.call(this,e,t)}},{key:"off",value:function(e,t){return ur.prototype.off.call(this,e,t)}},{key:"validateProperties",value:function(e){var t,n;if(null!=e&&null!==(t=e.dailyConfig)&&void 0!==t&&t.userMediaAudioConstraints){var r,i;ll()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var a=e.inputSettings||{};a.audio=(null===(r=e.inputSettings)||void 0===r?void 0:r.audio)||{},a.audio.settings=(null===(i=e.inputSettings)||void 0===i||null===(i=i.audio)||void 0===i?void 0:i.settings)||{},a.audio.settings=Tc(Tc({},a.audio.settings),e.dailyConfig.userMediaAudioConstraints),e.inputSettings=a,delete e.dailyConfig.userMediaAudioConstraints}if(null!=e&&null!==(n=e.dailyConfig)&&void 0!==n&&n.userMediaVideoConstraints){var o,s;ll()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var l=e.inputSettings||{};l.video=(null===(o=e.inputSettings)||void 0===o?void 0:o.video)||{},l.video.settings=(null===(s=e.inputSettings)||void 0===s||null===(s=s.video)||void 0===s?void 0:s.settings)||{},l.video.settings=Tc(Tc({},l.video.settings),e.dailyConfig.userMediaVideoConstraints),e.inputSettings=l,delete e.dailyConfig.userMediaVideoConstraints}for(var c in e)if(Vc[c]){if(Vc[c].validate&&!Vc[c].validate(e[c],this))throw new Error("property '".concat(c,"': ").concat(Vc[c].help))}else console.warn("Ignoring unrecognized property '".concat(c,"'")),delete e[c]}},{key:"assembleMeetingUrl",value:function(){var e,t,n=Tc(Tc({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:null!==(e=this.properties.dailyConfig)&&void 0!==e&&e.proxyUrl?encodeURIComponent(null===(t=this.properties.dailyConfig)||void 0===t?void 0:t.proxyUrl):void 0}),r=n.url.match(/\?/)?"&":"?";return n.url+r+Object.keys(Vc).filter(function(e){return Vc[e].queryString&&void 0!==n[e]}).map(function(e){return"".concat(Vc[e].queryString,"=").concat(n[e])}).join("&")}},{key:"needsLoad",value:function(){return[Os,As,js,Rs].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(e,t){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(e,t,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case"iframe-ready-for-launch-config":this.sendMessageToCallMachine(Tc({action:"iframe-launch-config"},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var t={action:el,level:"log",code:1011,stats:{event:"bundle load",time:"no-op"===this._bundleLoadTime?0:this._bundleLoadTime,preLoaded:"no-op"===this._bundleLoadTime,url:Or(this.properties.dailyConfig)}};this.sendMessageToCallMachine(t),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Us:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(e);break;case"joined-meeting":var n,r=Tc({},e);delete r.internal,this._maxAppMessageSize=(null===(n=e.internal)||void 0===n?void 0:n._maxAppMessageSize)||Qs,this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null),this.emitDailyJSEvent(r);break;case"participant-joined":case"participant-updated":if(this._callState===js)return;if(e.participant&&e.participant.session_id){var i=e.participant.local?"local":e.participant.session_id;if(this._callObjectMode){var a=this._callMachine().store;ec(e.participant,a),tc(e.participant,a),rc(e.participant,this._participants[i],a)}try{this.maybeParticipantTracksStopped(this._participants[i],e.participant),this.maybeParticipantTracksStarted(this._participants[i],e.participant),this.maybeEventRecordingStopped(this._participants[i],e.participant),this.maybeEventRecordingStarted(this._participants[i],e.participant)}catch(sr){console.error("track events error",sr)}this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[i])||(this._participants[i]=Tc({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(e))}break;case"participant-left":if(e.participant&&e.participant.session_id){var o=this._participants[e.participant.session_id];o&&this.maybeParticipantTracksStopped(o,null),delete this._participants[e.participant.session_id],this.emitDailyJSEvent(e)}break;case"participant-counts-updated":pr(this._participantCounts,e.participantCounts)||(this._participantCounts=e.participantCounts,this.emitDailyJSEvent(e));break;case"access-state-updated":var s={access:e.access};e.awaitingAccess&&(s.awaitingAccess=e.awaitingAccess),pr(this._accessState,s)||(this._accessState=s,this.emitDailyJSEvent(e));break;case"meeting-session-summary-updated":if(e.meetingSession){this._meetingSessionSummary=e.meetingSession,this.emitDailyJSEvent(e);var l=Tc(Tc({},e),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(l)}break;case Gs:var c;this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this._updateCallState(Rs),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),e.preserveIframe;var u=qn(e,xc);null!=u&&null!==(c=u.error)&&void 0!==c&&c.details&&(u.error.details=JSON.parse(u.error.details)),this._maybeSendToSentry(e),this._joinedCallback&&(this._joinedCallback(null,u),this._joinedCallback=null),this.emitDailyJSEvent(u);break;case"left-meeting":this._callState!==Rs&&this._updateCallState(js),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(e);break;case"selected-devices-updated":e.devices&&this.emitDailyJSEvent(e);break;case"network-quality-change":var d=e.state,f=e.threshold,p=e.quality,h=d.state,m=d.reasons;h===this._network.networkState&&pr(m,this._network.networkStateReasons)&&f===this._network.threshold&&p===this._network.quality||(this._network.networkState=h,this._network.networkStateReasons=m,this._network.quality=p,this._network.threshold=f,e.networkState=h,m.length&&(e.networkStateReasons=m),delete e.state,this.emitDailyJSEvent(e));break;case"cpu-load-change":e&&e.cpuLoadState&&this.emitDailyJSEvent(e);break;case"face-counts-updated":e&&void 0!==e.faceCounts&&this.emitDailyJSEvent(e);break;case"active-speaker-change":var g=e.activeSpeaker;this._activeSpeaker.peerId!==g.peerId&&(this._activeSpeaker.peerId=g.peerId,this.emitDailyJSEvent({action:e.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var v=e.show;this._showLocalVideo=v,this.emitDailyJSEvent({action:e.action,show:v});break;case"active-speaker-mode-change":var y=e.enabled;this._activeSpeakerMode!==y&&(this._activeSpeakerMode=y,this.emitDailyJSEvent({action:e.action,enabled:this._activeSpeakerMode}));break;case"waiting-participant-added":case"waiting-participant-updated":case"waiting-participant-removed":this._waitingParticipants=e.allWaitingParticipants,this.emitDailyJSEvent({action:e.action,participant:e.participant});break;case"receive-settings-updated":pr(this._receiveSettings,e.receiveSettings)||(this._receiveSettings=e.receiveSettings,this.emitDailyJSEvent({action:e.action,receiveSettings:e.receiveSettings}));break;case Hs:this._maybeUpdateInputSettings(e.inputSettings);break;case"send-settings-updated":pr(this._sendSettings,e.sendSettings)||(this._sendSettings=e.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:e.action,sendSettings:e.sendSettings}));break;case"local-audio-level":this._localAudioLevel=e.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=e.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-media-player-started":var b=e.session_id;this._rmpPlayerState[b]=e.playerState,this.emitDailyJSEvent(e);break;case"remote-media-player-stopped":delete this._rmpPlayerState[e.session_id],this.emitDailyJSEvent(e);break;case"remote-media-player-updated":var w=e.session_id,k=this._rmpPlayerState[w];k&&this.compareEqualForRMPUpdateEvent(k,e.remoteMediaPlayerState)||(this._rmpPlayerState[w]=e.remoteMediaPlayerState,this.emitDailyJSEvent(e));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(e);break;case"meeting-session-state-updated":var S=this._meetingSessionState.topology!==(e.meetingSessionState&&e.meetingSessionState.topology);this._meetingSessionState=yu(e.meetingSessionState,this._callObjectMode),(this._callObjectMode||S)&&this.emitDailyJSEvent(e);break;case"local-screen-share-started":this._isScreenSharing=!0,this.emitDailyJSEvent(e);break;case"local-screen-share-stopped":case"local-screen-share-canceled":this._isScreenSharing=!1,this.emitDailyJSEvent(e);break;case Vs:case $s:case"recording-stats":case"recording-error":case"recording-upload-completed":case"transcription-started":case"transcription-stopped":case"transcription-error":case"started-camera":case"camera-error":case"app-message":case"transcription-message":case"test-completed":case"network-connection":case"recording-data":case"live-streaming-started":case"live-streaming-updated":case"live-streaming-stopped":case"live-streaming-error":case Js:case"lang-updated":case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(e);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var n="record";e&&(t.local||!1!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:$s}))}},{key:"maybeEventRecordingStarted",value:function(e,t){var n="record";e&&(t.local||!0!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:Vs}))}},{key:"_trackStatePlayable",value:function(e){return!(!e||"playable"!==e.state)}},{key:"_trackChanged",value:function(e,t){return!((null==e?void 0:e.id)===(null==t?void 0:t.id))}},{key:"maybeEventTrackStopped",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==a?void 0:a.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(s,null==o?void 0:o.track);l&&(c&&!u||this.emitDailyJSEvent({action:"track-stopped",track:s,participant:null!=n?n:t,type:e}))}}},{key:"maybeEventTrackStarted",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==o?void 0:o.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(null==a?void 0:a.track,s);c&&(l&&!u||this.emitDailyJSEvent({action:"track-started",track:s,participant:n,type:e}))}}},{key:"maybeParticipantTracksStopped",value:function(e,t){if(e)for(var n in e.tracks)this.maybeEventTrackStopped(n,e,t)}},{key:"maybeParticipantTracksStarted",value:function(e,t){if(t)for(var n in t.tracks)this.maybeEventTrackStarted(n,e,t)}},{key:"compareEqualForRMPUpdateEvent",value:function(e,t){var n,r;return e.state===t.state&&(null===(n=e.settings)||void 0===n?void 0:n.volume)===(null===(r=t.settings)||void 0===r?void 0:r.volume)}},{key:"emitDailyJSEvent",value:function(e){try{e.callClientId=this.callClientId,this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!(!pr(e,t)||e.videoTrack&&t.videoTrack&&(e.videoTrack.id!==t.videoTrack.id||e.videoTrack.muted!==t.videoTrack.muted||e.videoTrack.enabled!==t.videoTrack.enabled)||e.audioTrack&&t.audioTrack&&(e.audioTrack.id!==t.audioTrack.id||e.audioTrack.muted!==t.audioTrack.muted||e.audioTrack.enabled!==t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return ll()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this._updateCallState(this._callState,e)}},{key:"_updateCallState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._callState||t!==this._isPreparingToJoin){var n=this._callState,r=this._isPreparingToJoin;this._callState=e,this._isPreparingToJoin=t;var i=this._callState===Is;this.updateShowAndroidOngoingMeetingNotification(i);var a=Gc(n,r),o=Gc(this._callState,this._isPreparingToJoin);a!==o&&(this.updateKeepDeviceAwake(o),this.updateDeviceAudioMode(o),this.updateNoOpRecordingEnsuringBackgroundContinuity(o))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=jc,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Ds},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=yu(Ic,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._maxAppMessageSize=Qs,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){ll()&&this.nativeUtils().setKeepDeviceAwake(e,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(e){if(ll()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(ll()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,n,r,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var a=this.properties.reactNativeConfig.androidInCallNotification;t=a.title,n=a.subtitle,r=a.iconName,i=a.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,n,r,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){ll()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var e;if(ll()){var t=null===(e=this._callMachine())||void 0===e||null===(e=e.store)||void 0===e?void 0:e.getState();for(var n in null==t?void 0:t.streams){var r=t.streams[n];r&&r.pendingTrack&&"audio"===r.pendingTrack.kind&&(r.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}},{key:"_logUseAfterDestroy",value:function(){var e=Object.values(Ac)[0];if(this.needsLoad())if(e&&!e.needsLoad()){var t={action:el,level:"error",code:this.strictMode?9995:9997};e.sendMessageToCallMachine(t)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var n={action:el,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(n,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var e=0,t=Object.values(Ac);e<t.length;e++){var n=t[e];n._callMachineInitialized?(n.sendMessageToCallMachine({action:el,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),n._delayDuplicateInstanceLog=!1):n._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(t){var n,r,i,a;if(null!==(n=t.error)&&void 0!==n&&n.type){if(![zs,Bs,Fs].includes(t.error.type))return;if(t.error.type===Fs&&t.error.msg.includes("deleted"))return}var o=null!==(r=this.properties)&&void 0!==r&&r.url?new URL(this.properties.url):void 0,s="production";o&&o.host.includes(".staging.daily")&&(s="staging");var u,d,f,p,h,m=function(){const e=[ho(),fo(),ks(),bs(),Cs(),Ps(),_o(),{name:"HttpContext",preprocessEvent(e){if(!Io.navigator&&!Io.location&&!Io.document)return;const t=e.request&&e.request.url||Io.location&&Io.location.href,{referrer:n}=Io.document||{},{userAgent:r}=Io.navigator||{},i=l(l(l({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),a=c(l(l({},e.request),t&&{url:t}),{headers:i});e.request=a}}];return!1!=={}.autoSessionTracking&&e.push({name:"BrowserSession",setupOnce(){void 0!==Io.document?(Ja({ignoreDuration:!0}),Ya(),is(({from:e,to:t})=>{void 0!==e&&e!==t&&(Ja({ignoreDuration:!0}),Ya())})):Fo&&zr.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),e}().filter(function(e){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name)}),g=new Qo({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:us,stackParser:vs,integrations:m,environment:s}),v=new Zi;if(v.setClient(g),g.init(),this.session_id&&v.setExtra("sessionId",this.session_id),this.properties){var y=Tc({},this.properties);y.userName=y.userName?"[Filtered]":void 0,y.userData=y.userData?"[Filtered]":void 0,y.token=y.token?"[Filtered]":void 0,v.setExtra("properties",y)}if(o){var b=o.searchParams.get("domain");if(!b){var w=o.host.match(/(.*?)\./);b=w&&w[1]||""}b&&v.setTag("domain",b)}t.error&&(v.setTag("fatalErrorType",t.error.type),v.setExtra("errorDetails",t.error.details),(null===(u=t.error.details)||void 0===u?void 0:u.uri)&&v.setTag("serverAddress",t.error.details.uri),(null===(d=t.error.details)||void 0===d?void 0:d.workerGroup)&&v.setTag("workerGroup",t.error.details.workerGroup),(null===(f=t.error.details)||void 0===f?void 0:f.geoGroup)&&v.setTag("geoGroup",t.error.details.geoGroup),(null===(p=t.error.details)||void 0===p?void 0:p.on)&&v.setTag("connectionAttempt",t.error.details.on),null!==(h=t.error.details)&&void 0!==h&&h.bundleUrl&&(v.setTag("bundleUrl",t.error.details.bundleUrl),v.setTag("bundleError",t.error.details.sourceError.type))),v.setTags({callMode:this._callObjectMode?ll()?"reactNative":null!==(i=this.properties)&&void 0!==i&&null!==(i=i.dailyConfig)&&void 0!==i&&null!==(i=i.callMode)&&void 0!==i&&i.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:e.version()});var k=(null===(a=t.error)||void 0===a?void 0:a.msg)||t.errorMsg;v.captureException(new Error(k))}},{key:"_callMachine",value:function(){var e;return null===(e=window._daily)||void 0===e||null===(e=e.instances)||void 0===e||null===(e=e[this.callClientId])||void 0===e?void 0:e.callMachine}},{key:"_maybeUpdateInputSettings",value:function(e){if(!pr(this._inputSettings,e)){var t=this._getInputSettings();this._inputSettings=e;var n=this._getInputSettings();pr(t,n)||this.emitDailyJSEvent({action:Hs,inputSettings:n})}}}],[{key:"supportedBrowser",value:function(){if(ll())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var e=Cr.getParser(sl());return{supported:!!ml(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsFullscreen:!!ul(),supportsScreenShare:!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!0}(yl(),bl())||ll())),supportsSfu:!!ml(),supportsVideoProcessing:pl(),supportsAudioProcessing:hl()}}},{key:"version",value:function(){return"0.84.0"}},{key:"createCallObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.layout="none",new e(null,t)}},{key:"wrap",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(eu(),!t||!t.contentWindow||"string"!=typeof t.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return n.layout||(n.customLayout?n.layout="custom-v1":n.layout="browser"),new e(t,n)}},{key:"createFrame",value:function(t,n){var r,i;eu(),t&&n?(r=t,i=n):t&&t.append?(r=t,i={}):(r=document.body,i=t||{});var a=i.iframeStyle;a||(a=r===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",o.style.visibility="hidden",r.appendChild(o),o.style.visibility=null,Object.keys(a).forEach(function(e){return o.style[e]=a[e]}),i.layout||(i.customLayout?i.layout="custom-v1":i.layout="browser");try{return new e(o,i)}catch(s){throw r.removeChild(o),s}}},{key:"createTransparentFrame",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eu();var n=document.createElement("iframe");return n.allow="microphone; camera; autoplay",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(n),t.layout||(t.layout="custom-v1"),e.wrap(n,t)}},{key:"getCallInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e?Ac[e]:Object.values(Ac)[0]}}]);var t,n,r,i,a,o,s,u,d,f,p,h,m,g,v,y,b,w,k,S,_,E,x,C,T,M,P,O,A,N,L,I,j,R,D,F,B,z}();function qc(e){if(e.extension){if("string"!=typeof e.extension)throw new Error("Error starting dial out: extension must be a string");if(e.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(e.waitBeforeExtensionDialSec){if("number"!=typeof e.waitBeforeExtensionDialSec)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(e.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!e.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function Hc(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=tl;else if("dailyConfig"===r){if(e[r].modifyLocalSdpHook){var i=window._daily.instances[t].customCallbacks||{};i.modifyLocalSdpHook=e[r].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=i,delete e[r].modifyLocalSdpHook}if(e[r].modifyRemoteSdpHook){var a=window._daily.instances[t].customCallbacks||{};a.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=a,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Jc(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==Is){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Gc(e,t){return[Ls,Is].includes(e)||t}function Qc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Gc(e,t)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Yc(e){var t=arguments.length>2?arguments[2]:void 0;if(!e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method",arguments.length>3&&void 0!==arguments[3]&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Kc(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(t),new Error(t)}}function Xc(e){if(!e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function Zc(e){if(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function eu(){if(ll())throw new Error("This daily-js method is not currently supported in React Native")}function tu(){if(!ll())throw new Error("This daily-js method is only supported in React Native")}function nu(e){if(void 0===e)return!0;var t;if("string"==typeof e)t=e;else try{t=JSON.stringify(e),pr(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function ru(e,t){for(var n=t.allowAllParticipantsKey,r=function(e){var t=["local"];return n||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},a=function(e){return!(!e||e.video&&!i(e.video)||e.screenVideo&&!i(e.screenVideo))},o=0,s=Object.entries(e);o<s.length;o++){var l=ar(s[o],2),c=l[0],u=l[1];if(!r(c)||!a(u))return!1}return!0}function iu(e){if("object"!==Jn(e))return!1;for(var t=0,n=Object.entries(e);t<n.length;t++){var r=ar(n[t],2),i=r[0],a=r[1];switch(i){case"video":if("object"!==Jn(a))return!1;for(var o=0,s=Object.entries(a);o<s.length;o++){var l=ar(s[o],2),c=l[0],u=l[1];switch(c){case"processor":if(!su(u))return!1;break;case"settings":if(!lu(u))return!1;break;default:return!1}}break;case"audio":if("object"!==Jn(a))return!1;for(var d=0,f=Object.entries(a);d<f.length;d++){var p=ar(f[d],2),h=p[0],m=p[1];switch(h){case"processor":if(!ou(m))return!1;break;case"settings":if(!lu(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function au(e,t,n){var r,i=[];e.video&&e.video.processor&&(pl(null!==(r=null==t?void 0:t.useLegacyVideoProcessor)&&void 0!==r&&r)||(e.video.settings?delete e.video.processor:delete e.video,i.push("video"))),e.audio&&e.audio.processor&&(hl()||(e.audio.settings?delete e.audio.processor:delete e.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),e.audio&&e.audio.settings&&(e.audio.settings.customTrack?(n.audioTrack=e.audio.settings.customTrack,e.audio.settings={customTrack:tl}):delete n.audioTrack),e.video&&e.video.settings&&(e.video.settings.customTrack?(n.videoTrack=e.video.settings.customTrack,e.video.settings={customTrack:tl}):delete n.videoTrack)}function ou(e){if(ll())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type"];return!(!e||"object"!==Jn(e)||(Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> audio -> processor : ".concat(t)),delete e[t]}),t=e.type,"string"!=typeof t||!Object.values(rl).includes(t)&&(console.error("inputSettings audio processor type invalid"),1)))}function su(e){if(ll())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type","config"];if(!e)return!1;if("object"!==Jn(e))return!1;if("string"!=typeof(t=e.type)||!Object.values(nl).includes(t)&&(console.error("inputSettings video processor type invalid"),1))return!1;if(e.config){if("object"!==Jn(e.config))return!1;if(!function(e,t){var n=Object.keys(t);if(0===n.length)return!0;var r,i,a,o="invalid object in inputSettings -> video -> processor -> config";switch(e){case nl.BGBLUR:return n.length>1||"strength"!==n[0]?(console.error(o),!1):!("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error("".concat(o,"; expected: {0 < strength <= 1}, got: ").concat(t.strength)),!1);case nl.BGIMAGE:return!(void 0!==t.source&&(r=t,!("default"===r.source?(r.type="default",1):r.source instanceof ArrayBuffer||(Ar(r.source)?(r.type="url",function(e){var t=new URL(e),n=t.pathname;if("data:"===t.protocol)try{var r=n.substring(n.indexOf(":")+1,n.indexOf(";")).split("/")[1];return al.includes(r)}catch(a){return console.error("failed to deduce blob content type",a),!1}var i=n.split(".").at(-1).toLowerCase().trim();return al.includes(i)}(r.source)||(console.error("invalid image type; supported types: [".concat(al.join(", "),"]")),0)):(i=r.source,a=Number(i),isNaN(a)||!Number.isInteger(a)||a<=0||a>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),0):(r.type="daily-preselect",1))))));default:return!0}}(e.type,e.config))return!1}return Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete e[t]}),!0}function lu(e){return"object"===Jn(e)&&(!e.customTrack||e.customTrack instanceof MediaStreamTrack)}function cu(){var e=Object.values(nl).join(" | "),t=Object.values(rl).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function uu(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat("base").concat(t?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function du(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Uc),".")}function fu(e){if(e&&"object"!==Jn(e)||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(zc),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=ar(n[t],1)[0],i=0,a=Object.entries(e[r]);i<a.length;i++){var o=ar(a[i],2),s=o[0],l=o[1],c=zc.id[s];if(!c)return console.error("customTrayButton does not support key ".concat(s)),!1;switch(s){case"iconPath":case"iconPathDarkMode":if(!Ar(l))return console.error("customTrayButton ".concat(s," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(s," should be ").concat(c,". Got: ").concat(l)),!1;break;default:if(Jn(l)!==c)return console.error("customTrayButton ".concat(s," should be a ").concat(c,".")),!1}}return!0}function pu(e){if(!e||e&&"object"!==Jn(e)||Array.isArray(e))return console.error(du()),!1;for(var t=function(e){return"".concat(e," should be ").concat(Uc.id[e])},n=function(e,t){return console.error("customIntegration ".concat(e,": ").concat(t))},r=0,i=Object.entries(e);r<i.length;r++){var a=ar(i[r],1)[0];if(!("label"in e[a]))return n(a,"label is required"),!1;if(!("location"in e[a]))return n(a,"location is required"),!1;if(!("src"in e[a])&&!("srcdoc"in e[a]))return n(a,"src or srcdoc is required"),!1;for(var o=0,s=Object.entries(e[a]);o<s.length;o++){var l=ar(s[o],2),c=l[0],u=l[1];switch(c){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if("string"!=typeof u)return n(a,t(c)),!1;break;case"iconURL":if(!Ar(u))return n(a,"".concat(c," should be a url")),!1;break;case"src":if("srcdoc"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if(!Ar(u))return n(a,'src "'.concat(u,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if("string"!=typeof u)return n(a,t(c)),!1;break;case"location":if(!["main","sidebar"].includes(u))return n(a,t(c)),!1;break;case"controlledBy":if("*"!==u&&"owners"!==u&&(!Array.isArray(u)||u.some(function(e){return"string"!=typeof e})))return n(a,t(c)),!1;break;case"shared":if((!Array.isArray(u)||u.some(function(e){return"string"!=typeof e}))&&"owners"!==u&&"boolean"!=typeof u)return n(a,t(c)),!1;break;default:if(!Uc.id[c])return console.error("customIntegration does not support key ".concat(c)),!1}}}return!0}function hu(e,t){if(void 0===t)return!1;switch(Jn(t)){case"string":return Jn(e)===t;case"object":if("object"!==Jn(e))return!1;for(var n in e)if(!hu(e[n],t[n]))return!1;return!0;default:return!1}}function mu(e,t){var n=e.sessionId,r=e.toEndPoint,i=e.callerId,a=e.useSipRefer;if(!n||!r)throw new Error("".concat(t,"() requires a sessionId and toEndPoint"));if("string"!=typeof n||"string"!=typeof r)throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(a&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(i&&"string"!=typeof i)throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function gu(e){if("object"!==Jn(e))throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(il).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(il));if(e.volume){if("number"!=typeof e.volume)throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function vu(e,t,n){return!("number"!=typeof e||e<t||e>n)}function yu(e,t){return e&&!t&&delete e.data,e}var bu,wu={exports:{}};var ku=function(){if(bu)return wu.exports;bu=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}wu.exports=i,wu.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}h(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&h(e,"error",t,n)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},wu.exports}();const Su=f(ku);for(var _u,Eu=[],xu=0;xu<256;++xu)Eu.push((xu+256).toString(16).slice(1));var Cu=new Uint8Array(16);function Tu(){if(!_u&&!(_u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _u(Cu)}const Mu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pu(e,t,n){if(Mu.randomUUID&&!t&&!e)return Mu.randomUUID();var r=(e=e||{}).random||(e.rng||Tu)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e,t=0){return(Eu[e[t+0]]+Eu[e[t+1]]+Eu[e[t+2]]+Eu[e[t+3]]+"-"+Eu[e[t+4]]+Eu[e[t+5]]+"-"+Eu[e[t+6]]+Eu[e[t+7]]+"-"+Eu[e[t+8]]+Eu[e[t+9]]+"-"+Eu[e[t+10]]+Eu[e[t+11]]+Eu[e[t+12]]+Eu[e[t+13]]+Eu[e[t+14]]+Eu[e[t+15]]).toLowerCase()}(r)}const Ou={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},Au={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},Nu={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},Lu={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},Iu={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class ju{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);t.push(0);const n=t[0],r=t[1];if(10===n)switch(r){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=ju.getVersionPrecision(e),i=ju.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=ju.map([e,t],e=>{const t=a-ju.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return ju.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return Ou[e]}static getBrowserTypeByAlias(e){return Au[e]||""}}const Ru=/version\/(\d+(\.?_?\d+)+)/i,Du=[{test:[/gptbot/i],describe(e){const t={name:"GPTBot"},n=ju.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe(e){const t={name:"ChatGPT-User"},n=ju.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe(e){const t={name:"OAI-SearchBot"},n=ju.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(e){const t={name:"ClaudeBot"},n=ju.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe(e){const t={name:"Omgilibot"},n=ju.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe(e){const t={name:"Diffbot"},n=ju.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe(e){const t={name:"PerplexityBot"},n=ju.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe(e){const t={name:"Perplexity-User"},n=ju.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe(e){const t={name:"YouBot"},n=ju.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe(e){const t={name:"Meta-WebIndexer"},n=ju.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe(e){const t={name:"Meta-ExternalAds"},n=ju.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe(e){const t={name:"Meta-ExternalAgent"},n=ju.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe(e){const t={name:"Meta-ExternalFetcher"},n=ju.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=ju.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe(e){const t={name:"AmazonBot"},n=ju.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe(e){const t={name:"BingCrawler"},n=ju.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe(e){const t={name:"BaiduSpider"},n=ju.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe(e){const t={name:"DuckDuckBot"},n=ju.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe(e){const t={name:"InternetArchiveCrawler"},n=ju.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({name:"FacebookExternalHit"})},{test:[/yahoo!?[\s/]*slurp/i],describe:()=>({name:"YahooSlurp"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({name:"YandexBot"})},{test:[/pingdom/i],describe:()=>({name:"PingdomBot"})},{test:[/opera/i],describe(e){const t={name:"Opera"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=ju.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe(e){const t={name:"Pale Moon"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=ju.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=ju.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=ju.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=ju.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=ju.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=ju.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=ju.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=ju.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=ju.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=ju.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=ju.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=ju.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=ju.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=ju.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=ju.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=ju.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=ju.getFirstMatch(Ru,e)||ju.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=ju.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=ju.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=ju.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe(e){const t={name:"LibreWolf"},n=ju.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=ju.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=ju.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(e){const t={name:"Sogou Browser"},n=ju.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),r=ju.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),i=ju.getFirstMatch(/se ([\d.]+)x/i,e),a=n||r||i;return a&&(t.version=a),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=ju.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=ju.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=ju.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=ju.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=ju.getFirstMatch(Ru,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:ju.getFirstMatch(t,e),version:ju.getSecondMatch(t,e)}}}],Fu=[{test:[/Roku\/DVP/],describe(e){const t=ju.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Lu.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=ju.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Lu.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=ju.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=ju.getWindowsVersionName(t);return{name:Lu.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Lu.iOS},n=ju.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=ju.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=ju.getMacOSVersionName(t),r={name:Lu.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=ju.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Lu.iOS,version:t}}},{test:[/OpenHarmony/i],describe(e){const t=ju.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:Lu.HarmonyOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=ju.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=ju.getAndroidVersionName(t),r={name:Lu.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=ju.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Lu.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=ju.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||ju.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||ju.getFirstMatch(/\bbb(\d+)/i,e);return{name:Lu.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=ju.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Lu.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=ju.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Lu.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Lu.Linux})},{test:[/CrOS/],describe:()=>({name:Lu.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=ju.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Lu.PlayStation4,version:t}}}],Bu=[{test:[/googlebot/i],describe:()=>({type:Nu.bot,vendor:"Google"})},{test:[/amazonbot/i],describe:()=>({type:Nu.bot,vendor:"Amazon"})},{test:[/gptbot/i],describe:()=>({type:Nu.bot,vendor:"OpenAI"})},{test:[/chatgpt-user/i],describe:()=>({type:Nu.bot,vendor:"OpenAI"})},{test:[/oai-searchbot/i],describe:()=>({type:Nu.bot,vendor:"OpenAI"})},{test:[/baiduspider/i],describe:()=>({type:Nu.bot,vendor:"Baidu"})},{test:[/bingbot/i],describe:()=>({type:Nu.bot,vendor:"Bing"})},{test:[/duckduckbot/i],describe:()=>({type:Nu.bot,vendor:"DuckDuckGo"})},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:()=>({type:Nu.bot,vendor:"Anthropic"})},{test:[/omgilibot/i,/webzio-extended/i],describe:()=>({type:Nu.bot,vendor:"Webz.io"})},{test:[/diffbot/i],describe:()=>({type:Nu.bot,vendor:"Diffbot"})},{test:[/perplexitybot/i],describe:()=>({type:Nu.bot,vendor:"Perplexity AI"})},{test:[/perplexity-user/i],describe:()=>({type:Nu.bot,vendor:"Perplexity AI"})},{test:[/youbot/i],describe:()=>({type:Nu.bot,vendor:"You.com"})},{test:[/ia_archiver/i],describe:()=>({type:Nu.bot,vendor:"Internet Archive"})},{test:[/meta-webindexer/i],describe:()=>({type:Nu.bot,vendor:"Meta"})},{test:[/meta-externalads/i],describe:()=>({type:Nu.bot,vendor:"Meta"})},{test:[/meta-externalagent/i],describe:()=>({type:Nu.bot,vendor:"Meta"})},{test:[/meta-externalfetcher/i],describe:()=>({type:Nu.bot,vendor:"Meta"})},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({type:Nu.bot,vendor:"Meta"})},{test:[/yahoo/i],describe:()=>({type:Nu.bot,vendor:"Yahoo"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({type:Nu.bot,vendor:"Yandex"})},{test:[/pingdom/i],describe:()=>({type:Nu.bot,vendor:"Pingdom"})},{test:[/huawei/i],describe(e){const t=ju.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Nu.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Nu.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Nu.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Nu.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Nu.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Nu.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Nu.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=ju.getFirstMatch(/(ipod|iphone)/i,e);return{type:Nu.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Nu.mobile,vendor:"Nexus"})},{test:[/Nokia/i],describe(e){const t=ju.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:Nu.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:()=>({type:Nu.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Nu.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Nu.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Nu.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Nu.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Nu.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Nu.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Nu.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Nu.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Nu.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Nu.tv})}],zu=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Iu.Blink};const t=ju.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Iu.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Iu.Trident},n=ju.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Iu.Presto},n=ju.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Iu.Gecko},n=ju.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Iu.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Iu.WebKit},n=ju.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Uu{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=ju.find(Du,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=ju.find(Fu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=ju.find(Bu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=ju.find(zu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return ju.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=ju.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=ju.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=ju.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=ju.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(ju.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
43
+ /*!
44
+ * Bowser - a browser detector
45
+ * https://github.com/lancedikson/bowser
46
+ * MIT License | (c) Dustin Diaz 2012-2015
47
+ * MIT License | (c) Denis Demchenko 2015-2019
48
+ */class Vu{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Uu(e,t)}static parse(e){return new Uu(e).getResult()}static get BROWSER_MAP(){return Au}static get ENGINE_MAP(){return Iu}static get OS_MAP(){return Lu}static get PLATFORMS_MAP(){return Nu}}function $u(e,t){return Object.keys(t).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})}),e}function Wu(e){return e&&e.__esModule?e.default:e}function qu(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var Hu={},Ju={};qu(Ju,"PipecatClient",()=>Ud);var Gu;Gu=JSON.parse('{"name":"@pipecat-ai/client-js","version":"1.5.0","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"index.ts","repository":{"type":"git","url":"git+https://github.com/pipecat-ai/pipecat-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent --passWithNoTests && parcel build --no-cache","dev":"parcel watch","lint":"eslint . --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"jsdom"},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","jest-environment-jsdom":"^30.0.2","ts-jest":"^29.2.5"},"dependencies":{"@types/events":"^3.0.3","bowser":"^2.11.0","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');var Qu,Yu,Ku={},Xu={};qu(Xu,"TransportStateEnum",()=>Qu),(Yu=Qu||(Qu={})).DISCONNECTED="disconnected",Yu.INITIALIZING="initializing",Yu.INITIALIZED="initialized",Yu.AUTHENTICATING="authenticating",Yu.AUTHENTICATED="authenticated",Yu.CONNECTING="connecting",Yu.CONNECTED="connected",Yu.READY="ready",Yu.DISCONNECTING="disconnecting",Yu.ERROR="error";var Zu={};qu(Zu,"RTVIError",()=>ed),qu(Zu,"ConnectionTimeoutError",()=>td),qu(Zu,"StartBotError",()=>nd),qu(Zu,"TransportStartError",()=>rd),qu(Zu,"InvalidTransportParamsError",()=>id),qu(Zu,"BotNotReadyError",()=>ad),qu(Zu,"BotAlreadyStartedError",()=>od),qu(Zu,"UnsupportedFeatureError",()=>sd),qu(Zu,"DeviceError",()=>ld);class ed extends Error{constructor(e,t){super(e),this.status=t}}class td extends ed{constructor(e){super(null!=e?e:"Bot did not enter ready state within the specified timeout period.")}}class nd extends ed{constructor(e,t){super(null!=e?e:"Failed to connect / invalid auth bundle from base url",null!=t?t:500),this.error="invalid-request-error"}}class rd extends ed{constructor(e){super(null!=e?e:"Unable to connect to transport")}}class id extends ed{constructor(e){super(null!=e?e:"Invalid transport connection parameters")}}class ad extends ed{constructor(e){super(null!=e?e:"Attempt to call action on transport when not in 'ready' state.")}}class od extends ed{constructor(e){super(null!=e?e:"Pipecat client has already been started. Please call disconnect() before starting again.")}}class sd extends ed{constructor(e,t,n){let r=`${e} not supported${n?`: ${n}`:""}`;t&&(r=`${t} does not support ${e}${n?`: ${n}`:""}`),super(r),this.feature=e}}class ld extends ed{constructor(e,t,n,r){super(null!=n?n:`Device error for ${e.join(", ")}: ${t}`),this.devices=e,this.type=t,this.details=r}}var cd,ud,dd={};qu(dd,"RTVIEvent",()=>cd),(ud=cd||(cd={})).Connected="connected",ud.Disconnected="disconnected",ud.TransportStateChanged="transportStateChanged",ud.BotStarted="botStarted",ud.BotConnected="botConnected",ud.BotReady="botReady",ud.BotDisconnected="botDisconnected",ud.Error="error",ud.ServerMessage="serverMessage",ud.ServerResponse="serverResponse",ud.MessageError="messageError",ud.Metrics="metrics",ud.BotStartedSpeaking="botStartedSpeaking",ud.BotStoppedSpeaking="botStoppedSpeaking",ud.UserStartedSpeaking="userStartedSpeaking",ud.UserStoppedSpeaking="userStoppedSpeaking",ud.UserTranscript="userTranscript",ud.BotOutput="botOutput",ud.BotTranscript="botTranscript",ud.BotLlmText="botLlmText",ud.BotLlmStarted="botLlmStarted",ud.BotLlmStopped="botLlmStopped",ud.LLMFunctionCall="llmFunctionCall",ud.BotLlmSearchResponse="botLlmSearchResponse",ud.BotTtsText="botTtsText",ud.BotTtsStarted="botTtsStarted",ud.BotTtsStopped="botTtsStopped",ud.ParticipantConnected="participantConnected",ud.ParticipantLeft="participantLeft",ud.TrackStarted="trackStarted",ud.TrackStopped="trackStopped",ud.ScreenTrackStarted="screenTrackStarted",ud.ScreenTrackStopped="screenTrackStopped",ud.ScreenShareError="screenShareError",ud.LocalAudioLevel="localAudioLevel",ud.RemoteAudioLevel="remoteAudioLevel",ud.AvailableCamsUpdated="availableCamsUpdated",ud.AvailableMicsUpdated="availableMicsUpdated",ud.AvailableSpeakersUpdated="availableSpeakersUpdated",ud.CamUpdated="camUpdated",ud.MicUpdated="micUpdated",ud.SpeakerUpdated="speakerUpdated",ud.DeviceError="deviceError";var fd={};qu(fd,"RTVI_PROTOCOL_VERSION",()=>pd),qu(fd,"RTVI_MESSAGE_LABEL",()=>hd),qu(fd,"RTVIMessageType",()=>md),qu(fd,"AggregationType",()=>vd),qu(fd,"setAboutClient",()=>wd),qu(fd,"RTVIMessage",()=>kd);const pd="1.0.0",hd="rtvi-ai";var md,gd,vd,yd;let bd;function wd(e){bd=bd?l(l({},bd),e):e}(gd=md||(md={})).CLIENT_READY="client-ready",gd.DISCONNECT_BOT="disconnect-bot",gd.CLIENT_MESSAGE="client-message",gd.SEND_TEXT="send-text",gd.APPEND_TO_CONTEXT="append-to-context",gd.BOT_READY="bot-ready",gd.ERROR="error",gd.METRICS="metrics",gd.SERVER_MESSAGE="server-message",gd.SERVER_RESPONSE="server-response",gd.ERROR_RESPONSE="error-response",gd.APPEND_TO_CONTEXT_RESULT="append-to-context-result",gd.USER_TRANSCRIPTION="user-transcription",gd.BOT_OUTPUT="bot-output",gd.BOT_TRANSCRIPTION="bot-transcription",gd.USER_STARTED_SPEAKING="user-started-speaking",gd.USER_STOPPED_SPEAKING="user-stopped-speaking",gd.BOT_STARTED_SPEAKING="bot-started-speaking",gd.BOT_STOPPED_SPEAKING="bot-stopped-speaking",gd.USER_LLM_TEXT="user-llm-text",gd.BOT_LLM_TEXT="bot-llm-text",gd.BOT_LLM_STARTED="bot-llm-started",gd.BOT_LLM_STOPPED="bot-llm-stopped",gd.LLM_FUNCTION_CALL="llm-function-call",gd.LLM_FUNCTION_CALL_RESULT="llm-function-call-result",gd.BOT_LLM_SEARCH_RESPONSE="bot-llm-search-response",gd.BOT_TTS_TEXT="bot-tts-text",gd.BOT_TTS_STARTED="bot-tts-started",gd.BOT_TTS_STOPPED="bot-tts-stopped",(yd=vd||(vd={})).WORD="word",yd.SENTENCE="sentence";class kd{constructor(e,t,n){this.label=hd,this.type=e,this.data=t,this.id=n||Pu().slice(0,8)}static clientReady(){return new kd(md.CLIENT_READY,{version:pd,about:bd||{library:Gu.name,library_version:Gu.version}})}static disconnectBot(){return new kd(md.DISCONNECT_BOT,{})}static error(e,t=!1){return new kd(md.ERROR,{message:e,fatal:t})}}function Sd(e,t,n){const r=n.value;return n.value=function(...e){if("ready"===this.state)return r.apply(this,e);throw new ad(`Attempt to call ${t.toString()} when transport not in ready state. Await connect() first.`)},n}function _d(e,t,n){const r=n.value,i=["authenticating","connecting","connected","ready"];return n.value=function(...e){if(i.includes(this.state))throw new od(`Attempt to call ${t.toString()} when client already started. Please call disconnect() before starting again.`);return r.apply(this,e)},n}$u(Ku,Xu),$u(Ku,Zu),$u(Ku,dd),$u(Ku,fd);var Ed={};qu(Ed,"MessageDispatcher",()=>Od);var xd,Cd,Td={};qu(Td,"LogLevel",()=>xd),qu(Td,"logger",()=>Pd),(Cd=xd||(xd={}))[Cd.NONE=0]="NONE",Cd[Cd.ERROR=1]="ERROR",Cd[Cd.WARN=2]="WARN",Cd[Cd.INFO=3]="INFO",Cd[Cd.DEBUG=4]="DEBUG";class Md{constructor(){this.level=xd.DEBUG}static getInstance(){return Md.instance||(Md.instance=new Md),Md.instance}setLevel(e){this.level=e}debug(...e){this.level>=xd.DEBUG&&console.debug(...e)}info(...e){this.level>=xd.INFO&&console.info(...e)}warn(...e){this.level>=xd.WARN&&console.warn(...e)}error(...e){this.level>=xd.ERROR&&console.error(...e)}}const Pd=Md.getInstance();class Od{constructor(e){this._queue=new Array,this._gcInterval=void 0,this._queue=[],this._sendMethod=e}disconnect(){this.clearQueue(),clearInterval(this._gcInterval),this._gcInterval=void 0}dispatch(e,t=md.CLIENT_MESSAGE,n=1e4){this._gcInterval||(this._gcInterval=setInterval(()=>{this._gc()},2e3));const r=new kd(t,e),i=new Promise((e,t)=>{this._queue.push({message:r,timestamp:Date.now(),timeout:n,resolve:e,reject:t})});Pd.debug("[MessageDispatcher] dispatch",r);try{this._sendMethod(r)}catch(sr){return Pd.error("[MessageDispatcher] Error sending message",sr),Promise.reject(sr)}return this._gc(),i}clearQueue(){this._queue=[]}_resolveReject(e,t=!0){const n=this._queue.find(t=>t.message.id===e.id);return n&&(t?(Pd.debug("[MessageDispatcher] Resolve",e),n.resolve(e)):(Pd.debug("[MessageDispatcher] Reject",e),n.reject(e)),this._queue=this._queue.filter(t=>t.message.id!==e.id),Pd.debug("[MessageDispatcher] Queue",this._queue)),e}resolve(e){return this._resolveReject(e,!0)}reject(e){return this._resolveReject(e,!1)}_gc(){const e=[];this._queue=this._queue.filter(t=>{const n=Date.now()-t.timestamp<t.timeout;return n||e.push(t),n}),e.forEach(e=>{e.message.type===md.CLIENT_MESSAGE&&e.reject(new kd(md.ERROR_RESPONSE,{error:"Timed out waiting for response",msgType:e.message.data.t,data:e.message.data.d,fatal:!1}))}),Pd.debug("[MessageDispatcher] GC",this._queue)}}var Ad={};function Nd(e){if("object"==typeof e&&null!==e&&Object.keys(e).includes("endpoint")){const t=e.endpoint;return"string"==typeof t||t instanceof URL||"undefined"!=typeof Request&&t instanceof Request}return!1}function Ld(e,t){return d(this,null,function*(){let n;return t||(t=new AbortController),new Promise((r,i)=>{d(null,null,function*(){var a;e.timeout&&(n=setTimeout(()=>d(null,null,function*(){t.abort(),i(new Error("Timed out"))}),e.timeout)),Pd.debug(`[Pipecat Client] Fetching from ${e.endpoint}`),fetch(e.endpoint,{method:"POST",mode:"cors",headers:new Headers(l({"Content-Type":"application/json"},Object.fromEntries((null!=(a=e.headers)?a:new Headers).entries()))),body:JSON.stringify(e.requestData),signal:null==t?void 0:t.signal}).then(t=>{Pd.debug(`[Pipecat Client] Received response from ${e.endpoint}`,t),t.ok||i(t),t.json().then(e=>r(e))}).catch(e=>{Pd.error(`[Pipecat Client] Error fetching: ${e}`),i(e)}).finally(()=>{n&&clearTimeout(n)})})})})}qu(Ad,"isAPIRequest",()=>Nd),qu(Ad,"makeRequest",()=>Ld);var Id={};qu(Id,"Transport",()=>jd),qu(Id,"TransportWrapper",()=>Rd);class jd{constructor(){this._state="disconnected"}connect(e){this._abortController=new AbortController;let t=e;try{t=this._validateConnectionParams(e)}catch(sr){throw new ed(`Invalid connection params: ${sr.message}. Please check your connection params and try again.`)}return this._connect(t)}get startBotParams(){return this._startBotParams}set startBotParams(e){this._startBotParams=e}disconnect(){return this._abortController&&this._abortController.abort(),this._disconnect()}}class Rd{constructor(e){this._transport=e,this._proxy=new Proxy(this._transport,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"initialize":n="Direct calls to initialize() are disabled and used internally by the PipecatClient.";break;case"initDevices":n="Direct calls to initDevices() are disabled. Please use the PipecatClient.initDevices() wrapper or let PipecatClient.connect() call it for you.";break;case"sendReadyMessage":n="Direct calls to sendReadyMessage() are disabled and used internally by the PipecatClient.";break;case"connect":n="Direct calls to connect() are disabled. Please use the PipecatClient.connect() wrapper.";break;case"disconnect":n="Direct calls to disconnect() are disabled. Please use the PipecatClient.disconnect() wrapper."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}var Dd={};function Fd(){var e,t,n,r,i,a;let o={library:Gu.name,library_version:Gu.version,platform_details:{}},s=null;if(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)try{s=Vu.parse(window.navigator.userAgent)}catch(l){}return(null==(t=null==s?void 0:s.browser)?void 0:t.name)&&(o.platform_details.browser=s.browser.name),"Safari"!==(null==(n=null==s?void 0:s.browser)?void 0:n.name)||s.browser.version?(null==(r=null==s?void 0:s.browser)?void 0:r.version)&&(o.platform_details.browser_version=s.browser.version):o.platform_details.browser_version="Web View",(null==(i=null==s?void 0:s.platform)?void 0:i.type)&&(o.platform_details.platform_type=s.platform.type),(null==(a=null==s?void 0:s.engine)?void 0:a.name)&&(o.platform_details.engine=s.engine.name),(null==s?void 0:s.os)&&(o.platform=s.os.name,o.platform_version=s.os.version),o}qu(Dd,"learnAboutClient",()=>Fd);var Bd=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class zd extends Su{}class Ud extends zd{constructor(e){var t,n,r;super(),this._functionCallCallbacks={},this._botTranscriptionWarned=!1,wd(Fd()),this._transport=e.transport,this._transportWrapper=new Rd(this._transport);const i=c(l({},e.callbacks),{onMessageError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMessageError)||r.call(n,t),this.emit(cd.MessageError,t)},onError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onError)||r.call(n,t);try{this.emit(cd.Error,t)}catch(sr){Pd.debug("Could not emit error",t)}const i=t.data;(null==i?void 0:i.fatal)&&(Pd.error("Fatal error reported. Disconnecting..."),this.disconnect())},onConnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onConnected)||n.call(t),this.emit(cd.Connected)},onDisconnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onDisconnected)||n.call(t),this.emit(cd.Disconnected)},onTransportStateChanged:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onTransportStateChanged)||r.call(n,t),this.emit(cd.TransportStateChanged,t)},onParticipantJoined:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantJoined)||r.call(n,t),this.emit(cd.ParticipantConnected,t)},onParticipantLeft:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantLeft)||r.call(n,t),this.emit(cd.ParticipantLeft,t)},onTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStarted)||i.call(r,t,n),this.emit(cd.TrackStarted,t,n)},onTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStopped)||i.call(r,t,n),this.emit(cd.TrackStopped,t,n)},onScreenTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStarted)||i.call(r,t,n),this.emit(cd.ScreenTrackStarted,t,n)},onScreenTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStopped)||i.call(r,t,n),this.emit(cd.ScreenTrackStopped,t,n)},onScreenShareError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onScreenShareError)||r.call(n,t),this.emit(cd.ScreenShareError,t)},onAvailableCamsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableCamsUpdated)||r.call(n,t),this.emit(cd.AvailableCamsUpdated,t)},onAvailableMicsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableMicsUpdated)||r.call(n,t),this.emit(cd.AvailableMicsUpdated,t)},onAvailableSpeakersUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableSpeakersUpdated)||r.call(n,t),this.emit(cd.AvailableSpeakersUpdated,t)},onCamUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onCamUpdated)||r.call(n,t),this.emit(cd.CamUpdated,t)},onMicUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMicUpdated)||r.call(n,t),this.emit(cd.MicUpdated,t)},onSpeakerUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onSpeakerUpdated)||r.call(n,t),this.emit(cd.SpeakerUpdated,t)},onDeviceError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onDeviceError)||r.call(n,t),this.emit(cd.DeviceError,t)},onBotStarted:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotStarted)||r.call(n,t),this.emit(cd.BotStarted,t)},onBotConnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotConnected)||r.call(n,t),this.emit(cd.BotConnected,t)},onBotReady:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotReady)||r.call(n,t),this.emit(cd.BotReady,t)},onBotDisconnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotDisconnected)||r.call(n,t),this.emit(cd.BotDisconnected,t)},onBotStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStartedSpeaking)||n.call(t),this.emit(cd.BotStartedSpeaking)},onBotStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStoppedSpeaking)||n.call(t),this.emit(cd.BotStoppedSpeaking)},onRemoteAudioLevel:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onRemoteAudioLevel)||i.call(r,t,n),this.emit(cd.RemoteAudioLevel,t,n)},onUserStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStartedSpeaking)||n.call(t),this.emit(cd.UserStartedSpeaking)},onUserStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStoppedSpeaking)||n.call(t),this.emit(cd.UserStoppedSpeaking)},onLocalAudioLevel:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onLocalAudioLevel)||r.call(n,t),this.emit(cd.LocalAudioLevel,t)},onUserTranscript:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onUserTranscript)||r.call(n,t),this.emit(cd.UserTranscript,t)},onBotOutput:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotOutput)||r.call(n,t),this.emit(cd.BotOutput,t)},onBotTranscript:t=>{var n,r;this._botTranscriptionWarned||(Pd.warn("[Pipecat Client] Bot transcription is deprecated. Please use the onBotOutput instead."),this._botTranscriptionWarned=!0),null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTranscript)||r.call(n,t),this.emit(cd.BotTranscript,t)},onBotLlmText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotLlmText)||r.call(n,t),this.emit(cd.BotLlmText,t)},onBotLlmStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStarted)||n.call(t),this.emit(cd.BotLlmStarted)},onBotLlmStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStopped)||n.call(t),this.emit(cd.BotLlmStopped)},onBotTtsText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTtsText)||r.call(n,t),this.emit(cd.BotTtsText,t)},onBotTtsStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStarted)||n.call(t),this.emit(cd.BotTtsStarted)},onBotTtsStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStopped)||n.call(t),this.emit(cd.BotTtsStopped)}});this._options=c(l({},e),{callbacks:i,enableMic:null==(t=e.enableMic)||t,enableCam:null!=(n=e.enableCam)&&n,enableScreenShare:null!=(r=e.enableScreenShare)&&r}),this._initialize(),Pd.debug("[Pipecat Client] Initialized",this.version)}setLogLevel(e){Pd.setLevel(e)}initDevices(){return d(this,null,function*(){Pd.debug("[Pipecat Client] Initializing devices..."),yield this._transport.initDevices()})}startBot(e){return d(this,null,function*(){var t,n,r,i,a,o;let s;this._transport.state="authenticating",this._transport.startBotParams=e,this._abortController=new AbortController;try{s=yield Ld(e,this._abortController)}catch(sr){let a,o="An unknown error occurred while starting the bot.";if(sr instanceof Response){const r=yield sr.json();o=null!=(n=null!=(t=r.info)?t:r.detail)?n:sr.statusText,a=sr.status}else sr instanceof Error&&(o=sr.message);throw null==(i=null==(r=this._options.callbacks)?void 0:r.onError)||i.call(r,new kd(md.ERROR_RESPONSE,{message:o,fatal:!0})),new nd(o,a)}return this._transport.state="authenticated",null==(o=null==(a=this._options.callbacks)?void 0:a.onBotStarted)||o.call(a,s),s})}connect(e){return d(this,null,function*(){return e&&Nd(e)?(Pd.warn("Calling connect with an API endpoint is deprecated. Use startBotAndConnect() instead."),this.startBotAndConnect(e)):new Promise((t,n)=>{(()=>{d(this,null,function*(){this._connectResolve=t,"disconnected"===this._transport.state&&(yield this._transport.initDevices());try{yield this._transport.connect(e),yield this._transport.sendReadyMessage()}catch(sr){return this.disconnect(),void n(sr)}})})()})})}startBotAndConnect(e){return d(this,null,function*(){"disconnected"===this._transport.state&&(yield this._transport.initDevices());const t=yield this.startBot(e);return this.connect(t)})}disconnect(){return d(this,null,function*(){yield this._transport.disconnect(),this._messageDispatcher.disconnect()})}_initialize(){this._transport.initialize(this._options,this.handleMessage.bind(this)),this._messageDispatcher=new Od(this._transport.sendMessage.bind(this._transport))}get connected(){return["connected","ready"].includes(this._transport.state)}get transport(){return this._transportWrapper.proxy}get state(){return this._transport.state}get version(){return Wu(Gu).version}getAllMics(){return d(this,null,function*(){return yield this._transport.getAllMics()})}getAllCams(){return d(this,null,function*(){return yield this._transport.getAllCams()})}getAllSpeakers(){return d(this,null,function*(){return yield this._transport.getAllSpeakers()})}get selectedMic(){return this._transport.selectedMic}get selectedCam(){return this._transport.selectedCam}get selectedSpeaker(){return this._transport.selectedSpeaker}updateMic(e){this._transport.updateMic(e)}updateCam(e){this._transport.updateCam(e)}updateSpeaker(e){this._transport.updateSpeaker(e)}enableMic(e){this._transport.enableMic(e)}get isMicEnabled(){return this._transport.isMicEnabled}enableCam(e){this._transport.enableCam(e)}get isCamEnabled(){return this._transport.isCamEnabled}tracks(){return this._transport.tracks()}enableScreenShare(e){return this._transport.enableScreenShare(e)}get isSharingScreen(){return this._transport.isSharingScreen}sendClientMessage(e,t){this._transport.sendMessage(new kd(md.CLIENT_MESSAGE,{t:e,d:t}))}sendClientRequest(e,t,n){return d(this,null,function*(){const r={t:e,d:t};return(yield this._messageDispatcher.dispatch(r,md.CLIENT_MESSAGE,n)).data.d})}registerFunctionCallHandler(e,t){this._functionCallCallbacks[e]=t}unregisterFunctionCallHandler(e){delete this._functionCallCallbacks[e]}unregisterAllFunctionCallHandlers(){this._functionCallCallbacks={}}appendToContext(e){return d(this,null,function*(){return Pd.warn("appendToContext() is deprecated. Use sendText() instead."),yield this._transport.sendMessage(new kd(md.APPEND_TO_CONTEXT,{role:e.role,content:e.content,run_immediately:e.run_immediately})),!0})}sendText(e){return d(this,arguments,function*(e,t={}){yield this._transport.sendMessage(new kd(md.SEND_TEXT,{content:e,options:t}))})}disconnectBot(){this._transport.sendMessage(new kd(md.DISCONNECT_BOT,{}))}handleMessage(e){var t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g,v,y,b,w,k,S,_,E,x,C,T,M,P,O,A,N,L,I,j,R,D,F,B,z,U;switch(Pd.debug("[RTVI Message]",e),e.type){case md.BOT_READY:{const i=e.data,a=i.version?i.version.split(".").map(Number):[0,0,0];Pd.debug(`[Pipecat Client] Bot is ready. Version: ${i.version}`),a[0]<1&&Pd.warn("[Pipecat Client] Bot version is less than 1.0.0, which may not be compatible with this client."),null==(t=this._connectResolve)||t.call(this,e.data),null==(r=null==(n=this._options.callbacks)?void 0:n.onBotReady)||r.call(n,e.data);break}case md.ERROR:null==(a=null==(i=this._options.callbacks)?void 0:i.onError)||a.call(i,e);break;case md.SERVER_RESPONSE:this._messageDispatcher.resolve(e);break;case md.ERROR_RESPONSE:{const t=this._messageDispatcher.reject(e);null==(s=null==(o=this._options.callbacks)?void 0:o.onMessageError)||s.call(o,t);break}case md.USER_STARTED_SPEAKING:null==(c=null==(l=this._options.callbacks)?void 0:l.onUserStartedSpeaking)||c.call(l);break;case md.USER_STOPPED_SPEAKING:null==(d=null==(u=this._options.callbacks)?void 0:u.onUserStoppedSpeaking)||d.call(u);break;case md.BOT_STARTED_SPEAKING:null==(p=null==(f=this._options.callbacks)?void 0:f.onBotStartedSpeaking)||p.call(f);break;case md.BOT_STOPPED_SPEAKING:null==(m=null==(h=this._options.callbacks)?void 0:h.onBotStoppedSpeaking)||m.call(h);break;case md.USER_TRANSCRIPTION:{const t=e.data;null==(v=null==(g=this._options.callbacks)?void 0:g.onUserTranscript)||v.call(g,t);break}case md.BOT_OUTPUT:null==(b=null==(y=this._options.callbacks)?void 0:y.onBotOutput)||b.call(y,e.data);break;case md.BOT_TRANSCRIPTION:null==(k=null==(w=this._options.callbacks)?void 0:w.onBotTranscript)||k.call(w,e.data);break;case md.BOT_LLM_TEXT:null==(_=null==(S=this._options.callbacks)?void 0:S.onBotLlmText)||_.call(S,e.data);break;case md.BOT_LLM_STARTED:null==(x=null==(E=this._options.callbacks)?void 0:E.onBotLlmStarted)||x.call(E);break;case md.BOT_LLM_STOPPED:null==(T=null==(C=this._options.callbacks)?void 0:C.onBotLlmStopped)||T.call(C);break;case md.BOT_TTS_TEXT:null==(P=null==(M=this._options.callbacks)?void 0:M.onBotTtsText)||P.call(M,e.data);break;case md.BOT_TTS_STARTED:null==(A=null==(O=this._options.callbacks)?void 0:O.onBotTtsStarted)||A.call(O);break;case md.BOT_TTS_STOPPED:null==(L=null==(N=this._options.callbacks)?void 0:N.onBotTtsStopped)||L.call(N);break;case md.METRICS:null==(j=null==(I=this._options.callbacks)?void 0:I.onMetrics)||j.call(I,e.data),this.emit(cd.Metrics,e.data);break;case md.SERVER_MESSAGE:null==(D=null==(R=this._options.callbacks)?void 0:R.onServerMessage)||D.call(R,e.data),this.emit(cd.ServerMessage,e.data);break;case md.LLM_FUNCTION_CALL:{const t=e.data,n=this._functionCallCallbacks[t.function_name];if(n){n({functionName:t.function_name,arguments:t.args}).then(e=>{null!=e&&this._transport.sendMessage(new kd(md.LLM_FUNCTION_CALL_RESULT,{function_name:t.function_name,tool_call_id:t.tool_call_id,arguments:t.args,result:e}))})}null==(B=null==(F=this._options.callbacks)?void 0:F.onLLMFunctionCall)||B.call(F,t),this.emit(cd.LLMFunctionCall,t);break}case md.BOT_LLM_SEARCH_RESPONSE:{const t=e.data;null==(U=null==(z=this._options.callbacks)?void 0:z.onBotLlmSearchResponse)||U.call(z,t),this.emit(cd.BotLlmSearchResponse,t);break}default:Pd.debug("[Pipecat Client] Unrecognized message type",e.type)}}}function Vd(e){return e&&e.__esModule?e.default:e}function $d(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}Bd([_d],Ud.prototype,"startBot",null),Bd([_d],Ud.prototype,"connect",null),Bd([_d],Ud.prototype,"startBotAndConnect",null),Bd([Sd],Ud.prototype,"sendClientMessage",null),Bd([Sd],Ud.prototype,"sendClientRequest",null),Bd([Sd],Ud.prototype,"appendToContext",null),Bd([Sd],Ud.prototype,"sendText",null),Bd([Sd],Ud.prototype,"disconnectBot",null),$u(Hu,Ju),$u(Hu,Ed),$u(Hu,Td),$u(Hu,Ad),$u(Hu,Id),$u(Hu,Dd);var Wd={};$d(Wd,"DailyRTVIMessageType",()=>sf),$d(Wd,"DailyTransport",()=>uf);class qd{static floatTo16BitPCM(e){const t=new ArrayBuffer(2*e.length),n=new DataView(t);let r=0;for(let i=0;i<e.length;i++,r+=2){let t=Math.max(-1,Math.min(1,e[i]));n.setInt16(r,t<0?32768*t:32767*t,!0)}return t}static mergeBuffers(e,t){const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer}_packData(e,t){return[new Uint8Array([t,t>>8]),new Uint8Array([t,t>>8,t>>16,t>>24])][e]}pack(e,t){if(!(null==t?void 0:t.bitsPerSample))throw new Error('Missing "bitsPerSample"');if(!(null==t?void 0:t.channels))throw new Error('Missing "channels"');if(!(null==t?void 0:t.data))throw new Error('Missing "data"');const{bitsPerSample:n,channels:r,data:i}=t,a=["RIFF",this._packData(1,52),"WAVE","fmt ",this._packData(1,16),this._packData(0,1),this._packData(0,r.length),this._packData(1,e),this._packData(1,e*r.length*n/8),this._packData(0,r.length*n/8),this._packData(0,n),"data",this._packData(1,r[0].length*r.length*n/8),i],o=new Blob(a,{type:"audio/mpeg"});return{blob:o,url:URL.createObjectURL(o),channelCount:r.length,sampleRate:e,duration:i.byteLength/(r.length*e*2)}}}globalThis.WavPacker=qd;const Hd=[4186.01,4434.92,4698.63,4978.03,5274.04,5587.65,5919.91,6271.93,6644.88,7040,7458.62,7902.13],Jd=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],Gd=[],Qd=[];for(let wf=1;wf<=8;wf++)for(let e=0;e<Hd.length;e++){const t=Hd[e];Gd.push(t/Math.pow(2,8-wf)),Qd.push(Jd[e]+wf)}const Yd=[32,2e3],Kd=Gd.filter((e,t)=>Gd[t]>Yd[0]&&Gd[t]<Yd[1]),Xd=Qd.filter((e,t)=>Gd[t]>Yd[0]&&Gd[t]<Yd[1]);class Zd{static getFrequencies(e,t,n,r="frequency",i=-100,a=-30){n||(n=new Float32Array(e.frequencyBinCount),e.getFloatFrequencyData(n));const o=t/2,s=1/n.length*o;let l,c,u;if("music"===r||"voice"===r){const e="voice"===r?Kd:Gd,t=Array(e.length).fill(i);for(let r=0;r<n.length;r++){const i=r*s,a=n[r];for(let n=e.length-1;n>=0;n--)if(i>e[n]){t[n]=Math.max(t[n],a);break}}l=t,c="voice"===r?Kd:Gd,u="voice"===r?Xd:Qd}else l=Array.from(n),c=l.map((e,t)=>s*t),u=c.map(e=>`${e.toFixed(2)} Hz`);const d=l.map(e=>Math.max(0,Math.min((e-i)/(a-i),1)));return{values:new Float32Array(d),frequencies:c,labels:u}}constructor(e,t=null){if(this.fftResults=[],t){const{length:n,sampleRate:r}=t,i=new OfflineAudioContext({length:n,sampleRate:r}),a=i.createBufferSource();a.buffer=t;const o=i.createAnalyser();o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o);const s=1/60,l=n/r,c=e=>{const t=s*e;t<l&&i.suspend(t).then(()=>{const t=new Float32Array(o.frequencyBinCount);o.getFloatFrequencyData(t),this.fftResults.push(t),c(e+1)}),1===e?i.startRendering():i.resume()};a.start(0),c(1),this.audio=e,this.context=i,this.analyser=o,this.sampleRate=r,this.audioBuffer=t}else{const t=new AudioContext,n=t.createMediaElementSource(e),r=t.createAnalyser();r.fftSize=8192,r.smoothingTimeConstant=.1,n.connect(r),r.connect(t.destination),this.audio=e,this.context=t,this.analyser=r,this.sampleRate=this.context.sampleRate,this.audioBuffer=null}}getFrequencies(e="frequency",t=-100,n=-30){let r=null;if(this.audioBuffer&&this.fftResults.length){const e=this.audio.currentTime/this.audio.duration,t=Math.min(e*this.fftResults.length|0,this.fftResults.length-1);r=this.fftResults[t]}return Zd.getFrequencies(this.analyser,this.sampleRate,r,e,t,n)}resumeIfSuspended(){return d(this,null,function*(){return"suspended"===this.context.state&&(yield this.context.resume()),!0})}}globalThis.AudioAnalysis=Zd;const ef=new Blob(["\nclass StreamProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.hasStarted = false;\n this.hasInterrupted = false;\n this.outputBuffers = [];\n this.bufferLength = 128;\n this.write = { buffer: new Float32Array(this.bufferLength), trackId: null };\n this.writeOffset = 0;\n this.trackSampleOffsets = {};\n this.port.onmessage = (event) => {\n if (event.data) {\n const payload = event.data;\n if (payload.event === 'write') {\n const int16Array = payload.buffer;\n const float32Array = new Float32Array(int16Array.length);\n for (let i = 0; i < int16Array.length; i++) {\n float32Array[i] = int16Array[i] / 0x8000; // Convert Int16 to Float32\n }\n this.writeData(float32Array, payload.trackId);\n } else if (\n payload.event === 'offset' ||\n payload.event === 'interrupt'\n ) {\n const requestId = payload.requestId;\n const trackId = this.write.trackId;\n const offset = this.trackSampleOffsets[trackId] || 0;\n this.port.postMessage({\n event: 'offset',\n requestId,\n trackId,\n offset,\n });\n if (payload.event === 'interrupt') {\n this.hasInterrupted = true;\n }\n } else {\n throw new Error(`Unhandled event \"${payload.event}\"`);\n }\n }\n };\n }\n\n writeData(float32Array, trackId = null) {\n let { buffer } = this.write;\n let offset = this.writeOffset;\n for (let i = 0; i < float32Array.length; i++) {\n buffer[offset++] = float32Array[i];\n if (offset >= buffer.length) {\n this.outputBuffers.push(this.write);\n this.write = { buffer: new Float32Array(this.bufferLength), trackId };\n buffer = this.write.buffer;\n offset = 0;\n }\n }\n this.writeOffset = offset;\n return true;\n }\n\n process(inputs, outputs, parameters) {\n const output = outputs[0];\n const outputChannelData = output[0];\n const outputBuffers = this.outputBuffers;\n if (this.hasInterrupted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else if (outputBuffers.length) {\n this.hasStarted = true;\n const { buffer, trackId } = outputBuffers.shift();\n for (let i = 0; i < outputChannelData.length; i++) {\n outputChannelData[i] = buffer[i] || 0;\n }\n if (trackId) {\n this.trackSampleOffsets[trackId] =\n this.trackSampleOffsets[trackId] || 0;\n this.trackSampleOffsets[trackId] += buffer.length;\n }\n return true;\n } else if (this.hasStarted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else {\n return true;\n }\n }\n}\n\nregisterProcessor('stream_processor', StreamProcessor);\n"],{type:"application/javascript"}),tf=URL.createObjectURL(ef);globalThis.WavStreamPlayer=class{constructor({sampleRate:e=44100}={}){this.scriptSrc=tf,this.sampleRate=e,this.context=null,this.stream=null,this.analyser=null,this.trackSampleOffsets={},this.interruptedTrackIds={}}connect(){return d(this,null,function*(){this.context=new AudioContext({sampleRate:this.sampleRate}),this._speakerID&&this.context.setSinkId(this._speakerID),"suspended"===this.context.state&&(yield this.context.resume());try{yield this.context.audioWorklet.addModule(this.scriptSrc)}catch(sr){throw console.error(sr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const e=this.context.createAnalyser();return e.fftSize=8192,e.smoothingTimeConstant=.1,this.analyser=e,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.analyser)throw new Error("Not connected, please call .connect() first");return Zd.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}updateSpeaker(e){return d(this,null,function*(){const t=this._speakerID;if(this._speakerID=e,this.context)try{"default"===e?yield this.context.setSinkId():yield this.context.setSinkId(e)}catch(sr){console.error(`Could not set sinkId to ${e}: ${sr}`),this._speakerID=t}})}_start(){const e=new AudioWorkletNode(this.context,"stream_processor");return e.connect(this.context.destination),e.port.onmessage=t=>{const{event:n}=t.data;if("stop"===n)e.disconnect(),this.stream=null;else if("offset"===n){const{requestId:e,trackId:n,offset:r}=t.data,i=r/this.sampleRate;this.trackSampleOffsets[e]={trackId:n,offset:r,currentTime:i}}},this.analyser.disconnect(),e.connect(this.analyser),this.stream=e,!0}add16BitPCM(e,t="default"){if("string"!=typeof t)throw new Error("trackId must be a string");if(this.interruptedTrackIds[t])return;let n;if(this.stream||this._start(),e instanceof Int16Array)n=e;else{if(!(e instanceof ArrayBuffer))throw new Error("argument must be Int16Array or ArrayBuffer");n=new Int16Array(e)}return this.stream.port.postMessage({event:"write",buffer:n,trackId:t}),n}getTrackSampleOffset(e=!1){return d(this,null,function*(){if(!this.stream)return null;const t=crypto.randomUUID();let n;for(this.stream.port.postMessage({event:e?"interrupt":"offset",requestId:t});!n;)n=this.trackSampleOffsets[t],yield new Promise(e=>setTimeout(()=>e(),1));const{trackId:r}=n;return e&&r&&(this.interruptedTrackIds[r]=!0),n})}interrupt(){return d(this,null,function*(){return this.getTrackSampleOffset(!0)})}};const nf=new Blob(["\nclass AudioProcessor extends AudioWorkletProcessor {\n\n constructor() {\n super();\n this.port.onmessage = this.receive.bind(this);\n this.initialize();\n }\n\n initialize() {\n this.foundAudio = false;\n this.recording = false;\n this.chunks = [];\n }\n\n /**\n * Concatenates sampled chunks into channels\n * Format is chunk[Left[], Right[]]\n */\n readChannelData(chunks, channel = -1, maxChannels = 9) {\n let channelLimit;\n if (channel !== -1) {\n if (chunks[0] && chunks[0].length - 1 < channel) {\n throw new Error(\n `Channel ${channel} out of range: max ${chunks[0].length}`\n );\n }\n channelLimit = channel + 1;\n } else {\n channel = 0;\n channelLimit = Math.min(chunks[0] ? chunks[0].length : 1, maxChannels);\n }\n const channels = [];\n for (let n = channel; n < channelLimit; n++) {\n const length = chunks.reduce((sum, chunk) => {\n return sum + chunk[n].length;\n }, 0);\n const buffers = chunks.map((chunk) => chunk[n]);\n const result = new Float32Array(length);\n let offset = 0;\n for (let i = 0; i < buffers.length; i++) {\n result.set(buffers[i], offset);\n offset += buffers[i].length;\n }\n channels[n] = result;\n }\n return channels;\n }\n\n /**\n * Combines parallel audio data into correct format,\n * channels[Left[], Right[]] to float32Array[LRLRLRLR...]\n */\n formatAudioData(channels) {\n if (channels.length === 1) {\n // Simple case is only one channel\n const float32Array = channels[0].slice();\n const meanValues = channels[0].slice();\n return { float32Array, meanValues };\n } else {\n const float32Array = new Float32Array(\n channels[0].length * channels.length\n );\n const meanValues = new Float32Array(channels[0].length);\n for (let i = 0; i < channels[0].length; i++) {\n const offset = i * channels.length;\n let meanValue = 0;\n for (let n = 0; n < channels.length; n++) {\n float32Array[offset + n] = channels[n][i];\n meanValue += channels[n][i];\n }\n meanValues[i] = meanValue / channels.length;\n }\n return { float32Array, meanValues };\n }\n }\n\n /**\n * Converts 32-bit float data to 16-bit integers\n */\n floatTo16BitPCM(float32Array) {\n const buffer = new ArrayBuffer(float32Array.length * 2);\n const view = new DataView(buffer);\n let offset = 0;\n for (let i = 0; i < float32Array.length; i++, offset += 2) {\n let s = Math.max(-1, Math.min(1, float32Array[i]));\n view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true);\n }\n return buffer;\n }\n\n /**\n * Retrieves the most recent amplitude values from the audio stream\n * @param {number} channel\n */\n getValues(channel = -1) {\n const channels = this.readChannelData(this.chunks, channel);\n const { meanValues } = this.formatAudioData(channels);\n return { meanValues, channels };\n }\n\n /**\n * Exports chunks as an audio/wav file\n */\n export() {\n const channels = this.readChannelData(this.chunks);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const audioData = this.floatTo16BitPCM(float32Array);\n return {\n meanValues: meanValues,\n audio: {\n bitsPerSample: 16,\n channels: channels,\n data: audioData,\n },\n };\n }\n\n receive(e) {\n const { event, id } = e.data;\n let receiptData = {};\n switch (event) {\n case 'start':\n this.recording = true;\n break;\n case 'stop':\n this.recording = false;\n break;\n case 'clear':\n this.initialize();\n break;\n case 'export':\n receiptData = this.export();\n break;\n case 'read':\n receiptData = this.getValues();\n break;\n default:\n break;\n }\n // Always send back receipt\n this.port.postMessage({ event: 'receipt', id, data: receiptData });\n }\n\n sendChunk(chunk) {\n const channels = this.readChannelData([chunk]);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const rawAudioData = this.floatTo16BitPCM(float32Array);\n const monoAudioData = this.floatTo16BitPCM(meanValues);\n this.port.postMessage({\n event: 'chunk',\n data: {\n mono: monoAudioData,\n raw: rawAudioData,\n },\n });\n }\n\n process(inputList, outputList, parameters) {\n // Copy input to output (e.g. speakers)\n // Note that this creates choppy sounds with Mac products\n const sourceLimit = Math.min(inputList.length, outputList.length);\n for (let inputNum = 0; inputNum < sourceLimit; inputNum++) {\n const input = inputList[inputNum];\n const output = outputList[inputNum];\n const channelCount = Math.min(input.length, output.length);\n for (let channelNum = 0; channelNum < channelCount; channelNum++) {\n input[channelNum].forEach((sample, i) => {\n output[channelNum][i] = sample;\n });\n }\n }\n const inputs = inputList[0];\n // There's latency at the beginning of a stream before recording starts\n // Make sure we actually receive audio data before we start storing chunks\n let sliceIndex = 0;\n if (!this.foundAudio) {\n for (const channel of inputs) {\n sliceIndex = 0; // reset for each channel\n if (this.foundAudio) {\n break;\n }\n if (channel) {\n for (const value of channel) {\n if (value !== 0) {\n // find only one non-zero entry in any channel\n this.foundAudio = true;\n break;\n } else {\n sliceIndex++;\n }\n }\n }\n }\n }\n if (inputs && inputs[0] && this.foundAudio && this.recording) {\n // We need to copy the TypedArray, because the `process`\n // internals will reuse the same buffer to hold each input\n const chunk = inputs.map((input) => input.slice(sliceIndex));\n this.chunks.push(chunk);\n this.sendChunk(chunk);\n }\n return true;\n }\n}\n\nregisterProcessor('audio_processor', AudioProcessor);\n"],{type:"application/javascript"}),rf=URL.createObjectURL(nf);globalThis.WavRecorder=class{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=rf,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this._deviceChangeCallback=null,this._deviceErrorCallback=null,this._devices=[],this.deviceSelection=null,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}static decode(e,t=44100,n=-1){return d(this,null,function*(){const r=new AudioContext({sampleRate:t});let i,a;if(e instanceof Blob){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from Blob');a=e,i=yield a.arrayBuffer()}else if(e instanceof ArrayBuffer){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from ArrayBuffer');i=e,a=new Blob([i],{type:"audio/wav"})}else{let t,r;if(e instanceof Int16Array){r=e,t=new Float32Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n]/32768}else if(e instanceof Float32Array)t=e;else{if(!(e instanceof Array))throw new Error('"audioData" must be one of: Blob, Float32Arrray, Int16Array, ArrayBuffer, Array<number>');t=new Float32Array(e)}if(-1===n)throw new Error('Must specify "fromSampleRate" when reading from Float32Array, In16Array or Array');if(n<3e3)throw new Error('Minimum "fromSampleRate" is 3000 (3kHz)');r||(r=qd.floatTo16BitPCM(t));const o={bitsPerSample:16,channels:[t],data:r};a=(new qd).pack(n,o).blob,i=yield a.arrayBuffer()}const o=yield r.decodeAudioData(i),s=o.getChannelData(0);return{blob:a,url:URL.createObjectURL(a),values:s,audioBuffer:o}})}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}listenForDeviceChange(e){if(null===e&&this._deviceChangeCallback)navigator.mediaDevices.removeEventListener("devicechange",this._deviceChangeCallback),this._deviceChangeCallback=null;else if(null!==e){let t=0,n=[];const r=e=>e.map(e=>e.deviceId).sort().join(","),i=()=>d(this,null,function*(){let i=++t;const a=yield this.listDevices();i===t&&r(n)!==r(a)&&(n=a,e(a.slice()))});navigator.mediaDevices.addEventListener("devicechange",i),i(),this._deviceChangeCallback=i}return!0}listenForDeviceErrors(e){this._deviceErrorCallback=e}requestPermission(){return d(this,null,function*(){const e=yield navigator.permissions.query({name:"microphone"});if("denied"===e.state)this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:new Error("Microphone access denied")});else if("prompt"===e.state)try{const e=yield navigator.mediaDevices.getUserMedia({audio:!0});e.getTracks().forEach(e=>e.stop())}catch(sr){console.error("Error accessing microphone."),this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:sr})}return!0})}listDevices(){return d(this,null,function*(){if(!navigator.mediaDevices||!("enumerateDevices"in navigator.mediaDevices))throw new Error("Could not request user devices");yield this.requestPermission();return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind)})}begin(e){return d(this,null,function*(){var t;if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!navigator.mediaDevices||!("getUserMedia"in navigator.mediaDevices))throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic","cam"],type:"undefined-mediadevices"}),new Error("Could not request user media");e=null!=e?e:null==(t=this.deviceSelection)?void 0:t.deviceId;try{const t={audio:!0};e&&(t.audio={deviceId:{exact:e}}),this.stream=yield navigator.mediaDevices.getUserMedia(t)}catch(s){throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:s}),new Error("Could not start media stream")}this.listDevices().then(t=>{e=this.stream.getAudioTracks()[0].getSettings().deviceId,console.log("find current device",t,e,this.stream.getAudioTracks()[0].getSettings()),this.deviceSelection=t.find(t=>t.deviceId===e),console.log("current device",this.deviceSelection)});const n=new AudioContext({sampleRate:this.sampleRate}),r=n.createMediaStreamSource(this.stream);try{yield n.audioWorklet.addModule(this.scriptSrc)}catch(sr){throw console.error(sr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const i=new AudioWorkletNode(n,"audio_processor");i.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:qd.mergeBuffers(e.raw,r.raw),mono:qd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const a=r.connect(i),o=n.createAnalyser();return o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),o.connect(n.destination)),this.source=r,this.node=a,this.analyser=o,this.processor=i,console.log("begin completed"),!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return Zd.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new qd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1;this.stream.getTracks().forEach(e=>e.stop()),this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new qd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.deviceSelection=null,this.processor&&(yield this.end()),!0})}};class af{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=rf,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}begin(e){return d(this,null,function*(){if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!e||"audio"!==e.kind)throw new Error("No audio track provided");this.stream=new MediaStream([e]);const t=new AudioContext({sampleRate:this.sampleRate}),n=t.createMediaStreamSource(this.stream);try{yield t.audioWorklet.addModule(this.scriptSrc)}catch(sr){throw console.error(sr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const r=new AudioWorkletNode(t,"audio_processor");r.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:qd.mergeBuffers(e.raw,r.raw),mono:qd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const i=n.connect(r),a=t.createAnalyser();return a.fftSize=8192,a.smoothingTimeConstant=.1,i.connect(a),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),a.connect(t.destination)),this.source=n,this.node=i,this.analyser=a,this.processor=r,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return Zd.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: HELLO please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new qd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1,this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new qd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.processor&&(yield this.end()),!0})}}globalThis.WavRecorder=WavRecorder;var of,sf,lf;of=JSON.parse('{"name":"@pipecat-ai/daily-transport","version":"1.5.0","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"src/index.ts","repository":{"type":"git","url":"git+https://github.com/pipecat-ai/pipecat-client-web-transports.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"parcel build --no-cache","dev":"parcel watch","lint":"eslint . --ext ts --report-unused-disable-directives --max-warnings 0"},"devDependencies":{"@pipecat-ai/client-js":"^1.5.0","eslint":"9.39.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"@pipecat-ai/client-js":"~1.5.0"},"dependencies":{"@daily-co/daily-js":"^0.84.0"},"description":"Pipecat Daily Transport Package","author":"Daily.co","bugs":{"url":"https://github.com/pipecat-ai/pipecat-client-web-transports/issues"},"homepage":"https://github.com/pipecat-ai/pipecat-client-web-transports/blob/main/transports/daily-webrtc/README.md"}'),(lf=sf||(sf={})).AUDIO_BUFFERING_STARTED="audio-buffering-started",lf.AUDIO_BUFFERING_STOPPED="audio-buffering-stopped";class cf{constructor(e){this._daily=e,this._proxy=new Proxy(this._daily,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"preAuth":n="Calls to preAuth() are disabled. Please use Transport.preAuth()";break;case"startCamera":n="Calls to startCamera() are disabled. Please use PipecatClient.initDevices()";break;case"join":n="Calls to join() are disabled. Please use PipecatClient.connect()";break;case"leave":n="Calls to leave() are disabled. Please use PipecatClient.disconnect()";break;case"destroy":n="Calls to destroy() are disabled."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}class uf extends jd{constructor(e={}){var t;super(),this._botId="",this._selectedCam={},this._selectedMic={},this._selectedSpeaker={},this._currentAudioTrack=null,this._audioQueue=[],this._callbacks={};const n=e,{bufferLocalAudioUntilBotReady:r}=n,i=u(n,["bufferLocalAudioUntilBotReady"]);this._dailyFactoryOptions=i,void 0===(null==(t=this._dailyFactoryOptions.dailyConfig)?void 0:t.useDevicePreferenceCookies)&&(null==this._dailyFactoryOptions.dailyConfig&&(this._dailyFactoryOptions.dailyConfig={}),this._dailyFactoryOptions.dailyConfig.useDevicePreferenceCookies=!0),this._bufferLocalAudioUntilBotReady=r||!1,this._daily=Wc.createCallObject(c(l({},this._dailyFactoryOptions),{allowMultipleCallInstances:!0})),this._dailyWrapper=new cf(this._daily)}setupRecorder(){this._mediaStreamRecorder=new af({sampleRate:uf.RECORDER_SAMPLE_RATE})}handleUserAudioStream(e){this._audioQueue.push(e)}flushAudioQueue(){if(0!==this._audioQueue.length)for(Pd.debug(`Will flush audio queue: ${this._audioQueue.length}`);this._audioQueue.length>0;){const e=[];for(;e.length<10&&this._audioQueue.length>0;){const t=this._audioQueue.shift();t&&e.push(t)}e.length>0&&this._sendAudioBatch(e)}}_sendAudioBatch(e){const t={id:"raw-audio-batch",label:"rtvi-ai",type:"raw-audio-batch",data:{base64AudioBatch:e.map(e=>{const t=new Uint8Array(e);return btoa(String.fromCharCode(...t))}),sampleRate:uf.RECORDER_SAMPLE_RATE,numChannels:1}};this.sendMessage(t)}initialize(e,t){var n,r,i;this._bufferLocalAudioUntilBotReady&&this.setupRecorder(),this._callbacks=null!=(n=e.callbacks)?n:{},this._onMessage=t,null!=this._dailyFactoryOptions.startVideoOff&&null==e.enableCam||(this._dailyFactoryOptions.startVideoOff=!(null!=(r=e.enableCam)&&r)),null!=this._dailyFactoryOptions.startAudioOff&&null==e.enableMic||(this._dailyFactoryOptions.startAudioOff=!(null==(i=e.enableMic)||i)),this.attachEventListeners(),this.state="disconnected",Pd.debug("[Daily Transport] Initialized",Vd(of).version)}get dailyCallClient(){return this._dailyWrapper.proxy}get state(){return this._state}set state(e){var t,n;this._state!==e&&(this._state=e,null==(n=(t=this._callbacks).onTransportStateChanged)||n.call(t,e))}getSessionInfo(){return this._daily.meetingSessionSummary()}getAllCams(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"videoinput"===e.kind)})}updateCam(e){this._daily.setInputDevicesAsync({videoDeviceId:e}).then(e=>{this._selectedCam=e.camera})}get selectedCam(){return this._selectedCam}getAllMics(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audioinput"===e.kind)})}updateMic(e){this._daily.setInputDevicesAsync({audioDeviceId:e}).then(e=>{this._selectedMic=e.mic})}get selectedMic(){return this._selectedMic}getAllSpeakers(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audiooutput"===e.kind)})}updateSpeaker(e){this._daily.setOutputDeviceAsync({outputDeviceId:e}).then(e=>{this._selectedSpeaker=e.speaker}).catch(e=>{var t,n,r;null==(r=(n=this._callbacks).onDeviceError)||r.call(n,new ld(["speaker"],null!=(t=e.type)?t:"unknown",e.message))})}get selectedSpeaker(){return this._selectedSpeaker}enableMic(e){this._daily.setLocalAudio(e)}get isMicEnabled(){return this._daily.localAudio()}enableCam(e){this._daily.setLocalVideo(e)}get isCamEnabled(){return this._daily.localVideo()}enableScreenShare(e){e?this._daily.startScreenShare():this._daily.stopScreenShare()}get isSharingScreen(){return this._daily.localScreenAudio()||this._daily.localScreenVideo()}tracks(){var e,t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g;const v=null!=(e=this._daily.participants())?e:{},y=null==v?void 0:v[this._botId],b={local:{audio:null==(r=null==(n=null==(t=null==v?void 0:v.local)?void 0:t.tracks)?void 0:n.audio)?void 0:r.persistentTrack,screenAudio:null==(o=null==(a=null==(i=null==v?void 0:v.local)?void 0:i.tracks)?void 0:a.screenAudio)?void 0:o.persistentTrack,screenVideo:null==(c=null==(l=null==(s=null==v?void 0:v.local)?void 0:s.tracks)?void 0:l.screenVideo)?void 0:c.persistentTrack,video:null==(f=null==(d=null==(u=null==v?void 0:v.local)?void 0:u.tracks)?void 0:d.video)?void 0:f.persistentTrack}};return y&&(b.bot={audio:null==(h=null==(p=null==y?void 0:y.tracks)?void 0:p.audio)?void 0:h.persistentTrack,video:null==(g=null==(m=null==y?void 0:y.tracks)?void 0:m.video)?void 0:g.persistentTrack}),b}startRecording(){return d(this,null,function*(){var e,t;try{Pd.info("[Daily Transport] Initializing recording"),yield this._mediaStreamRecorder.record(e=>{this.handleUserAudioStream(e.mono)},uf.RECORDER_CHUNK_SIZE),null==(t=(e=this._callbacks).onAudioBufferingStarted)||t.call(e),Pd.info("[Daily Transport] Recording Initialized")}catch(sr){sr.message.includes("Already recording")||Pd.error("Error starting recording",sr)}})}preAuth(e){return d(this,null,function*(){this._dailyFactoryOptions=e,yield this._daily.preAuth(e)})}initDevices(){return d(this,null,function*(){var e,t,n,r,i,a,o,s,l,c,u,d;if(!this._daily)throw new ed("Transport instance not initialized");this.state="initializing";const f=yield this._daily.startCamera(this._dailyFactoryOptions),{devices:p}=yield this._daily.enumerateDevices(),h=p.filter(e=>"videoinput"===e.kind),m=p.filter(e=>"audioinput"===e.kind),g=p.filter(e=>"audiooutput"===e.kind);this._selectedCam=f.camera,this._selectedMic=f.mic,this._selectedSpeaker=f.speaker,null==(t=(e=this._callbacks).onAvailableCamsUpdated)||t.call(e,h),null==(r=(n=this._callbacks).onAvailableMicsUpdated)||r.call(n,m),null==(a=(i=this._callbacks).onAvailableSpeakersUpdated)||a.call(i,g),null==(s=(o=this._callbacks).onCamUpdated)||s.call(o,f.camera),null==(c=(l=this._callbacks).onMicUpdated)||c.call(l,f.mic),null==(d=(u=this._callbacks).onSpeakerUpdated)||d.call(u,f.speaker),this._daily.isLocalAudioLevelObserverRunning()||(yield this._daily.startLocalAudioLevelObserver(100)),this._daily.isRemoteParticipantsAudioLevelObserverRunning()||(yield this._daily.startRemoteParticipantsAudioLevelObserver(100)),this.state="initialized"})}_validateConnectionParams(e){if(null==e)return;if("object"!=typeof e)throw new ed("Invalid connection parameters");const t=e;return t.room_url?(t.url=t.room_url,delete t.room_url):t.dailyRoom&&(t.url=t.dailyRoom,delete t.dailyRoom),t.dailyToken&&(t.token=t.dailyToken,delete t.dailyToken),t.token||delete t.token,t}_connect(e){return d(this,null,function*(){var t,n,r;if(!this._daily)throw new ed("Transport instance not initialized");e&&(this._dailyFactoryOptions=l(l({},this._dailyFactoryOptions),e)),this.state="connecting";try{yield this._daily.join(this._dailyFactoryOptions)}catch(sr){throw Pd.error("Failed to join room",sr),this.state="error",new rd}(null==(t=this._abortController)?void 0:t.signal.aborted)||(this.state="connected",null==(r=(n=this._callbacks).onConnected)||r.call(n))})}sendReadyMessage(){return d(this,null,function*(){return new Promise(e=>{var t,n;const r=()=>{this.state="ready",this.flushAudioQueue(),this.sendMessage(kd.clientReady()),this.stopRecording(),e()};for(const a in this._daily.participants()){const i=this._daily.participants()[a];if(!i.local&&(null==(n=null==(t=i.tracks)?void 0:t.audio)?void 0:n.persistentTrack))return r(),void e()}const i=e=>{var t;(null==(t=e.participant)?void 0:t.local)||(this._daily.off("track-started",i),(()=>{const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document})()?(Pd.debug("[Daily Transport] iOS device detected, adding 0.5 second delay before sending ready message"),setTimeout(r,500)):r())};this._daily.on("track-started",i)})})}stopRecording(){var e,t;this._mediaStreamRecorder&&"ended"!==this._mediaStreamRecorder.getStatus()&&(this._mediaStreamRecorder.end(),null==(t=(e=this._callbacks).onAudioBufferingStopped)||t.call(e))}attachEventListeners(){this._daily.on("available-devices-updated",this.handleAvailableDevicesUpdated.bind(this)),this._daily.on("selected-devices-updated",this.handleSelectedDevicesUpdated.bind(this)),this._daily.on("camera-error",this.handleDeviceError.bind(this)),this._daily.on("track-started",this.handleTrackStarted.bind(this)),this._daily.on("track-stopped",this.handleTrackStopped.bind(this)),this._daily.on("participant-joined",this.handleParticipantJoined.bind(this)),this._daily.on("participant-left",this.handleParticipantLeft.bind(this)),this._daily.on("local-audio-level",this.handleLocalAudioLevel.bind(this)),this._daily.on("remote-participants-audio-level",this.handleRemoteAudioLevel.bind(this)),this._daily.on("app-message",this.handleAppMessage.bind(this)),this._daily.on("left-meeting",this.handleLeftMeeting.bind(this)),this._daily.on("error",this.handleFatalError.bind(this)),this._daily.on("nonfatal-error",this.handleNonFatalError.bind(this))}_disconnect(){return d(this,null,function*(){this.state="disconnecting",this._daily.stopLocalAudioLevelObserver(),this._daily.stopRemoteParticipantsAudioLevelObserver(),this._audioQueue=[],this._currentAudioTrack=null,this.stopRecording(),yield this._daily.leave()})}sendMessage(e){this._daily.sendAppMessage(e,"*")}handleAppMessage(e){"rtvi-ai"===e.data.label&&this._onMessage({id:e.data.id,type:e.data.type,data:e.data.data})}handleAvailableDevicesUpdated(e){var t,n,r,i,a,o;null==(n=(t=this._callbacks).onAvailableCamsUpdated)||n.call(t,e.availableDevices.filter(e=>"videoinput"===e.kind)),null==(i=(r=this._callbacks).onAvailableMicsUpdated)||i.call(r,e.availableDevices.filter(e=>"audioinput"===e.kind)),null==(o=(a=this._callbacks).onAvailableSpeakersUpdated)||o.call(a,e.availableDevices.filter(e=>"audiooutput"===e.kind))}handleSelectedDevicesUpdated(e){var t,n,r,i,a,o,s,l,c;(null==(t=this._selectedCam)?void 0:t.deviceId)!==e.devices.camera&&(this._selectedCam=e.devices.camera,null==(r=(n=this._callbacks).onCamUpdated)||r.call(n,e.devices.camera)),(null==(i=this._selectedMic)?void 0:i.deviceId)!==e.devices.mic&&(this._selectedMic=e.devices.mic,null==(o=(a=this._callbacks).onMicUpdated)||o.call(a,e.devices.mic)),(null==(s=this._selectedSpeaker)?void 0:s.deviceId)!==e.devices.speaker&&(this._selectedSpeaker=e.devices.speaker,null==(c=(l=this._callbacks).onSpeakerUpdated)||c.call(l,e.devices.speaker))}handleDeviceError(e){var t,n;null==(n=(t=this._callbacks).onDeviceError)||n.call(t,(e=>{const t=[];switch(e.type){case"permissions":return e.blockedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new ld(t,e.type,e.msg,{blockedBy:e.blockedBy});case"not-found":return e.missingMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new ld(t,e.type,e.msg);case"constraints":return e.failedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new ld(t,e.type,e.msg,{reason:e.reason});case"cam-in-use":return t.push("cam"),new ld(t,"in-use",e.msg);case"mic-in-use":return t.push("mic"),new ld(t,"in-use",e.msg);case"cam-mic-in-use":return t.push("cam"),t.push("mic"),new ld(t,"in-use",e.msg);default:return t.push("cam"),t.push("mic"),new ld(t,e.type,e.msg)}})(e.error))}handleLocalAudioTrack(e){return d(this,null,function*(){if("ready"==this.state||!this._bufferLocalAudioUntilBotReady)return;switch(this._mediaStreamRecorder.getStatus()){case"ended":try{yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(sr){}break;case"paused":yield this.startRecording();break;default:if(this._currentAudioTrack!==e)try{yield this._mediaStreamRecorder.end(),yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(sr){}else Pd.warn("track-started event received for current track and already recording")}this._currentAudioTrack=e})}handleTrackStarted(e){var t,n,r,i,a;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStarted)||n.call(t,e.track,e.participant?df(e.participant):void 0):((null==(r=e.participant)?void 0:r.local)&&"audio"===e.track.kind&&this.handleLocalAudioTrack(e.track),null==(a=(i=this._callbacks).onTrackStarted)||a.call(i,e.track,e.participant?df(e.participant):void 0))}handleTrackStopped(e){var t,n,r,i;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStopped)||n.call(t,e.track,e.participant?df(e.participant):void 0):null==(i=(r=this._callbacks).onTrackStopped)||i.call(r,e.track,e.participant?df(e.participant):void 0)}handleParticipantJoined(e){var t,n,r,i;const a=df(e.participant);null==(n=(t=this._callbacks).onParticipantJoined)||n.call(t,a),a.local||(this._botId=e.participant.session_id,null==(i=(r=this._callbacks).onBotConnected)||i.call(r,a))}handleParticipantLeft(e){var t,n,r,i;const a=df(e.participant);null==(n=(t=this._callbacks).onParticipantLeft)||n.call(t,a),a.local||(this._botId="",null==(i=(r=this._callbacks).onBotDisconnected)||i.call(r,a))}handleLocalAudioLevel(e){var t,n;null==(n=(t=this._callbacks).onLocalAudioLevel)||n.call(t,e.audioLevel)}handleRemoteAudioLevel(e){var t,n;const r=this._daily.participants(),i=Object.keys(e.participantsAudioLevel);for(let a=0;a<i.length;a++){const o=i[a],s=e.participantsAudioLevel[o];null==(n=(t=this._callbacks).onRemoteAudioLevel)||n.call(t,s,df(r[o]))}}handleLeftMeeting(){var e,t;this.state="disconnected",this._botId="",null==(t=(e=this._callbacks).onDisconnected)||t.call(e)}handleFatalError(e){var t,n;Pd.error("Daily fatal error",e.errorMsg),this.state="error",this._botId="",null==(n=(t=this._callbacks).onError)||n.call(t,kd.error(e.errorMsg,!0))}handleNonFatalError(e){var t,n;if("screen-share-error"===e.type)null==(n=(t=this._callbacks).onScreenShareError)||n.call(t,e.errorMsg)}}uf.RECORDER_SAMPLE_RATE=16e3,uf.RECORDER_CHUNK_SIZE=512;const df=e=>({id:e.user_id,local:e.local,name:e.user_name});function ff(e,t,n={}){const{pipecatClient:r,connectionState:i,isBotReady:a,isMicEnabled:o,remoteAudioStream:s,addMessage:u,setPipecatClient:f,setConnectionState:p,setIsBotReady:h,setIsMicEnabled:m,setRemoteAudioStream:g}=H(),v=E.useRef(null),y=E.useRef(!1),b=E.useRef(null),w=E.useRef(!1);E.useEffect(()=>{const e=v.current;if(e&&s)try{G("🔊 Attaching remote audio stream"),e.srcObject=s,e.volume=1;const t=e.play();t&&t.then(()=>{G("✅ Remote audio playback started")}).catch(e=>{((...e)=>{console.warn("[EigiChat Warning]",...e)})("⚠️ Autoplay prevented:",e)})}catch(t){Q("❌ Failed to attach remote audio:",t)}return()=>{e&&(e.srcObject=null)}},[s]);const k=E.useCallback(()=>d(null,null,function*(){var r;if(w.current)G("⚠️ Call start already in progress, skipping");else if("disconnected"===i){w.current=!0,p("connecting");try{if(!e||!t)throw new Error("Missing agent ID or prompt token");const r={agent_id:e,conversation_metadata:c(l({},n),{agent_id:e}),prompt_access_token:t,conversation_visibility:!1,conversation_config_type:"VOICE"};G("📡 Creating Daily session...");const i=yield function(e){return d(this,null,function*(){const t=`${Y}/v1/widgets/sessions/daily`;G("📡 Creating Daily session with payload:",e);const n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":e.prompt_access_token},body:JSON.stringify(e)});if(!n.ok){const e=yield n.json().catch(()=>({}));throw new Error(e.detail||e.message||`HTTP ${n.status}`)}const r=yield n.json();return G("✅ Daily session created:",r.conversation_id),r})}(r);if(!(null==i?void 0:i.dailyRoom)||!(null==i?void 0:i.dailyToken))throw new Error("Invalid response from server");const{dailyRoom:a,dailyToken:s,conversation_id:v}=i;G("✅ Daily session created:",v);const w=new Ud({transport:new uf,enableMic:o,enableCam:!1,timeout:3e4,callbacks:{onTransportStateChanged:e=>{G(`🔄 Transport state: ${e}`),p(e)},onConnected:()=>{G("✅ Connected to Daily room"),u({type:"separator",text:"Voice call started"})},onBotReady:e=>{G("🚀 Bot ready!",e),h(!0),p("ready")},onBotStartedSpeaking:()=>{h(e=>e||(G("🚀 Bot speaking - marking as ready (fallback)"),p("ready"),!0))},onDisconnected:()=>{G("❌ Disconnected from Daily room"),p("disconnected"),h(!1),y.current||(G("⚠️ Unexpected disconnection"),u({type:"separator",text:"Call disconnected"}))},onTrackStarted:(e,t)=>{if("audio"===e.kind&&!(null==t?void 0:t.local)){G("🎧 Remote audio track detected");const t=new MediaStream([e]);g(t)}},onUserTranscript:e=>{(null==e?void 0:e.final)&&(null==e?void 0:e.text)&&(G("👤 User transcript:",e.text),u({type:"user",text:e.text,isTranscript:!0}))},onBotTranscript:e=>{var t;const n=(null==(t=null==e?void 0:e.text)?void 0:t.trim())||"";n&&(G("🤖 Bot transcript:",n),u({type:"assistant",text:n,isTranscript:!0}))},onMicStateChanged:e=>{m(e)},onError:e=>{var t,n;Q("❌ PipecatClient error:",e);const r=(null==(t=null==e?void 0:e.data)?void 0:t.error)||(null==e?void 0:e.message)||"";r.includes("validation error")||r.includes("FunctionResponse")||!(null==(n=null==e?void 0:e.data)?void 0:n.fatal)?(u({type:"separator",text:"Agent disconnected"}),S()):(p("error"),u({type:"system",text:`Error: ${r}`}))}}});f(w),b.current=w,G("🎥 Initializing devices..."),yield w.initDevices(),G("🔗 Connecting to Daily room..."),yield w.connect({url:a,token:s}),G("✅ Call started successfully!")}catch(a){Q("❌ Failed to start call:",a),w.current=!1,p("error");let e="Failed to start call";e=(null==(r=a.message)?void 0:r.includes("Failed to fetch"))?"Cannot reach server":"NotAllowedError"===a.name?"Microphone access denied":"NotFoundError"===a.name?"No microphone found":a.message,u({type:"system",text:`❌ ${e}`})}}else G("⚠️ Call already in progress")}),[e,t,n,i,o,p,f,h,m,g,u]),S=E.useCallback(()=>d(null,null,function*(){var e;try{if(G("🔚 Ending call..."),u({type:"separator",text:"Voice call ended"}),y.current=!0,w.current=!1,r&&"disconnected"!==i&&(yield r.disconnect()),null==(e=v.current)?void 0:e.srcObject){v.current.srcObject.getTracks().forEach(e=>e.stop()),v.current.srcObject=null}g(null),f(null),b.current=null,p("disconnected"),h(!1),setTimeout(()=>{y.current=!1},500)}catch(t){Q("❌ Error ending call:",t),w.current=!1,f(null),b.current=null,p("disconnected"),h(!1)}}),[r,i,f,p,h,g,u]),_=E.useCallback(()=>{if(r&&a)try{const e=!o;r.enableMic(e),m(e)}catch(e){Q("❌ Error toggling mic:",e)}else G("⚠️ Cannot toggle mic - client not ready")},[r,o,a,m]);return E.useEffect(()=>()=>{var e;const t=b.current;if(t&&(y.current=!0,t.disconnect().catch(e=>{Q("Error during cleanup:",e)})),null==(e=v.current)?void 0:e.srcObject){v.current.srcObject.getTracks().forEach(e=>e.stop())}},[]),{connectionState:i,isBotReady:a,isMicEnabled:o,startCall:k,endCall:S,toggleMic:_,remoteAudioRef:v}}function pf({agentId:e,agentName:t,avatarUrl:n,promptToken:r,metadata:i,showTranscripts:a,onClose:o,className:s}){const{messages:l}=H(),{connectionState:c,isBotReady:u,isMicEnabled:d,startCall:f,endCall:p,toggleMic:h,remoteAudioRef:m}=ff(e,r,i);E.useEffect(()=>("disconnected"===c&&f(),()=>{"disconnected"!==c&&p()}),[]);const g="connecting"===c||!u,v="ready"===c||"connected"===c,y="error"===c;return b.jsxs("div",{className:wt("flex flex-col h-full w-full animate-fade-in",s),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("audio",{ref:m,autoPlay:!0,playsInline:!0,style:{display:"none"}}),b.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsx("button",{onClick:()=>{p(),o()},className:"p-2 rounded-full hover:opacity-80 transition-opacity",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Fn,{className:"h-5 w-5"})}),b.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--widget-header-text, #111827)"},children:t}),b.jsx("div",{className:"w-9"})]}),b.jsxs("div",{className:"flex-1 flex flex-col",children:[b.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-6",children:[b.jsx(Ct,{src:n,alt:t,size:"xl",status:"connecting"===c?"connecting":"error"===c?"error":u?d?"listening":"idle":"connecting",className:"mb-4"}),b.jsxs("div",{className:"flex items-center gap-2",children:[g&&b.jsx(Nn,{className:"h-4 w-4 animate-spin",style:{color:"var(--widget-status-connecting, #F59E0B)"}}),b.jsx("span",{className:"text-sm font-medium",style:{color:y?"var(--widget-status-error, #DC2626)":v?"var(--widget-status-success, #10B981)":"var(--widget-text-secondary, #6B7280)"},children:"connecting"===c?"Connecting...":"error"===c?"Connection failed":u?d?"Listening...":"Muted":"Waiting for agent..."})]})]}),a&&b.jsx(zn,{messages:l.filter(e=>e.isTranscript||"separator"===e.type),streamingContent:"",isStreaming:!1,className:"flex-1 border-t",style:{borderColor:"var(--widget-border, #E5E7EB)"}})]}),b.jsx("div",{className:"p-6",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsxs("div",{className:"flex justify-center gap-6",children:[b.jsx(Et,{onClick:h,variant:d?"secondary":"destructive",size:"icon-lg",className:"rounded-full",disabled:!v,children:d?b.jsx(jn,{className:"h-6 w-6"}):b.jsx(In,{className:"h-6 w-6"})}),b.jsx(Et,{onClick:()=>{p(),o()},variant:"destructive",size:"icon-lg",className:"rounded-full",children:b.jsx(Rn,{className:"h-6 w-6"})})]})})]})}function hf({agentId:e,metadata:t={},widgetElement:n}){const{isOpen:r,currentScreen:i,setScreen:a,closeDialog:o}=H(),{agentName:s,avatarUrl:l,promptToken:c,themeConfig:u,tncConfig:f,interfaceConfig:p,isLoading:h,error:m}=function(e){var t,n;const{agentConfig:r,configLoading:i,configError:a,setAgentId:o,setAgentConfig:s,setConfigLoading:l,setConfigError:c}=H(),u=E.useRef(null),f=E.useRef(!1);E.useEffect(()=>{d(null,null,function*(){if(e)if(f.current)G("⏭️ Fetch already in progress, skipping...");else if(u.current===e&&r)G("✓ Using cached config for agent:",e);else{u.current&&u.current!==e&&(G("🔄 Agent ID changed, fetching new config"),s(null),u.current=null);try{f.current=!0,l(!0),c(null),o(e),G("🔍 Fetching agent config for:",e);const t=yield X(e);if(G("✅ Agent config fetched:",t),!t||!t.widget_config)throw new Error("Invalid agent configuration structure");s(t),u.current=e}catch(m){Q("❌ Failed to fetch agent config:",m),c(m.message||"Failed to load configuration")}finally{f.current=!1,l(!1)}}else c("Agent ID is required")})},[e,r,o,s,l,c]);const p=E.useCallback(()=>d(null,null,function*(){if(e)try{u.current=null,f.current=!0,l(!0),c(null),G("🔄 Refreshing agent config for:",e);const t=yield X(e);if(!t||!t.widget_config)throw new Error("Invalid agent configuration structure");s(t),u.current=e}catch(m){Q("❌ Failed to refresh agent config:",m),c(m.message||"Failed to load configuration")}finally{f.current=!1,l(!1)}else c("Agent ID is required")}),[e,s,l,c]),h=(null==r?void 0:r.widget_config)||{};return{agentConfig:r,agentName:(null==r?void 0:r.agent_name)||"AI Assistant",promptToken:(null==r?void 0:r.prompt_access_token)||null,interfaceConfig:h.widget_interface||{},appearanceConfig:h.widget_appearance||{},avatarConfig:h.widget_avatar||{},themeConfig:h.widget_theme||{},tncConfig:h.widget_tnc_config||{},avatarUrl:(null==(n=null==(t=null==r?void 0:r.MediaFiles)?void 0:t.find(e=>"avatar"===e.fileType))?void 0:n.mediaUrl)||null,isLoading:i,error:a,refresh:p}}(e);if(!r)return null;if(h)return b.jsx(mf,{children:b.jsx(gf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[b.jsx(Nn,{className:"h-12 w-12 animate-spin",style:{color:"var(--widget-primary-color, #3B82F6)"}}),b.jsx("p",{className:"text-sm",style:{color:"var(--widget-text-secondary, #6B7280)"},children:"Loading..."})]})})});if(m)return b.jsx(mf,{children:b.jsx(gf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-6",children:[b.jsx("div",{className:"text-4xl",role:"img","aria-label":"Error",children:"😕"}),b.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--widget-text-primary, #111827)"},children:"Something went wrong"}),b.jsx("p",{className:"text-sm text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:m}),b.jsx("button",{onClick:o,className:"mt-4 px-6 py-2 rounded-lg text-sm font-medium",style:{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"},children:"Close"})]})})});return b.jsxs(mf,{onClick:o,children:[b.jsx(te,{theme:u,widgetElement:n}),b.jsx(gf,{onClick:e=>e.stopPropagation(),children:(()=>{switch(i){case"chat":return b.jsx(Wn,{agentId:e,agentName:s,promptToken:c,metadata:t,onClose:o,onSwitchToTalk:()=>a("talk")});case"talk":return b.jsx(pf,{agentId:e,agentName:s,avatarUrl:l,promptToken:c,metadata:t,showTranscripts:p.realtime_transcript_of_the_call,onClose:o});default:return b.jsx(Bn,{agentName:s,avatarUrl:l,tncEnabled:f.tnc_enabled,tncContent:f.tnc_content,onTalk:()=>a("talk"),onChat:()=>a("chat"),onClose:o})}})()})]})}function mf({children:e,onClick:t}){return b.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center animate-fade-in",style:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"},onClick:t,children:e})}function gf({children:e,onClick:t,className:n}){return b.jsx("div",{className:wt("relative w-full h-full max-w-lg max-h-[90vh] overflow-hidden animate-scale-in","sm:rounded-2xl sm:h-[700px]",n),style:{backgroundColor:"var(--widget-background, #FFFFFF)",boxShadow:"var(--widget-shadow-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25))"},onClick:t,children:e})}const vf='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--widget-font-family),system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mt-4{margin-top:1rem}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2\\.5{height:.625rem}.h-24{height:6rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.max-h-\\[90vh\\]{max-height:90vh}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-24{width:6rem}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.max-w-\\[85\\%\\]{max-width:85%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}@keyframes spin{to{transform:rotate(360deg)}}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-2xl{border-radius:1rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.border{border-width:1px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-current{background-color:currentColor}.bg-transparent{background-color:transparent}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-4{--tw-ring-offset-width: 4px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}*,*:before,*:after{box-sizing:border-box}html{scroll-behavior:smooth}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--widget-border, #e5e7eb);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--widget-text-muted, #9ca3af)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-fade-in{animation:fadeIn .3s ease-out}.animate-slide-up{animation:slideUp .4s ease-out}.animate-slide-down{animation:slideDown .4s ease-out}.animate-scale-in{animation:scaleIn .3s ease-out}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:opacity-90:hover{opacity:.9}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:640px){.sm\\:h-\\[700px\\]{height:700px}.sm\\:rounded-2xl{border-radius:1rem}}';class yf extends HTMLElement{constructor(){super(),this.root=null,this.shadow=null,this.themeStyleSheet=null,this.agentId=null,this.metadata={}}injectThemeCSS(e){if(this.shadow&&e)try{if(this.themeStyleSheet){const e=this.shadow.adoptedStyleSheets.indexOf(this.themeStyleSheet);e>-1&&(this.shadow.adoptedStyleSheets=this.shadow.adoptedStyleSheets.filter((t,n)=>n!==e))}const t=new CSSStyleSheet;t.replaceSync(e),this.shadow.adoptedStyleSheets=[...this.shadow.adoptedStyleSheets,t],this.themeStyleSheet=t,G("✅ Theme CSS injected")}catch(t){Q("Constructable Stylesheets failed, using fallback:",t);const n=document.createElement("style");n.setAttribute("data-eigi-theme","true"),n.textContent=e;const r=this.shadow.querySelector("[data-eigi-theme]");r&&r.remove(),this.shadow.appendChild(n),G("✅ Theme CSS injected (fallback)")}}connectedCallback(){this.agentId=this.getAttribute("agent-id");const e=this.getAttribute("metadata");if(e)try{this.metadata=JSON.parse(e)}catch(sr){Q("Failed to parse metadata:",sr)}if(!this.agentId)return void Q("EigiChat: agent-id attribute is required");const t=this.attachShadow({mode:"open"});this.shadow=t;try{const e=new CSSStyleSheet;e.replaceSync(vf),t.adoptedStyleSheets=[e],G("✅ Base CSS injected")}catch(r){const e=document.createElement("style");e.textContent=vf,t.appendChild(e),G("✅ Base CSS injected (fallback)")}const n=document.createElement("div");n.id="eigi-chat-root",t.appendChild(n),this.root=V.createRoot(n),this.render(),G("✅ EigiChat mounted with agent:",this.agentId),"undefined"!=typeof window&&window.EigiChat&&(window.EigiChat._element=this,window.EigiChat._agentId=this.agentId,window.EigiChat._metadata=this.metadata,H.getState().setAgentId(this.agentId))}render(){this.root&&this.root.render(b.jsx(x.StrictMode,{children:b.jsx(hf,{agentId:this.agentId,metadata:this.metadata,widgetElement:this})}))}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}static get observedAttributes(){return["agent-id","metadata"]}attributeChangedCallback(e,t,n){if(t!==n){if("agent-id"===e)this.agentId=n;else if("metadata"===e)try{this.metadata=JSON.parse(n)}catch(sr){Q("Failed to parse metadata:",sr)}this.render()}}}"undefined"==typeof window||customElements.get("eigi-chat")||customElements.define("eigi-chat",yf);const bf={_element:null,_agentId:null,_metadata:{},init({agentId:e,metadata:t={}}={}){e?(this._agentId=e,this._metadata=t,H.getState().setAgentId(e),this._element?(this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t))):(this._element=document.createElement("eigi-chat"),this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t)),document.body.appendChild(this._element),G("✅ EigiChat element created"))):Q("EigiChat.init: agentId is required")},open(){this._ensureInitialized(),H.getState().openDialog(),G("📖 Dialog opened")},close(){H.getState().closeDialog(),G("📕 Dialog closed")},toggle(){H.getState().toggleDialog()},isOpen:()=>H.getState().isOpen,openChat(){this._ensureInitialized(),H.getState().openChat(),G("📖 Chat opened")},openTalk(){this._ensureInitialized(),H.getState().openTalk(),G("📖 Talk opened")},_ensureInitialized(){!this._element&&this._agentId?this.init({agentId:this._agentId,metadata:this._metadata}):this._agentId||Q("EigiChat: Call init() with agentId first, or add data-agent-id to script tag")}};if("undefined"!=typeof window){const e=document.querySelectorAll("script[data-agent-id]"),t=e[e.length-1];if(t){const e=t.getAttribute("data-agent-id"),n=t.getAttribute("data-metadata");let r={};if(n)try{r=JSON.parse(n)}catch(sr){Q("Failed to parse data-metadata:",sr)}e&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{bf.init({agentId:e,metadata:r})}):bf.init({agentId:e,metadata:r}))}window.EigiChat=bf,G("✅ window.EigiChat API ready")}return e.EigiChatAPI=bf,e.EigiChatElement=yf,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});"undefined"!=typeof window&&window.EigiChatInternal&&(window.EigiChat=window.EigiChatInternal.EigiChatAPI,window.EigiChatElement=window.EigiChatInternal.EigiChatElement);