diff --git "a/index-Gqb7jVQE.js" "b/index-Gqb7jVQE.js" deleted file mode 100644--- "a/index-Gqb7jVQE.js" +++ /dev/null @@ -1,98 +0,0 @@ -var My=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var _S=My((SS,xg)=>{(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function da(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ac={exports:{}},so={},lc={exports:{}},ke={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var up;function Py(){if(up)return ke;up=1;var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),S=Symbol.iterator;function M(P){return P===null||typeof P!="object"?null:(P=S&&P[S]||P["@@iterator"],typeof P=="function"?P:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,B={};function q(P,U,ge){this.props=P,this.context=U,this.refs=B,this.updater=ge||D}q.prototype.isReactComponent={},q.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,U,"setState")},q.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function ne(){}ne.prototype=q.prototype;function ve(P,U,ge){this.props=P,this.context=U,this.refs=B,this.updater=ge||D}var K=ve.prototype=new ne;K.constructor=ve,F(K,q.prototype),K.isPureReactComponent=!0;var x=Array.isArray,O=Object.prototype.hasOwnProperty,R={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function z(P,U,ge){var ue,d={},g=null,v=null;if(U!=null)for(ue in U.ref!==void 0&&(v=U.ref),U.key!==void 0&&(g=""+U.key),U)O.call(U,ue)&&!j.hasOwnProperty(ue)&&(d[ue]=U[ue]);var C=arguments.length-2;if(C===1)d.children=ge;else if(1>>1,U=Q[P];if(0>>1;Pl(d,Z))gl(v,d)?(Q[P]=v,Q[g]=Z,P=g):(Q[P]=d,Q[ue]=Z,P=ue);else if(gl(v,Z))Q[P]=v,Q[g]=Z,P=g;else break e}}return ae}function l(Q,ae){var Z=Q.sortIndex-ae.sortIndex;return Z!==0?Z:Q.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var p=Date,m=p.now();r.unstable_now=function(){return p.now()-m}}var h=[],w=[],_=1,S=null,M=3,D=!1,F=!1,B=!1,q=typeof setTimeout=="function"?setTimeout:null,ne=typeof clearTimeout=="function"?clearTimeout:null,ve=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function K(Q){for(var ae=i(w);ae!==null;){if(ae.callback===null)s(w);else if(ae.startTime<=Q)s(w),ae.sortIndex=ae.expirationTime,n(h,ae);else break;ae=i(w)}}function x(Q){if(B=!1,K(Q),!F)if(i(h)!==null)F=!0,Je(O);else{var ae=i(w);ae!==null&&Te(x,ae.startTime-Q)}}function O(Q,ae){F=!1,B&&(B=!1,ne(z),z=-1),D=!0;var Z=M;try{for(K(ae),S=i(h);S!==null&&(!(S.expirationTime>ae)||Q&&!ce());){var P=S.callback;if(typeof P=="function"){S.callback=null,M=S.priorityLevel;var U=P(S.expirationTime<=ae);ae=r.unstable_now(),typeof U=="function"?S.callback=U:S===i(h)&&s(h),K(ae)}else s(h);S=i(h)}if(S!==null)var ge=!0;else{var ue=i(w);ue!==null&&Te(x,ue.startTime-ae),ge=!1}return ge}finally{S=null,M=Z,D=!1}}var R=!1,j=null,z=-1,J=5,H=-1;function ce(){return!(r.unstable_now()-HQ||125P?(Q.sortIndex=Z,n(w,Q),i(h)===null&&Q===i(w)&&(B?(ne(z),z=-1):B=!0,Te(x,Z-P))):(Q.sortIndex=U,n(h,Q),F||D||(F=!0,Je(O))),Q},r.unstable_shouldYield=ce,r.unstable_wrapCallback=function(Q){var ae=M;return function(){var Z=M;M=ae;try{return Q.apply(this,arguments)}finally{M=Z}}}}(dc)),dc}var mp;function Ay(){return mp||(mp=1,uc.exports=Ly()),uc.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gp;function Dy(){if(gp)return bt;gp=1;var r=au(),n=Ay();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,w=/^[: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]*$/,_={},S={};function M(e){return h.call(S,e)?!0:h.call(_,e)?!1:w.test(e)?S[e]=!0:(_[e]=!0,!1)}function D(e,t,o,a){if(o!==null&&o.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function F(e,t,o,a){if(t===null||typeof t>"u"||D(e,t,o,a))return!0;if(a)return!1;if(o!==null)switch(o.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function B(e,t,o,a,u,f,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=u,this.mustUseProperty=o,this.propertyName=e,this.type=t,this.sanitizeURL=f,this.removeEmptyString=y}var q={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){q[e]=new B(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];q[t]=new B(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){q[e]=new B(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){q[e]=new B(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){q[e]=new B(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){q[e]=new B(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){q[e]=new B(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){q[e]=new B(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){q[e]=new B(e,5,!1,e.toLowerCase(),null,!1,!1)});var ne=/[\-:]([a-z])/g;function ve(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ne,ve);q[t]=new B(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ne,ve);q[t]=new B(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ne,ve);q[t]=new B(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){q[e]=new B(e,1,!1,e.toLowerCase(),null,!1,!1)}),q.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){q[e]=new B(e,1,!1,e.toLowerCase(),null,!0,!0)});function K(e,t,o,a){var u=q.hasOwnProperty(t)?q[t]:null;(u!==null?u.type!==0:a||!(2E||u[y]!==f[E]){var b=` -`+u[y].replace(" at new "," at ");return e.displayName&&b.includes("")&&(b=b.replace("",e.displayName)),b}while(1<=y&&0<=E);break}}}finally{ge=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?U(e):""}function d(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function g(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case R:return"Portal";case J:return"Profiler";case z:return"StrictMode";case le:return"Suspense";case be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case Se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pe:return t=e.displayName||null,t!==null?t:g(e.type)||"Memo";case Je:t=e._payload,e=e._init;try{return g(e(t))}catch{}}return null}function v(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return g(t);case 8:return t===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function C(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function I(e){var t=k(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){a=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function X(e){e._valueTracker||(e._valueTracker=I(e))}function oe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),a="";return e&&(a=k(e)?e.checked?"true":"false":e.value),e=a,e!==o?(t.setValue(e),!0):!1}function we(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qe(e,t){var o=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Fe(e,t){var o=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;o=C(t.value!=null?t.value:o),e._wrapperState={initialChecked:a,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Rt(e,t){t=t.checked,t!=null&&K(e,"checked",t,!1)}function jt(e,t){Rt(e,t);var o=C(t.value),a=t.type;if(o!=null)a==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xn(e,t.type,o):t.hasOwnProperty("defaultValue")&&xn(e,t.type,C(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function It(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function xn(e,t,o){(t!=="number"||we(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var He=Array.isArray;function dt(e,t,o,a){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=To.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ki(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var Ei={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Lg=["Webkit","ms","Moz","O"];Object.keys(Ei).forEach(function(e){Lg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ei[t]=Ei[e]})});function Cu(e,t,o){return t==null||typeof t=="boolean"||t===""?"":o||typeof t!="number"||t===0||Ei.hasOwnProperty(e)&&Ei[e]?(""+t).trim():t+"px"}function bu(e,t){e=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=o.indexOf("--")===0,u=Cu(o,t[o],a);o==="float"&&(o="cssFloat"),a?e.setProperty(o,u):e[o]=u}}var Ag=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _a(e,t){if(t){if(Ag[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function wa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Sa=null;function ka(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,jr=null,Ir=null;function Tu(e){if(e=Ji(e)){if(typeof Ea!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Yo(t),Ea(e.stateNode,e.type,t))}}function Mu(e){jr?Ir?Ir.push(e):Ir=[e]:jr=e}function Pu(){if(jr){var e=jr,t=Ir;if(Ir=jr=null,Tu(e),t)for(e=0;e>>=0,e===0?32:31-(Vg(e)/Wg|0)|0}var Lo=64,Ao=4194304;function Mi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Do(e,t){var o=e.pendingLanes;if(o===0)return 0;var a=0,u=e.suspendedLanes,f=e.pingedLanes,y=o&268435455;if(y!==0){var E=y&~u;E!==0?a=Mi(E):(f&=y,f!==0&&(a=Mi(f)))}else y=o&~u,y!==0?a=Mi(y):f!==0&&(a=Mi(f));if(a===0)return 0;if(t!==0&&t!==a&&!(t&u)&&(u=a&-a,f=t&-t,u>=f||u===16&&(f&4194240)!==0))return t;if(a&4&&(a|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0o;o++)t.push(e);return t}function Pi(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=o}function Hg(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=ji),nd=" ",rd=!1;function id(e,t){switch(e){case"keyup":return kv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function od(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ur=!1;function Cv(e,t){switch(e){case"compositionend":return od(t);case"keypress":return t.which!==32?null:(rd=!0,nd);case"textInput":return e=t.data,e===nd&&rd?null:e;default:return null}}function bv(e,t){if(Ur)return e==="compositionend"||!$a&&id(e,t)?(e=Qu(),Bo=Ra=jn=null,Ur=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:o,offset:t-e};e=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=fd(o)}}function hd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function md(){for(var e=window,t=we();t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=we(e.document)}return t}function Wa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Nv(e){var t=md(),o=e.focusedElem,a=e.selectionRange;if(t!==o&&o&&o.ownerDocument&&hd(o.ownerDocument.documentElement,o)){if(a!==null&&Wa(o)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in o)o.selectionStart=t,o.selectionEnd=Math.min(e,o.value.length);else if(e=(t=o.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=o.textContent.length,f=Math.min(a.start,u);a=a.end===void 0?f:Math.min(a.end,u),!e.extend&&f>a&&(u=a,a=f,f=u),u=pd(o,f);var y=pd(o,a);u&&y&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),f>a?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=o;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,$r=null,Ja=null,Ui=null,Ga=!1;function gd(e,t,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ga||$r==null||$r!==we(a)||(a=$r,"selectionStart"in a&&Wa(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ui&&Fi(Ui,a)||(Ui=a,a=Go(Ja,"onSelect"),0Gr||(e.current=il[Gr],il[Gr]=null,Gr--)}function Ie(e,t){Gr++,il[Gr]=e.current,e.current=t}var Un={},ft=Fn(Un),wt=Fn(!1),ur=Un;function qr(e,t){var o=e.type.contextTypes;if(!o)return Un;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var u={},f;for(f in o)u[f]=t[f];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function St(e){return e=e.childContextTypes,e!=null}function Qo(){$e(wt),$e(ft)}function Ld(e,t,o){if(ft.current!==Un)throw Error(i(168));Ie(ft,t),Ie(wt,o)}function Ad(e,t,o){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var u in a)if(!(u in t))throw Error(i(108,v(e)||"Unknown",u));return Z({},o,a)}function Ko(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,ur=ft.current,Ie(ft,e),Ie(wt,wt.current),!0}function Dd(e,t,o){var a=e.stateNode;if(!a)throw Error(i(169));o?(e=Ad(e,t,ur),a.__reactInternalMemoizedMergedChildContext=e,$e(wt),$e(ft),Ie(ft,e)):$e(wt),Ie(wt,o)}var yn=null,Xo=!1,ol=!1;function Nd(e){yn===null?yn=[e]:yn.push(e)}function Gv(e){Xo=!0,Nd(e)}function $n(){if(!ol&&yn!==null){ol=!0;var e=0,t=Ae;try{var o=yn;for(Ae=1;e>=y,u-=y,_n=1<<32-qt(t)+u|o<he?(st=fe,fe=null):st=fe.sibling;var Oe=V(L,fe,A[he],Y);if(Oe===null){fe===null&&(fe=st);break}e&&fe&&Oe.alternate===null&&t(L,fe),T=f(Oe,T,he),de===null?se=Oe:de.sibling=Oe,de=Oe,fe=st}if(he===A.length)return o(L,fe),Ve&&fr(L,he),se;if(fe===null){for(;hehe?(st=fe,fe=null):st=fe.sibling;var Qn=V(L,fe,Oe.value,Y);if(Qn===null){fe===null&&(fe=st);break}e&&fe&&Qn.alternate===null&&t(L,fe),T=f(Qn,T,he),de===null?se=Qn:de.sibling=Qn,de=Qn,fe=st}if(Oe.done)return o(L,fe),Ve&&fr(L,he),se;if(fe===null){for(;!Oe.done;he++,Oe=A.next())Oe=G(L,Oe.value,Y),Oe!==null&&(T=f(Oe,T,he),de===null?se=Oe:de.sibling=Oe,de=Oe);return Ve&&fr(L,he),se}for(fe=a(L,fe);!Oe.done;he++,Oe=A.next())Oe=ee(fe,L,he,Oe.value,Y),Oe!==null&&(e&&Oe.alternate!==null&&fe.delete(Oe.key===null?he:Oe.key),T=f(Oe,T,he),de===null?se=Oe:de.sibling=Oe,de=Oe);return e&&fe.forEach(function(Ty){return t(L,Ty)}),Ve&&fr(L,he),se}function Xe(L,T,A,Y){if(typeof A=="object"&&A!==null&&A.type===j&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case O:e:{for(var se=A.key,de=T;de!==null;){if(de.key===se){if(se=A.type,se===j){if(de.tag===7){o(L,de.sibling),T=u(de,A.props.children),T.return=L,L=T;break e}}else if(de.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===Je&&Ud(se)===de.type){o(L,de.sibling),T=u(de,A.props),T.ref=Gi(L,de,A),T.return=L,L=T;break e}o(L,de);break}else t(L,de);de=de.sibling}A.type===j?(T=wr(A.props.children,L.mode,Y,A.key),T.return=L,L=T):(Y=Ts(A.type,A.key,A.props,null,L.mode,Y),Y.ref=Gi(L,T,A),Y.return=L,L=Y)}return y(L);case R:e:{for(de=A.key;T!==null;){if(T.key===de)if(T.tag===4&&T.stateNode.containerInfo===A.containerInfo&&T.stateNode.implementation===A.implementation){o(L,T.sibling),T=u(T,A.children||[]),T.return=L,L=T;break e}else{o(L,T);break}else t(L,T);T=T.sibling}T=nc(A,L.mode,Y),T.return=L,L=T}return y(L);case Je:return de=A._init,Xe(L,T,de(A._payload),Y)}if(He(A))return re(L,T,A,Y);if(ae(A))return ie(L,T,A,Y);ns(L,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,T!==null&&T.tag===6?(o(L,T.sibling),T=u(T,A),T.return=L,L=T):(o(L,T),T=tc(A,L.mode,Y),T.return=L,L=T),y(L)):o(L,T)}return Xe}var Kr=$d(!0),zd=$d(!1),rs=Fn(null),is=null,Xr=null,dl=null;function fl(){dl=Xr=is=null}function pl(e){var t=rs.current;$e(rs),e._currentValue=t}function hl(e,t,o){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===o)break;e=e.return}}function Zr(e,t){is=e,dl=Xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(kt=!0),e.firstContext=null)}function Ut(e){var t=e._currentValue;if(dl!==e)if(e={context:e,memoizedValue:t,next:null},Xr===null){if(is===null)throw Error(i(308));Xr=e,is.dependencies={lanes:0,firstContext:e}}else Xr=Xr.next=e;return t}var pr=null;function ml(e){pr===null?pr=[e]:pr.push(e)}function Vd(e,t,o,a){var u=t.interleaved;return u===null?(o.next=o,ml(t)):(o.next=u.next,u.next=o),t.interleaved=o,Sn(e,a)}function Sn(e,t){e.lanes|=t;var o=e.alternate;for(o!==null&&(o.lanes|=t),o=e,e=e.return;e!==null;)e.childLanes|=t,o=e.alternate,o!==null&&(o.childLanes|=t),o=e,e=e.return;return o.tag===3?o.stateNode:null}var zn=!1;function gl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vn(e,t,o){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Me&2){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,Sn(e,o)}return u=a.interleaved,u===null?(t.next=t,ml(a)):(t.next=u.next,u.next=t),a.interleaved=t,Sn(e,o)}function os(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,xa(e,o)}}function Jd(e,t){var o=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var u=null,f=null;if(o=o.firstBaseUpdate,o!==null){do{var y={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};f===null?u=f=y:f=f.next=y,o=o.next}while(o!==null);f===null?u=f=t:f=f.next=t}else u=f=t;o={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,effects:a.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}function ss(e,t,o,a){var u=e.updateQueue;zn=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var b=E,N=b.next;b.next=null,y===null?f=N:y.next=N,y=b;var W=e.alternate;W!==null&&(W=W.updateQueue,E=W.lastBaseUpdate,E!==y&&(E===null?W.firstBaseUpdate=N:E.next=N,W.lastBaseUpdate=b))}if(f!==null){var G=u.baseState;y=0,W=N=b=null,E=f;do{var V=E.lane,ee=E.eventTime;if((a&V)===V){W!==null&&(W=W.next={eventTime:ee,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var re=e,ie=E;switch(V=t,ee=o,ie.tag){case 1:if(re=ie.payload,typeof re=="function"){G=re.call(ee,G,V);break e}G=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ie.payload,V=typeof re=="function"?re.call(ee,G,V):re,V==null)break e;G=Z({},G,V);break e;case 2:zn=!0}}E.callback!==null&&E.lane!==0&&(e.flags|=64,V=u.effects,V===null?u.effects=[E]:V.push(E))}else ee={eventTime:ee,lane:V,tag:E.tag,payload:E.payload,callback:E.callback,next:null},W===null?(N=W=ee,b=G):W=W.next=ee,y|=V;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;V=E,E=V.next,V.next=null,u.lastBaseUpdate=V,u.shared.pending=null}}while(!0);if(W===null&&(b=G),u.baseState=b,u.firstBaseUpdate=N,u.lastBaseUpdate=W,t=u.shared.interleaved,t!==null){u=t;do y|=u.lane,u=u.next;while(u!==t)}else f===null&&(u.shared.lanes=0);gr|=y,e.lanes=y,e.memoizedState=G}}function Gd(e,t,o){if(e=t.effects,t.effects=null,e!==null)for(t=0;to?o:4,e(!0);var a=Sl.transition;Sl.transition={};try{e(!1),t()}finally{Ae=o,Sl.transition=a}}function ff(){return $t().memoizedState}function Qv(e,t,o){var a=qn(e);if(o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},pf(e))hf(t,o);else if(o=Vd(e,t,o,a),o!==null){var u=yt();Zt(o,e,a,u),mf(o,t,a)}}function Kv(e,t,o){var a=qn(e),u={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(pf(e))hf(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,E=f(y,o);if(u.hasEagerState=!0,u.eagerState=E,Ht(E,y)){var b=t.interleaved;b===null?(u.next=u,ml(t)):(u.next=b.next,b.next=u),t.interleaved=u;return}}catch{}finally{}o=Vd(e,t,u,a),o!==null&&(u=yt(),Zt(o,e,a,u),mf(o,t,a))}}function pf(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function hf(e,t){Qi=cs=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function mf(e,t,o){if(o&4194240){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,xa(e,o)}}var fs={readContext:Ut,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},Xv={readContext:Ut,useCallback:function(e,t){return dn().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:rf,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,us(4194308,4,af.bind(null,t,e),o)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){return us(4,2,e,t)},useMemo:function(e,t){var o=dn();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var a=dn();return t=o!==void 0?o(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=Qv.bind(null,qe,e),[a.memoizedState,e]},useRef:function(e){var t=dn();return e={current:e},t.memoizedState=e},useState:tf,useDebugValue:Pl,useDeferredValue:function(e){return dn().memoizedState=e},useTransition:function(){var e=tf(!1),t=e[0];return e=Yv.bind(null,e[1]),dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var a=qe,u=dn();if(Ve){if(o===void 0)throw Error(i(407));o=o()}else{if(o=t(),ot===null)throw Error(i(349));mr&30||Qd(a,t,o)}u.memoizedState=o;var f={value:o,getSnapshot:t};return u.queue=f,rf(Xd.bind(null,a,f,e),[e]),a.flags|=2048,Zi(9,Kd.bind(null,a,f,o,t),void 0,null),o},useId:function(){var e=dn(),t=ot.identifierPrefix;if(Ve){var o=wn,a=_n;o=(a&~(1<<32-qt(a)-1)).toString(32)+o,t=":"+t+"R"+o,o=Ki++,0<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=y.createElement(o,{is:a.is}):(e=y.createElement(o),o==="select"&&(y=e,a.multiple?y.multiple=!0:a.size&&(y.size=a.size))):e=y.createElementNS(e,o),e[cn]=t,e[Wi]=a,Rf(e,t,!1,!1),t.stateNode=e;e:{switch(y=wa(o,a),o){case"dialog":Ue("cancel",e),Ue("close",e),u=a;break;case"iframe":case"object":case"embed":Ue("load",e),u=a;break;case"video":case"audio":for(u=0;u<$i.length;u++)Ue($i[u],e);u=a;break;case"source":Ue("error",e),u=a;break;case"img":case"image":case"link":Ue("error",e),Ue("load",e),u=a;break;case"details":Ue("toggle",e),u=a;break;case"input":Fe(e,a),u=Qe(e,a),Ue("invalid",e);break;case"option":u=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},u=Z({},a,{value:void 0}),Ue("invalid",e);break;case"textarea":Ln(e,a),u=an(e,a),Ue("invalid",e);break;default:u=a}_a(o,u),E=u;for(f in E)if(E.hasOwnProperty(f)){var b=E[f];f==="style"?bu(e,b):f==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,b!=null&&Eu(e,b)):f==="children"?typeof b=="string"?(o!=="textarea"||b!=="")&&ki(e,b):typeof b=="number"&&ki(e,""+b):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(l.hasOwnProperty(f)?b!=null&&f==="onScroll"&&Ue("scroll",e):b!=null&&K(e,f,b,y))}switch(o){case"input":X(e),It(e,a,!1);break;case"textarea":X(e),Rr(e);break;case"option":a.value!=null&&e.setAttribute("value",""+C(a.value));break;case"select":e.multiple=!!a.multiple,f=a.value,f!=null?dt(e,!!a.multiple,f,!1):a.defaultValue!=null&&dt(e,!!a.multiple,a.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=Ho)}switch(o){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ht(t),null;case 6:if(e&&t.stateNode!=null)If(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(i(166));if(o=hr(Yi.current),hr(un.current),ts(t)){if(a=t.stateNode,o=t.memoizedProps,a[cn]=t,(f=a.nodeValue!==o)&&(e=Ot,e!==null))switch(e.tag){case 3:qo(a.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qo(a.nodeValue,o,(e.mode&1)!==0)}f&&(t.flags|=4)}else a=(o.nodeType===9?o:o.ownerDocument).createTextNode(a),a[cn]=t,t.stateNode=a}return ht(t),null;case 13:if($e(Ge),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ve&&xt!==null&&t.mode&1&&!(t.flags&128))Fd(),Qr(),t.flags|=98560,f=!1;else if(f=ts(t),a!==null&&a.dehydrated!==null){if(e===null){if(!f)throw Error(i(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(i(317));f[cn]=t}else Qr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ht(t),f=!1}else Yt!==null&&(Ql(Yt),Yt=null),f=!0;if(!f)return t.flags&65536?t:null}return t.flags&128?(t.lanes=o,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,t.mode&1&&(e===null||Ge.current&1?rt===0&&(rt=3):Zl())),t.updateQueue!==null&&(t.flags|=4),ht(t),null);case 4:return ei(),Fl(e,t),e===null&&zi(t.stateNode.containerInfo),ht(t),null;case 10:return pl(t.type._context),ht(t),null;case 17:return St(t.type)&&Qo(),ht(t),null;case 19:if($e(Ge),f=t.memoizedState,f===null)return ht(t),null;if(a=(t.flags&128)!==0,y=f.rendering,y===null)if(a)eo(f,!1);else{if(rt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(y=as(e),y!==null){for(t.flags|=128,eo(f,!1),a=y.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=o,o=t.child;o!==null;)f=o,e=a,f.flags&=14680066,y=f.alternate,y===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=y.childLanes,f.lanes=y.lanes,f.child=y.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=y.memoizedProps,f.memoizedState=y.memoizedState,f.updateQueue=y.updateQueue,f.type=y.type,e=y.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Ie(Ge,Ge.current&1|2),t.child}e=e.sibling}f.tail!==null&&Ke()>ii&&(t.flags|=128,a=!0,eo(f,!1),t.lanes=4194304)}else{if(!a)if(e=as(y),e!==null){if(t.flags|=128,a=!0,o=e.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),eo(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ve)return ht(t),null}else 2*Ke()-f.renderingStartTime>ii&&o!==1073741824&&(t.flags|=128,a=!0,eo(f,!1),t.lanes=4194304);f.isBackwards?(y.sibling=t.child,t.child=y):(o=f.last,o!==null?o.sibling=y:t.child=y,f.last=y)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=Ke(),t.sibling=null,o=Ge.current,Ie(Ge,a?o&1|2:o&1),t):(ht(t),null);case 22:case 23:return Xl(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&t.mode&1?Lt&1073741824&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function sy(e,t){switch(al(t),t.tag){case 1:return St(t.type)&&Qo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ei(),$e(wt),$e(ft),wl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yl(t),null;case 13:if($e(Ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Qr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(Ge),null;case 4:return ei(),null;case 10:return pl(t.type._context),null;case 22:case 23:return Xl(),null;case 24:return null;default:return null}}var gs=!1,mt=!1,ay=typeof WeakSet=="function"?WeakSet:Set,te=null;function ni(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){Ye(e,t,a)}else o.current=null}function Ul(e,t,o){try{o()}catch(a){Ye(e,t,a)}}var Bf=!1;function ly(e,t){if(Xa=jo,e=md(),Wa(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{o.nodeType,f.nodeType}catch{o=null;break e}var y=0,E=-1,b=-1,N=0,W=0,G=e,V=null;t:for(;;){for(var ee;G!==o||u!==0&&G.nodeType!==3||(E=y+u),G!==f||a!==0&&G.nodeType!==3||(b=y+a),G.nodeType===3&&(y+=G.nodeValue.length),(ee=G.firstChild)!==null;)V=G,G=ee;for(;;){if(G===e)break t;if(V===o&&++N===u&&(E=y),V===f&&++W===a&&(b=y),(ee=G.nextSibling)!==null)break;G=V,V=G.parentNode}G=ee}o=E===-1||b===-1?null:{start:E,end:b}}else o=null}o=o||{start:0,end:0}}else o=null;for(Za={focusedElem:e,selectionRange:o},jo=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var re=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(re!==null){var ie=re.memoizedProps,Xe=re.memoizedState,L=t.stateNode,T=L.getSnapshotBeforeUpdate(t.elementType===t.type?ie:Qt(t.type,ie),Xe);L.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var A=t.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Y){Ye(t,t.return,Y)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return re=Bf,Bf=!1,re}function to(e,t,o){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&e)===e){var f=u.destroy;u.destroy=void 0,f!==void 0&&Ul(t,o,f)}u=u.next}while(u!==a)}}function vs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var a=o.create;o.destroy=a()}o=o.next}while(o!==t)}}function $l(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof t=="function"?t(e):t.current=e}}function Ff(e){var t=e.alternate;t!==null&&(e.alternate=null,Ff(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cn],delete t[Wi],delete t[rl],delete t[Wv],delete t[Jv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uf(e){return e.tag===5||e.tag===3||e.tag===4}function $f(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=Ho));else if(a!==4&&(e=e.child,e!==null))for(zl(e,t,o),e=e.sibling;e!==null;)zl(e,t,o),e=e.sibling}function Vl(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Vl(e,t,o),e=e.sibling;e!==null;)Vl(e,t,o),e=e.sibling}var at=null,Kt=!1;function Wn(e,t,o){for(o=o.child;o!==null;)zf(e,t,o),o=o.sibling}function zf(e,t,o){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(xo,o)}catch{}switch(o.tag){case 5:mt||ni(o,t);case 6:var a=at,u=Kt;at=null,Wn(e,t,o),at=a,Kt=u,at!==null&&(Kt?(e=at,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):at.removeChild(o.stateNode));break;case 18:at!==null&&(Kt?(e=at,o=o.stateNode,e.nodeType===8?nl(e.parentNode,o):e.nodeType===1&&nl(e,o),Di(e)):nl(at,o.stateNode));break;case 4:a=at,u=Kt,at=o.stateNode.containerInfo,Kt=!0,Wn(e,t,o),at=a,Kt=u;break;case 0:case 11:case 14:case 15:if(!mt&&(a=o.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){u=a=a.next;do{var f=u,y=f.destroy;f=f.tag,y!==void 0&&(f&2||f&4)&&Ul(o,t,y),u=u.next}while(u!==a)}Wn(e,t,o);break;case 1:if(!mt&&(ni(o,t),a=o.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(E){Ye(o,t,E)}Wn(e,t,o);break;case 21:Wn(e,t,o);break;case 22:o.mode&1?(mt=(a=mt)||o.memoizedState!==null,Wn(e,t,o),mt=a):Wn(e,t,o);break;default:Wn(e,t,o)}}function Vf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new ay),t.forEach(function(a){var u=vy.bind(null,e,a);o.has(a)||(o.add(a),a.then(u,u))})}}function Xt(e,t){var o=t.deletions;if(o!==null)for(var a=0;au&&(u=y),a&=~f}if(a=u,a=Ke()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*uy(a/1960))-a,10e?16:e,Gn===null)var a=!1;else{if(e=Gn,Gn=null,ks=0,Me&6)throw Error(i(331));var u=Me;for(Me|=4,te=e.current;te!==null;){var f=te,y=f.child;if(te.flags&16){var E=f.deletions;if(E!==null){for(var b=0;bKe()-Gl?yr(e,0):Jl|=o),Ct(e,t)}function np(e,t){t===0&&(e.mode&1?(t=Ao,Ao<<=1,!(Ao&130023424)&&(Ao=4194304)):t=1);var o=yt();e=Sn(e,t),e!==null&&(Pi(e,t,o),Ct(e,o))}function gy(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),np(e,o)}function vy(e,t){var o=0;switch(e.tag){case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(o=u.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(t),np(e,o)}var rp;rp=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)kt=!0;else{if(!(e.lanes&o)&&!(t.flags&128))return kt=!1,iy(e,t,o);kt=!!(e.flags&131072)}else kt=!1,Ve&&t.flags&1048576&&Rd(t,es,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;ms(e,t),e=t.pendingProps;var u=qr(t,ft.current);Zr(t,o),u=El(null,t,a,e,u,o);var f=Cl();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,St(a)?(f=!0,Ko(t)):f=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,gl(t),u.updater=ps,t.stateNode=u,u._reactInternals=t,xl(t,a,e,o),t=Nl(null,t,a,!0,f,o)):(t.tag=0,Ve&&f&&sl(t),vt(null,t,u,o),t=t.child),t;case 16:a=t.elementType;e:{switch(ms(e,t),e=t.pendingProps,u=a._init,a=u(a._payload),t.type=a,u=t.tag=_y(a),e=Qt(a,e),u){case 0:t=Dl(null,t,a,e,o);break e;case 1:t=Of(null,t,a,e,o);break e;case 11:t=Cf(null,t,a,e,o);break e;case 14:t=bf(null,t,a,Qt(a.type,e),o);break e}throw Error(i(306,a,""))}return t;case 0:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Qt(a,u),Dl(e,t,a,u,o);case 1:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Qt(a,u),Of(e,t,a,u,o);case 3:e:{if(xf(t),e===null)throw Error(i(387));a=t.pendingProps,f=t.memoizedState,u=f.element,Wd(e,t),ss(t,a,null,o);var y=t.memoizedState;if(a=y.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){u=ti(Error(i(423)),t),t=Lf(e,t,a,o,u);break e}else if(a!==u){u=ti(Error(i(424)),t),t=Lf(e,t,a,o,u);break e}else for(xt=Bn(t.stateNode.containerInfo.firstChild),Ot=t,Ve=!0,Yt=null,o=zd(t,null,a,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Qr(),a===u){t=En(e,t,o);break e}vt(e,t,a,o)}t=t.child}return t;case 5:return qd(t),e===null&&cl(t),a=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,y=u.children,el(a,u)?y=null:f!==null&&el(a,f)&&(t.flags|=32),Pf(e,t),vt(e,t,y,o),t.child;case 6:return e===null&&cl(t),null;case 13:return Af(e,t,o);case 4:return vl(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Kr(t,null,a,o):vt(e,t,a,o),t.child;case 11:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Qt(a,u),Cf(e,t,a,u,o);case 7:return vt(e,t,t.pendingProps,o),t.child;case 8:return vt(e,t,t.pendingProps.children,o),t.child;case 12:return vt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(a=t.type._context,u=t.pendingProps,f=t.memoizedProps,y=u.value,Ie(rs,a._currentValue),a._currentValue=y,f!==null)if(Ht(f.value,y)){if(f.children===u.children&&!wt.current){t=En(e,t,o);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var E=f.dependencies;if(E!==null){y=f.child;for(var b=E.firstContext;b!==null;){if(b.context===a){if(f.tag===1){b=kn(-1,o&-o),b.tag=2;var N=f.updateQueue;if(N!==null){N=N.shared;var W=N.pending;W===null?b.next=b:(b.next=W.next,W.next=b),N.pending=b}}f.lanes|=o,b=f.alternate,b!==null&&(b.lanes|=o),hl(f.return,o,t),E.lanes|=o;break}b=b.next}}else if(f.tag===10)y=f.type===t.type?null:f.child;else if(f.tag===18){if(y=f.return,y===null)throw Error(i(341));y.lanes|=o,E=y.alternate,E!==null&&(E.lanes|=o),hl(y,o,t),y=f.sibling}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===t){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}vt(e,t,u.children,o),t=t.child}return t;case 9:return u=t.type,a=t.pendingProps.children,Zr(t,o),u=Ut(u),a=a(u),t.flags|=1,vt(e,t,a,o),t.child;case 14:return a=t.type,u=Qt(a,t.pendingProps),u=Qt(a.type,u),bf(e,t,a,u,o);case 15:return Tf(e,t,t.type,t.pendingProps,o);case 17:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:Qt(a,u),ms(e,t),t.tag=1,St(a)?(e=!0,Ko(t)):e=!1,Zr(t,o),vf(t,a,u),xl(t,a,u,o),Nl(null,t,a,!0,e,o);case 19:return Nf(e,t,o);case 22:return Mf(e,t,o)}throw Error(i(156,t.tag))};function ip(e,t){return ju(e,t)}function yy(e,t,o,a){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,o,a){return new yy(e,t,o,a)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _y(e){if(typeof e=="function")return ec(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Se)return 11;if(e===Pe)return 14}return 2}function Yn(e,t){var o=e.alternate;return o===null?(o=Vt(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ts(e,t,o,a,u,f){var y=2;if(a=e,typeof e=="function")ec(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case j:return wr(o.children,u,f,t);case z:y=8,u|=8;break;case J:return e=Vt(12,o,t,u|2),e.elementType=J,e.lanes=f,e;case le:return e=Vt(13,o,t,u),e.elementType=le,e.lanes=f,e;case be:return e=Vt(19,o,t,u),e.elementType=be,e.lanes=f,e;case Te:return Ms(o,u,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:y=10;break e;case ce:y=9;break e;case Se:y=11;break e;case Pe:y=14;break e;case Je:y=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Vt(y,o,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function wr(e,t,o,a){return e=Vt(7,e,a,t),e.lanes=o,e}function Ms(e,t,o,a){return e=Vt(22,e,a,t),e.elementType=Te,e.lanes=o,e.stateNode={isHidden:!1},e}function tc(e,t,o){return e=Vt(6,e,null,t),e.lanes=o,e}function nc(e,t,o){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wy(e,t,o,a,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=a,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function rc(e,t,o,a,u,f,y,E,b){return e=new wy(e,t,o,E,b),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Vt(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},gl(f),e}function Sy(e,t,o){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),cc.exports=Dy(),cc.exports}var yp;function Ry(){if(yp)return Ns;yp=1;var r=Ny();return Ns.createRoot=r.createRoot,Ns.hydrateRoot=r.hydrateRoot,Ns}var jy=Ry();const Iy=da(jy),Wt={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let By=0;function gn(r,n){const i=`atom${++By}`,s={toString(){return(Wt?"production":void 0)!=="production"&&this.debugLabel?i+":"+this.debugLabel:i}};return typeof r=="function"?s.read=r:(s.init=r,s.read=Fy,s.write=Uy),n&&(s.write=n),s}function Fy(r){return r(this)}function Uy(r,n,i){return n(this,typeof i=="function"?i(r(this)):i)}const _p=(r,n)=>r.unstable_is?r.unstable_is(n):n===r,fc=r=>"init"in r,pc=r=>!!r.write,ta=new WeakMap,Ic=r=>{var n;return Bc(r)&&!((n=ta.get(r))!=null&&n[1])},$y=(r,n)=>{const i=ta.get(r);if(i)i[1]=!0,i[0].forEach(s=>s(n));else if((Wt?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},zy=r=>{if(ta.has(r))return;const n=[new Set,!1];ta.set(r,n);const i=()=>{n[1]=!0};r.then(i,i),r.onCancel=s=>{n[0].add(s)}},Bc=r=>typeof(r==null?void 0:r.then)=="function",wp=r=>"v"in r||"e"in r,Rs=r=>{if("e"in r)throw r.e;if((Wt?"production":void 0)!=="production"&&!("v"in r))throw new Error("[Bug] atom state is not initialized");return r.v},pm=(r,n,i)=>{i.p.has(r)||(i.p.add(r),n.then(()=>{i.p.delete(r)},()=>{i.p.delete(r)}))},Sp=(r,n,i,s,l)=>{var c;if((Wt?"production":void 0)!=="production"&&s===n)throw new Error("[Bug] atom cannot depend on itself");i.d.set(s,l.n),Ic(i.v)&&pm(n,i.v,l),(c=l.m)==null||c.t.add(n),r&&Vy(r,s,n)},si=()=>[new Map,new Map,new Set],hc=(r,n,i)=>{r[0].has(n)||r[0].set(n,new Set),r[1].set(n,i)},Vy=(r,n,i)=>{const s=r[0].get(n);s&&s.add(i)},Wy=(r,n)=>r[0].get(n),kp=(r,n)=>{r[2].add(n)},Kn=r=>{let n,i=!1;const s=l=>{try{l()}catch(c){i||(n=c,i=!0)}};for(;r[1].size||r[2].size;){r[0].clear();const l=new Set(r[1].values());r[1].clear();const c=new Set(r[2]);r[2].clear(),l.forEach(p=>{var m;return(m=p.m)==null?void 0:m.l.forEach(s)}),c.forEach(s)}if(i)throw n},hm=(...[r,n,i,s])=>{let l;(Wt?"production":void 0)!=="production"&&(l=new Set);const c=(K,x,O)=>{const R="v"in x,j=x.v,z=Ic(x.v)?x.v:null;if(Bc(O)){zy(O);for(const J of x.d.keys())pm(K,O,r(J));x.v=O,delete x.e}else x.v=O,delete x.e;(!R||!Object.is(j,x.v))&&(++x.n,z&&$y(z,O))},p=(K,x,O)=>{var R;const j=r(x);if(wp(j)&&(j.m&&!(O!=null&&O.has(x))||Array.from(j.d).every(([le,be])=>p(K,le,O).n===be)))return j;j.d.clear();let z=!0;const J=le=>{if(_p(x,le)){const Pe=r(le);if(!wp(Pe))if(fc(le))c(le,Pe,le.init);else throw new Error("no atom init");return Rs(Pe)}const be=p(K,le,O);try{return Rs(be)}finally{if(z)Sp(K,x,j,le,be);else{const Pe=si();Sp(Pe,x,j,le,be),D(Pe,x,j),Kn(Pe)}}};let H,ce;const Se={get signal(){return H||(H=new AbortController),H.signal},get setSelf(){return(Wt?"production":void 0)!=="production"&&!pc(x)&&console.warn("setSelf function cannot be used with read-only atom"),!ce&&pc(x)&&(ce=(...le)=>{if((Wt?"production":void 0)!=="production"&&z&&console.warn("setSelf function cannot be called in sync"),!z)return M(x,...le)}),ce}};try{const le=n(x,J,Se);if(c(x,j,le),Bc(le)){(R=le.onCancel)==null||R.call(le,()=>H==null?void 0:H.abort());const be=()=>{if(j.m){const Pe=si();D(Pe,x,j),Kn(Pe)}};le.then(be,be)}return j}catch(le){return delete j.v,j.e=le,++j.n,j}finally{z=!1}},m=K=>Rs(p(void 0,K)),h=(K,x,O)=>{var R,j;const z=new Map;for(const J of((R=O.m)==null?void 0:R.t)||[])z.set(J,r(J));for(const J of O.p)z.set(J,r(J));return(j=Wy(K,x))==null||j.forEach(J=>{z.set(J,r(J))}),z};function w(K,x,O){const R=[],j=new Set,z=new Set,J=[[x,O]];for(;J.length>0;){const[H,ce]=J[J.length-1];if(z.has(H)){J.pop();continue}if(j.has(H)){R.push([H,ce,ce.n]),z.add(H),J.pop();continue}j.add(H);for(const[Se,le]of h(K,H,ce))H!==Se&&!j.has(Se)&&J.push([Se,le])}return[R,z]}const _=(K,x,O)=>{const[R,j]=w(K,x,O),z=new Set([x]);for(let J=R.length-1;J>=0;--J){const[H,ce,Se]=R[J];let le=!1;for(const be of ce.d.keys())if(be!==H&&z.has(be)){le=!0;break}le&&(p(K,H,j),D(K,H,ce),Se!==ce.n&&(hc(K,H,ce),z.add(H))),j.delete(H)}},S=(K,x,...O)=>{let R=!0;const j=J=>Rs(p(K,J)),z=(J,...H)=>{const ce=r(J);try{if(_p(x,J)){if(!fc(J))throw new Error("atom not writable");const Se=ce.n,le=H[0];c(J,ce,le),D(K,J,ce),Se!==ce.n&&(hc(K,J,ce),_(K,J,ce));return}else return S(K,J,...H)}finally{R||Kn(K)}};try{return i(x,j,z,...O)}finally{R=!1}},M=(K,...x)=>{const O=si();try{return S(O,K,...x)}finally{Kn(O)}},D=(K,x,O)=>{if(O.m&&!Ic(O.v)){for(const R of O.d.keys())O.m.d.has(R)||(F(K,R,r(R)).t.add(x),O.m.d.add(R));for(const R of O.m.d||[])if(!O.d.has(R)){O.m.d.delete(R);const j=B(K,R,r(R));j==null||j.t.delete(x)}}},F=(K,x,O)=>{if(!O.m){p(K,x);for(const R of O.d.keys())F(K,R,r(R)).t.add(x);if(O.m={l:new Set,d:new Set(O.d.keys()),t:new Set},(Wt?"production":void 0)!=="production"&&l.add(x),pc(x)){const R=O.m;let j;const z=(J,H)=>{let ce=!0;j=(...Se)=>{try{return S(J,x,...Se)}finally{ce||Kn(J)}};try{return H()}finally{ce=!1}};kp(K,()=>{const J=z(K,()=>s(x,(...H)=>j(...H)));J&&(R.u=H=>z(H,J))})}}return O.m},B=(K,x,O)=>{if(O.m&&!O.m.l.size&&!Array.from(O.m.t).some(R=>{var j;return(j=r(R).m)==null?void 0:j.d.has(x)})){const R=O.m.u;R&&kp(K,()=>R(K)),delete O.m,(Wt?"production":void 0)!=="production"&&l.delete(x);for(const j of O.d.keys()){const z=B(K,j,r(j));z==null||z.t.delete(x)}return}return O.m},ve={get:m,set:M,sub:(K,x)=>{const O=si(),R=r(K),z=F(O,K,R).l;return z.add(x),Kn(O),()=>{z.delete(x);const J=si();B(J,K,R),Kn(J)}},unstable_derive:K=>hm(...K(r,n,i,s))};return(Wt?"production":void 0)!=="production"&&Object.assign(ve,{dev4_get_internal_weak_map:()=>({get:x=>{const O=r(x);if(O.n!==0)return O}}),dev4_get_mounted_atoms:()=>l,dev4_restore_atoms:x=>{const O=si();for(const[R,j]of x)if(fc(R)){const z=r(R),J=z.n;c(R,z,j),D(O,R,z),J!==z.n&&(hc(O,R,z),_(O,R,z))}Kn(O)}}),ve},mm=()=>{const r=new WeakMap;return hm(i=>{if((Wt?"production":void 0)!=="production"&&!i)throw new Error("Atom is undefined or null");let s=r.get(i);return s||(s={d:new Map,p:new Set,n:0},r.set(i,s)),s},(i,...s)=>i.read(...s),(i,...s)=>i.write(...s),(i,...s)=>{var l;return(l=i.onMount)==null?void 0:l.call(i,...s)})};let ao;const Jy=()=>(ao||(ao=mm(),(Wt?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ao),globalThis.__JOTAI_DEFAULT_STORE__!==ao&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ao),gm={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},vm=Ee.createContext(void 0),ym=r=>{const n=Ee.useContext(vm);return(r==null?void 0:r.store)||n||Jy()},Gy=({children:r,store:n})=>{const i=Ee.useRef();return!n&&!i.current&&(i.current=mm()),Ee.createElement(vm.Provider,{value:n||i.current},r)},Fc=r=>typeof(r==null?void 0:r.then)=="function",_m=r=>{r.status="pending",r.then(n=>{r.status="fulfilled",r.value=n},n=>{r.status="rejected",r.reason=n})},qy=lu.use||(r=>{if(r.status==="pending")throw r;if(r.status==="fulfilled")return r.value;throw r.status==="rejected"?r.reason:(_m(r),r)}),mc=new WeakMap,Ep=r=>{let n=mc.get(r);return n||(n=new Promise((i,s)=>{let l=r;const c=h=>w=>{l===h&&i(w)},p=h=>w=>{l===h&&s(w)},m=h=>{"onCancel"in h&&typeof h.onCancel=="function"&&h.onCancel(w=>{if((gm?"production":void 0)!=="production"&&w===h)throw new Error("[Bug] p is not updated even after cancelation");Fc(w)?(mc.set(w,n),l=w,w.then(c(w),p(w)),m(w)):i(w)})};r.then(c(r),p(r)),m(r)}),mc.set(r,n)),n};function wm(r,n){const i=ym(n),[[s,l,c],p]=Ee.useReducer(w=>{const _=i.get(r);return Object.is(w[0],_)&&w[1]===i&&w[2]===r?w:[_,i,r]},void 0,()=>[i.get(r),i,r]);let m=s;(l!==i||c!==r)&&(p(),m=i.get(r));const h=n==null?void 0:n.delay;if(Ee.useEffect(()=>{const w=i.sub(r,()=>{if(typeof h=="number"){const _=i.get(r);Fc(_)&&_m(Ep(_)),setTimeout(p,h);return}p()});return p(),w},[i,r,h]),Ee.useDebugValue(m),Fc(m)){const w=Ep(m);return qy(w)}return m}function Sm(r,n){const i=ym(n);return Ee.useCallback((...l)=>{if((gm?"production":void 0)!=="production"&&!("write"in r))throw new Error("not writable atom");return i.set(r,...l)},[i,r])}function Hy(r,n){return[wm(r,n),Sm(r,n)]}const Yy={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Qy(r,n){let i=null;const s=new Map,l=new Set,c=m=>{let h;if(n===void 0)h=s.get(m);else for(const[_,S]of s)if(n(_,m)){h=S;break}if(h!==void 0)if(i!=null&&i(h[1],m))c.remove(m);else return h[0];const w=r(m);return s.set(m,[w,Date.now()]),p("CREATE",m,w),w};function p(m,h,w){for(const _ of l)_({type:m,param:h,atom:w})}return c.unstable_listen=m=>(l.add(m),()=>{l.delete(m)}),c.getParams=()=>s.keys(),c.remove=m=>{if(n===void 0){if(!s.has(m))return;const[h]=s.get(m);s.delete(m),p("REMOVE",m,h)}else for(const[h,[w]]of s)if(n(h,m)){s.delete(h),p("REMOVE",h,w);break}},c.setShouldRemove=m=>{if(i=m,!!i)for(const[h,[w,_]]of s)i(_,h)&&(s.delete(h),p("REMOVE",h,w))},c}const Ky=r=>typeof(r==null?void 0:r.then)=="function";function Xy(r=()=>{try{return window.localStorage}catch(i){(Yy?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(i);return}},n){var i;let s,l;const c={getItem:(h,w)=>{var _,S;const M=F=>{if(F=F||"",s!==F){try{l=JSON.parse(F,n==null?void 0:n.reviver)}catch{return w}s=F}return l},D=(S=(_=r())==null?void 0:_.getItem(h))!=null?S:null;return Ky(D)?D.then(M):M(D)},setItem:(h,w)=>{var _;return(_=r())==null?void 0:_.setItem(h,JSON.stringify(w,void 0))},removeItem:h=>{var w;return(w=r())==null?void 0:w.removeItem(h)}},p=h=>(w,_,S)=>h(w,M=>{let D;try{D=JSON.parse(M||"")}catch{D=S}_(D)});let m;try{m=(i=r())==null?void 0:i.subscribe}catch{}return!m&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(m=(h,w)=>{if(!(r()instanceof window.Storage))return()=>{};const _=S=>{S.storageArea===r()&&S.key===h&&w(S.newValue)};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}),m&&(c.subscribe=p(m)),c}Xy();function Zy(r,n){const i=Ee.useMemo(()=>gn(null,(s,l,...c)=>r(s,l,...c)),[r]);return Sm(i,n)}var gc,Cp;function km(){if(Cp)return gc;Cp=1;var r=Object.prototype.toString;gc=function(S){if(S===void 0)return"undefined";if(S===null)return"null";var M=typeof S;if(M==="boolean")return"boolean";if(M==="string")return"string";if(M==="number")return"number";if(M==="symbol")return"symbol";if(M==="function")return p(S)?"generatorfunction":"function";if(i(S))return"array";if(w(S))return"buffer";if(h(S))return"arguments";if(l(S))return"date";if(s(S))return"error";if(c(S))return"regexp";switch(n(S)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(m(S))return"generator";switch(M=r.call(S),M){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return M.slice(8,-1).toLowerCase().replace(/\s/g,"")};function n(_){return typeof _.constructor=="function"?_.constructor.name:null}function i(_){return Array.isArray?Array.isArray(_):_ instanceof Array}function s(_){return _ instanceof Error||typeof _.message=="string"&&_.constructor&&typeof _.constructor.stackTraceLimit=="number"}function l(_){return _ instanceof Date?!0:typeof _.toDateString=="function"&&typeof _.getDate=="function"&&typeof _.setDate=="function"}function c(_){return _ instanceof RegExp?!0:typeof _.flags=="string"&&typeof _.ignoreCase=="boolean"&&typeof _.multiline=="boolean"&&typeof _.global=="boolean"}function p(_,S){return n(_)==="GeneratorFunction"}function m(_){return typeof _.throw=="function"&&typeof _.return=="function"&&typeof _.next=="function"}function h(_){try{if(typeof _.length=="number"&&typeof _.callee=="function")return!0}catch(S){if(S.message.indexOf("callee")!==-1)return!0}return!1}function w(_){return _.constructor&&typeof _.constructor.isBuffer=="function"?_.constructor.isBuffer(_):!1}return gc}/*! - * shallow-clone - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */var vc,bp;function e_(){if(bp)return vc;bp=1;const r=Symbol.prototype.valueOf,n=km();function i(h,w){switch(n(h)){case"array":return h.slice();case"object":return Object.assign({},h);case"date":return new h.constructor(Number(h));case"map":return new Map(h);case"set":return new Set(h);case"buffer":return p(h);case"symbol":return m(h);case"arraybuffer":return l(h);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return c(h);case"regexp":return s(h);case"error":return Object.create(h);default:return h}}function s(h){const w=h.flags!==void 0?h.flags:/\w+$/.exec(h)||void 0,_=new h.constructor(h.source,w);return _.lastIndex=h.lastIndex,_}function l(h){const w=new h.constructor(h.byteLength);return new Uint8Array(w).set(new Uint8Array(h)),w}function c(h,w){return new h.constructor(h.buffer,h.byteOffset,h.length)}function p(h){const w=h.length,_=Buffer.allocUnsafe?Buffer.allocUnsafe(w):Buffer.from(w);return h.copy(_),_}function m(h){return r?Object(r.call(h)):{}}return vc=i,vc}/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */var yc,Tp;function t_(){return Tp||(Tp=1,yc=function(n){return n!=null&&typeof n=="object"&&Array.isArray(n)===!1}),yc}/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */var _c,Mp;function n_(){if(Mp)return _c;Mp=1;var r=t_();function n(i){return r(i)===!0&&Object.prototype.toString.call(i)==="[object Object]"}return _c=function(s){var l,c;return!(n(s)===!1||(l=s.constructor,typeof l!="function")||(c=l.prototype,n(c)===!1)||c.hasOwnProperty("isPrototypeOf")===!1)},_c}var wc,Pp;function r_(){if(Pp)return wc;Pp=1;const r=e_(),n=km(),i=n_();function s(p,m){switch(n(p)){case"object":return l(p,m);case"array":return c(p,m);default:return r(p)}}function l(p,m){if(typeof m=="function")return m(p);if(m||i(p)){const h=new p.constructor;for(let w in p)h[w]=s(p[w],m);return h}return p}function c(p,m){const h=new p.constructor(p.length);for(let w=0;w0&&(H=R[0]),H instanceof Error)throw H;var ce=new Error("Unhandled error."+(H?" ("+H.message+")":""));throw ce.context=H,ce}var Se=J[O];if(Se===void 0)return!1;if(typeof Se=="function")n(Se,this,R);else for(var le=Se.length,be=F(Se,le),j=0;j0&&H.length>z&&!H.warned){H.warned=!0;var ce=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");ce.name="MaxListenersExceededWarning",ce.emitter=x,ce.type=O,ce.count=H.length,s(ce)}return x}c.prototype.addListener=function(O,R){return w(this,O,R,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(O,R){return w(this,O,R,!0)};function _(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function S(x,O,R){var j={fired:!1,wrapFn:void 0,target:x,type:O,listener:R},z=_.bind(j);return z.listener=R,j.wrapFn=z,z}c.prototype.once=function(O,R){return m(R),this.on(O,S(this,O,R)),this},c.prototype.prependOnceListener=function(O,R){return m(R),this.prependListener(O,S(this,O,R)),this},c.prototype.removeListener=function(O,R){var j,z,J,H,ce;if(m(R),z=this._events,z===void 0)return this;if(j=z[O],j===void 0)return this;if(j===R||j.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete z[O],z.removeListener&&this.emit("removeListener",O,j.listener||R));else if(typeof j!="function"){for(J=-1,H=j.length-1;H>=0;H--)if(j[H]===R||j[H].listener===R){ce=j[H].listener,J=H;break}if(J<0)return this;J===0?j.shift():B(j,J),j.length===1&&(z[O]=j[0]),z.removeListener!==void 0&&this.emit("removeListener",O,ce||R)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(O){var R,j,z;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[O]),this;if(arguments.length===0){var J=Object.keys(j),H;for(z=0;z=0;z--)this.removeListener(O,R[z]);return this};function M(x,O,R){var j=x._events;if(j===void 0)return[];var z=j[O];return z===void 0?[]:typeof z=="function"?R?[z.listener||z]:[z]:R?q(z):F(z,z.length)}c.prototype.listeners=function(O){return M(this,O,!0)},c.prototype.rawListeners=function(O){return M(this,O,!1)},c.listenerCount=function(x,O){return typeof x.listenerCount=="function"?x.listenerCount(O):D.call(x,O)},c.prototype.listenerCount=D;function D(x){var O=this._events;if(O!==void 0){var R=O[x];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function F(x,O){for(var R=new Array(O),j=0;jEm);async function Em(r,n,i,s){try{console.debug("[RTVI] Fetch action",r,n);const l=new Headers({...Object.fromEntries((i.headers??new Headers).entries())});l.has("Content-Type")||l.set("Content-Type","application/json"),l.set("Cache-Control","no-cache"),l.set("Connection","keep-alive");const c=await fetch(r,{method:"POST",headers:l,body:JSON.stringify({...i.requestData,actions:[n]})}),p=c.headers.get("content-type");if(!c.ok){const m=await c.text();throw new Dt(`Failed to resolve action: ${m}`,c.status)}if(c.body&&(p!=null&&p.includes("text/event-stream"))){const m=c.body.pipeThrough(new TextDecoderStream).getReader();let h="";for(;;){const{value:w,done:_}=await m.read();if(_)break;h+=w;let S=h.indexOf(` - -`);for(;S!==-1;){const M=h.slice(0,S);h=h.slice(S+2);const D=M.split(` -`);let F="";for(const B of D){const q=B.indexOf(":");q!==-1&&(F+=B.slice(q+1).trim())}try{const B=atob(F),q=JSON.parse(B);s(q)}catch(B){throw console.error("[RTVI] Failed to parse JSON:",B),B}S=h.indexOf(` - -`)}}}else{const m=await c.json();s(m)}}catch(l){throw console.error("[RTVI] Error during fetch:",l),l}}var m_={};et(m_,"RTVIClient",()=>On);var Cm={};Cm=JSON.parse('{"name":"realtime-ai","version":"0.2.1","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/rtvi-ai/rtvi-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent && parcel build --no-cache","dev":"parcel watch","lint":"eslint src/ --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","@typescript-eslint/eslint-plugin":"^7.16.0","@typescript-eslint/parser":"^7.16.0","eslint":"9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","ts-jest":"^29.2.5"},"dependencies":{"@types/events":"^3.0.3","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');var Ar={};et(Ar,"RTVIError",()=>Dt);et(Ar,"ConnectionTimeoutError",()=>bm);et(Ar,"StartBotError",()=>Uc);et(Ar,"TransportStartError",()=>Tm);et(Ar,"BotNotReadyError",()=>rr);et(Ar,"ConfigUpdateError",()=>g_);et(Ar,"VoiceError",()=>v_);class Dt extends Error{constructor(n,i){super(n),this.status=i}}class bm extends Dt{constructor(n){super(n??"Bot did not enter ready state within the specified timeout period.")}}class Uc extends Dt{constructor(n,i){super(n??"Failed to connect / invalid auth bundle from base url",i??500),this.error="invalid-request-error"}}class Tm extends Dt{constructor(n){super(n??"Unable to connect to transport")}}class rr extends Dt{constructor(n){super(n??"Attempt to call action on transport when not in 'ready' state.")}}class g_ extends Dt{constructor(n){super(n??"Unable to update configuration"),this.status=400}}class v_ extends Dt{}function wi(r,n,i){const s=i.value;return i.value=function(...l){if(this.state==="ready")return s.apply(this,l);throw new rr(`Attempt to call ${n.toString()} when transport not in ready state. Await connect() first.`)},i}function y_(...r){return r=["ready",...r],function(n,i,s){const l=s.get;return s.get=function(){if(r.includes(this.state))return l==null?void 0:l.apply(this);throw new rr(`Attempt to call ${i.toString()} when transport not in ${r}. Await connect() first.`)},s}}var __={};et(__,"RTVIEvent",()=>pe);var pe;(function(r){r.MessageError="messageError",r.Error="error",r.Connected="connected",r.Disconnected="disconnected",r.TransportStateChanged="transportStateChanged",r.Config="config",r.ConfigDescribe="configDescribe",r.ActionsAvailable="actionsAvailable",r.ParticipantConnected="participantConnected",r.ParticipantLeft="participantLeft",r.TrackStarted="trackStarted",r.TrackedStopped="trackStopped",r.AvailableCamsUpdated="availableCamsUpdated",r.AvailableMicsUpdated="availableMicsUpdated",r.CamUpdated="camUpdated",r.MicUpdated="micUpdated",r.BotConnected="botConnected",r.BotReady="botReady",r.BotDisconnected="botDisconnected",r.BotStartedSpeaking="botStartedSpeaking",r.BotStoppedSpeaking="botStoppedSpeaking",r.RemoteAudioLevel="remoteAudioLevel",r.UserStartedSpeaking="userStartedSpeaking",r.UserStoppedSpeaking="userStoppedSpeaking",r.LocalAudioLevel="localAudioLevel",r.Metrics="metrics",r.UserTranscript="userTranscript",r.BotTranscript="botTranscript",r.BotLlmText="botLlmText",r.BotLlmStarted="botLlmStarted",r.BotLlmStopped="botLlmStopped",r.BotTtsText="botTtsText",r.BotTtsStarted="botTtsStarted",r.BotTtsStopped="botTtsStopped",r.LLMFunctionCall="llmFunctionCall",r.LLMFunctionCallStart="llmFunctionCallStart",r.LLMJsonCompletion="llmJsonCompletion",r.StorageItemStored="storageItemStored",r.BotText="botText"})(pe||(pe={}));var w_={};et(w_,"RTVIClientHelper",()=>cu);class cu{constructor(n){this._options=n}set client(n){this._client=n}set service(n){this._service=n}}var Dr={};et(Dr,"RTVI_MESSAGE_LABEL",()=>Mm);et(Dr,"RTVIMessageType",()=>xe);et(Dr,"RTVIMessage",()=>gt);et(Dr,"RTVI_ACTION_TYPE",()=>Pm);et(Dr,"RTVIActionRequest",()=>Om);et(Dr,"MessageDispatcher",()=>xm);et(Dr,"VoiceMessage",()=>S_);const Mm="rtvi-ai";var xe;(function(r){r.CLIENT_READY="client-ready",r.UPDATE_CONFIG="update-config",r.GET_CONFIG="get-config",r.DESCRIBE_CONFIG="describe-config",r.DESCRIBE_ACTIONS="describe-actions",r.BOT_READY="bot-ready",r.ERROR="error",r.ERROR_RESPONSE="error-response",r.CONFIG="config",r.CONFIG_AVAILABLE="config-available",r.CONFIG_ERROR="config-error",r.ACTIONS_AVAILABLE="actions-available",r.ACTION_RESPONSE="action-response",r.METRICS="metrics",r.USER_TRANSCRIPTION="user-transcription",r.BOT_TRANSCRIPTION="bot-transcription",r.USER_STARTED_SPEAKING="user-started-speaking",r.USER_STOPPED_SPEAKING="user-stopped-speaking",r.BOT_STARTED_SPEAKING="bot-started-speaking",r.BOT_STOPPED_SPEAKING="bot-stopped-speaking",r.USER_LLM_TEXT="user-llm-text",r.BOT_LLM_TEXT="bot-llm-text",r.BOT_LLM_STARTED="bot-llm-started",r.BOT_LLM_STOPPED="bot-llm-stopped",r.BOT_TTS_TEXT="bot-tts-text",r.BOT_TTS_STARTED="bot-tts-started",r.BOT_TTS_STOPPED="bot-tts-stopped",r.STORAGE_ITEM_STORED="storage-item-stored"})(xe||(xe={}));class gt{constructor(n,i,s){this.label=Mm,this.type=n,this.data=i,this.id=s||f_().slice(0,8)}static clientReady(){return new gt(xe.CLIENT_READY,{})}static updateConfig(n,i=!1){return new gt(xe.UPDATE_CONFIG,{config:n,interrupt:i})}static describeConfig(){return new gt(xe.DESCRIBE_CONFIG,{})}static getBotConfig(){return new gt(xe.GET_CONFIG,{})}static describeActions(){return new gt(xe.DESCRIBE_ACTIONS,{})}}const Pm="action";class Om extends gt{constructor(n){super(Pm,n)}}class xm{constructor(n){this._queue=new Array,this._gcTime=1e4,this._queue=[],this._client=n}dispatch(n){const i=new Promise((s,l)=>{this._queue.push({message:n,timestamp:Date.now(),resolve:s,reject:l})});return console.debug("[MessageDispatcher] dispatch",n),this._client.sendMessage(n),this._gc(),i}async dispatchAction(n,i){const s=new Promise((l,c)=>{this._queue.push({message:n,timestamp:Date.now(),resolve:l,reject:c})});if(console.debug("[MessageDispatcher] action",n),this._client.connected)this._client.sendMessage(n);else{const l=this._client.constructUrl("action");try{await Em(l,n,this._client.params,c=>{i(c)})}catch{i(new gt(xe.ERROR_RESPONSE,`Action endpoint '${l}' returned an error response`,n.id))}}return this._gc(),s}_resolveReject(n,i=!0){const s=this._queue.find(l=>l.message.id===n.id);return s&&(i?(console.debug("[MessageDispatcher] Resolve",n),s.resolve((n.type===xe.ACTION_RESPONSE,n))):(console.debug("[MessageDispatcher] Reject",n),s.reject(n)),this._queue=this._queue.filter(l=>l.message.id!==n.id),console.debug("[MessageDispatcher] Queue",this._queue)),n}resolve(n){return this._resolveReject(n,!0)}reject(n){return this._resolveReject(n,!1)}_gc(){this._queue=this._queue.filter(n=>Date.now()-n.timestamp=0;m--)(p=r[m])&&(c=(l<3?p(c):l>3?p(n,i,c):p(n,i))||c);return l>3&&c&&Object.defineProperty(n,i,c),c};const k_={connect:"/connect",action:"/action"};class E_ extends a_{}class On extends E_{constructor(n){super(),this.params={...n.params,endpoints:{...k_,...n.params.endpoints??{}}},this._helpers={},this._transport=n.transport;const i={...n.callbacks,onMessageError:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onMessageError)==null||c.call(l,s),this.emit(pe.MessageError,s)},onError:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onError)==null||c.call(l,s),this.emit(pe.Error,s)},onConnected:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onConnected)==null||l.call(s),this.emit(pe.Connected)},onDisconnected:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onDisconnected)==null||l.call(s),this.emit(pe.Disconnected)},onTransportStateChanged:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onTransportStateChanged)==null||c.call(l,s),this.emit(pe.TransportStateChanged,s)},onConfig:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onConfig)==null||c.call(l,s),this.emit(pe.Config,s)},onConfigDescribe:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onConfigDescribe)==null||c.call(l,s),this.emit(pe.ConfigDescribe,s)},onActionsAvailable:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onActionsAvailable)==null||c.call(l,s),this.emit(pe.ActionsAvailable,s)},onParticipantJoined:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onParticipantJoined)==null||c.call(l,s),this.emit(pe.ParticipantConnected,s)},onParticipantLeft:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onParticipantLeft)==null||c.call(l,s),this.emit(pe.ParticipantLeft,s)},onTrackStarted:(s,l)=>{var c,p;(p=(c=n==null?void 0:n.callbacks)==null?void 0:c.onTrackStarted)==null||p.call(c,s,l),this.emit(pe.TrackStarted,s,l)},onTrackStopped:(s,l)=>{var c,p;(p=(c=n==null?void 0:n.callbacks)==null?void 0:c.onTrackStopped)==null||p.call(c,s,l),this.emit(pe.TrackedStopped,s,l)},onAvailableCamsUpdated:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onAvailableCamsUpdated)==null||c.call(l,s),this.emit(pe.AvailableCamsUpdated,s)},onAvailableMicsUpdated:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onAvailableMicsUpdated)==null||c.call(l,s),this.emit(pe.AvailableMicsUpdated,s)},onCamUpdated:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onCamUpdated)==null||c.call(l,s),this.emit(pe.CamUpdated,s)},onMicUpdated:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onMicUpdated)==null||c.call(l,s),this.emit(pe.MicUpdated,s)},onBotConnected:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotConnected)==null||c.call(l,s),this.emit(pe.BotConnected,s)},onBotReady:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotReady)==null||c.call(l,s),this.emit(pe.BotReady,s)},onBotDisconnected:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotDisconnected)==null||c.call(l,s),this.emit(pe.BotDisconnected,s)},onBotStartedSpeaking:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotStartedSpeaking)==null||l.call(s),this.emit(pe.BotStartedSpeaking)},onBotStoppedSpeaking:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotStoppedSpeaking)==null||l.call(s),this.emit(pe.BotStoppedSpeaking)},onRemoteAudioLevel:(s,l)=>{var c,p;(p=(c=n==null?void 0:n.callbacks)==null?void 0:c.onRemoteAudioLevel)==null||p.call(c,s,l),this.emit(pe.RemoteAudioLevel,s,l)},onUserStartedSpeaking:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onUserStartedSpeaking)==null||l.call(s),this.emit(pe.UserStartedSpeaking)},onUserStoppedSpeaking:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onUserStoppedSpeaking)==null||l.call(s),this.emit(pe.UserStoppedSpeaking)},onLocalAudioLevel:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onLocalAudioLevel)==null||c.call(l,s),this.emit(pe.LocalAudioLevel,s)},onUserTranscript:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onUserTranscript)==null||c.call(l,s),this.emit(pe.UserTranscript,s)},onBotTranscript:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotTranscript)==null||c.call(l,s),this.emit(pe.BotTranscript,s)},onBotLlmText:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotLlmText)==null||c.call(l,s),this.emit(pe.BotLlmText,s)},onBotLlmStarted:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotLlmStarted)==null||l.call(s),this.emit(pe.BotLlmStarted)},onBotLlmStopped:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotLlmStopped)==null||l.call(s),this.emit(pe.BotLlmStopped)},onBotTtsText:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotTtsText)==null||c.call(l,s),this.emit(pe.BotTtsText,s)},onBotTtsStarted:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotTtsStarted)==null||l.call(s),this.emit(pe.BotTtsStarted)},onBotTtsStopped:()=>{var s,l;(l=(s=n==null?void 0:n.callbacks)==null?void 0:s.onBotTtsStopped)==null||l.call(s),this.emit(pe.BotTtsStopped)},onStorageItemStored:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onStorageItemStored)==null||c.call(l,s),this.emit(pe.StorageItemStored,s)},onBotText:s=>{var l,c;(c=(l=n==null?void 0:n.callbacks)==null?void 0:l.onBotText)==null||c.call(l,s),this.emit(pe.BotText,s)}};this._options={...n,callbacks:i,enableMic:n.enableMic??!0,enableCam:n.enableCam??!1},this._initialize(),console.debug("[RTVI Client] Initialized",this.version)}constructUrl(n){var s;if(!this.params.baseUrl)throw new Dt("Base URL not set. Please set rtviClient.params.baseUrl");return this.params.baseUrl.replace(/\/+$/,"")+(((s=this.params.endpoints)==null?void 0:s[n])??"")}async initDevices(){console.debug("[RTVI Client] Initializing devices..."),await this._transport.initDevices()}async connect(){if(["authenticating","connecting","connected","ready"].includes(this._transport.state))throw new Dt("Voice client has already been started. Please call disconnect() before starting again.");return this._abortController=new AbortController,new Promise((n,i)=>{(async()=>{var p,m;this._startResolve=n,this._transport.state==="disconnected"&&await this._transport.initDevices(),this._transport.state="authenticating",this._options.timeout&&(this._handshakeTimeout=setTimeout(async()=>{var h;(h=this._abortController)==null||h.abort(),await this.disconnect(),this._transport.state="error",i(new bm)},this._options.timeout));let s;const l=this._options.customConnectHandler,c=this.constructUrl("connect");this.params={...this.params,requestData:{...this.params.requestData,rtvi_client_version:this.version}},console.debug("[RTVI Client] Connecting...",c),console.debug("[RTVI Client] Start params",this.params);try{l?s=await l(this.params,this._handshakeTimeout,this._abortController):s=await fetch(c,{method:"POST",mode:"cors",headers:new Headers({"Content-Type":"application/json",...Object.fromEntries((this.params.headers??new Headers).entries())}),body:JSON.stringify({services:this._options.services,config:this.params.config??this._options.config,...this._options.customBodyParams,...this.params.requestData}),signal:(p=this._abortController)==null?void 0:p.signal}).then(h=>(clearTimeout(this._handshakeTimeout),h.ok?h.json():Promise.reject(h)))}catch(h){if(clearTimeout(this._handshakeTimeout),(m=this._abortController)!=null&&m.signal.aborted)return;if(this._transport.state="error",h instanceof Response){const w=await h.json();i(new Uc(w.info??w.detail??h.statusText,h.status))}else i(new Uc);return}console.debug("[RTVI Client] Auth bundle received",s);try{await this._transport.connect(s,this._abortController)}catch(h){clearTimeout(this._handshakeTimeout),i(h);return}await this._transport.sendReadyMessage()})()})}async disconnect(){this._abortController&&this._abortController.abort(),clearTimeout(this._handshakeTimeout),await this._transport.disconnect(),this._initialize()}_initialize(){this._transport=this._options.transport,this._transport.initialize(this._options,this.handleMessage.bind(this)),this._messageDispatcher=new xm(this)}get connected(){return["connected","ready"].includes(this._transport.state)}get state(){return this._transport.state}get version(){return p_(Cm).version}async getAllMics(){return await this._transport.getAllMics()}async getAllCams(){return await this._transport.getAllCams()}get selectedMic(){return this._transport.selectedMic}get selectedCam(){return this._transport.selectedCam}updateMic(n){this._transport.updateMic(n)}updateCam(n){this._transport.updateCam(n)}enableMic(n){this._transport.enableMic(n)}get isMicEnabled(){return this._transport.isMicEnabled}enableCam(n){this._transport.enableCam(n)}get isCamEnabled(){return this._transport.isCamEnabled}tracks(){return this._transport.tracks()}async getConfig(){return(await this._messageDispatcher.dispatch(gt.getBotConfig())).data.config}async updateConfig(n,i=!1){return console.debug("[RTVI Client] Updating config",n),this._messageDispatcher.dispatch(gt.updateConfig(n,i))}async describeConfig(){return this._messageDispatcher.dispatch(gt.describeConfig())}async getServiceOptionsFromConfig(n,i){if(!i&&this.state!=="ready")throw new rr("getServiceOptionsFromConfig called without config array before bot is ready");return Promise.resolve().then(async()=>{if(!n){console.debug("Target service name is required");return}const l=(i??await this.getConfig()).find(c=>c.service===n);if(!l){console.debug("No service with name "+n+" not found in config");return}return l})}async getServiceOptionValueFromConfig(n,i,s){const l=await this.getServiceOptionsFromConfig(n,s);if(!l){console.debug("Service with name "+n+" not found in config");return}const c=l.options.find(p=>p.name===i);return c?c.value:void 0}_updateOrAddOption(n,i){const s=n.findIndex(l=>l.name===i.name);return s!==-1?n.map((l,c)=>c===s?{...l,value:i.value}:l):[...n,{name:i.name,value:i.value}]}async setServiceOptionInConfig(n,i,s){const l=Op(s??await this.getConfig());if(!await this.getServiceOptionsFromConfig(n,l))return console.debug("Service with name '"+n+"' not found in config"),l;const p=Array.isArray(i)?i:[i];for(const m of p){const h=l.find(_=>_.service===n),w=h?this._updateOrAddOption(h.options,m):[{name:m.name,value:m.value}];h?h.options=w:l.push({service:n,options:w})}return l}async setConfigOptions(n,i){let s=Op(i??await this.getConfig());for(const l of n)s=await this.setServiceOptionInConfig(l.service,l.options,s)||s;return s}async action(n){return this._messageDispatcher.dispatchAction(new Om(n),this.handleMessage.bind(this))}async describeActions(){return this._messageDispatcher.dispatch(gt.describeActions())}get transportExpiry(){return this._transport.expiry}sendMessage(n){this._transport.sendMessage(n)}handleMessage(n){var i,s,l,c,p,m,h,w,_,S,M,D,F,B,q,ne,ve,K,x,O,R,j,z,J,H,ce,Se,le,be,Pe,Je,Te,Q,ae,Z,P,U,ge,ue,d,g,v,C,k,I;switch(console.debug("[RTVI Message]",n),n.type){case xe.BOT_READY:clearTimeout(this._handshakeTimeout),(i=this._startResolve)==null||i.call(this,n.data),(l=(s=this._options.callbacks)==null?void 0:s.onBotReady)==null||l.call(s,n.data);break;case xe.CONFIG_AVAILABLE:this._messageDispatcher.resolve(n),(p=(c=this._options.callbacks)==null?void 0:c.onConfigDescribe)==null||p.call(c,n.data);break;case xe.CONFIG:{const X=this._messageDispatcher.resolve(n);(h=(m=this._options.callbacks)==null?void 0:m.onConfig)==null||h.call(m,X.data.config);break}case xe.ACTIONS_AVAILABLE:this._messageDispatcher.resolve(n),(_=(w=this._options.callbacks)==null?void 0:w.onActionsAvailable)==null||_.call(w,n.data);break;case xe.ACTION_RESPONSE:this._messageDispatcher.resolve(n);break;case xe.ERROR_RESPONSE:{const X=this._messageDispatcher.reject(n);(M=(S=this._options.callbacks)==null?void 0:S.onMessageError)==null||M.call(S,X);break}case xe.ERROR:(F=(D=this._options.callbacks)==null?void 0:D.onError)==null||F.call(D,n);break;case xe.USER_STARTED_SPEAKING:(q=(B=this._options.callbacks)==null?void 0:B.onUserStartedSpeaking)==null||q.call(B);break;case xe.USER_STOPPED_SPEAKING:(ve=(ne=this._options.callbacks)==null?void 0:ne.onUserStoppedSpeaking)==null||ve.call(ne);break;case xe.BOT_STARTED_SPEAKING:(x=(K=this._options.callbacks)==null?void 0:K.onBotStartedSpeaking)==null||x.call(K);break;case xe.BOT_STOPPED_SPEAKING:(R=(O=this._options.callbacks)==null?void 0:O.onBotStoppedSpeaking)==null||R.call(O);break;case xe.USER_TRANSCRIPTION:{const X=n.data;(z=(j=this._options.callbacks)==null?void 0:j.onUserTranscript)==null||z.call(j,X);break}case xe.BOT_TRANSCRIPTION:(H=(J=this._options.callbacks)==null?void 0:J.onBotTranscript)==null||H.call(J,n.data);break;case xe.BOT_LLM_TEXT:(Se=(ce=this._options.callbacks)==null?void 0:ce.onBotLlmText)==null||Se.call(ce,n.data),(be=(le=this._options.callbacks)==null?void 0:le.onBotText)==null||be.call(le,n.data);break;case xe.BOT_LLM_STARTED:(Je=(Pe=this._options.callbacks)==null?void 0:Pe.onBotLlmStarted)==null||Je.call(Pe);break;case xe.BOT_LLM_STOPPED:(Q=(Te=this._options.callbacks)==null?void 0:Te.onBotLlmStopped)==null||Q.call(Te);break;case xe.BOT_TTS_TEXT:(Z=(ae=this._options.callbacks)==null?void 0:ae.onBotTtsText)==null||Z.call(ae,n.data);break;case xe.BOT_TTS_STARTED:(U=(P=this._options.callbacks)==null?void 0:P.onBotTtsStarted)==null||U.call(P);break;case xe.BOT_TTS_STOPPED:(ue=(ge=this._options.callbacks)==null?void 0:ge.onBotTtsStopped)==null||ue.call(ge);break;case xe.METRICS:this.emit(pe.Metrics,n.data),(g=(d=this._options.callbacks)==null?void 0:d.onMetrics)==null||g.call(d,n.data);break;case xe.STORAGE_ITEM_STORED:(C=(v=this._options.callbacks)==null?void 0:v.onStorageItemStored)==null||C.call(v,n.data);break;default:{let X=!1;for(const oe of Object.values(this._helpers))oe.getMessageTypes().includes(n.type)&&(X=!0,oe.handleMessage(n));X||(I=(k=this._options.callbacks)==null?void 0:k.onGenericMessage)==null||I.call(k,n.data)}}}registerHelper(n,i){if(this._helpers[n])throw new Error(`Helper with name '${n}' already registered`);if(!(i instanceof cu))throw new Error("Helper must be an instance of RTVIClientHelper");return i.service=n,i.client=this,this._helpers[n]=i,this._helpers[n]}getHelper(n){const i=this._helpers[n];if(!i){console.debug(`Helper targeting service '${n}' not found`);return}return i}unregisterHelper(n){this._helpers[n]&&delete this._helpers[n]}async start(){return this.connect()}async getBotConfig(){return console.warn("VoiceClient.getBotConfig is deprecated. Use getConfig instead."),this.getConfig()}get config(){return console.warn("VoiceClient.config is deprecated. Use getConfig instead."),this._options.config}get services(){return console.warn("VoiceClient.services is deprecated."),this._options.services}set services(n){if(console.warn("VoiceClient.services is deprecated."),!["authenticating","connecting","connected","ready"].includes(this._transport.state))this._options.services=n;else throw new Dt("Cannot set services while transport is connected")}}Nr([wi],On.prototype,"getConfig",null);Nr([wi],On.prototype,"updateConfig",null);Nr([wi],On.prototype,"describeConfig",null);Nr([wi],On.prototype,"describeActions",null);Nr([y_("connected","ready")],On.prototype,"transportExpiry",null);Nr([wi],On.prototype,"sendMessage",null);Nr([wi],On.prototype,"getBotConfig",null);var Lm={};et(Lm,"LLMMessageType",()=>nr);et(Lm,"LLMHelper",()=>C_);var nr;(function(r){r.LLM_FUNCTION_CALL="llm-function-call",r.LLM_FUNCTION_CALL_START="llm-function-call-start",r.LLM_FUNCTION_CALL_RESULT="llm-function-call-result",r.LLM_JSON_COMPLETION="llm-json-completion"})(nr||(nr={}));class C_ extends cu{constructor(n){super(n),this._functionCallCallback=null}getMessageTypes(){return Object.values(nr)}async getContext(){if(this._client.state!=="ready")throw new rr("getContext called while transport not in ready state");return(await this._client.action({service:this._service,action:"get_context"})).data.result}async setContext(n,i=!1){if(this._client.state!=="ready")throw new rr("setContext called while transport not in ready state");return!!(await this._client.action({service:this._service,action:"set_context",arguments:[{name:"messages",value:n.messages},{name:"interrupt",value:i}]})).data.result}async appendToMessages(n,i=!1){if(this._client.state!=="ready")throw new rr("setContext called while transport not in ready state");return!!(await this._client.action({service:this._service,action:"append_to_messages",arguments:[{name:"messages",value:[n]},{name:"run_immediately",value:i}]})).data.result}async run(n=!1){if(this._client.state==="ready")return this._client.action({service:this._service,action:"run",arguments:[{name:"interrupt",value:n}]})}handleFunctionCall(n){this._functionCallCallback=n}handleMessage(n){var i,s,l,c,p,m;switch(n.type){case nr.LLM_JSON_COMPLETION:(s=(i=this._options.callbacks)==null?void 0:i.onLLMJsonCompletion)==null||s.call(i,n.data),this._client.emit(pe.LLMJsonCompletion,n.data);break;case nr.LLM_FUNCTION_CALL:{const h=n.data;if((c=(l=this._options.callbacks)==null?void 0:l.onLLMFunctionCall)==null||c.call(l,n.data),this._client.emit(pe.LLMFunctionCall,n.data),this._functionCallCallback){const w={functionName:h.function_name,arguments:h.args};if(this._client.state==="ready")this._functionCallCallback(w).then(_=>{this._client.sendMessage(new gt(nr.LLM_FUNCTION_CALL_RESULT,{function_name:h.function_name,tool_call_id:h.tool_call_id,arguments:h.args,result:_}))});else throw new rr("Attempted to send a function call result from bot while transport not in ready state")}break}case nr.LLM_FUNCTION_CALL_START:{const h=n.data;(m=(p=this._options.callbacks)==null?void 0:p.onLLMFunctionCallStart)==null||m.call(p,h.function_name),this._client.emit(pe.LLMFunctionCallStart,h.function_name);break}}}}var b_={};et(b_,"Transport",()=>Am);class Am{constructor(){this._state="disconnected",this._expiry=void 0}get expiry(){return this._expiry}}const Dm=Ee.createContext({}),Nm=({children:r,client:n})=>ze.jsx(Gy,{children:ze.jsx(Dm.Provider,{value:{client:n},children:r})});Nm.displayName="RTVIClientProvider";const fa=()=>{const{client:r}=Ee.useContext(Dm);return r},pn=(r,n)=>{const i=fa();Ee.useEffect(()=>{if(i)return i.on(r,n),()=>{i.off(r,n)}},[r,n,i])},T_=gn(null),M_=gn(null),P_=gn(null),O_=gn(null),Ap=Qy(({local:r,trackType:n})=>r?n==="audio"?T_:M_:n==="audio"?P_:O_),uu=(r,n)=>{const i=fa(),s=wm(Ap({local:n==="local",trackType:r})),l=Zy(Ee.useCallback((c,p,m,h,w)=>{const _=Ap({local:w,trackType:h}),S=c(_);(S==null?void 0:S.id)!==m.id&&p(_,m)},[n,s,r]));return pn(pe.TrackStarted,Ee.useCallback((c,p)=>{l(c,c.kind,!!(p!=null&&p.local))},[])),Ee.useEffect(()=>{var m;if(!i)return;const c=i.tracks(),p=(m=c==null?void 0:c[n])==null?void 0:m[r];p&&l(p,r,n==="local")},[n,r,l,i]),s},Rm=()=>{const r=Ee.useRef(null),n=uu("audio","bot");return Ee.useEffect(()=>{!r.current||!n||r.current.srcObject&&r.current.srcObject.getAudioTracks()[0].id===n.id||(r.current.srcObject=new MediaStream([n]))},[n]),ze.jsx(ze.Fragment,{children:ze.jsx("audio",{ref:r,autoPlay:!0})})};Rm.displayName="RTVIClientAudio";function x_(...r){return Ee.useCallback(n=>{for(let i=0;i{const ve=M.play();ve!==void 0&&ve.then(()=>{M.controls=!1}).catch(K=>{M.controls=!0,console.warn("Failed to play video",K)})},F=()=>{M.paused&&D()},B=()=>{M.style.transform="scale(1)"},q=()=>{M.style.transform="",setTimeout(()=>{M.paused&&D()},100)},ne=()=>{document.visibilityState!=="hidden"&&M.paused&&D()};return M.addEventListener("canplay",F),M.addEventListener("enterpictureinpicture",B),M.addEventListener("leavepictureinpicture",q),document.addEventListener("visibilitychange",ne),()=>{M.removeEventListener("canplay",F),M.removeEventListener("enterpictureinpicture",B),M.removeEventListener("leavepictureinpicture",q),document.removeEventListener("visibilitychange",ne)}},[]),Ee.useEffect(function(){const M=w.current;if(!(!M||!h))return M.srcObject=new MediaStream([h]),M.load(),()=>{M.srcObject=null,M.load()}},[h,h==null?void 0:h.id]),Ee.useEffect(function(){const M=w.current;if(!l||!M)return;let D;function F(){D&&cancelAnimationFrame(D),D=requestAnimationFrame(()=>{const B=w.current;if(!B||document.hidden)return;const q=B.videoWidth,ne=B.videoHeight;q&&ne&&(l==null||l({aspectRatio:q/ne,height:ne,width:q}))})}return F(),M.addEventListener("loadedmetadata",F),M.addEventListener("resize",F),()=>{D&&cancelAnimationFrame(D),M.removeEventListener("loadedmetadata",F),M.removeEventListener("resize",F)}},[l]),ze.jsx("video",{autoPlay:!0,muted:!0,playsInline:!0,ref:_,style:{objectFit:i,transform:s?"scale(-1, 1)":"",...c},...p})});A_.displayName="RTVIClientVideo";const D_=lu.memo(({backgroundColor:r="transparent",barColor:n="black",barWidth:i=30,barGap:s=12,barMaxHeight:l=120,participantType:c})=>{const p=Ee.useRef(null),m=uu("audio",c);return Ee.useEffect(()=>{if(!p.current)return;const h=5*i+4*s,w=l,_=p.current,S=2,M=()=>{_.width=h*S,_.height=w*S,_.style.width=`${h}px`,_.style.height=`${w}px`,D.lineCap="round",D.scale(S,S)},D=_.getContext("2d");if(M(),!m)return;const F=new AudioContext,B=F.createMediaStreamSource(new MediaStream([m])),q=F.createAnalyser();q.fftSize=1024,B.connect(q);const ne=new Uint8Array(q.frequencyBinCount);D.lineCap="round";const ve=[{startFreq:85,endFreq:255,smoothValue:0},{startFreq:255,endFreq:500,smoothValue:0},{startFreq:500,endFreq:2e3,smoothValue:0},{startFreq:2e3,endFreq:4e3,smoothValue:0},{startFreq:4e3,endFreq:8e3,smoothValue:0}],K=R=>{const j=F.sampleRate/2;return Math.round(R/j*(q.frequencyBinCount-1))};function x(){q.getByteFrequencyData(ne),D.clearRect(0,0,_.width/S,_.height/S),D.fillStyle=r,D.fillRect(0,0,_.width/S,_.height/S);let R=!1;const j=ve.length*i+(ve.length-1)*s,z=(_.width/S-j)/2,J=i/2;ve.forEach((H,ce)=>{const Se=K(H.startFreq),le=K(H.endFreq),be=ne.slice(Se,le),Pe=be.reduce((P,U)=>P+U,0)/be.length,Je=.2;Pe<1?H.smoothValue=Math.max(H.smoothValue-Je*5,0):(H.smoothValue=H.smoothValue+(Pe-H.smoothValue)*Je,R=!0);const Te=z+ce*(i+s),Q=Math.min(H.smoothValue/255*l,l),ae=Math.max(_.height/S/2-Q/2,J),Z=Math.min(_.height/S/2+Q/2,_.height/S-J);H.smoothValue>0?(D.beginPath(),D.moveTo(Te+i/2,ae),D.lineTo(Te+i/2,Z),D.lineWidth=i,D.strokeStyle=n,D.stroke()):(D.beginPath(),D.arc(Te+i/2,_.height/S/2,J,0,2*Math.PI),D.fillStyle=n,D.fill(),D.closePath())}),R||O(J,n),requestAnimationFrame(x)}function O(R,j){const z=ve.length*i+(ve.length-1)*s,J=(_.width/S-z)/2,H=_.height/S/2;ve.forEach((ce,Se)=>{const le=J+Se*(i+s);D.beginPath(),D.arc(le+i/2,H,R,0,2*Math.PI),D.fillStyle=j,D.fill(),D.closePath()})}return x(),window.addEventListener("resize",M),()=>{F.close(),window.removeEventListener("resize",M)}},[r,n,s,l,i,m]),ze.jsx("canvas",{ref:p,style:{display:"block",width:"100%",height:"100%"}})});D_.displayName="VoiceVisualizer";gn([]);gn([]);gn({});gn({});const N_=gn("disconnected"),jm=()=>{const[r,n]=Hy(N_);return pn(pe.TransportStateChanged,n),r};function Dp(r,n){if(r==null)return{};var i,s,l=function(p,m){if(p==null)return{};var h,w,_={},S=Object.keys(p);for(w=0;w=0||(_[h]=p[h]);return _}(r,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(r,i)&&(l[i]=r[i])}return l}function on(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function Ne(r){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ne(r)}function Im(r){var n=function(i,s){if(Ne(i)!=="object"||i===null)return i;var l=i[Symbol.toPrimitive];if(l!==void 0){var c=l.call(i,s||"default");if(Ne(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}(r,"string");return Ne(n)==="symbol"?n:String(n)}function Np(r,n){for(var i=0;ir.length)&&(n=r.length);for(var i=0,s=new Array(n);i0&&p.length>l&&!p.warned){p.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+p.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=r,h.type=n,h.count=p.length,m=h,console&&console.warn&&console.warn(m)}return r}function j_(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function $p(r,n,i){var s={fired:!1,wrapFn:void 0,target:r,type:n,listener:i},l=j_.bind(s);return l.listener=i,s.wrapFn=l,l}function zp(r,n,i){var s=r._events;if(s===void 0)return[];var l=s[n];return l===void 0?[]:typeof l=="function"?i?[l.listener||l]:[l]:i?function(c){for(var p=new Array(c.length),m=0;m0&&(c=n[0]),c instanceof Error)throw c;var p=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw p.context=c,p}var m=l[r];if(m===void 0)return!1;if(typeof m=="function")Ip(m,this,n);else{var h=m.length,w=Um(m,h);for(i=0;i=0;c--)if(i[c]===n||i[c].listener===n){p=i[c].listener,l=c;break}if(l<0)return this;l===0?i.shift():function(m,h){for(;h+1=0;s--)this.removeListener(r,n[s]);return this},De.prototype.listeners=function(r){return zp(this,r,!0)},De.prototype.rawListeners=function(r){return zp(this,r,!1)},De.listenerCount=function(r,n){return typeof r.listenerCount=="function"?r.listenerCount(n):Vp.call(r,n)},De.prototype.listenerCount=Vp,De.prototype.eventNames=function(){return this._eventsCount>0?Bm(this._events):[]};var Jp=Object.prototype.hasOwnProperty;function Gp(r,n,i){for(i of r.keys())if(Mt(i,n))return i}function Mt(r,n){var i,s,l;if(r===n)return!0;if(r&&n&&(i=r.constructor)===n.constructor){if(i===Date)return r.getTime()===n.getTime();if(i===RegExp)return r.toString()===n.toString();if(i===Array){if((s=r.length)===n.length)for(;s--&&Mt(r[s],n[s]););return s===-1}if(i===Set){if(r.size!==n.size)return!1;for(s of r)if((l=s)&&typeof l=="object"&&!(l=Gp(n,l))||!n.has(l))return!1;return!0}if(i===Map){if(r.size!==n.size)return!1;for(s of r)if((l=s[0])&&typeof l=="object"&&!(l=Gp(n,l))||!Mt(s[1],n.get(l)))return!1;return!0}if(i===ArrayBuffer)r=new Uint8Array(r),n=new Uint8Array(n);else if(i===DataView){if((s=r.byteLength)===n.byteLength)for(;s--&&r.getInt8(s)===n.getInt8(s););return s===-1}if(ArrayBuffer.isView(r)){if((s=r.byteLength)===n.byteLength)for(;s--&&r[s]===n[s];);return s===-1}if(!i||typeof r=="object"){for(i in s=0,r)if(Jp.call(r,i)&&++s&&!Jp.call(n,i)||!(i in n)||!Mt(r[i],n[i]))return!1;return Object.keys(n).length===s}}return r!=r&&n!=n}const I_={"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"},$m={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"},Ze={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},_t={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"},Zn={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class ${static getFirstMatch(n,i){const s=i.match(n);return s&&s.length>0&&s[1]||""}static getSecondMatch(n,i){const s=i.match(n);return s&&s.length>1&&s[2]||""}static matchAndReturnConst(n,i,s){if(n.test(i))return s}static getWindowsVersionName(n){switch(n){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(n){const i=n.split(".").splice(0,2).map(s=>parseInt(s,10)||0);if(i.push(0),i[0]===10)switch(i[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(n){const i=n.split(".").splice(0,2).map(s=>parseInt(s,10)||0);if(i.push(0),!(i[0]===1&&i[1]<5))return i[0]===1&&i[1]<6?"Cupcake":i[0]===1&&i[1]>=6?"Donut":i[0]===2&&i[1]<2?"Eclair":i[0]===2&&i[1]===2?"Froyo":i[0]===2&&i[1]>2?"Gingerbread":i[0]===3?"Honeycomb":i[0]===4&&i[1]<1?"Ice Cream Sandwich":i[0]===4&&i[1]<4?"Jelly Bean":i[0]===4&&i[1]>=4?"KitKat":i[0]===5?"Lollipop":i[0]===6?"Marshmallow":i[0]===7?"Nougat":i[0]===8?"Oreo":i[0]===9?"Pie":void 0}static getVersionPrecision(n){return n.split(".").length}static compareVersions(n,i,s=!1){const l=$.getVersionPrecision(n),c=$.getVersionPrecision(i);let p=Math.max(l,c),m=0;const h=$.map([n,i],w=>{const _=p-$.getVersionPrecision(w),S=w+new Array(_+1).join(".0");return $.map(S.split("."),M=>new Array(20-M.length).join("0")+M).reverse()});for(s&&(m=p-Math.min(l,c)),p-=1;p>=m;){if(h[0][p]>h[1][p])return 1;if(h[0][p]===h[1][p]){if(p===m)return 0;p-=1}else if(h[0][p]{s[m]=p[m]})}return n}static getBrowserAlias(n){return I_[n]}static getBrowserTypeByAlias(n){return $m[n]||""}}const Re=/version\/(\d+(\.?_?\d+)+)/i,B_=[{test:[/googlebot/i],describe(r){const n={name:"Googlebot"},i=$.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/opera/i],describe(r){const n={name:"Opera"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/opr\/|opios/i],describe(r){const n={name:"Opera"},i=$.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/SamsungBrowser/i],describe(r){const n={name:"Samsung Internet for Android"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/Whale/i],describe(r){const n={name:"NAVER Whale Browser"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/MZBrowser/i],describe(r){const n={name:"MZ Browser"},i=$.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/focus/i],describe(r){const n={name:"Focus"},i=$.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/swing/i],describe(r){const n={name:"Swing"},i=$.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/coast/i],describe(r){const n={name:"Opera Coast"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const n={name:"Opera Touch"},i=$.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/yabrowser/i],describe(r){const n={name:"Yandex Browser"},i=$.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/ucbrowser/i],describe(r){const n={name:"UC Browser"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/Maxthon|mxios/i],describe(r){const n={name:"Maxthon"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/epiphany/i],describe(r){const n={name:"Epiphany"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/puffin/i],describe(r){const n={name:"Puffin"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/sleipnir/i],describe(r){const n={name:"Sleipnir"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/k-meleon/i],describe(r){const n={name:"K-Meleon"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/micromessenger/i],describe(r){const n={name:"WeChat"},i=$.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/qqbrowser/i],describe(r){const n={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},i=$.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/msie|trident/i],describe(r){const n={name:"Internet Explorer"},i=$.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/\sedg\//i],describe(r){const n={name:"Microsoft Edge"},i=$.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/edg([ea]|ios)/i],describe(r){const n={name:"Microsoft Edge"},i=$.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/vivaldi/i],describe(r){const n={name:"Vivaldi"},i=$.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/seamonkey/i],describe(r){const n={name:"SeaMonkey"},i=$.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/sailfish/i],describe(r){const n={name:"Sailfish"},i=$.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return i&&(n.version=i),n}},{test:[/silk/i],describe(r){const n={name:"Amazon Silk"},i=$.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/phantom/i],describe(r){const n={name:"PhantomJS"},i=$.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/slimerjs/i],describe(r){const n={name:"SlimerJS"},i=$.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const n={name:"BlackBerry"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/(web|hpw)[o0]s/i],describe(r){const n={name:"WebOS Browser"},i=$.getFirstMatch(Re,r)||$.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/bada/i],describe(r){const n={name:"Bada"},i=$.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/tizen/i],describe(r){const n={name:"Tizen"},i=$.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/qupzilla/i],describe(r){const n={name:"QupZilla"},i=$.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/firefox|iceweasel|fxios/i],describe(r){const n={name:"Firefox"},i=$.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/electron/i],describe(r){const n={name:"Electron"},i=$.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/MiuiBrowser/i],describe(r){const n={name:"Miui"},i=$.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/chromium/i],describe(r){const n={name:"Chromium"},i=$.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/chrome|crios|crmo/i],describe(r){const n={name:"Chrome"},i=$.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/GSA/i],describe(r){const n={name:"Google Search"},i=$.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test(r){const n=!r.test(/like android/i),i=r.test(/android/i);return n&&i},describe(r){const n={name:"Android Browser"},i=$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/playstation 4/i],describe(r){const n={name:"PlayStation 4"},i=$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/safari|applewebkit/i],describe(r){const n={name:"Safari"},i=$.getFirstMatch(Re,r);return i&&(n.version=i),n}},{test:[/.*/i],describe(r){const n=r.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:$.getFirstMatch(n,r),version:$.getSecondMatch(n,r)}}}];var F_=[{test:[/Roku\/DVP/],describe(r){const n=$.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:_t.Roku,version:n}}},{test:[/windows phone/i],describe(r){const n=$.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:_t.WindowsPhone,version:n}}},{test:[/windows /i],describe(r){const n=$.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),i=$.getWindowsVersionName(n);return{name:_t.Windows,version:n,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const n={name:_t.iOS},i=$.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return i&&(n.version=i),n}},{test:[/macintosh/i],describe(r){const n=$.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),i=$.getMacOSVersionName(n),s={name:_t.MacOS,version:n};return i&&(s.versionName=i),s}},{test:[/(ipod|iphone|ipad)/i],describe(r){const n=$.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:_t.iOS,version:n}}},{test(r){const n=!r.test(/like android/i),i=r.test(/android/i);return n&&i},describe(r){const n=$.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),i=$.getAndroidVersionName(n),s={name:_t.Android,version:n};return i&&(s.versionName=i),s}},{test:[/(web|hpw)[o0]s/i],describe(r){const n=$.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),i={name:_t.WebOS};return n&&n.length&&(i.version=n),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const n=$.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||$.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||$.getFirstMatch(/\bbb(\d+)/i,r);return{name:_t.BlackBerry,version:n}}},{test:[/bada/i],describe(r){const n=$.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:_t.Bada,version:n}}},{test:[/tizen/i],describe(r){const n=$.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:_t.Tizen,version:n}}},{test:[/linux/i],describe:()=>({name:_t.Linux})},{test:[/CrOS/],describe:()=>({name:_t.ChromeOS})},{test:[/PlayStation 4/],describe(r){const n=$.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:_t.PlayStation4,version:n}}}],U_=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(r){const n=$.getFirstMatch(/(can-l01)/i,r)&&"Nova",i={type:Ze.mobile,vendor:"Huawei"};return n&&(i.model=n),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Ze.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Ze.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Ze.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Ze.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Ze.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Ze.tablet})},{test(r){const n=r.test(/ipod|iphone/i),i=r.test(/like (ipod|iphone)/i);return n&&!i},describe(r){const n=$.getFirstMatch(/(ipod|iphone)/i,r);return{type:Ze.mobile,vendor:"Apple",model:n}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Ze.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Ze.mobile})},{test:r=>r.getBrowserName(!0)==="blackberry",describe:()=>({type:Ze.mobile,vendor:"BlackBerry"})},{test:r=>r.getBrowserName(!0)==="bada",describe:()=>({type:Ze.mobile})},{test:r=>r.getBrowserName()==="windows phone",describe:()=>({type:Ze.mobile,vendor:"Microsoft"})},{test(r){const n=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&n>=3},describe:()=>({type:Ze.tablet})},{test:r=>r.getOSName(!0)==="android",describe:()=>({type:Ze.mobile})},{test:r=>r.getOSName(!0)==="macos",describe:()=>({type:Ze.desktop,vendor:"Apple"})},{test:r=>r.getOSName(!0)==="windows",describe:()=>({type:Ze.desktop})},{test:r=>r.getOSName(!0)==="linux",describe:()=>({type:Ze.desktop})},{test:r=>r.getOSName(!0)==="playstation 4",describe:()=>({type:Ze.tv})},{test:r=>r.getOSName(!0)==="roku",describe:()=>({type:Ze.tv})}],$_=[{test:r=>r.getBrowserName(!0)==="microsoft edge",describe(r){if(/\sedg\//i.test(r))return{name:Zn.Blink};const n=$.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:Zn.EdgeHTML,version:n}}},{test:[/trident/i],describe(r){const n={name:Zn.Trident},i=$.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:r=>r.test(/presto/i),describe(r){const n={name:Zn.Presto},i=$.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test(r){const n=r.test(/gecko/i),i=r.test(/like gecko/i);return n&&!i},describe(r){const n={name:Zn.Gecko},i=$.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Zn.Blink})},{test:[/(apple)?webkit/i],describe(r){const n={name:Zn.WebKit},i=$.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}}];class qp{constructor(n,i=!1){if(n==null||n==="")throw new Error("UserAgent parameter can't be empty");this._ua=n,this.parsedResult={},i!==!0&&this.parse()}getUA(){return this._ua}test(n){return n.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const n=$.find(B_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.browser=n.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(n){return n?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 n=$.find(F_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.os=n.describe(this.getUA())),this.parsedResult.os}getOSName(n){const{name:i}=this.getOS();return n?String(i).toLowerCase()||"":i||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(n=!1){const{type:i}=this.getPlatform();return n?String(i).toLowerCase()||"":i||""}parsePlatform(){this.parsedResult.platform={};const n=$.find(U_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.platform=n.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(n){return n?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const n=$.find($_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(s=>this.test(s));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.engine=n.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return $.assign({},this.parsedResult)}satisfies(n){const i={};let s=0;const l={};let c=0;if(Object.keys(n).forEach(p=>{const m=n[p];typeof m=="string"?(l[p]=m,c+=1):typeof m=="object"&&(i[p]=m,s+=1)}),s>0){const p=Object.keys(i),m=$.find(p,w=>this.isOS(w));if(m){const w=this.satisfies(i[m]);if(w!==void 0)return w}const h=$.find(p,w=>this.isPlatform(w));if(h){const w=this.satisfies(i[h]);if(w!==void 0)return w}}if(c>0){const p=Object.keys(l),m=$.find(p,h=>this.isBrowser(h,!0));if(m!==void 0)return this.compareVersion(l[m])}}isBrowser(n,i=!1){const s=this.getBrowserName().toLowerCase();let l=n.toLowerCase();const c=$.getBrowserTypeByAlias(l);return i&&c&&(l=c.toLowerCase()),l===s}compareVersion(n){let i=[0],s=n,l=!1;const c=this.getBrowserVersion();if(typeof c=="string")return n[0]===">"||n[0]==="<"?(s=n.substr(1),n[1]==="="?(l=!0,s=n.substr(2)):i=[],n[0]===">"?i.push(1):i.push(-1)):n[0]==="="?s=n.substr(1):n[0]==="~"&&(l=!0,s=n.substr(1)),i.indexOf($.compareVersions(c,s,l))>-1}isOS(n){return this.getOSName(!0)===String(n).toLowerCase()}isPlatform(n){return this.getPlatformType(!0)===String(n).toLowerCase()}isEngine(n){return this.getEngineName(!0)===String(n).toLowerCase()}is(n,i=!1){return this.isBrowser(n,i)||this.isOS(n)||this.isPlatform(n)}some(n=[]){return n.some(i=>this.is(i))}}/*! - * Bowser - a browser detector - * https://github.com/lancedikson/bowser - * MIT License | (c) Dustin Diaz 2012-2015 - * MIT License | (c) Denis Demchenko 2015-2019 - */class z_{static getParser(n,i=!1){if(typeof n!="string")throw new Error("UserAgent should be a string");return new qp(n,i)}static parse(n){return new qp(n).getResult()}static get BROWSER_MAP(){return $m}static get ENGINE_MAP(){return Zn}static get OS_MAP(){return _t}static get PLATFORMS_MAP(){return Ze}}function ma(){return Date.now()+Math.random().toString()}function lo(){throw new Error("Method must be implemented in subclass")}function zm(r,n){return n!=null&&n.proxyUrl?n.proxyUrl+(n.proxyUrl.slice(-1)==="/"?"":"/")+r.substring(8):r}function na(r){return r!=null&&r.callObjectBundleUrlOverride?r.callObjectBundleUrlOverride:zm("https://c.daily.co/call-machine/versioned/".concat("0.72.2","/static/call-machine-object-bundle.js"),r)}function yo(r){try{new URL(r)}catch{return!1}return!0}const Vm=Object.prototype.toString;function Wm(r){switch(Vm.call(r)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Or(r,Error)}}function Si(r,n){return Vm.call(r)===`[object ${n}]`}function du(r){return Si(r,"ErrorEvent")}function Hp(r){return Si(r,"DOMError")}function Pr(r){return Si(r,"String")}function Jm(r){return r===null||typeof r!="object"&&typeof r!="function"}function vi(r){return Si(r,"Object")}function ra(r){return typeof Event<"u"&&Or(r,Event)}function fu(r){return!!(r&&r.then&&typeof r.then=="function")}function Or(r,n){try{return r instanceof n}catch{return!1}}function di(r,n=0){return typeof r!="string"||n===0||r.length<=n?r:`${r.slice(0,n)}...`}function Yp(r,n){if(!Array.isArray(r))return"";const i=[];for(let s=0;sV_(r,s,i))}function W_(r,n,i=250,s,l,c,p){if(!(c.exception&&c.exception.values&&p&&Or(p.originalException,Error)))return;const m=c.exception.values.length>0?c.exception.values[c.exception.values.length-1]:void 0;var h,w;m&&(c.exception.values=(h=$c(r,n,l,p.originalException,s,c.exception.values,m,0),w=i,h.map(_=>(_.value&&(_.value=di(_.value,w)),_))))}function $c(r,n,i,s,l,c,p,m){if(c.length>=i+1)return c;let h=[...c];if(Or(s[l],Error)){Qp(p,m);const w=r(n,s[l]),_=h.length;Kp(w,l,_,m),h=$c(r,n,i,s[l],l,[w,...h],w,_)}return Array.isArray(s.errors)&&s.errors.forEach((w,_)=>{if(Or(w,Error)){Qp(p,m);const S=r(n,w),M=h.length;Kp(S,`errors[${_}]`,M,m),h=$c(r,n,i,w,l,[S,...h],S,M)}}),h}function Qp(r,n){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,is_exception_group:!0,exception_id:n}}function Kp(r,n,i,s){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,type:"chained",source:n,exception_id:i,parent_id:s}}function Fs(r){return r&&r.Math==Math?r:void 0}const Jt=typeof globalThis=="object"&&Fs(globalThis)||typeof window=="object"&&Fs(window)||typeof self=="object"&&Fs(self)||typeof global=="object"&&Fs(global)||function(){return this}()||{};function Co(){return Jt}function pu(r,n,i){const s=i||Jt,l=s.__SENTRY__=s.__SENTRY__||{};return l[r]||(l[r]=n())}const J_=Co(),G_=80;function zc(r,n={}){try{let i=r;const s=5,l=[];let c=0,p=0;const m=" > ",h=m.length;let w;const _=Array.isArray(n)?n:n.keyAttrs,S=!Array.isArray(n)&&n.maxStringLength||G_;for(;i&&c++1&&p+l.length*h+w.length>=S));)l.push(w),p+=w.length,i=i.parentNode;return l.reverse().join(m)}catch{return""}}function q_(r,n){const i=r,s=[];let l,c,p,m,h;if(!i||!i.tagName)return"";s.push(i.tagName.toLowerCase());const w=n&&n.length?n.filter(S=>i.getAttribute(S)).map(S=>[S,i.getAttribute(S)]):null;if(w&&w.length)w.forEach(S=>{s.push(`[${S[0]}="${S[1]}"]`)});else if(i.id&&s.push(`#${i.id}`),l=i.className,l&&Pr(l))for(c=l.split(/\s+/),h=0;h{const l=n[s]&&n[s].__sentry_original__;s in n&&l&&(i[s]=n[s],n[s]=l)});try{return r()}finally{Object.keys(i).forEach(s=>{n[s]=i[s]})}}function Xp(){let r=!1;const n={enable:()=>{r=!0},disable:()=>{r=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?ia.forEach(i=>{n[i]=(...s)=>{r&&Gm(()=>{Jt.console[i](`Sentry Logger [${i}]:`,...s)})}}):ia.forEach(i=>{n[i]=()=>{}}),n}let _e;_e=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?pu("logger",Xp):Xp();const H_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function oa(r,n=!1){const{host:i,path:s,pass:l,port:c,projectId:p,protocol:m,publicKey:h}=r;return`${m}://${h}${n&&l?`:${l}`:""}@${i}${c?`:${c}`:""}/${s&&`${s}/`}${p}`}function Zp(r){return{protocol:r.protocol,publicKey:r.publicKey||"",pass:r.pass||"",host:r.host,port:r.port||"",path:r.path||"",projectId:r.projectId}}function Y_(r){const n=typeof r=="string"?function(i){const s=H_.exec(i);if(!s)return void console.error(`Invalid Sentry Dsn: ${i}`);const[l,c,p="",m,h="",w]=s.slice(1);let _="",S=w;const M=S.split("/");if(M.length>1&&(_=M.slice(0,-1).join("/"),S=M.pop()),S){const D=S.match(/^\d+/);D&&(S=D[0])}return Zp({host:m,pass:p,path:_,projectId:S,port:h,protocol:l,publicKey:c})}(r):Zp(r);if(n&&function(i){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:s,projectId:l,protocol:c}=i;return!(["protocol","publicKey","host","projectId"].find(p=>!i[p]&&(_e.error(`Invalid Sentry Dsn: ${p} missing`),!0))||(l.match(/^\d+$/)?function(p){return p==="http"||p==="https"}(c)?s&&isNaN(parseInt(s,10))&&(_e.error(`Invalid Sentry Dsn: Invalid port ${s}`),1):(_e.error(`Invalid Sentry Dsn: Invalid protocol ${c}`),1):(_e.error(`Invalid Sentry Dsn: Invalid projectId ${l}`),1)))}(n))return n}class nn extends Error{constructor(n,i="warn"){super(n),this.message=n,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=i}}function ut(r,n,i){if(!(n in r))return;const s=r[n],l=i(s);if(typeof l=="function")try{qm(l,s)}catch{}r[n]=l}function hu(r,n,i){Object.defineProperty(r,n,{value:i,writable:!0,configurable:!0})}function qm(r,n){const i=n.prototype||{};r.prototype=n.prototype=i,hu(r,"__sentry_original__",n)}function mu(r){return r.__sentry_original__}function Hm(r){if(Wm(r))return{message:r.message,name:r.name,stack:r.stack,...th(r)};if(ra(r)){const n={type:r.type,target:eh(r.target),currentTarget:eh(r.currentTarget),...th(r)};return typeof CustomEvent<"u"&&Or(r,CustomEvent)&&(n.detail=r.detail),n}return r}function eh(r){try{return n=r,typeof Element<"u"&&Or(n,Element)?zc(r):Object.prototype.toString.call(r)}catch{return""}var n}function th(r){if(typeof r=="object"&&r!==null){const n={};for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}return{}}function ga(r){return Vc(r,new Map)}function Vc(r,n){if(vi(r)){const i=n.get(r);if(i!==void 0)return i;const s={};n.set(r,s);for(const l of Object.keys(r))r[l]!==void 0&&(s[l]=Vc(r[l],n));return s}if(Array.isArray(r)){const i=n.get(r);if(i!==void 0)return i;const s=[];return n.set(r,s),r.forEach(l=>{s.push(Vc(l,n))}),s}return r}const nh="";function sr(r){try{return r&&typeof r=="function"&&r.name||nh}catch{return nh}}const kc=Co();function Wc(r){return r&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(r.toString())}function Q_(){if(!function(){if(!("fetch"in kc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Wc(kc.fetch))return!0;let r=!1;const n=kc.document;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(r=Wc(i.contentWindow.fetch)),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return r}const Us=Co(),We=Co(),po="__sentry_xhr_v2__",mo={},rh={};function K_(r){if(!rh[r])switch(rh[r]=!0,r){case"console":(function(){"console"in We&&ia.forEach(function(n){n in We.console&&ut(We.console,n,function(i){return function(...s){en("console",{args:s,level:n}),i&&i.apply(We.console,s)}})})})();break;case"dom":(function(){if(!("document"in We))return;const n=en.bind(null,"dom"),i=oh(n,!0);We.document.addEventListener("click",i,!1),We.document.addEventListener("keypress",i,!1),["EventTarget","Node"].forEach(s=>{const l=We[s]&&We[s].prototype;l&&l.hasOwnProperty&&l.hasOwnProperty("addEventListener")&&(ut(l,"addEventListener",function(c){return function(p,m,h){if(p==="click"||p=="keypress")try{const w=this,_=w.__sentry_instrumentation_handlers__=w.__sentry_instrumentation_handlers__||{},S=_[p]=_[p]||{refCount:0};if(!S.handler){const M=oh(n);S.handler=M,c.call(this,p,M,h)}S.refCount++}catch{}return c.call(this,p,m,h)}}),ut(l,"removeEventListener",function(c){return function(p,m,h){if(p==="click"||p=="keypress")try{const w=this,_=w.__sentry_instrumentation_handlers__||{},S=_[p];S&&(S.refCount--,S.refCount<=0&&(c.call(this,p,S.handler,h),S.handler=void 0,delete _[p]),Object.keys(_).length===0&&delete w.__sentry_instrumentation_handlers__)}catch{}return c.call(this,p,m,h)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in We))return;const n=XMLHttpRequest.prototype;ut(n,"open",function(i){return function(...s){const l=s[1],c=this[po]={method:Pr(s[0])?s[0].toUpperCase():s[0],url:s[1],request_headers:{}};Pr(l)&&c.method==="POST"&&l.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const p=()=>{const m=this[po];if(m&&this.readyState===4){try{m.status_code=this.status}catch{}en("xhr",{args:s,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?ut(this,"onreadystatechange",function(m){return function(...h){return p(),m.apply(this,h)}}):this.addEventListener("readystatechange",p),ut(this,"setRequestHeader",function(m){return function(...h){const[w,_]=h,S=this[po];return S&&(S.request_headers[w.toLowerCase()]=_),m.apply(this,h)}}),i.apply(this,s)}}),ut(n,"send",function(i){return function(...s){const l=this[po];return l&&s[0]!==void 0&&(l.body=s[0]),en("xhr",{args:s,startTimestamp:Date.now(),xhr:this}),i.apply(this,s)}})})();break;case"fetch":(function(){Q_()&&ut(We,"fetch",function(n){return function(...i){const{method:s,url:l}=function(p){if(p.length===0)return{method:"GET",url:""};if(p.length===2){const[h,w]=p;return{url:ih(h),method:Jc(w,"method")?String(w.method).toUpperCase():"GET"}}const m=p[0];return{url:ih(m),method:Jc(m,"method")?String(m.method).toUpperCase():"GET"}}(i),c={args:i,fetchData:{method:s,url:l},startTimestamp:Date.now()};return en("fetch",{...c}),n.apply(We,i).then(p=>(en("fetch",{...c,endTimestamp:Date.now(),response:p}),p),p=>{throw en("fetch",{...c,endTimestamp:Date.now(),error:p}),p})}})})();break;case"history":(function(){if(!function(){const s=Us.chrome,l=s&&s.app&&s.app.runtime,c="history"in Us&&!!Us.history.pushState&&!!Us.history.replaceState;return!l&&c}())return;const n=We.onpopstate;function i(s){return function(...l){const c=l.length>2?l[2]:void 0;if(c){const p=$s,m=String(c);$s=m,en("history",{from:p,to:m})}return s.apply(this,l)}}We.onpopstate=function(...s){const l=We.location.href,c=$s;if($s=l,en("history",{from:c,to:l}),n)try{return n.apply(this,s)}catch{}},ut(We.history,"pushState",i),ut(We.history,"replaceState",i)})();break;case"error":Vs=We.onerror,We.onerror=function(n,i,s,l,c){return en("error",{column:l,error:c,line:s,msg:n,url:i}),!(!Vs||Vs.__SENTRY_LOADER__)&&Vs.apply(this,arguments)},We.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Ws=We.onunhandledrejection,We.onunhandledrejection=function(n){return en("unhandledrejection",n),!(Ws&&!Ws.__SENTRY_LOADER__)||Ws.apply(this,arguments)},We.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("unknown instrumentation type:",r))}}function Cr(r,n){mo[r]=mo[r]||[],mo[r].push(n),K_(r)}function en(r,n){if(r&&mo[r])for(const i of mo[r]||[])try{i(n)}catch(s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error(`Error while triggering instrumentation handler. -Type: ${r} -Name: ${sr(i)} -Error:`,s)}}function Jc(r,n){return!!r&&typeof r=="object"&&!!r[n]}function ih(r){return typeof r=="string"?r:r?Jc(r,"url")?r.url:r.toString?r.toString():"":""}let $s;const X_=1e3;let zs,Ec;function oh(r,n=!1){return i=>{if(!i||Ec===i||function(l){if(l.type!=="keypress")return!1;try{const c=l.target;if(!c||!c.tagName)return!0;if(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)return!1}catch{}return!0}(i))return;const s=i.type==="keypress"?"input":i.type;(zs===void 0||function(l,c){if(!l||l.type!==c.type)return!0;try{if(l.target!==c.target)return!0}catch{}return!1}(Ec,i))&&(r({event:i,name:s,global:n}),Ec=i),clearTimeout(zs),zs=We.setTimeout(()=>{zs=void 0},X_)}}let Vs=null,Ws=null;function ir(){const r=Jt,n=r.crypto||r.msCrypto;if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");const i=n&&n.getRandomValues?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,s=>(s^(15&i())>>s/4).toString(16))}function Ym(r){return r.exception&&r.exception.values?r.exception.values[0]:void 0}function er(r){const{message:n,event_id:i}=r;if(n)return n;const s=Ym(r);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||i||"":i||""}function Gc(r,n,i){const s=r.exception=r.exception||{},l=s.values=s.values||[],c=l[0]=l[0]||{};c.value||(c.value=n||""),c.type||(c.type="Error")}function _o(r,n){const i=Ym(r);if(!i)return;const s=i.mechanism;if(i.mechanism={type:"generic",handled:!0,...s,...n},n&&"data"in n){const l={...s&&s.data,...n.data};i.mechanism.data=l}}function sh(r){if(r&&r.__sentry_captured__)return!0;try{hu(r,"__sentry_captured__",!0)}catch{}return!1}function tr(r,n=100,i=1/0){try{return qc("",r,n,i)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function Qm(r,n=3,i=102400){const s=tr(r,n);return l=s,function(c){return~-encodeURI(c).split(/%..|./).length}(JSON.stringify(l))>i?Qm(r,n-1,i):s;var l}function qc(r,n,i=1/0,s=1/0,l=function(){const c=typeof WeakSet=="function",p=c?new WeakSet:[];return[function(m){if(c)return!!p.has(m)||(p.add(m),!1);for(let h=0;h=s){S[F]="[MaxProperties ~]";break}const B=D[F];S[F]=qc(F,B,w-1,s,l),M++}return p(n),S}var Tn;function xr(r){return new Tt(n=>{n(r)})}function sa(r){return new Tt((n,i)=>{i(r)})}(function(r){r[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED"})(Tn||(Tn={}));class Tt{__init(){this._state=Tn.PENDING}__init2(){this._handlers=[]}constructor(n){Tt.prototype.__init.call(this),Tt.prototype.__init2.call(this),Tt.prototype.__init3.call(this),Tt.prototype.__init4.call(this),Tt.prototype.__init5.call(this),Tt.prototype.__init6.call(this);try{n(this._resolve,this._reject)}catch(i){this._reject(i)}}then(n,i){return new Tt((s,l)=>{this._handlers.push([!1,c=>{if(n)try{s(n(c))}catch(p){l(p)}else s(c)},c=>{if(i)try{s(i(c))}catch(p){l(p)}else l(c)}]),this._executeHandlers()})}catch(n){return this.then(i=>i,n)}finally(n){return new Tt((i,s)=>{let l,c;return this.then(p=>{c=!1,l=p,n&&n()},p=>{c=!0,l=p,n&&n()}).then(()=>{c?s(l):i(l)})})}__init3(){this._resolve=n=>{this._setResult(Tn.RESOLVED,n)}}__init4(){this._reject=n=>{this._setResult(Tn.REJECTED,n)}}__init5(){this._setResult=(n,i)=>{this._state===Tn.PENDING&&(fu(i)?i.then(this._resolve,this._reject):(this._state=n,this._value=i,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===Tn.PENDING)return;const n=this._handlers.slice();this._handlers=[],n.forEach(i=>{i[0]||(this._state===Tn.RESOLVED&&i[1](this._value),this._state===Tn.REJECTED&&i[2](this._value),i[0]=!0)})}}}function Z_(r){const n=[];function i(s){return n.splice(n.indexOf(s),1)[0]}return{$:n,add:function(s){if(!(r===void 0||n.lengthi(l)).then(null,()=>i(l).then(null,()=>{})),l},drain:function(s){return new Tt((l,c)=>{let p=n.length;if(!p)return l(!0);const m=setTimeout(()=>{s&&s>0&&l(!1)},s);n.forEach(h=>{xr(h).then(()=>{--p||(clearTimeout(m),l(!0))},c)})})}}}function Cc(r){if(!r)return{};const n=r.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const i=n[6]||"",s=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:i,hash:s,relative:n[5]+i+s}}const e0=["fatal","error","warning","log","info","debug"],Km=Co(),Hc={nowSeconds:()=>Date.now()/1e3},bc=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:r}=Km;if(!(!r||!r.now))return{now:()=>r.now(),timeOrigin:Date.now()-r.now()}}():function(){try{return(r=xg,n="perf_hooks",r.require(n)).performance}catch{return}var r,n}(),ah=bc===void 0?Hc:{nowSeconds:()=>(bc.timeOrigin+bc.now())/1e3},va=Hc.nowSeconds.bind(Hc),Xm=ah.nowSeconds.bind(ah);function wo(r,n=[]){return[r,n]}function t0(r,n){const[i,s]=r;return[i,[...s,n]]}function lh(r,n){const i=r[1];for(const s of i)if(n(s,s[0].type))return!0;return!1}function Yc(r,n){return(n||new TextEncoder).encode(r)}function n0(r,n){const[i,s]=r;let l=JSON.stringify(i);function c(p){typeof l=="string"?l=typeof p=="string"?l+p:[Yc(l,n),p]:l.push(typeof p=="string"?Yc(p,n):p)}for(const p of s){const[m,h]=p;if(c(` -${JSON.stringify(m)} -`),typeof h=="string"||h instanceof Uint8Array)c(h);else{let w;try{w=JSON.stringify(h)}catch{w=JSON.stringify(tr(h))}c(w)}}return typeof l=="string"?l:function(p){const m=p.reduce((_,S)=>_+S.length,0),h=new Uint8Array(m);let w=0;for(const _ of p)h.set(_,w),w+=_.length;return h}(l)}function r0(r,n){const i=typeof r.data=="string"?Yc(r.data,n):r.data;return[ga({type:"attachment",length:i.length,filename:r.filename,content_type:r.contentType,attachment_type:r.attachmentType}),i]}(()=>{const{performance:r}=Km;if(!r||!r.now)return;const n=36e5,i=r.now(),s=Date.now(),l=r.timeOrigin?Math.abs(r.timeOrigin+i-s):n,c=lfunction(s){return ga({sid:`${s.sid}`,init:s.init,started:new Date(1e3*s.started).toISOString(),timestamp:new Date(1e3*s.timestamp).toISOString(),status:s.status,errors:s.errors,did:typeof s.did=="number"||typeof s.did=="string"?`${s.did}`:void 0,duration:s.duration,attrs:{release:s.release,environment:s.environment,ip_address:s.ipAddress,user_agent:s.userAgent}})}(i)};return r&&yi(i,r),i}function yi(r,n={}){if(n.user&&(!r.ipAddress&&n.user.ip_address&&(r.ipAddress=n.user.ip_address),r.did||n.did||(r.did=n.user.id||n.user.email||n.user.username)),r.timestamp=n.timestamp||Xm(),n.ignoreDuration&&(r.ignoreDuration=n.ignoreDuration),n.sid&&(r.sid=n.sid.length===32?n.sid:ir()),n.init!==void 0&&(r.init=n.init),!r.did&&n.did&&(r.did=`${n.did}`),typeof n.started=="number"&&(r.started=n.started),r.ignoreDuration)r.duration=void 0;else if(typeof n.duration=="number")r.duration=n.duration;else{const i=r.timestamp-r.started;r.duration=i>=0?i:0}n.release&&(r.release=n.release),n.environment&&(r.environment=n.environment),!r.ipAddress&&n.ipAddress&&(r.ipAddress=n.ipAddress),!r.userAgent&&n.userAgent&&(r.userAgent=n.userAgent),typeof n.errors=="number"&&(r.errors=n.errors),n.status&&(r.status=n.status)}class Tr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=uh()}static clone(n){const i=new Tr;return n&&(i._breadcrumbs=[...n._breadcrumbs],i._tags={...n._tags},i._extra={...n._extra},i._contexts={...n._contexts},i._user=n._user,i._level=n._level,i._span=n._span,i._session=n._session,i._transactionName=n._transactionName,i._fingerprint=n._fingerprint,i._eventProcessors=[...n._eventProcessors],i._requestSession=n._requestSession,i._attachments=[...n._attachments],i._sdkProcessingMetadata={...n._sdkProcessingMetadata},i._propagationContext={...n._propagationContext}),i}addScopeListener(n){this._scopeListeners.push(n)}addEventProcessor(n){return this._eventProcessors.push(n),this}setUser(n){return this._user=n||{},this._session&&yi(this._session,{user:n}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(n){return this._requestSession=n,this}setTags(n){return this._tags={...this._tags,...n},this._notifyScopeListeners(),this}setTag(n,i){return this._tags={...this._tags,[n]:i},this._notifyScopeListeners(),this}setExtras(n){return this._extra={...this._extra,...n},this._notifyScopeListeners(),this}setExtra(n,i){return this._extra={...this._extra,[n]:i},this._notifyScopeListeners(),this}setFingerprint(n){return this._fingerprint=n,this._notifyScopeListeners(),this}setLevel(n){return this._level=n,this._notifyScopeListeners(),this}setTransactionName(n){return this._transactionName=n,this._notifyScopeListeners(),this}setContext(n,i){return i===null?delete this._contexts[n]:this._contexts[n]=i,this._notifyScopeListeners(),this}setSpan(n){return this._span=n,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const n=this.getSpan();return n&&n.transaction}setSession(n){return n?this._session=n:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(n){if(!n)return this;if(typeof n=="function"){const i=n(this);return i instanceof Tr?i:this}return n instanceof Tr?(this._tags={...this._tags,...n._tags},this._extra={...this._extra,...n._extra},this._contexts={...this._contexts,...n._contexts},n._user&&Object.keys(n._user).length&&(this._user=n._user),n._level&&(this._level=n._level),n._fingerprint&&(this._fingerprint=n._fingerprint),n._requestSession&&(this._requestSession=n._requestSession),n._propagationContext&&(this._propagationContext=n._propagationContext)):vi(n)&&(this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint&&(this._fingerprint=n.fingerprint),n.requestSession&&(this._requestSession=n.requestSession),n.propagationContext&&(this._propagationContext=n.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=uh(),this}addBreadcrumb(n,i){const s=typeof i=="number"?i:100;if(s<=0)return this;const l={timestamp:va(),...n};return this._breadcrumbs=[...this._breadcrumbs,l].slice(-s),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(n){return this._attachments.push(n),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(n,i={}){if(this._extra&&Object.keys(this._extra).length&&(n.extra={...this._extra,...n.extra}),this._tags&&Object.keys(this._tags).length&&(n.tags={...this._tags,...n.tags}),this._user&&Object.keys(this._user).length&&(n.user={...this._user,...n.user}),this._contexts&&Object.keys(this._contexts).length&&(n.contexts={...this._contexts,...n.contexts}),this._level&&(n.level=this._level),this._transactionName&&(n.transaction=this._transactionName),this._span){n.contexts={trace:this._span.getTraceContext(),...n.contexts};const s=this._span.transaction;if(s){n.sdkProcessingMetadata={dynamicSamplingContext:s.getDynamicSamplingContext(),...n.sdkProcessingMetadata};const l=s.name;l&&(n.tags={transaction:l,...n.tags})}}return this._applyFingerprint(n),n.breadcrumbs=[...n.breadcrumbs||[],...this._breadcrumbs],n.breadcrumbs=n.breadcrumbs.length>0?n.breadcrumbs:void 0,n.sdkProcessingMetadata={...n.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...eg(),...this._eventProcessors],n,i)}setSDKProcessingMetadata(n){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...n},this}setPropagationContext(n){return this._propagationContext=n,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(n,i,s,l=0){return new Tt((c,p)=>{const m=n[l];if(i===null||typeof m!="function")c(i);else{const h=m({...i},s);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&m.id&&h===null&&_e.log(`Event processor "${m.id}" dropped event`),fu(h)?h.then(w=>this._notifyEventProcessors(n,w,s,l+1).then(c)).then(null,p):this._notifyEventProcessors(n,h,s,l+1).then(c).then(null,p)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(n=>{n(this)}),this._notifyingListeners=!1)}_applyFingerprint(n){var i;n.fingerprint=n.fingerprint?(i=n.fingerprint,Array.isArray(i)?i:[i]):[],this._fingerprint&&(n.fingerprint=n.fingerprint.concat(this._fingerprint)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint}}function eg(){return pu("globalEventProcessors",()=>[])}function tg(r){eg().push(r)}function uh(){return{traceId:ir(),spanId:ir().substring(16),sampled:!1}}const ng=4,l0=100;class vu{constructor(n,i=new Tr,s=ng){this._version=s,this._stack=[{scope:i}],n&&this.bindClient(n)}isOlderThan(n){return this._version{c.captureException(n,{originalException:n,syntheticException:l,...i,event_id:s},p)}),s}captureMessage(n,i,s){const l=this._lastEventId=s&&s.event_id?s.event_id:ir(),c=new Error(n);return this._withClient((p,m)=>{p.captureMessage(n,i,{originalException:n,syntheticException:c,...s,event_id:l},m)}),l}captureEvent(n,i){const s=i&&i.event_id?i.event_id:ir();return n.type||(this._lastEventId=s),this._withClient((l,c)=>{l.captureEvent(n,{...i,event_id:s},c)}),s}lastEventId(){return this._lastEventId}addBreadcrumb(n,i){const{scope:s,client:l}=this.getStackTop();if(!l)return;const{beforeBreadcrumb:c=null,maxBreadcrumbs:p=l0}=l.getOptions&&l.getOptions()||{};if(p<=0)return;const m={timestamp:va(),...n},h=c?Gm(()=>c(m,i)):m;h!==null&&(l.emit&&l.emit("beforeAddBreadcrumb",h,i),s.addBreadcrumb(h,p))}setUser(n){this.getScope().setUser(n)}setTags(n){this.getScope().setTags(n)}setExtras(n){this.getScope().setExtras(n)}setTag(n,i){this.getScope().setTag(n,i)}setExtra(n,i){this.getScope().setExtra(n,i)}setContext(n,i){this.getScope().setContext(n,i)}configureScope(n){const{scope:i,client:s}=this.getStackTop();s&&n(i)}run(n){const i=dh(this);try{n(this)}finally{dh(i)}}getIntegration(n){const i=this.getClient();if(!i)return null;try{return i.getIntegration(n)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Cannot retrieve integration ${n.id} from the current Hub`),null}}startTransaction(n,i){const s=this._callExtensionMethod("startTransaction",n,i);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||s||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': -Sentry.addTracingExtensions(); -Sentry.init({...}); -`),s}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(n=!1){if(n)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,i=n.getSession();i&&function(s,l){let c={};s.status==="ok"&&(c={status:"exited"}),yi(s,c)}(i),this._sendSessionUpdate(),n.setSession()}startSession(n){const{scope:i,client:s}=this.getStackTop(),{release:l,environment:c=gu}=s&&s.getOptions()||{},{userAgent:p}=Jt.navigator||{},m=a0({release:l,environment:c,user:i.getUser(),...p&&{userAgent:p},...n}),h=i.getSession&&i.getSession();return h&&h.status==="ok"&&yi(h,{status:"exited"}),this.endSession(),i.setSession(m),m}shouldSendDefaultPii(){const n=this.getClient(),i=n&&n.getOptions();return!!(i&&i.sendDefaultPii)}_sendSessionUpdate(){const{scope:n,client:i}=this.getStackTop(),s=n.getSession();s&&i&&i.captureSession&&i.captureSession(s)}_withClient(n){const{scope:i,client:s}=this.getStackTop();s&&n(s,i)}_callExtensionMethod(n,...i){const s=aa().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[n]=="function")return s.extensions[n].apply(this,i);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Extension method ${n} couldn't be found, doing nothing.`)}}function aa(){return Jt.__SENTRY__=Jt.__SENTRY__||{extensions:{},hub:void 0},Jt}function dh(r){const n=aa(),i=Qc(n);return rg(n,r),i}function Nt(){const r=aa();if(r.__SENTRY__&&r.__SENTRY__.acs){const n=r.__SENTRY__.acs.getCurrentHub();if(n)return n}return function(n=aa()){i=n,i&&i.__SENTRY__&&i.__SENTRY__.hub&&!Qc(n).isOlderThan(ng)||rg(n,new vu);var i;return Qc(n)}(r)}function Qc(r){return pu("hub",()=>new vu,r)}function rg(r,n){return r?((r.__SENTRY__=r.__SENTRY__||{}).hub=n,!0):!1}const c0="7";function u0(r,n){return i={sentry_key:r.publicKey,sentry_version:c0,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(i).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(i[s])}`).join("&");var i}function d0(r,n,i,s){const l=Zm(i),c=r.type&&r.type!=="replay_event"?r.type:"event";(function(m,h){h&&(m.sdk=m.sdk||{},m.sdk.name=m.sdk.name||h.name,m.sdk.version=m.sdk.version||h.version,m.sdk.integrations=[...m.sdk.integrations||[],...h.integrations||[]],m.sdk.packages=[...m.sdk.packages||[],...h.packages||[]])})(r,i&&i.sdk);const p=function(m,h,w,_){const S=m.sdkProcessingMetadata&&m.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:m.event_id,sent_at:new Date().toISOString(),...h&&{sdk:h},...!!w&&{dsn:oa(_)},...S&&{trace:ga({...S})}}}(r,l,s,n);return delete r.sdkProcessingMetadata,wo(p,[[{type:c},r]])}const fh=[];function ph(r,n){n[r.name]=r,fh.indexOf(r.name)===-1&&(r.setupOnce(tg,Nt),fh.push(r.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log(`Integration installed: ${r.name}`))}function f0(r,n,i,s){const{normalizeDepth:l=3,normalizeMaxBreadth:c=1e3}=r,p={...n,event_id:n.event_id||i.event_id||ir(),timestamp:n.timestamp||va()},m=i.integrations||r.integrations.map(_=>_.name);(function(_,S){const{environment:M,release:D,dist:F,maxValueLength:B=250}=S;"environment"in _||(_.environment="environment"in S?M:gu),_.release===void 0&&D!==void 0&&(_.release=D),_.dist===void 0&&F!==void 0&&(_.dist=F),_.message&&(_.message=di(_.message,B));const q=_.exception&&_.exception.values&&_.exception.values[0];q&&q.value&&(q.value=di(q.value,B));const ne=_.request;ne&&ne.url&&(ne.url=di(ne.url,B))})(p,r),function(_,S){S.length>0&&(_.sdk=_.sdk||{},_.sdk.integrations=[..._.sdk.integrations||[],...S])}(p,m),n.type===void 0&&function(_,S){const M=Jt._sentryDebugIds;if(!M)return;let D;const F=hh.get(S);F?D=F:(D=new Map,hh.set(S,D));const B=Object.keys(M).reduce((q,ne)=>{let ve;const K=D.get(ne);K?ve=K:(ve=S(ne),D.set(ne,ve));for(let x=ve.length-1;x>=0;x--){const O=ve[x];if(O.filename){q[O.filename]=M[ne];break}}return q},{});try{_.exception.values.forEach(q=>{q.stacktrace.frames.forEach(ne=>{ne.filename&&(ne.debug_id=B[ne.filename])})})}catch{}}(p,r.stackParser);let h=s;i.captureContext&&(h=Tr.clone(h).update(i.captureContext));let w=xr(p);if(h){if(h.getAttachments){const _=[...i.attachments||[],...h.getAttachments()];_.length&&(i.attachments=_)}w=h.applyToEvent(p,i)}return w.then(_=>(_&&function(S){const M={};try{S.exception.values.forEach(F=>{F.stacktrace.frames.forEach(B=>{B.debug_id&&(B.abs_path?M[B.abs_path]=B.debug_id:B.filename&&(M[B.filename]=B.debug_id),delete B.debug_id)})})}catch{}if(Object.keys(M).length===0)return;S.debug_meta=S.debug_meta||{},S.debug_meta.images=S.debug_meta.images||[];const D=S.debug_meta.images;Object.keys(M).forEach(F=>{D.push({type:"sourcemap",code_file:F,debug_id:M[F]})})}(_),typeof l=="number"&&l>0?function(S,M,D){if(!S)return null;const F={...S,...S.breadcrumbs&&{breadcrumbs:S.breadcrumbs.map(B=>({...B,...B.data&&{data:tr(B.data,M,D)}}))},...S.user&&{user:tr(S.user,M,D)},...S.contexts&&{contexts:tr(S.contexts,M,D)},...S.extra&&{extra:tr(S.extra,M,D)}};return S.contexts&&S.contexts.trace&&F.contexts&&(F.contexts.trace=S.contexts.trace,S.contexts.trace.data&&(F.contexts.trace.data=tr(S.contexts.trace.data,M,D))),S.spans&&(F.spans=S.spans.map(B=>(B.data&&(B.data=tr(B.data,M,D)),B))),F}(_,l,c):_))}const hh=new WeakMap,mh="Not capturing exception because it's already been captured.";class br{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(n){if(br.prototype.__init.call(this),br.prototype.__init2.call(this),br.prototype.__init3.call(this),br.prototype.__init4.call(this),br.prototype.__init5.call(this),this._options=n,n.dsn?this._dsn=Y_(n.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("No DSN provided, client will not do anything."),this._dsn){const i=function(s,l={}){const c=typeof l=="string"?l:l.tunnel,p=typeof l!="string"&&l._metadata?l._metadata.sdk:void 0;return c||`${function(m){return`${function(h){const w=h.protocol?`${h.protocol}:`:"",_=h.port?`:${h.port}`:"";return`${w}//${h.host}${_}${h.path?`/${h.path}`:""}/api/`}(m)}${m.projectId}/envelope/`}(s)}?${u0(s,p)}`}(this._dsn,n);this._transport=n.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...n.transportOptions,url:i})}}captureException(n,i,s){if(sh(n))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log(mh));let l=i&&i.event_id;return this._process(this.eventFromException(n,i).then(c=>this._captureEvent(c,i,s)).then(c=>{l=c})),l}captureMessage(n,i,s,l){let c=s&&s.event_id;const p=Jm(n)?this.eventFromMessage(String(n),i,s):this.eventFromException(n,s);return this._process(p.then(m=>this._captureEvent(m,s,l)).then(m=>{c=m})),c}captureEvent(n,i,s){if(i&&i.originalException&&sh(i.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log(mh));let l=i&&i.event_id;return this._process(this._captureEvent(n,i,s).then(c=>{l=c})),l}captureSession(n){this._isEnabled()?typeof n.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("Discarded session because of missing or non-string release"):(this.sendSession(n),yi(n,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(n){const i=this._transport;return i?this._isClientDoneProcessing(n).then(s=>i.flush(n).then(l=>s&&l)):xr(!0)}close(n){return this.flush(n).then(i=>(this.getOptions().enabled=!1,i))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(n){const i={};return n.forEach(s=>{s&&ph(s,i)}),i}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(n){return this._integrations[n]}getIntegration(n){try{return this._integrations[n.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Cannot retrieve integration ${n.id} from the current Client`),null}}addIntegration(n){ph(n,this._integrations)}sendEvent(n,i={}){if(this._dsn){let s=d0(n,this._dsn,this._options._metadata,this._options.tunnel);for(const c of i.attachments||[])s=t0(s,r0(c,this._options.transportOptions&&this._options.transportOptions.textEncoder));const l=this._sendEnvelope(s);l&&l.then(c=>this.emit("afterSendEvent",n,c),null)}}sendSession(n){if(this._dsn){const i=function(s,l,c,p){const m=Zm(c);return wo({sent_at:new Date().toISOString(),...m&&{sdk:m},...!!p&&{dsn:oa(l)}},["aggregates"in s?[{type:"sessions"},s]:[{type:"session"},s.toJSON()]])}(n,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(i)}}recordDroppedEvent(n,i,s){if(this._options.sendClientReports){const l=`${n}:${i}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log(`Adding outcome: "${l}"`),this._outcomes[l]=this._outcomes[l]+1||1}}on(n,i){this._hooks[n]||(this._hooks[n]=[]),this._hooks[n].push(i)}emit(n,...i){this._hooks[n]&&this._hooks[n].forEach(s=>s(...i))}_updateSessionFromEvent(n,i){let s=!1,l=!1;const c=i.exception&&i.exception.values;if(c){l=!0;for(const m of c){const h=m.mechanism;if(h&&h.handled===!1){s=!0;break}}}const p=n.status==="ok";(p&&n.errors===0||p&&s)&&(yi(n,{...s&&{status:"crashed"},errors:n.errors||Number(l||s)}),this.captureSession(n))}_isClientDoneProcessing(n){return new Tt(i=>{let s=0;const l=setInterval(()=>{this._numProcessing==0?(clearInterval(l),i(!0)):(s+=1,n&&s>=n&&(clearInterval(l),i(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(n,i,s){const l=this.getOptions(),c=Object.keys(this._integrations);return!i.integrations&&c.length>0&&(i.integrations=c),f0(l,n,i,s).then(p=>{if(p===null)return p;const{propagationContext:m}=p.sdkProcessingMetadata||{};if(!(p.contexts&&p.contexts.trace)&&m){const{traceId:h,spanId:w,parentSpanId:_,dsc:S}=m;p.contexts={trace:{trace_id:h,span_id:w,parent_span_id:_},...p.contexts};const M=S||function(D,F,B){const q=F.getOptions(),{publicKey:ne}=F.getDsn()||{},{segment:ve}=B&&B.getUser()||{},K=ga({environment:q.environment||gu,release:q.release,user_segment:ve,public_key:ne,trace_id:D});return F.emit&&F.emit("createDsc",K),K}(h,this,s);p.sdkProcessingMetadata={dynamicSamplingContext:M,...p.sdkProcessingMetadata}}return p})}_captureEvent(n,i={},s){return this._processEvent(n,i,s).then(l=>l.event_id,l=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const c=l;c.logLevel==="log"?_e.log(c.message):_e.warn(c)}})}_processEvent(n,i,s){const l=this.getOptions(),{sampleRate:c}=l;if(!this._isEnabled())return sa(new nn("SDK not enabled, will not capture event.","log"));const p=vh(n),m=gh(n),h=n.type||"error",w=`before send for type \`${h}\``;if(m&&typeof c=="number"&&Math.random()>c)return this.recordDroppedEvent("sample_rate","error",n),sa(new nn(`Discarding event because it's not included in the random sample (sampling rate = ${c})`,"log"));const _=h==="replay_event"?"replay":h;return this._prepareEvent(n,i,s).then(S=>{if(S===null)throw this.recordDroppedEvent("event_processor",_,n),new nn("An event processor returned `null`, will not send event.","log");if(i.data&&i.data.__sentry__===!0)return S;const M=function(D,F,B){const{beforeSend:q,beforeSendTransaction:ne}=D;return gh(F)&&q?q(F,B):vh(F)&&ne?ne(F,B):F}(l,S,i);return function(D,F){const B=`${F} must return \`null\` or a valid event.`;if(fu(D))return D.then(q=>{if(!vi(q)&&q!==null)throw new nn(B);return q},q=>{throw new nn(`${F} rejected with ${q}`)});if(!vi(D)&&D!==null)throw new nn(B);return D}(M,w)}).then(S=>{if(S===null)throw this.recordDroppedEvent("before_send",_,n),new nn(`${w} returned \`null\`, will not send event.`,"log");const M=s&&s.getSession();!p&&M&&this._updateSessionFromEvent(M,S);const D=S.transaction_info;if(p&&D&&S.transaction!==n.transaction){const F="custom";S.transaction_info={...D,source:F}}return this.sendEvent(S,i),S}).then(null,S=>{throw S instanceof nn?S:(this.captureException(S,{data:{__sentry__:!0},originalException:S}),new nn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. -Reason: ${S}`))})}_process(n){this._numProcessing++,n.then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i))}_sendEnvelope(n){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",n),this._transport.send(n).then(null,i=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error("Error while sending event:",i)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error("Transport disabled")}_clearOutcomes(){const n=this._outcomes;return this._outcomes={},Object.keys(n).map(i=>{const[s,l]=i.split(":");return{reason:s,category:l,quantity:n[i]}})}}function gh(r){return r.type===void 0}function vh(r){return r.type==="transaction"}const p0=30;function h0(r,n,i=Z_(r.bufferSize||p0)){let s={};function l(c){const p=[];if(lh(c,(w,_)=>{const S=ch(_);if(function(M,D,F=Date.now()){return function(B,q){return B[q]||B.all||0}(M,D)>F}(s,S)){const M=yh(w,_);r.recordDroppedEvent("ratelimit_backoff",S,M)}else p.push(w)}),p.length===0)return xr();const m=wo(c[0],p),h=w=>{lh(m,(_,S)=>{const M=yh(_,S);r.recordDroppedEvent(w,ch(S),M)})};return i.add(()=>n({body:n0(m,r.textEncoder)}).then(w=>(w.statusCode!==void 0&&(w.statusCode<200||w.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Sentry responded with status code ${w.statusCode} to sent event.`),s=s0(s,w),w),w=>{throw h("network_error"),w})).then(w=>w,w=>{if(w instanceof nn)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error("Skipped sending event because buffer is full."),h("queue_overflow"),xr();throw w})}return l.__sentry__baseTransport__=!0,{send:l,flush:c=>i.drain(c)}}function yh(r,n){if(n==="event"||n==="transaction")return Array.isArray(r)?r[1]:void 0}const _h="7.60.1";let wh;class So{constructor(){So.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=So.id}setupOnce(){wh=Function.prototype.toString;try{Function.prototype.toString=function(...n){const i=mu(this)||this;return wh.apply(i,n)}}catch{}}}So.__initStatic();const m0=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],g0=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class fi{static __initStatic(){this.id="InboundFilters"}__init(){this.name=fi.id}constructor(n={}){this._options=n,fi.prototype.__init.call(this)}setupOnce(n,i){const s=l=>{const c=i();if(c){const p=c.getIntegration(fi);if(p){const m=c.getClient(),h=m?m.getOptions():{},w=function(_={},S={}){return{allowUrls:[..._.allowUrls||[],...S.allowUrls||[]],denyUrls:[..._.denyUrls||[],...S.denyUrls||[]],ignoreErrors:[..._.ignoreErrors||[],...S.ignoreErrors||[],..._.disableErrorDefaults?[]:m0],ignoreTransactions:[..._.ignoreTransactions||[],...S.ignoreTransactions||[],..._.disableTransactionDefaults?[]:g0],ignoreInternal:_.ignoreInternal===void 0||_.ignoreInternal}}(p._options,h);return function(_,S){return S.ignoreInternal&&function(M){try{return M.exception.values[0].type==="SentryError"}catch{}return!1}(_)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Event dropped due to being internal Sentry Error. -Event: ${er(_)}`),!0):function(M,D){return M.type||!D||!D.length?!1:function(F){if(F.message)return[F.message];if(F.exception){const{values:B}=F.exception;try{const{type:q="",value:ne=""}=B&&B[B.length-1]||{};return[`${ne}`,`${q}: ${ne}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error(`Cannot extract message for event ${er(F)}`),[]}}return[]}(M).some(F=>Bs(F,D))}(_,S.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Event dropped due to being matched by \`ignoreErrors\` option. -Event: ${er(_)}`),!0):function(M,D){if(M.type!=="transaction"||!D||!D.length)return!1;const F=M.transaction;return!!F&&Bs(F,D)}(_,S.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. -Event: ${er(_)}`),!0):function(M,D){if(!D||!D.length)return!1;const F=Js(M);return!!F&&Bs(F,D)}(_,S.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Event dropped due to being matched by \`denyUrls\` option. -Event: ${er(_)}. -Url: ${Js(_)}`),!0):function(M,D){if(!D||!D.length)return!0;const F=Js(M);return!F||Bs(F,D)}(_,S.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`Event dropped due to not being matched by \`allowUrls\` option. -Event: ${er(_)}. -Url: ${Js(_)}`),!0)}(l,w)?null:l}}return l};s.id=this.name,n(s)}}function Js(r){try{let n;try{n=r.exception.values[0].stacktrace.frames}catch{}return n?function(i=[]){for(let s=i.length-1;s>=0;s--){const l=i[s];if(l&&l.filename!==""&&l.filename!=="[native code]")return l.filename||null}return null}(n):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.error(`Cannot extract url for event ${er(r)}`),null}}fi.__initStatic();var v0=Object.freeze({__proto__:null,FunctionToString:So,InboundFilters:fi});const Be=Jt;let Kc=0;function ig(){return Kc>0}function _i(r,n={},i){if(typeof r!="function")return r;try{const l=r.__sentry_wrapped__;if(l)return l;if(mu(r))return r}catch{return r}const s=function(){const l=Array.prototype.slice.call(arguments);try{i&&typeof i=="function"&&i.apply(this,arguments);const p=l.map(m=>_i(m,n));return r.apply(this,p)}catch(p){throw Kc++,setTimeout(()=>{Kc--}),c=m=>{var h,w;m.addEventProcessor(_=>(n.mechanism&&(Gc(_,void 0),_o(_,n.mechanism)),_.extra={..._.extra,arguments:l},_)),h=p,Nt().captureException(h,{captureContext:w})},Nt().withScope(c),p}var c};try{for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(s[l]=r[l])}catch{}qm(s,r),hu(r,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get:()=>r.name})}catch{}return s}function og(r,n){const i=yu(r,n),s={type:n&&n.name,value:_0(n)};return i.length&&(s.stacktrace={frames:i}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function Tc(r,n){return{exception:{values:[og(r,n)]}}}function yu(r,n){const i=n.stacktrace||n.stack||"",s=function(l){if(l){if(typeof l.framesToPop=="number")return l.framesToPop;if(y0.test(l.message))return 1}return 0}(n);try{return r(i,s)}catch{}return[]}const y0=/Minified React error #\d+;/i;function _0(r){const n=r&&r.message;return n?n.error&&typeof n.error.message=="string"?n.error.message:n:"No error message"}function _u(r,n,i,s,l){let c;if(du(n)&&n.error)return Tc(r,n.error);if(Hp(n)||Si(n,"DOMException")){const p=n;if("stack"in n)c=Tc(r,n);else{const m=p.name||(Hp(p)?"DOMError":"DOMException"),h=p.message?`${m}: ${p.message}`:m;c=Xc(r,h,i,s),Gc(c,h)}return"code"in p&&(c.tags={...c.tags,"DOMException.code":`${p.code}`}),c}return Wm(n)?Tc(r,n):vi(n)||ra(n)?(c=function(p,m,h,w){const _=Nt().getClient(),S=_&&_.getOptions().normalizeDepth,M={exception:{values:[{type:ra(m)?m.constructor.name:w?"UnhandledRejection":"Error",value:w0(m,{isUnhandledRejection:w})}]},extra:{__serialized__:Qm(m,S)}};if(h){const D=yu(p,h);D.length&&(M.exception.values[0].stacktrace={frames:D})}return M}(r,n,i,l),_o(c,{synthetic:!0}),c):(c=Xc(r,n,i,s),Gc(c,`${n}`),_o(c,{synthetic:!0}),c)}function Xc(r,n,i,s){const l={message:n};if(s&&i){const c=yu(r,i);c.length&&(l.exception={values:[{value:n,stacktrace:{frames:c}}]})}return l}function w0(r,{isUnhandledRejection:n}){const i=function(l,c=40){const p=Object.keys(Hm(l));if(p.sort(),!p.length)return"[object has no keys]";if(p[0].length>=c)return di(p[0],c);for(let m=p.length;m>0;m--){const h=p.slice(0,m).join(", ");if(!(h.length>c))return m===p.length?h:di(h,c)}return""}(r),s=n?"promise rejection":"exception";return du(r)?`Event \`ErrorEvent\` captured as ${s} with message \`${r.message}\``:ra(r)?`Event \`${function(l){try{const c=Object.getPrototypeOf(l);return c?c.constructor.name:void 0}catch{}}(r)}\` (type=${r.type}) captured as ${s}`:`Object captured as ${s} with keys: ${i}`}const Sh=1024,sg="Breadcrumbs";class ko{static __initStatic(){this.id=sg}__init(){this.name=ko.id}constructor(n){ko.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...n}}setupOnce(){this.options.console&&Cr("console",S0),this.options.dom&&Cr("dom",function(n){function i(s){let l,c=typeof n=="object"?n.serializeAttribute:void 0,p=typeof n=="object"&&typeof n.maxStringLength=="number"?n.maxStringLength:void 0;p&&p>Sh&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${p} was configured. Sentry will use 1024 instead.`),p=Sh),typeof c=="string"&&(c=[c]);try{const m=s.event;l=function(h){return!!h&&!!h.target}(m)?zc(m.target,{keyAttrs:c,maxStringLength:p}):zc(m,{keyAttrs:c,maxStringLength:p})}catch{l=""}l.length!==0&&Nt().addBreadcrumb({category:`ui.${s.name}`,message:l},{event:s.event,name:s.name,global:s.global})}return i}(this.options.dom)),this.options.xhr&&Cr("xhr",k0),this.options.fetch&&Cr("fetch",E0),this.options.history&&Cr("history",C0)}addSentryBreadcrumb(n){this.options.sentry&&Nt().addBreadcrumb({category:"sentry."+(n.type==="transaction"?"transaction":"event"),event_id:n.event_id,level:n.level,message:er(n)},{event:n})}}function S0(r){for(let s=0;s{Be.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(n,i){return function(s,l,c,p){const m=_u(s,l,c&&c.syntheticException||void 0,p);return _o(m),m.level="error",c&&c.event_id&&(m.event_id=c.event_id),xr(m)}(this._options.stackParser,n,i,this._options.attachStacktrace)}eventFromMessage(n,i="info",s){return function(l,c,p="info",m,h){const w=Xc(l,c,m&&m.syntheticException||void 0,h);return w.level=p,m&&m.event_id&&(w.event_id=m.event_id),xr(w)}(this._options.stackParser,n,i,s,this._options.attachStacktrace)}sendEvent(n,i){const s=this.getIntegrationById(sg);s&&s.addSentryBreadcrumb&&s.addSentryBreadcrumb(n),super.sendEvent(n,i)}captureUserFeedback(n){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("SDK not enabled, will not capture user feedback."));const i=function(s,{metadata:l,tunnel:c,dsn:p}){const m={event_id:s.event_id,sent_at:new Date().toISOString(),...l&&l.sdk&&{sdk:{name:l.sdk.name,version:l.sdk.version}},...!!c&&!!p&&{dsn:oa(p)}};return wo(m,[function(w){return[{type:"user_report"},w]}(s)])}(n,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(i)}_prepareEvent(n,i,s){return n.platform=n.platform||"javascript",super._prepareEvent(n,i,s)}_flushOutcomes(){const n=this._clearOutcomes();if(n.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log("Sending outcomes:",n);const i=(s=n,wo((l=this._options.tunnel&&oa(this._dsn))?{dsn:l}:{},[[{type:"client_report"},{timestamp:c||va(),discarded_events:s}]]));var s,l,c;this._sendEnvelope(i)}}let co;function T0(r,n=function(){if(co)return co;if(Wc(Be.fetch))return co=Be.fetch.bind(Be);const i=Be.document;let s=Be.fetch;if(i&&typeof i.createElement=="function")try{const l=i.createElement("iframe");l.hidden=!0,i.head.appendChild(l);const c=l.contentWindow;c&&c.fetch&&(s=c.fetch),i.head.removeChild(l)}catch(l){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",l)}return co=s.bind(Be)}()){let i=0,s=0;return h0(r,function(l){const c=l.body.length;i+=c,s++;const p={body:l.body,method:"POST",referrerPolicy:"origin",headers:r.headers,keepalive:i<=6e4&&s<15,...r.fetchOptions};try{return n(r.url,p).then(m=>(i-=c,s--,{statusCode:m.status,headers:{"x-sentry-rate-limits":m.headers.get("X-Sentry-Rate-Limits"),"retry-after":m.headers.get("Retry-After")}}))}catch(m){return co=void 0,i-=c,s--,sa(m)}})}class or{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=or.id}__init2(){this._installFunc={onerror:M0,onunhandledrejection:P0}}constructor(n){or.prototype.__init.call(this),or.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...n}}setupOnce(){Error.stackTraceLimit=50;const n=this._options;for(const s in n){const l=this._installFunc[s];l&&n[s]&&(i=s,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.log(`Global Handler attached: ${i}`),l(),this._installFunc[s]=void 0)}var i}}function M0(){Cr("error",r=>{const[n,i,s]=lg();if(!n.getIntegration(or))return;const{msg:l,url:c,line:p,column:m,error:h}=r;if(ig()||h&&h.__sentry_own_request__)return;const w=h===void 0&&Pr(l)?function(_,S,M,D){const F=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let B=du(_)?_.message:_,q="Error";const ne=B.match(F);return ne&&(q=ne[1],B=ne[2]),kh({exception:{values:[{type:q,value:B}]}},S,M,D)}(l,c,p,m):kh(_u(i,h||l,void 0,s,!1),c,p,m);w.level="error",ag(n,h,w,"onerror")})}function P0(){Cr("unhandledrejection",r=>{const[n,i,s]=lg();if(!n.getIntegration(or))return;let l=r;try{"reason"in r?l=r.reason:"detail"in r&&"reason"in r.detail&&(l=r.detail.reason)}catch{}if(ig()||l&&l.__sentry_own_request__)return!0;const c=Jm(l)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(l)}`}]}}:_u(i,l,void 0,s,!0);c.level="error",ag(n,l,c,"onunhandledrejection")})}function kh(r,n,i,s){const l=r.exception=r.exception||{},c=l.values=l.values||[],p=c[0]=c[0]||{},m=p.stacktrace=p.stacktrace||{},h=m.frames=m.frames||[],w=isNaN(parseInt(s,10))?void 0:s,_=isNaN(parseInt(i,10))?void 0:i,S=Pr(n)&&n.length>0?n:function(){try{return J_.document.location.href}catch{return""}}();return h.length===0&&h.push({colno:w,filename:S,function:"?",in_app:!0,lineno:_}),r}function ag(r,n,i,s){_o(i,{handled:!1,type:s}),r.captureEvent(i,{originalException:n})}function lg(){const r=Nt(),n=r.getClient(),i=n&&n.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[r,i.stackParser,i.attachStacktrace]}or.__initStatic();const O0=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Eo{static __initStatic(){this.id="TryCatch"}__init(){this.name=Eo.id}constructor(n){Eo.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...n}}setupOnce(){this._options.setTimeout&&ut(Be,"setTimeout",Eh),this._options.setInterval&&ut(Be,"setInterval",Eh),this._options.requestAnimationFrame&&ut(Be,"requestAnimationFrame",x0),this._options.XMLHttpRequest&&"XMLHttpRequest"in Be&&ut(XMLHttpRequest.prototype,"send",L0);const n=this._options.eventTarget;n&&(Array.isArray(n)?n:O0).forEach(A0)}}function Eh(r){return function(...n){const i=n[0];return n[0]=_i(i,{mechanism:{data:{function:sr(r)},handled:!0,type:"instrument"}}),r.apply(this,n)}}function x0(r){return function(n){return r.apply(this,[_i(n,{mechanism:{data:{function:"requestAnimationFrame",handler:sr(r)},handled:!0,type:"instrument"}})])}}function L0(r){return function(...n){const i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in i&&typeof i[s]=="function"&&ut(i,s,function(l){const c={mechanism:{data:{function:s,handler:sr(l)},handled:!0,type:"instrument"}},p=mu(l);return p&&(c.mechanism.data.handler=sr(p)),_i(l,c)})}),r.apply(this,n)}}function A0(r){const n=Be,i=n[r]&&n[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(ut(i,"addEventListener",function(s){return function(l,c,p){try{typeof c.handleEvent=="function"&&(c.handleEvent=_i(c.handleEvent,{mechanism:{data:{function:"handleEvent",handler:sr(c),target:r},handled:!0,type:"instrument"}}))}catch{}return s.apply(this,[l,_i(c,{mechanism:{data:{function:"addEventListener",handler:sr(c),target:r},handled:!0,type:"instrument"}}),p])}}),ut(i,"removeEventListener",function(s){return function(l,c,p){const m=c;try{const h=m&&m.__sentry_wrapped__;h&&s.call(this,l,h,p)}catch{}return s.call(this,l,m,p)}}))}Eo.__initStatic();class pi{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=pi.id}constructor(n={}){pi.prototype.__init.call(this),this._key=n.key||"cause",this._limit=n.limit||5}setupOnce(n,i){n((s,l)=>{const c=i(),p=c.getClient(),m=c.getIntegration(pi);if(!p||!m)return s;const h=p.getOptions();return W_(og,h.stackParser,h.maxValueLength,m._key,m._limit,s,l),s})}}pi.__initStatic();class hi{constructor(){hi.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=hi.id}setupOnce(){tg(n=>{if(Nt().getIntegration(hi)){if(!Be.navigator&&!Be.location&&!Be.document)return n;const i=n.request&&n.request.url||Be.location&&Be.location.href,{referrer:s}=Be.document||{},{userAgent:l}=Be.navigator||{},c={...n.request&&n.request.headers,...s&&{Referer:s},...l&&{"User-Agent":l}},p={...n.request,...i&&{url:i},headers:c};return{...n,request:p}}return n})}}hi.__initStatic();class mi{constructor(){mi.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=mi.id}setupOnce(n,i){const s=l=>{if(l.type)return l;const c=i().getIntegration(mi);if(c){try{if(function(p,m){return m?!!(function(h,w){const _=h.message,S=w.message;return!(!_&&!S||_&&!S||!_&&S||_!==S||!bh(h,w)||!Ch(h,w))}(p,m)||function(h,w){const _=Th(w),S=Th(h);return!(!_||!S||_.type!==S.type||_.value!==S.value||!bh(h,w)||!Ch(h,w))}(p,m)):!1}(l,c._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_e.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return c._previousEvent=l}return c._previousEvent=l}return l};s.id=this.name,n(s)}}function Ch(r,n){let i=Mh(r),s=Mh(n);if(!i&&!s)return!0;if(i&&!s||!i&&s||s.length!==i.length)return!1;for(let l=0;l=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(n.major===13&&n.minor===0&&n.point===0);case"Firefox":return n.major>=67}return!0}(Lr(),la())||Le())}function zh(){if(Le()||!document)return!1;var r=document.createElement("iframe");return!!r.requestFullscreen||!!r.webkitRequestFullscreen}var jw=function(){try{var r=document.createElement("canvas"),n=r.getContext("webgl2")!=null;return r.remove(),n}catch{return!1}}();function fg(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!Le()&&!!jw&&(r?function(){return Wh()?!1:["Chrome","Firefox"].includes(Lr())}():function(){if(Wh())return!1;var n=Lr();if(n==="Safari"){var i=Su();if(i.major<15||i.major===15&&i.minor<4)return!1}return n==="Chrome"?wu().major>=77:n==="Firefox"?ku().major>=97:["Chrome","Firefox","Safari"].includes(n)}())}function pg(){if(Le()||hg()||typeof AudioWorkletNode>"u")return!1;switch(Lr()){case"Chrome":case"Firefox":return!0;case"Safari":return la().major>=17}return!1}function Vh(){return dg()&&!function(){var r,n=Lr();if(!Gt())return!0;switch(n){case"Chrome":return(r=wu()).major&&r.major>0&&r.major<75;case"Firefox":return(r=ku()).major<91;case"Safari":return(r=Su()).major<13||r.major===13&&r.minor<1;default:return!0}}()}function hg(){return Gt().match(/Linux; Android/)}function Wh(){var r,n,i=Gt(),s=i.match(/Mac/)&&(!Le()&&typeof window<"u"&&(r=window)!==null&&r!==void 0&&(n=r.navigator)!==null&&n!==void 0&&n.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(i.match(/Mobi/)||i.match(/Android/)||s)||!!Gt().match(/DailyAnd\//)||void 0}function Lr(){if(typeof window<"u"){var r=Gt();return mg()?"Safari":r.indexOf("Edge")>-1?"Edge":r.match(/Chrome\//)?"Chrome":r.indexOf("Safari")>-1||gg()?"Safari":r.indexOf("Firefox")>-1?"Firefox":r.indexOf("MSIE")>-1||r.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function la(){switch(Lr()){case"Chrome":return wu();case"Safari":return Su();case"Firefox":return ku();case"Edge":return function(){var r=0,n=0;if(typeof window<"u"){var i=Gt().match(/Edge\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),n=parseInt(i[2])}catch{}}return{major:r,minor:n}}()}}function wu(){var r=0,n=0,i=0,s=0,l=!1;if(typeof window<"u"){var c=Gt(),p=c.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(p)try{r=parseInt(p[1]),n=parseInt(p[2]),i=parseInt(p[3]),s=parseInt(p[4]),l=c.indexOf("OPR/")>-1}catch{}}return{major:r,minor:n,build:i,patch:s,opera:l}}function mg(){return!!Gt().match(/iPad|iPhone|iPod/i)&&dg()}function gg(){return Gt().indexOf("AppleWebKit/605.1.15")>-1}function Su(){var r=0,n=0,i=0;if(typeof window<"u"){var s=Gt().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(s)try{r=parseInt(s[1]),n=parseInt(s[2]),i=parseInt(s[4])}catch{}else(mg()||gg())&&(r=14,n=0,i=3)}return{major:r,minor:n,point:i}}function ku(){var r=0,n=0;if(typeof window<"u"){var i=Gt().match(/Firefox\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),n=parseInt(i[2])}catch{}}return{major:r,minor:n}}var vg=function(){function r(){on(this,r)}return sn(r,[{key:"addListenerForMessagesFromCallMachine",value:function(n,i,s){lo()}},{key:"addListenerForMessagesFromDailyJs",value:function(n,i,s){lo()}},{key:"sendMessageToCallMachine",value:function(n,i,s,l){lo()}},{key:"sendMessageToDailyJs",value:function(n,i){lo()}},{key:"removeListener",value:function(n){lo()}}]),r}();function Jh(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);n&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,s)}return i}function Lc(r){for(var n=1;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,s=rn(r);if(n){var l=rn(this).constructor;i=Reflect.construct(s,arguments,l)}else i=s.apply(this,arguments);return ha(this,i)}}var Bw=function(r){pa(i,vg);var n=Iw(i);function i(){var s;return on(this,i),(s=n.call(this))._wrappedListeners={},s._messageCallbacks={},s}return sn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(s,l,c){var p=this,m=function(h){if(h.data&&h.data.what==="iframe-call-message"&&(!h.data.callClientId||h.data.callClientId===l)&&(!h.data.from||h.data.from!=="module")){var w=Lc({},h.data);if(delete w.from,w.callbackStamp&&p._messageCallbacks[w.callbackStamp]){var _=w.callbackStamp;p._messageCallbacks[_].call(c,w),delete p._messageCallbacks[_]}delete w.what,delete w.callbackStamp,s.call(c,w)}};this._wrappedListeners[s]=m,window.addEventListener("message",m)}},{key:"addListenerForMessagesFromDailyJs",value:function(s,l,c){var p=function(m){var h;if(!(!m.data||m.data.what!==Oc||!m.data.action||m.data.from&&m.data.from!=="module"||m.data.callClientId&&l&&m.data.callClientId!==l||m!=null&&(h=m.data)!==null&&h!==void 0&&h.callFrameId)){var w=m.data;s.call(c,w)}};this._wrappedListeners[s]=p,window.addEventListener("message",p)}},{key:"sendMessageToCallMachine",value:function(s,l,c,p){if(!c)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var m=Lc({},s);if(m.what=Oc,m.from="module",m.callClientId=c,l){var h=ma();this._messageCallbacks[h]=l,m.callbackStamp=h}var w=p?p.contentWindow:window,_=this._callMachineTargetOrigin(p);_&&w.postMessage(m,_)}},{key:"sendMessageToDailyJs",value:function(s,l){s.what=Oc,s.callClientId=l,s.from="embedded",window.postMessage(s,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(s){var l=this._wrappedListeners[s];l&&(window.removeEventListener("message",l),delete this._wrappedListeners[s])}},{key:"forwardPackagedMessageToCallMachine",value:function(s,l,c){var p=Lc({},s);p.callClientId=c;var m=l?l.contentWindow:window,h=this._callMachineTargetOrigin(l);h&&m.postMessage(p,h)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(s,l){var c=function(p){if(p.data&&p.data.what==="iframe-call-message"&&(!p.data.callClientId||p.data.callClientId===l)&&(!p.data.from||p.data.from!=="module")){var m=p.data;s(m)}};return this._wrappedListeners[s]=c,window.addEventListener("message",c),s}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(s){var l=this._wrappedListeners[s];l&&(window.removeEventListener("message",l),delete this._wrappedListeners[s])}},{key:"_callMachineTargetOrigin",value:function(s){return s?s.src?new URL(s.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),i}();function Gh(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);n&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,s)}return i}function Fw(r){var n=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,s=rn(r);if(n){var l=rn(this).constructor;i=Reflect.construct(s,arguments,l)}else i=s.apply(this,arguments);return ha(this,i)}}var Uw=function(r){pa(i,vg);var n=Fw(i);function i(){var s;return on(this,i),s=n.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Pn.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Pn.EventEmitter,s._wrappedListeners={},s._messageCallbacks={},s}return sn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(s,l,c){this._addListener(s,global.callMachineToDailyJsEmitter,l,c,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(s,l,c){this._addListener(s,global.dailyJsToCallMachineEmitter,l,c,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(s,l,c){this._sendMessage(s,global.dailyJsToCallMachineEmitter,c,l,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(s,l){this._sendMessage(s,global.callMachineToDailyJsEmitter,l,null,"sending message to daily-js")}},{key:"removeListener",value:function(s){var l=this._wrappedListeners[s];l&&(global.callMachineToDailyJsEmitter.removeListener("message",l),global.dailyJsToCallMachineEmitter.removeListener("message",l),delete this._wrappedListeners[s])}},{key:"_addListener",value:function(s,l,c,p,m){var h=this,w=function(_){if(_.callClientId===c){if(_.callbackStamp&&h._messageCallbacks[_.callbackStamp]){var S=_.callbackStamp;h._messageCallbacks[S].call(p,_),delete h._messageCallbacks[S]}s.call(p,_)}};this._wrappedListeners[s]=w,l.addListener("message",w)}},{key:"_sendMessage",value:function(s,l,c,p,m){var h=function(_){for(var S=1;S0&&arguments[0]!==void 0?arguments[0]:{},i=n.data,s=n.mergeStrategy,l=s===void 0?tu:s;on(this,r),r._validateMergeStrategy(l),r._validateData(i,l),this.mergeStrategy=l,this.data=i}return sn(r,[{key:"isNoOp",value:function(){return r.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(n,i){return Object.keys(n).length===0&&i===nu}},{key:"_validateMergeStrategy",value:function(n){if(!qh.includes(n))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(qh,"]"))}},{key:"_validateData",value:function(n,i){if(!function(m){if(m==null||Ne(m)!=="object")return!1;var h=Object.getPrototypeOf(m);return h==null||h===Object.prototype}(n))throw Error("Meeting session data must be a plain (map-like) object");var s;try{if(s=JSON.stringify(n),i===tu){var l=JSON.parse(s);Mt(l,n)||console.warn("The meeting session data provided will be modified when serialized.",l,n)}else if(i===nu){for(var c in n)if(Object.hasOwnProperty.call(n,c)&&n[c]!==void 0){var p=JSON.parse(JSON.stringify(n[c]));Mt(n[c],p)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",p,n[c])}}}catch(m){throw Error("Meeting session data must be serializable to JSON: ".concat(m))}if(s.length>Ih)throw Error("Meeting session data is too large (".concat(s.length," characters). Maximum size suppported is ").concat(Ih,"."))}}]),r}();function ru(r,n,i){return ru=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(s,l,c){var p=[null];p.push.apply(p,l);var m=new(Function.bind.apply(s,p));return c&&vo(m,c.prototype),m},ru.apply(null,arguments)}function iu(r){var n=typeof Map=="function"?new Map:void 0;return iu=function(i){if(i===null||(s=i,Function.toString.call(s).indexOf("[native code]")===-1))return i;var s;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(i))return n.get(i);n.set(i,l)}function l(){return ru(i,arguments,rn(this).constructor)}return l.prototype=Object.create(i.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),vo(l,i)},iu(r)}function zw(r){var n=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,s=rn(r);if(n){var l=rn(this).constructor;i=Reflect.construct(s,arguments,l)}else i=s.apply(this,arguments);return ha(this,i)}}function Hh(r){var n,i=(n=window._daily)===null||n===void 0?void 0:n.pendings;if(i){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}}var Vw=function(){function r(n){on(this,r),this._currentLoad=null,this._callClientId=n}return sn(r,[{key:"load",value:function(){var n,i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void l(!0);n=this._callClientId,window._daily.pendings.push(n),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new Ww(s,function(){l(!1)},function(p,m){m||Hh(i._callClientId),c(p,m)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Hh(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),r}(),Ww=function(){function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;on(this,r),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=n,this._successCallback=i,this._failureCallback=s}return sn(r,[{key:"start",value:function(){var n=this;this._currentAttempt||(this._currentAttempt=new Yh(this._dailyConfig,this._successCallback,function i(s){n._currentAttempt.cancelled||(n._attemptsRemaining--,n._failureCallback(s,n._attemptsRemaining>0),n._attemptsRemaining<=0||setTimeout(function(){n._currentAttempt.cancelled||(n._currentAttempt=new Yh(n._dailyConfig,n._successCallback,i),n._currentAttempt.start())},3e3))}),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}}]),r}(),Ac=function(r){pa(i,iu(Error));var n=zw(i);function i(){return on(this,i),n.apply(this,arguments)}return sn(i)}(),ca=2e4,Yh=function(){function r(i,s,l){on(this,r),this._loadAttemptImpl=Le()||!i.avoidEval?new Jw(i,s,l):new Gw(i,s,l)}var n;return sn(r,[{key:"start",value:(n=me(function*(){return this._loadAttemptImpl.start()}),function(){return n.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}}]),r}(),Jw=function(){function r(c,p,m){on(this,r),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=c,this._successCallback=p,this._failureCallback=m}var n,i,s,l;return sn(r,[{key:"start",value:(l=me(function*(){var c=na(this._dailyConfig);!(yield this._tryLoadFromIOSCache(c))&&this._loadFromNetwork(c)}),function(){return l.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(s=me(function*(c){if(!this._iosCache)return!1;try{var p=yield this._iosCache.get(c);return!!this.cancelled||!!p&&(p.code?(Function('"use strict";'+p.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=p.refetchHeaders,!1))}catch{return!1}}),function(c){return s.apply(this,arguments)})},{key:"_loadFromNetwork",value:(i=me(function*(c){var p=this;this._networkTimeout=setTimeout(function(){p._networkTimedOut=!0,p._failureCallback({msg:"Timed out (>".concat(ca," ms) when loading call object bundle ").concat(c),type:"timeout"})},ca);try{var m=this._refetchHeaders?{headers:this._refetchHeaders}:{},h=yield fetch(c,m);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Ac;var w=yield this._getBundleCodeFromResponse(c,h);if(this.cancelled)throw new Ac;Function('"use strict";'+w)(),this._iosCache&&this._iosCache.set(c,w,h.headers),this.succeeded=!0,this._successCallback()}catch(_){if(clearTimeout(this._networkTimeout),_ instanceof Ac||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(c,": ").concat(_),type:_.message})}}),function(c){return i.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(n=me(function*(c,p){if(p.ok)return yield p.text();if(this._iosCache&&p.status===304)return(yield this._iosCache.renew(c,p.headers)).code;throw new Error("Received ".concat(p.status," response"))}),function(c,p){return n.apply(this,arguments)})}]),r}(),Gw=function(){function r(n,i,s){on(this,r),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=n,this._successCallback=i,this._failureCallback=s,this._attemptId=ma(),this._networkTimeout=null,this._scriptElement=null}return sn(r,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var n=na(this._dailyConfig);(typeof document>"u"?"undefined":Ne(document))==="object"?this._startLoading(n):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(n){var i=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){i._stopLoading(),i._failureCallback({msg:"Timed out (>".concat(ca," ms) when loading call object bundle ").concat(n),type:"timeout"})},ca);var s=document.getElementsByTagName("head")[0],l=document.createElement("script");this._scriptElement=l,l.onload=function(){i._stopLoading(),i.succeeded=!0,i._successCallback()},l.onerror=function(c){i._stopLoading(),i._failureCallback({msg:"Failed to load call object bundle ".concat(c.target.src),type:c.message})},l.src=n,s.appendChild(l)}},{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)}}]),r}(),Ys=function(r,n,i){return Hw(r.local,n,i)===!0},qw=function(r,n,i){return r.local.streams&&r.local.streams[n]&&r.local.streams[n].stream&&r.local.streams[n].stream["get".concat(i==="video"?"Video":"Audio","Tracks")]()[0]},ci=function(r,n,i,s){var l=Yw(r,n,i,s);return l&&l.pendingTrack},Hw=function(r,n,i){if(!r)return!1;var s=function(c){switch(c){case"avatar":return!0;case"staged":return c;default:return!!c}},l=r.public.subscribedTracks;return l&&l[n]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(i)===-1&&l[n].custom?[!0,"staged"].includes(l[n].custom)?s(l[n].custom):s(l[n].custom[i]):s(l[n][i]):!l||s(l.ALL)},Yw=function(r,n,i,s){var l=Object.values(r.streams||{}).filter(function(c){return c.participantId===n&&c.type===i&&c.pendingTrack&&c.pendingTrack.kind===s}).sort(function(c,p){return new Date(p.starttime)-new Date(c.starttime)});return l&&l[0]},Qw=function(r,n){var i=r.local.public.customTracks;if(i&&i[n])return i[n].track};function Qh(r,n){for(var i=n.getState(),s=0,l=["cam","screen"];s=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,m=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){m=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(m)throw c}}}}function Zh(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,s=new Array(n);i=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,m=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){m=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(m)throw c}}}}function em(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,s=new Array(n);i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,s=rn(r);if(n){var l=rn(this).constructor;i=Reflect.construct(s,arguments,l)}else i=s.apply(this,arguments);return ha(this,i)}}function nm(r,n){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function(h,w){if(h){if(typeof h=="string")return rm(h,w);var _=Object.prototype.toString.call(h).slice(8,-1);if(_==="Object"&&h.constructor&&(_=h.constructor.name),_==="Map"||_==="Set")return Array.from(h);if(_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_))return rm(h,w)}}(r))||n){i&&(r=i);var s=0,l=function(){};return{s:l,n:function(){return s>=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,m=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){m=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(m)throw c}}}}function rm(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,s=new Array(n);i49)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 n){if(!Number.isInteger(n.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(n.minTilesPerPage,".")),!1;if(n.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in n&&n.minTilesPerPage>n.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(r){return Sg(r,{allowAllParticipantsKey:!1})},help:Cg({allowAllParticipantsKey:!1})},sendSettings:{validate:function(r,n){return!!function(i,s){try{return s.validateUpdateSendSettings(i),!0}catch(l){return console.error("Failed to validate send settings",l),!1}}(r,n)&&(n._preloadCache.sendSettings=r,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(r,n){var i;return!!kg(r)&&(n._preloadCache.inputSettings||(n._preloadCache.inputSettings={}),Eg(r,(i=n.properties)===null||i===void 0?void 0:i.dailyConfig),r.audio&&(n._preloadCache.inputSettings.audio=r.audio),r.video&&(n._preloadCache.inputSettings.video=r.video),!0)},help:su()},layout:{validate:function(r){return r==="custom-v1"||r==="browser"||r==="none"},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},Qs={styles:{validate:function(r){for(var n in r)if(n!=="cam"&&n!=="screen")return!1;if(r.cam){for(var i in r.cam)if(i!=="div"&&i!=="video")return!1}if(r.screen){for(var s in r.screen)if(s!=="div"&&s!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(r,n){if(n._preloadCache.subscribeToTracksAutomatically)return!1;var i=[!0,!1,"staged"];if(i.includes(r)||!Le()&&r==="avatar")return!0;var s=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function l(c){var p=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var m in c)if(m==="custom"){if(!i.includes(c[m])&&!l(c[m],!0))return!1}else{var h=!p&&!s.includes(m),w=!i.includes(c[m]);if(h||w)return!1}return!0}(r)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(Le()?"":" | '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(r){return r===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(r){for(var n=0,i=Object.entries(r);n1&&arguments[1]!==void 0?arguments[1]:{};if(on(this,ue),Mn(bn(v=ge.call(this)),"startListeningForDeviceChanges",function(){tS(v.handleDeviceChange)}),Mn(bn(v),"stopListeningForDeviceChanges",function(){nS(v.handleDeviceChange)}),Mn(bn(v),"handleDeviceChange",function(X){X=X.map(function(oe){return JSON.parse(JSON.stringify(oe))}),v.emitDailyJSEvent({action:"available-devices-updated",availableDevices:X})}),Mn(bn(v),"handleNativeAppStateChange",function(){var X=me(function*(oe){if(oe==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield v.destroy());var we=oe==="active";v.disableReactNativeAutoDeviceManagement("video")||(we?v.camUnmutedBeforeLosingNativeActiveState&&v.setLocalVideo(!0):(v.camUnmutedBeforeLosingNativeActiveState=v.localVideo(),v.camUnmutedBeforeLosingNativeActiveState&&v.setLocalVideo(!1)))});return function(oe){return X.apply(this,arguments)}}()),Mn(bn(v),"handleNativeAudioFocusChange",function(X){v.disableReactNativeAutoDeviceManagement("audio")||(v._hasNativeAudioFocus=X,v.toggleParticipantAudioBasedOnNativeAudioFocus(),v._hasNativeAudioFocus?v.micUnmutedBeforeLosingNativeAudioFocus&&v.setLocalAudio(!0):(v.micUnmutedBeforeLosingNativeAudioFocus=v.localAudio(),v.setLocalAudio(!1)))}),Mn(bn(v),"handleNativeSystemScreenCaptureStop",function(){v.stopScreenShare()}),v.strictMode=k.strictMode===void 0||k.strictMode,v.allowMultipleCallInstances=(g=k.allowMultipleCallInstances)!==null&&g!==void 0&&g,Object.keys(kr).length&&(v._logDuplicateInstanceAttempt(),!v.allowMultipleCallInstances)){if(v.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:{}}),v.callClientId=ma(),C=bn(v),kr[C.callClientId]=C,window._daily.instances[v.callClientId]={},v._sharedTracks={},window._daily.instances[v.callClientId].tracks=v._sharedTracks,k.dailyJsVersion=ue.version(),v._iframe=d,v._callObjectMode=k.layout==="none"&&!v._iframe,v._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},k.showLocalVideo!==void 0?v._callObjectMode?console.error("showLocalVideo is not available in call object mode"):v._showLocalVideo=!!k.showLocalVideo:v._showLocalVideo=!0,k.showParticipantsBar!==void 0?v._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):v._showParticipantsBar=!!k.showParticipantsBar:v._showParticipantsBar=!0,k.customIntegrations!==void 0?v._callObjectMode?console.error("customIntegrations is not available in call object mode"):v._customIntegrations=k.customIntegrations:v._customIntegrations={},k.customTrayButtons!==void 0?v._callObjectMode?console.error("customTrayButtons is not available in call object mode"):v._customTrayButtons=k.customTrayButtons:v._customTrayButtons={},k.activeSpeakerMode!==void 0?v._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):v._activeSpeakerMode=!!k.activeSpeakerMode:v._activeSpeakerMode=!1,k.receiveSettings?v._callObjectMode?v._receiveSettings=k.receiveSettings:console.error("receiveSettings is only available in call object mode"):v._receiveSettings={},v.validateProperties(k),v.properties=ye({},k),v._preloadCache.inputSettings||(v._preloadCache.inputSettings={}),k.inputSettings&&k.inputSettings.audio&&(v._preloadCache.inputSettings.audio=k.inputSettings.audio),k.inputSettings&&k.inputSettings.video&&(v._preloadCache.inputSettings.video=k.inputSettings.video),v._callObjectLoader=v._callObjectMode?new Vw(v.callClientId):null,v._callState=Oh,v._isPreparingToJoin=!1,v._accessState={access:Mc},v._meetingSessionSummary={},v._finalSummaryOfPrevSession={},v._meetingSessionState=jc(om,v._callObjectMode),v._nativeInCallAudioMode=im,v._participants={},v._isScreenSharing=!1,v._participantCounts=sm,v._rmpPlayerState={},v._waitingParticipants={},v._network={threshold:"good",quality:100},v._activeSpeaker={},v._localAudioLevel=0,v._isLocalAudioLevelObserverRunning=!1,v._remoteParticipantsAudioLevel={},v._isRemoteParticipantsAudioLevelObserverRunning=!1,v._maxAppMessageSize=Pc,v._messageChannel=Le()?new Uw:new Bw,v._iframe&&(v._iframe.requestFullscreen?v._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===v._iframe?(v.emitDailyJSEvent({action:Gs}),v.sendMessageToCallMachine({action:Gs})):(v.emitDailyJSEvent({action:qs}),v.sendMessageToCallMachine({action:qs}))}):v._iframe.webkitRequestFullscreen&&v._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===v._iframe?(v.emitDailyJSEvent({action:Gs}),v.sendMessageToCallMachine({action:Gs})):(v.emitDailyJSEvent({action:qs}),v.sendMessageToCallMachine({action:qs}))})),Le()){var I=v.nativeUtils();I.addAudioFocusChangeListener&&I.removeAudioFocusChangeListener&&I.addAppStateChangeListener&&I.removeAppStateChangeListener&&I.addSystemScreenCaptureStopListener&&I.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),v._hasNativeAudioFocus=!0,I.addAudioFocusChangeListener(v.handleNativeAudioFocusChange),I.addAppStateChangeListener(v.handleNativeAppStateChange),I.addSystemScreenCaptureStopListener(v.handleNativeSystemScreenCaptureStop)}return v._callObjectMode&&v.startListeningForDeviceChanges(),v._messageChannel.addListenerForMessagesFromCallMachine(v.handleMessageFromCallMachine,v.callClientId,bn(v)),v}return sn(ue,[{key:"destroy",value:(U=me(function*(){var d,g;try{yield this.leave()}catch{}var v=this._iframe;if(v){var C=v.parentElement;C&&C.removeChild(v)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),Le()){var k=this.nativeUtils();k.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),k.removeAppStateChangeListener(this.handleNativeAppStateChange),k.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete kr[this.callClientId],!((d=window)===null||d===void 0||(g=d._daily)===null||g===void 0)&&g.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return U.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(d){var g=d.bodyClass,v=d.cssFile,C=d.cssText;return Ce(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(v),bodyClass:g,cssText:C}),this}},{key:"iframe",value:function(){return Ce(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return tn(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return tn(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(d,g){for(var v in g){if(!Qs[v])throw new Error("unrecognized updateParticipant property ".concat(v));if(Qs[v].validate&&!Qs[v].validate(g[v],this,this._participants[d]))throw new Error(Qs[v].help)}}},{key:"updateParticipant",value:function(d,g){return this._participants.local&&this._participants.local.session_id===d&&(d="local"),d&&g&&(this.validateParticipantProperties(d,g),this.sendMessageToCallMachine({action:"update-participant",id:d,properties:g})),this}},{key:"updateParticipants",value:function(d){var g=this._participants.local&&this._participants.local.session_id;for(var v in d)v===g&&(v="local"),v&&d[v]&&this.validateParticipantProperties(v,d[v]);return this.sendMessageToCallMachine({action:"update-participants",participants:d}),this}},{key:"updateWaitingParticipant",value:(P=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(tn(this._callObjectMode,"updateWaitingParticipant()"),je(this._callState,"updateWaitingParticipant()"),typeof g!="string"||Ne(v)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(C,k){d.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:g,updates:v},function(I){I.error&&k(I.error),I.id||k(new Error("unknown error in updateWaitingParticipant()")),C({id:I.id})})})}),function(){return P.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Z=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tn(this._callObjectMode,"updateWaitingParticipants()"),je(this._callState,"updateWaitingParticipants()"),Ne(g)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(v,C){d.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:g},function(k){k.error&&C(k.error),k.ids||C(new Error("unknown error in updateWaitingParticipants()")),v({ids:k.ids})})})}),function(){return Z.apply(this,arguments)})},{key:"requestAccess",value:(ae=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=g.access,C=v===void 0?{level:N0}:v,k=g.name,I=k===void 0?"":k;return tn(this._callObjectMode,"requestAccess()"),je(this._callState,"requestAccess()"),new Promise(function(X,oe){d.sendMessageToCallMachine({action:"daily-method-request-access",access:C,name:I},function(we){we.error&&oe(we.error),we.access||oe(new Error("unknown error in requestAccess()")),X({access:we.access,granted:we.granted})})})}),function(){return ae.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(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in g&&(Le()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),g={}):d&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),g={})),this.sendMessageToCallMachine({action:"local-audio",state:d,options:g}),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(d){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:d}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(d){return this.sendMessageToCallMachine({action:"local-video",state:d}),this}},{key:"getReceiveSettings",value:(Q=me(function*(d){var g=this,v=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,C=v!==void 0&&v;if(tn(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Ne(d)){case"string":return new Promise(function(k){g.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:d,showInheritedValues:C},function(I){k(I.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(d){return Q.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Te=me(function*(d){var g=this;if(tn(this._callObjectMode,"updateReceiveSettings()"),!Sg(d,{allowAllParticipantsKey:!0}))throw new Error(Cg({allowAllParticipantsKey:!0}));return je(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(v){g.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:d},function(C){v({receiveSettings:C.receiveSettings})})})}),function(d){return Te.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(d){var g,v,C,k,I,X,oe,we;if(d){var Qe={},Fe=((g=d.audio)===null||g===void 0||(v=g.processor)===null||v===void 0?void 0:v.type)==="none"&&((C=d.audio)===null||C===void 0||(k=C.processor)===null||k===void 0?void 0:k._isDefaultWhenNone);if(d.audio&&!Fe){var Rt=ye({},d.audio.processor);delete Rt._isDefaultWhenNone,Qe.audio=ye(ye({},d.audio),{},{processor:Rt})}var jt=((I=d.video)===null||I===void 0||(X=I.processor)===null||X===void 0?void 0:X.type)==="none"&&((oe=d.video)===null||oe===void 0||(we=oe.processor)===null||we===void 0?void 0:we._isDefaultWhenNone);if(d.video&&!jt){var It=ye({},d.video.processor);delete It._isDefaultWhenNone,Qe.video=ye(ye({},d.video),{},{processor:It})}return Qe}}},{key:"getInputSettings",value:function(){var d=this;return Ce(),new Promise(function(g){g(d._getInputSettings())})}},{key:"_getInputSettings",value:function(){var d,g,v,C,k,I,X,oe,we={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(d=((v=this._inputSettings)===null||v===void 0?void 0:v.video)||we,g=((C=this._inputSettings)===null||C===void 0?void 0:C.audio)||we):(d=((k=this._preloadCache)===null||k===void 0||(I=k.inputSettings)===null||I===void 0?void 0:I.video)||we,g=((X=this._preloadCache)===null||X===void 0||(oe=X.inputSettings)===null||oe===void 0?void 0:oe.audio)||we);var Qe={audio:g,video:d};return this._prepInputSettingsToPresentToUser(Qe)}},{key:"updateInputSettings",value:(Je=me(function*(d){var g=this;return Ce(),kg(d)?(d&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),Eg(d,this.properties.dailyConfig),d.audio&&(this._preloadCache.inputSettings.audio=d.audio),d.video&&(this._preloadCache.inputSettings.video=d.video)),d.video||d.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(v,C){g.sendMessageToCallMachine({action:"update-input-settings",inputSettings:d},function(k){k.error?C(k.error):v({inputSettings:g._prepInputSettingsToPresentToUser(k.inputSettings)})})}):this._getInputSettings()):(console.error(su()),Promise.reject(su()))}),function(d){return Je.apply(this,arguments)})},{key:"setBandwidth",value:function(d){var g=d.kbs,v=d.trackConstraints;if(Ce(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:g,trackConstraints:v}),this}},{key:"getDailyLang",value:function(){var d=this;if(Ce(),this._callMachineInitialized)return new Promise(function(g){d.sendMessageToCallMachine({action:"get-daily-lang"},function(v){delete v.action,delete v.callbackStamp,g(v)})})}},{key:"setDailyLang",value:function(d){return Ce(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:d}),this}},{key:"setProxyUrl",value:function(d){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:d}),this}},{key:"setIceConfig",value:function(d){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:d}),this}},{key:"meetingSessionSummary",value:function(){return[Sr,Xn].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Pe=me(function*(){var d=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),je(this._callState,"getMeetingSession()"),new Promise(function(g){d.sendMessageToCallMachine({action:"get-meeting-session"},function(v){delete v.action,delete v.callbackStamp,g(v)})})}),function(){return Pe.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return je(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";tn(this._callObjectMode,"setMeetingSessionData()"),je(this._callState,"setMeetingSessionData");try{(function(v,C){new $w({data:v,mergeStrategy:C})})(d,g)}catch(v){throw console.error(v),v}try{this.sendMessageToCallMachine({action:"set-session-data",data:d,mergeStrategy:g})}catch(v){throw new Error("Error setting meeting session data: ".concat(v))}}},{key:"setUserName",value:function(d,g){var v=this;return this.properties.userName=d,new Promise(function(C){v.sendMessageToCallMachine({action:"set-user-name",name:d??"",thisMeetingOnly:Le()||!!g&&!!g.thisMeetingOnly},function(k){delete k.action,delete k.callbackStamp,C(k)})})}},{key:"setUserData",value:(be=me(function*(d){var g=this;try{wg(d)}catch(v){throw console.error(v),v}if(this.properties.userData=d,this._callMachineInitialized)return new Promise(function(v){try{g.sendMessageToCallMachine({action:"set-user-data",userData:d},function(C){delete C.action,delete C.callbackStamp,v(C)})}catch(C){throw new Error("Error setting user data: ".concat(C))}})}),function(d){return be.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(d){if(d&&(d<100||typeof d!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(d){var g=this;if(typeof AudioWorkletNode>"u"&&!Le())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(v,C){g.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:d},function(k){g._isLocalAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):v()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:d}}},{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(d){var g=this;if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(v,C){g.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:d},function(k){g._isRemoteParticipantsAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):v()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:d}}},{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:(le=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tn(this._callObjectMode,"startCamera()"),Nc(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(g)}catch(v){return Promise.reject(v)}else{if(this._didPreAuth){if(g.url&&g.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(g.token&&g.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(g),this.properties=ye(ye({},this.properties),g)}return new Promise(function(v){d.sendMessageToCallMachine({action:"start-camera",properties:ai(d.properties,d.callClientId),preloadCache:ai(d._preloadCache,d.callClientId)},function(C){delete C.action,delete C.callbackStamp,v(C)})})}),function(){return le.apply(this,arguments)})},{key:"validateCustomTrack",value:function(d,g,v){if(v&&v.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(g&&g!=="music"&&g!=="speech"&&!(g instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(v&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(v))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(!(d instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return Ce(),je(this._callState,"startCustomTrack()"),this.validateCustomTrack(g.track,g.mode,g.trackName),new Promise(function(v,C){d._sharedTracks.customTrack=g.track,g.track=ho,d.sendMessageToCallMachine({action:"start-custom-track",properties:g},function(k){k.error?C({error:k.error}):v(k.mediaTag)})})}},{key:"stopCustomTrack",value:function(d){var g=this;return Ce(),je(this._callState,"stopCustomTrack()"),new Promise(function(v){g.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:d},function(C){v(C.mediaTag)})})}},{key:"setCamera",value:function(d){var g=this;return uo(),Ks(this._callMachineInitialized,"setCamera()"),new Promise(function(v){g.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:d},function(C){v({device:C.device})})})}},{key:"setAudioDevice",value:(Se=me(function*(d){return uo(),this.nativeUtils().setAudioDevice(d),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(d){return Se.apply(this,arguments)})},{key:"cycleCamera",value:function(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(v){d.sendMessageToCallMachine({action:"cycle-camera",properties:g},function(C){v({device:C.device})})})}},{key:"cycleMic",value:function(){var d=this;return Ce(),new Promise(function(g){d.sendMessageToCallMachine({action:"cycle-mic"},function(v){g({device:v.device})})})}},{key:"getCameraFacingMode",value:function(){var d=this;return uo(),new Promise(function(g){d.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(v){g(v.facingMode)})})}},{key:"setInputDevicesAsync",value:(ce=me(function*(d){var g=this,v=d.audioDeviceId,C=d.videoDeviceId,k=d.audioSource,I=d.videoSource;return Ce(),k!==void 0&&(v=k),I!==void 0&&(C=I),v&&(this._preloadCache.audioDeviceId=v,this._sharedTracks.audioDeviceId=v),C&&(this._preloadCache.videoDeviceId=C,this._sharedTracks.videoDeviceId=C),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(v instanceof MediaStreamTrack&&(v=ho),C instanceof MediaStreamTrack&&(C=ho),new Promise(function(X){g.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:v,videoDeviceId:C},function(oe){delete oe.action,delete oe.callbackStamp,oe.returnPreloadCache?X({camera:{deviceId:g._preloadCache.videoDeviceId},mic:{deviceId:g._preloadCache.audioDeviceId},speaker:{deviceId:g._preloadCache.outputDeviceId}}):X(oe)})}))}),function(d){return ce.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(H=me(function*(d){var g=this,v=d.outputDeviceId;return Ce(),v&&(this._preloadCache.outputDeviceId=v),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(C){g.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:v},function(k){delete k.action,delete k.callbackStamp,k.returnPreloadCache?C({camera:{deviceId:g._preloadCache.videoDeviceId},mic:{deviceId:g._preloadCache.audioDeviceId},speaker:{deviceId:g._preloadCache.outputDeviceId}}):C(k)})})}),function(d){return H.apply(this,arguments)})},{key:"getInputDevices",value:(J=me(function*(){var d=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){d.sendMessageToCallMachine({action:"get-input-devices"},function(v){delete v.action,delete v.callbackStamp,v.returnPreloadCache?g({camera:{deviceId:d._preloadCache.videoDeviceId},mic:{deviceId:d._preloadCache.audioDeviceId},speaker:{deviceId:d._preloadCache.outputDeviceId}}):g(v)})})}),function(){return J.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return uo(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(d){if(uo(),[im,lS].includes(d)){if(d!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=d,!this.disableReactNativeAutoDeviceManagement("audio")&&ea(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",d)}},{key:"preAuth",value:(z=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tn(this._callObjectMode,"preAuth()"),Nc(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(g)),!g.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(g),this.properties=ye(ye({},this.properties),g),new Promise(function(v,C){d.sendMessageToCallMachine({action:"daily-method-preauth",properties:ai(d.properties,d.callClientId),preloadCache:ai(d._preloadCache,d.callClientId)},function(k){return k.error?C(k.error):k.access?(d._didPreAuth=!0,void v({access:k.access})):C(new Error("unknown error in preAuth()"))})})}),function(){return z.apply(this,arguments)})},{key:"load",value:(j=me(function*(d){var g=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(d&&(this.validateProperties(d),this.properties=ye(ye({},this.properties),d)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(xh),this.emitDailyJSEvent({action:U0}),this._callObjectMode?new Promise(function(v,C){g._callObjectLoader.cancel();var k=Date.now();g._callObjectLoader.load(g.properties.dailyConfig,function(I){g._bundleLoadTime=I?"no-op":Date.now()-k,g._updateCallState(Lh),I&&g.emitDailyJSEvent({action:Ah}),v()},function(I,X){if(g.emitDailyJSEvent({action:$0}),!X){g._updateCallState(Xn),g.resetMeetingDependentVars();var oe={action:jh,errorMsg:I.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:I,bundleUrl:na(g.properties.dailyConfig)}}};g._maybeSendToSentry(oe),g.emitDailyJSEvent(oe),C(I.msg)}})}):(this._iframe.src=zm(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(v,C){g._loadedCallback=function(k){g._callState!==Xn?(g._updateCallState(Lh),(g.properties.cssFile||g.properties.cssText)&&g.loadCss(g.properties),v()):C(k)}}))}}),function(d){return j.apply(this,arguments)})},{key:"join",value:(R=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var v=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(g)}catch(C){return this.updateIsPreparingToJoin(!1),Promise.reject(C)}}else{if(v=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(g.url&&g.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(g.token&&g.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(g.url&&!this._callObjectMode&&g.url&&g.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(g.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(g),this.properties=ye(ye({},this.properties),g)}return g.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!g.showLocalVideo),g.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!g.showParticipantsBar),this._callState===li||this._callState===Zc?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Zc,!1),this.emitDailyJSEvent({action:W0}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),g.inputSettings&&g.inputSettings.audio&&(this._preloadCache.inputSettings.audio=g.inputSettings.audio),g.inputSettings&&g.inputSettings.video&&(this._preloadCache.inputSettings.video=g.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:ai(this.properties,this.callClientId),preloadCache:ai(this._preloadCache,this.callClientId)}),new Promise(function(C,k){d._joinedCallback=function(I,X){if(d._callState!==Xn){if(d._updateCallState(li),I)for(var oe in I){if(d._callObjectMode){var we=d._callMachine().store;Qh(I[oe],we),Kh(I[oe],we),Xh(I[oe],d._participants[oe],we)}d._participants[oe]=ye({},I[oe]),d.toggleParticipantAudioBasedOnNativeAudioFocus()}v&&d.loadCss(d.properties),C(I)}else k(X)}}))}),function(){return R.apply(this,arguments)})},{key:"leave",value:(O=me(function*(){var d=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(g){d._callState===Sr||d._callState===Xn?g():d._callObjectLoader&&!d._callObjectLoader.loaded?(d._callObjectLoader.cancel(),d._updateCallState(Sr),d.resetMeetingDependentVars(),d.emitDailyJSEvent({action:Sr}),g()):(d._resolveLeave=g,d.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return O.apply(this,arguments)})},{key:"startScreenShare",value:(x=me(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ks(this._callMachineInitialized,"startScreenShare()"),g.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",g.screenVideoSendSettings),g.mediaStream&&(this._sharedTracks.screenMediaStream=g.mediaStream,g.mediaStream=ho),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var v=this.nativeUtils();if(yield v.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Rh,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});v.setSystemScreenCaptureStartCallback(function(){v.setSystemScreenCaptureStartCallback(null),d.sendMessageToCallMachine({action:Bh,captureOptions:g})}),v.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Bh,captureOptions:g})}),function(){return x.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Ks(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ye({action:"local-recording-start"},d))}},{key:"updateRecording",value:function(d){var g=d.layout,v=g===void 0?{preset:"default"}:g,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:v,instanceId:C})}},{key:"stopRecording",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ye({action:"local-recording-stop"},d))}},{key:"startLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ye({action:"daily-method-start-live-streaming"},d))}},{key:"updateLiveStreaming",value:function(d){var g=d.layout,v=g===void 0?{preset:"default"}:g,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:v,instanceId:C})}},{key:"addLiveStreamingEndpoints",value:function(d){var g=d.endpoints,v=d.instanceId;this.sendMessageToCallMachine({action:Fh,endpointsOp:Dw,endpoints:g,instanceId:v})}},{key:"removeLiveStreamingEndpoints",value:function(d){var g=d.endpoints,v=d.instanceId;this.sendMessageToCallMachine({action:Fh,endpointsOp:Nw,endpoints:g,instanceId:v})}},{key:"stopLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(ye({action:"daily-method-stop-live-streaming"},d))}},{key:"validateDailyConfig",value:function(d){d.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(d.camSimulcastEncodings)),d.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),hg()&&d.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,v=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(d){if(!(d instanceof Array||Array.isArray(d)))throw new Error("encodings must be an Array");if(!fm(d.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var C=0;C=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(d.userId){if(typeof d.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(d.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}return new Promise(function(C,k){g.sendMessageToCallMachine(ye({action:"dialout-start"},d),function(I){I.error?k(I.error):C(I)})})}),function(d){return q.apply(this,arguments)})},{key:"stopDialOut",value:function(d){var g=this;return je(this._callState,"stopDialOut()"),new Promise(function(v,C){g.sendMessageToCallMachine(ye({action:"dialout-stop"},d),function(k){k.error?C(k.error):v(k)})})}},{key:"sipCallTransfer",value:(B=me(function*(d){var g=this;if(je(this._callState,"sipCallTransfer()"),!d)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return d.useSipRefer=!1,um(d,"sipCallTransfer"),new Promise(function(v,C){g.sendMessageToCallMachine(ye({action:$h},d),function(k){k.error?C(k.error):v(k)})})}),function(d){return B.apply(this,arguments)})},{key:"sipRefer",value:(F=me(function*(d){var g=this;if(je(this._callState,"sipRefer()"),!d)throw new Error("sessionId and toEndPoint are mandatory parameter");return d.useSipRefer=!0,um(d,"sipRefer"),new Promise(function(v,C){g.sendMessageToCallMachine(ye({action:$h},d),function(k){k.error?C(k.error):v(k)})})}),function(d){return F.apply(this,arguments)})},{key:"sendDTMF",value:(D=me(function*(d){var g=this;return je(this._callState,"sendDTMF()"),function(v){var C=v.sessionId,k=v.tones;if(!C||!k)throw new Error("sessionId and tones are mandatory parameter");if(typeof C!="string"||typeof k!="string")throw new Error("sessionId and tones should be of string type");if(k.length>20)throw new Error("tones string must be upto 20 characters");var I=/[^0-9A-D*#]/g,X=k.match(I);if(X&&X[0])throw new Error("".concat(X[0]," is not valid DTMF tone"))}(d),new Promise(function(v,C){g.sendMessageToCallMachine(ye({action:"send-dtmf"},d),function(k){k.error?C(k.error):v(k)})})}),function(d){return D.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var d=this;return this._callState!==li?{stats:{latest:{}}}:new Promise(function(g){d.sendMessageToCallMachine({action:"get-calc-stats"},function(v){g(ye({stats:v.stats},d._network))})})}},{key:"testWebsocketConnectivity",value:(M=me(function*(){var d=this;if(Rc(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}return new Promise(function(g,v){d.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(C){C.error?v(C.error):g(C.results)})})}),function(){return M.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(d){return d?d instanceof MediaStreamTrack?!!iS(d)||(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:(S=me(function*(){var d=this;Ce(),tn(this._callObjectMode,"testCallQuality()"),Ks(this._callMachineInitialized,"testCallQuality()",null,!0),Nc(this._callState,this._isPreparingToJoin,"testCallQuality()");var g=this._testCallAlreadyInProgress,v=function(k){g||(d._testCallInProgress=k)};if(v(!0),this.needsLoad())try{var C=this._callState;yield this.load(),this._callState=C}catch(k){return v(!1),Promise.reject(k)}return new Promise(function(k){d.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:d.properties.dailyJsVersion},function(I){var X=I.results,oe=X.result,we=Dp(X,oS);if(oe==="failed"){var Qe,Fe=ye({},we);(Qe=we.error)!==null&&Qe!==void 0&&Qe.details?(we.error.details=JSON.parse(we.error.details),Fe.error=ye(ye({},Fe.error),{},{details:ye({},Fe.error.details)}),Fe.error.details.duringTest="testCallQuality"):(Fe.error=Fe.error?ye({},Fe.error):{},Fe.error.details={duringTest:"testCallQuality"}),d._maybeSendToSentry(Fe)}v(!1),k(ye({result:oe},we))})})}),function(){return S.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(_=me(function*(d){var g;Le()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),g=yield this.testPeerToPeerCallQuality(d)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),g=yield this.testCallQuality());var v={result:g.result,secondsElapsed:g.secondsElapsed};return g.data&&(v.data={maxRTT:g.data.maxRoundTripTime,packetLoss:g.data.avgRecvPacketLoss}),v}),function(d){return _.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(w=me(function*(d){var g=this;if(Rc(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(k){return Promise.reject(k)}var v=d.videoTrack,C=d.duration;if(!this._validateVideoTrackForNetworkTests(v))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=v,new Promise(function(k,I){g.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:C},function(X){X.error?I(X.error):k(X.results)})})}),function(d){return w.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){Le()?(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:(h=me(function*(d){var g=this;if(Rc(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(v){return Promise.reject(v)}if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=d,new Promise(function(v,C){g.sendMessageToCallMachine({action:"test-network-connectivity"},function(k){k.error?C(k.error):v(k.results)})})}),function(d){return h.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var d=this;return new Promise(function(g){d._callState===li?d.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(v){g(v.cpuStats)}):g({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(d){var g;if(!(((g=Object.keys(d))===null||g===void 0?void 0:g.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(d,g){var v=d==="screenVideo"?["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"],C="Video send settings should be either an object or one of the supported presets: ".concat(v.join());if(typeof g=="string"){if(!v.includes(g))throw new Error(C)}else{if(Ne(g)!=="object")throw new Error(C);if(!g.maxQuality&&!g.encodings&&g.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(g.maxQuality&&["low","medium","high"].indexOf(g.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(g.encodings){var k=!1;switch(Object.keys(g.encodings).length){case 1:k=!g.encodings.low;break;case 2:k=!g.encodings.low||!g.encodings.medium;break;case 3:k=!g.encodings.low||!g.encodings.medium||!g.encodings.high;break;default:k=!0}if(k)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");g.encodings.low&&this._validateEncodingLayerHasValidProperties(g.encodings.low),g.encodings.medium&&this._validateEncodingLayerHasValidProperties(g.encodings.medium),g.encodings.high&&this._validateEncodingLayerHasValidProperties(g.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(d){var g=this;if(!d||Object.keys(d).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(d).forEach(function(v){var C=Mr(v,2),k=C[0],I=C[1];g._validateVideoSendSettings(k,I)})}},{key:"updateSendSettings",value:function(d){var g=this;return this.validateUpdateSendSettings(d),this.needsLoad()?(this._preloadCache.sendSettings=d,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(v,C){g.sendMessageToCallMachine({action:"update-send-settings",sendSettings:d},function(k){k.error?C(k.error):v(k.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 Ce(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(d){return Ce(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:d}),this}},{key:"activeSpeakerMode",value:function(){return Ce(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(d){return je(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=d,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:d}),this}},{key:"enumerateDevices",value:(m=me(function*(){var d=this;if(this._callObjectMode){var g=yield navigator.mediaDevices.enumerateDevices();return Lr()==="Firefox"&&la().major>115&&la().major<123&&(g=g.filter(function(v){return v.kind!=="audiooutput"})),{devices:g.map(function(v){var C=JSON.parse(JSON.stringify(v));if(!Le()&&v.kind==="videoinput"&&v.getCapabilities){var k,I=v.getCapabilities();C.facing=(I==null||(k=I.facingMode)===null||k===void 0?void 0:k.length)>=1?I.facingMode[0]:void 0}return C})}}return new Promise(function(v){d.sendMessageToCallMachine({action:"enumerate-devices"},function(C){v({devices:C.devices})})})}),function(){return m.apply(this,arguments)})},{key:"sendAppMessage",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(je(this._callState,"sendAppMessage()"),JSON.stringify(d).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:d,to:g}),this}},{key:"addFakeParticipant",value:function(d){return Ce(),je(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(ye({action:"add-fake-participant"},d)),this}},{key:"setShowNamesMode",value:function(d){return At(this._callObjectMode,"setShowNamesMode()"),Ce(),d&&d!=="always"&&d!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:d}),this)}},{key:"setShowLocalVideo",value:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return At(this._callObjectMode,"setShowLocalVideo()"),Ce(),je(this._callState,"setShowLocalVideo()"),typeof d!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:d}),this._showLocalVideo=d,this)}},{key:"showLocalVideo",value:function(){return At(this._callObjectMode,"showLocalVideo()"),Ce(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return At(this._callObjectMode,"setShowParticipantsBar()"),Ce(),je(this._callState,"setShowParticipantsBar()"),typeof d!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:d}),this._showParticipantsBar=d,this)}},{key:"showParticipantsBar",value:function(){return At(this._callObjectMode,"showParticipantsBar()"),Ce(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return Ce(),At(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(d){return Ce(),At(this._callObjectMode,"setCustomIntegrations()"),je(this._callState,"setCustomIntegrations()"),Mg(d)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:d}),this._customIntegrations=d,this):this}},{key:"startCustomIntegrations",value:function(d){var g=this;if(Ce(),At(this._callObjectMode,"startCustomIntegrations()"),je(this._callState,"startCustomIntegrations()"),Array.isArray(d)&&d.some(function(k){return typeof k!="string"})||!Array.isArray(d)&&typeof d!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var v=typeof d=="string"?[d]:d,C=v.filter(function(k){return!(k in g._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:v}),this)}},{key:"stopCustomIntegrations",value:function(d){var g=this;if(Ce(),At(this._callObjectMode,"stopCustomIntegrations()"),je(this._callState,"stopCustomIntegrations()"),Array.isArray(d)&&d.some(function(k){return typeof k!="string"})||!Array.isArray(d)&&typeof d!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var v=typeof d=="string"?[d]:d,C=v.filter(function(k){return!(k in g._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:v}),this)}},{key:"customTrayButtons",value:function(){return At(this._callObjectMode,"customTrayButtons()"),Ce(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(d){return At(this._callObjectMode,"updateCustomTrayButtons()"),Ce(),je(this._callState,"updateCustomTrayButtons()"),Tg(d)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:d}),this._customTrayButtons=d,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(ua))),this)}},{key:"theme",value:function(){return At(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(d){var g=this;return At(this._callObjectMode,"setTheme()"),new Promise(function(v,C){try{g.validateProperties({theme:d}),g.properties.theme=ye({},d),g.sendMessageToCallMachine({action:"set-theme",theme:g.properties.theme});try{g.emitDailyJSEvent({action:F0,theme:g.properties.theme})}catch(k){console.log("could not emit 'theme-updated'",k)}v(g.properties.theme)}catch(k){C(k)}})}},{key:"requestFullscreen",value:(p=me(function*(){if(Ce(),this._iframe&&!document.fullscreenElement&&zh())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(d){console.log("could not make video call fullscreen",d)}}),function(){return p.apply(this,arguments)})},{key:"exitFullscreen",value:function(){Ce(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(c=me(function*(){var d=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(g){d.sendMessageToCallMachine({action:"get-sidebar-view"},function(v){g(v.view)})})}),function(){return c.apply(this,arguments)})},{key:"setSidebarView",value:function(d){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:d}),this)}},{key:"room",value:(l=me(function*(){var d=this,g=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,v=g===void 0||g;return this._accessState.access===Mc||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(C){d.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:v},function(k){delete k.action,delete k.callbackStamp,C(k)})})}),function(){return l.apply(this,arguments)})},{key:"geo",value:(s=me(function*(){try{var d=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield d.json()).geo}}catch(g){return console.error("geo lookup failed",g),{current:""}}}),function(){return s.apply(this,arguments)})},{key:"setNetworkTopology",value:(i=me(function*(d){var g=this;return Ce(),je(this._callState,"setNetworkTopology()"),new Promise(function(v,C){g.sendMessageToCallMachine({action:"set-network-topology",opts:d},function(k){k.error?C({error:k.error}):v({workerId:k.workerId})})})}),function(d){return i.apply(this,arguments)})},{key:"getNetworkTopology",value:(n=me(function*(){var d=this;return new Promise(function(g,v){d.needsLoad()&&g({topology:"none"}),d.sendMessageToCallMachine({action:"get-network-topology"},function(C){C.error?v({error:C.error}):g({topology:C.topology})})})}),function(){return n.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(d){if(Ce(),typeof d!="number"&&d!==!0&&d!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(d));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:d})}},{key:"on",value:function(d,g){return Pn.prototype.on.call(this,d,g)}},{key:"once",value:function(d,g){return Pn.prototype.once.call(this,d,g)}},{key:"off",value:function(d,g){return Pn.prototype.off.call(this,d,g)}},{key:"validateProperties",value:function(d){for(var g in d){if(!Er[g])throw new Error("unrecognized property '".concat(g,"'"));if(Er[g].validate&&!Er[g].validate(d[g],this))throw new Error("property '".concat(g,"': ").concat(Er[g].help))}}},{key:"assembleMeetingUrl",value:function(){var d,g,v=ye(ye({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(d=this.properties.dailyConfig)!==null&&d!==void 0&&d.proxyUrl?encodeURIComponent((g=this.properties.dailyConfig)===null||g===void 0?void 0:g.proxyUrl):void 0}),C=v.url.match(/\?/)?"&":"?";return v.url+C+Object.keys(Er).filter(function(k){return Er[k].queryString&&v[k]!==void 0}).map(function(k){return"".concat(Er[k].queryString,"=").concat(v[k])}).join("&")}},{key:"needsLoad",value:function(){return[Oh,xh,Sr,Xn].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(d,g){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(d,g,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(d){this._messageChannel.forwardPackagedMessageToCallMachine(d,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(d){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(d,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(d){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(d)}},{key:"handleMessageFromCallMachine",value:function(d){switch(d.action){case I0:this.sendMessageToCallMachine(ye({action:B0},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var g={action:Hs,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:na(this.properties.dailyConfig)}};this.sendMessageToCallMachine(g),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Ah:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(d);break;case J0:var v,C=ye({},d);delete C.internal,this._maxAppMessageSize=((v=d.internal)===null||v===void 0?void 0:v._maxAppMessageSize)||Pc,this._joinedCallback&&(this._joinedCallback(d.participants),this._joinedCallback=null),this.emitDailyJSEvent(C);break;case q0:case H0:if(this._callState===Sr)return;if(d.participant&&d.participant.session_id){var k=d.participant.local?"local":d.participant.session_id;if(this._callObjectMode){var I=this._callMachine().store;Qh(d.participant,I),Kh(d.participant,I),Xh(d.participant,this._participants[k],I)}try{this.maybeParticipantTracksStopped(this._participants[k],d.participant),this.maybeParticipantTracksStarted(this._participants[k],d.participant),this.maybeEventRecordingStopped(this._participants[k],d.participant),this.maybeEventRecordingStarted(this._participants[k],d.participant)}catch(bo){console.error("track events error",bo)}this.compareEqualForParticipantUpdateEvent(d.participant,this._participants[k])||(this._participants[k]=ye({},d.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(d))}break;case Y0:if(d.participant&&d.participant.session_id){var X=this._participants[d.participant.session_id];X&&this.maybeParticipantTracksStopped(X,null),delete this._participants[d.participant.session_id],this.emitDailyJSEvent(d)}break;case Q0:Mt(this._participantCounts,d.participantCounts)||(this._participantCounts=d.participantCounts,this.emitDailyJSEvent(d));break;case K0:var oe={access:d.access};d.awaitingAccess&&(oe.awaitingAccess=d.awaitingAccess),Mt(this._accessState,oe)||(this._accessState=oe,this.emitDailyJSEvent(d));break;case X0:if(d.meetingSession){this._meetingSessionSummary=d.meetingSession,this.emitDailyJSEvent(d);var we=ye(ye({},d),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(we)}break;case jh:var Qe;this._iframe&&!d.preserveIframe&&(this._iframe.src=""),this._updateCallState(Xn),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(d.errorMsg),this._loadedCallback=null),d.preserveIframe;var Fe=Dp(d,sS);Fe!=null&&(Qe=Fe.error)!==null&&Qe!==void 0&&Qe.details&&(Fe.error.details=JSON.parse(Fe.error.details)),this._maybeSendToSentry(d),this._joinedCallback&&(this._joinedCallback(null,Fe),this._joinedCallback=null),this.emitDailyJSEvent(Fe);break;case G0:this._callState!==Xn&&this._updateCallState(Sr),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(d);break;case"selected-devices-updated":d.devices&&this.emitDailyJSEvent(d);break;case kw:var Rt=d.threshold,jt=d.quality;Rt===this._network.threshold&&jt===this._network.quality||(this._network.quality=jt,this._network.threshold=Rt,this.emitDailyJSEvent(d));break;case Cw:d&&d.cpuLoadState&&this.emitDailyJSEvent(d);break;case bw:d&&d.faceCounts!==void 0&&this.emitDailyJSEvent(d);break;case ww:var It=d.activeSpeaker;this._activeSpeaker.peerId!==It.peerId&&(this._activeSpeaker.peerId=It.peerId,this.emitDailyJSEvent({action:d.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var xn=d.show;this._showLocalVideo=xn,this.emitDailyJSEvent({action:d.action,show:xn});break;case Sw:var He=d.enabled;this._activeSpeakerMode!==He&&(this._activeSpeakerMode=He,this.emitDailyJSEvent({action:d.action,enabled:this._activeSpeakerMode}));break;case ew:case tw:case nw:this._waitingParticipants=d.allWaitingParticipants,this.emitDailyJSEvent({action:d.action,participant:d.participant});break;case Lw:Mt(this._receiveSettings,d.receiveSettings)||(this._receiveSettings=d.receiveSettings,this.emitDailyJSEvent({action:d.action,receiveSettings:d.receiveSettings}));break;case Aw:if(!Mt(this._inputSettings,d.inputSettings)){var dt=this._getInputSettings();this._inputSettings=d.inputSettings,this._preloadCache.inputSettings={},Mt(dt,this._getInputSettings())||this.emitDailyJSEvent({action:d.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":Mt(this._sendSettings,d.sendSettings)||(this._sendSettings=d.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:d.action,sendSettings:d.sendSettings}));break;case"local-audio-level":this._localAudioLevel=d.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(d);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=d.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(d);break;case hw:var an=d.session_id;this._rmpPlayerState[an]=d.playerState,this.emitDailyJSEvent(d);break;case gw:delete this._rmpPlayerState[d.session_id],this.emitDailyJSEvent(d);break;case mw:var Ln=d.session_id,ar=this._rmpPlayerState[Ln];ar&&this.compareEqualForRMPUpdateEvent(ar,d.remoteMediaPlayerState)||(this._rmpPlayerState[Ln]=d.remoteMediaPlayerState,this.emitDailyJSEvent(d));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(d);break;case Z0:var Rr=this._meetingSessionState.topology!==(d.meetingSessionState&&d.meetingSessionState.topology);this._meetingSessionState=jc(d.meetingSessionState,this._callObjectMode),(this._callObjectMode||Rr)&&this.emitDailyJSEvent(d);break;case vw:this._isScreenSharing=!0,this.emitDailyJSEvent(d);break;case yw:case _w:this._isScreenSharing=!1,this.emitDailyJSEvent(d);break;case Dh:case Nh:case lw:case cw:case uw:case ow:case sw:case aw:case z0:case V0:case fw:case pw:case"test-completed":case Ew:case dw:case Tw:case Mw:case Pw:case Ow:case Rh:case xw: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(d);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(d,g){var v="record";d&&(g.local||g[v]!==!1||d[v]===g[v]||this.emitDailyJSEvent({action:Nh}))}},{key:"maybeEventRecordingStarted",value:function(d,g){var v="record";d&&(g.local||g[v]!==!0||d[v]===g[v]||this.emitDailyJSEvent({action:Dh}))}},{key:"maybeEventTrackStopped",value:function(d,g,v,C){d&&(d.readyState!=="ended"&&g&&d.id===g.id||this.emitDailyJSEvent({action:iw,track:d,participant:v,type:C}))}},{key:"maybeEventTrackStarted",value:function(d,g,v,C){g&&(d&&d.readyState!=="ended"&&g.id===d.id||this.emitDailyJSEvent({action:rw,track:g,participant:v,type:C}))}},{key:"maybeParticipantTracksStopped",value:function(d,g){if(d)for(var v in d.tracks)this.maybeEventTrackStopped(d.tracks[v].track,g&&g.tracks[v]?g.tracks[v].track:null,g,v)}},{key:"maybeParticipantTracksStarted",value:function(d,g){if(g)for(var v in g.tracks)this.maybeEventTrackStarted(d&&d.tracks[v]?d.tracks[v].track:null,g.tracks[v].track,g,v)}},{key:"compareEqualForRMPUpdateEvent",value:function(d,g){var v,C;return d.state===g.state&&((v=d.settings)===null||v===void 0?void 0:v.volume)===((C=g.settings)===null||C===void 0?void 0:C.volume)}},{key:"emitDailyJSEvent",value:function(d){try{d.callClientId=this.callClientId,this.emit(d.action,d)}catch(g){console.log("could not emit",d,g)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(d,g){return!!Mt(d,g)&&(!d.videoTrack||!g.videoTrack||d.videoTrack.id===g.videoTrack.id&&d.videoTrack.muted===g.videoTrack.muted&&d.videoTrack.enabled===g.videoTrack.enabled)&&(!d.audioTrack||!g.audioTrack||d.audioTrack.id===g.audioTrack.id&&d.audioTrack.muted===g.audioTrack.muted&&d.audioTrack.enabled===g.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return Le()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(d){this._updateCallState(this._callState,d)}},{key:"_updateCallState",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(d!==this._callState||g!==this._isPreparingToJoin){var v=this._callState,C=this._isPreparingToJoin;this._callState=d,this._isPreparingToJoin=g;var k=ea(v,C),I=ea(this._callState,this._isPreparingToJoin);k!==I&&(this.updateKeepDeviceAwake(I),this.updateDeviceAudioMode(I),this.updateShowAndroidOngoingMeetingNotification(I),this.updateNoOpRecordingEnsuringBackgroundContinuity(I))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=sm,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Mc},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=jc(om,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=Pc,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(d){Le()&&this.nativeUtils().setKeepDeviceAwake(d,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(d){if(Le()&&!this.disableReactNativeAutoDeviceManagement("audio")){var g=d?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(g)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(d){if(Le()&&this.nativeUtils().setShowOngoingMeetingNotification){var g,v,C,k;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var I=this.properties.reactNativeConfig.androidInCallNotification;g=I.title,v=I.subtitle,C=I.iconName,k=I.disableForCustomOverride}k&&(d=!1),this.nativeUtils().setShowOngoingMeetingNotification(d,g,v,C,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(d){Le()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(d)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var d,g;if(Le()){var v=(d=this._callMachine())===null||d===void 0||(g=d.store)===null||g===void 0?void 0:g.getState();for(var C in v==null?void 0:v.streams){var k=v.streams[C];k&&k.pendingTrack&&k.pendingTrack.kind==="audio"&&(k.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(d){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[d]}},{key:"absoluteUrl",value:function(d){if(d!==void 0){var g=document.createElement("a");return g.href=d,g.href}}},{key:"sayHello",value:function(){var d="hello, world.";return console.log(d),d}},{key:"_logUseAfterDestroy",value:function(){var d=Object.values(kr)[0];if(this.needsLoad())if(d&&!d.needsLoad()){var g={action:Hs,level:"error",code:this.strictMode?9995:9997};d.sendMessageToCallMachine(g)}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 v={action:Hs,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(v,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var d=0,g=Object.values(kr);d0&&arguments[0]!==void 0?arguments[0]:{};return d.layout="none",new ue(null,d)}},{key:"wrap",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ce(),!d||!d.contentWindow||typeof d.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser"),new ue(d,g)}},{key:"createFrame",value:function(d,g){var v,C;Ce(),d&&g?(v=d,C=g):d&&d.append?(v=d,C={}):(v=document.body,C=d||{});var k=C.iframeStyle;k||(k=v===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 I=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?I.allow="microphone, camera":I.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",I.style.visibility="hidden",v.appendChild(I),I.style.visibility=null,Object.keys(k).forEach(function(X){return I.style[X]=k[X]}),C.layout||(C.customLayout?C.layout="custom-v1":C.layout="browser");try{return new ue(I,C)}catch(X){throw v.removeChild(I),X}}},{key:"createTransparentFrame",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ce();var g=document.createElement("iframe");return g.allow="microphone; camera; autoplay",g.style.cssText=` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; - pointer-events: none; - `,document.body.appendChild(g),d.layout||(d.layout="custom-v1"),ue.wrap(g,d)}},{key:"getCallInstance",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return d?kr[d]:Object.values(kr)[0]}}]),ue}();function ai(r,n){var i={};for(var s in r)if(r[s]instanceof MediaStreamTrack)i[s]=ho;else if(s==="dailyConfig"){if(r[s].modifyLocalSdpHook){var l=window._daily.instances[n].customCallbacks||{};l.modifyLocalSdpHook=r[s].modifyLocalSdpHook,window._daily.instances[n].customCallbacks=l,delete r[s].modifyLocalSdpHook}if(r[s].modifyRemoteSdpHook){var c=window._daily.instances[n].customCallbacks||{};c.modifyRemoteSdpHook=r[s].modifyRemoteSdpHook,window._daily.instances[n].customCallbacks=c,delete r[s].modifyRemoteSdpHook}i[s]=r[s]}else i[s]=r[s];return i}function je(r){var n=arguments.length>2?arguments[2]:void 0;if(r!==li){var i="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw n&&(i+=" ".concat(n)),console.error(i),new Error(i)}}function ea(r,n){return[Zc,li].includes(r)||n}function Nc(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",s=arguments.length>3?arguments[3]:void 0;if(ea(r,n)){var l="".concat(i," not supported after joining a meeting.");throw s&&(l+=" ".concat(s)),console.error(l),new Error(l)}}function Ks(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",i=arguments.length>2?arguments[2]:void 0;if(!r){var s="".concat(n,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw i&&(s+=" ".concat(i)),console.error(s),new Error(s)}}function Rc(r){if(r){var n="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(n),new Error(n)}}function tn(r){if(!r){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(n),new Error(n)}}function At(r){if(r){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(n),new Error(n)}}function Ce(){if(Le())throw new Error("This daily-js method is not currently supported in React Native")}function uo(){if(!Le())throw new Error("This daily-js method is only supported in React Native")}function wg(r){if(r===void 0)return!0;var n;if(typeof r=="string")n=r;else try{n=JSON.stringify(r),Mt(JSON.parse(n),r)||console.warn("The userData provided will be modified when serialized.")}catch(i){throw Error("userData must be serializable to JSON: ".concat(i))}if(n.length>4096)throw Error("userData is too large (".concat(n.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function Sg(r,n){for(var i=n.allowAllParticipantsKey,s=function(S){var M=["local"];return i||M.push("*"),S&&!M.includes(S)},l=function(S){return!!(S.layer===void 0||Number.isInteger(S.layer)&&S.layer>=0||S.layer==="inherit")},c=function(S){return!!S&&!(S.video&&!l(S.video))&&!(S.screenVideo&&!l(S.screenVideo))},p=0,m=Object.entries(r);p1||h[0]!=="strength"?(console.error(w),!1):!(typeof m.strength!="number"||m.strength<=0||m.strength>1||isNaN(m.strength))||(console.error("".concat(w,"; expected: {0 < strength <= 1}, got: ").concat(m.strength)),!1);case Zs.BGIMAGE:return!(m.source!==void 0&&!function(_){if(_.source==="default")return _.type="default",!0;if(_.source instanceof ArrayBuffer)return!0;if(yo(_.source))return _.type="url",!!function(D){var F=new URL(D),B=F.pathname;if(F.protocol==="data:")try{var q=B.substring(B.indexOf(":")+1,B.indexOf(";")).split("/")[1];return xc.includes(q)}catch(ve){return console.error("failed to deduce blob content type",ve),!1}var ne=B.split(".").at(-1).toLowerCase().trim();return xc.includes(ne)}(_.source)||(console.error("invalid image type; supported types: [".concat(xc.join(", "),"]")),!1);return S=_.source,M=Number(S),isNaN(M)||!Number.isInteger(M)||M<=0||M>Uh?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Uh)),!1):(_.type="daily-preselect",!0);var S,M}(m));default:return!0}}(l.type,l.config))?!1:(Object.keys(l).filter(function(p){return!c.includes(p)}).forEach(function(p){console.warn("invalid key inputSettings -> video -> processor : ".concat(p)),delete l[p]}),!0)}(r.video.processor)))&&!(r.audio&&(Ne(r.audio)!=="object"||(i=r.audio.processor,s=["type"],!i||Ne(i)!=="object"||(Object.keys(i).filter(function(l){return!s.includes(l)}).forEach(function(l){console.warn("invalid key inputSettings -> audio -> processor : ".concat(l)),delete i[l]}),n=i.type,typeof n!="string"||!Object.values(ug).includes(n)&&(console.error("inputSettings audio processor type invalid"),1)))));var n,i,s}function Eg(r,n){var i,s=[];r.video&&!fg((i=n==null?void 0:n.useLegacyVideoProcessor)!==null&&i!==void 0&&i)&&(delete r.video,s.push("video")),r.audio&&!pg()&&(delete r.audio,s.push("audio")),s.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(s.join(", ")))}function su(){var r=Object.values(Zs).join(" | "),n=Object.values(ug).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(r," ], config?: {} } }, audio?: { processor: {type: [ ").concat(n," ] } } }")}function Cg(r){var n=r.allowAllParticipantsKey;return"receiveSettings must be of the form { [ | ".concat(R0).concat(n?' | "'.concat(j0,'"'):"","]: ")+'{ [video: [{ layer: [ | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [ | "inherit"] } | "inherit"]] }}}'}function bg(){return"customIntegrations should be an object of type ".concat(JSON.stringify(ou),".")}function Tg(r){if(r&&Ne(r)!=="object"||Array.isArray(r))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(ua),".")),!1;if(r)for(var n=0,i=Object.entries(r);n2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function fm(r,n,i){return!(typeof r!="number"||ri)}function jc(r,n){return r&&!n&&delete r.data,r}function cS(r,n,i,s){Object.defineProperty(r,n,{get:i,set:s,enumerable:!0,configurable:!0})}var uS={};cS(uS,"DailyTransport",()=>Og);class Og extends Am{constructor(){super(),this._botId="",this._selectedCam={},this._selectedMic={}}initialize(n,i){this._callbacks=n.callbacks??{},this._onMessage=i;const s=cm.getCallInstance();s&&s.destroy(),this._daily=cm.createCallObject({startVideoOff:n.enableCam!=!0,startAudioOff:n.enableMic==!1,allowMultipleCallInstances:!0,dailyConfig:{}}),this.attachEventListeners(),this.state="disconnected",console.debug("[RTVI Transport] Initialized")}get state(){return this._state}set state(n){var i,s;this._state!==n&&(this._state=n,(s=(i=this._callbacks).onTransportStateChanged)==null||s.call(i,n))}async getAllCams(){const{devices:n}=await this._daily.enumerateDevices();return n.filter(i=>i.kind==="videoinput")}updateCam(n){this._daily.setInputDevicesAsync({videoDeviceId:n}).then(i=>{this._selectedCam=i.camera})}get selectedCam(){return this._selectedCam}async getAllMics(){const{devices:n}=await this._daily.enumerateDevices();return n.filter(i=>i.kind==="audioinput")}updateMic(n){this._daily.setInputDevicesAsync({audioDeviceId:n}).then(i=>{this._selectedMic=i.mic})}get selectedMic(){return this._selectedMic}enableMic(n){this._daily.setLocalAudio(n)}get isMicEnabled(){return this._daily.localAudio()}enableCam(n){this._daily.setLocalVideo(n)}get isCamEnabled(){return this._daily.localVideo()}tracks(){var l,c,p,m,h,w,_,S,M,D,F;const n=((l=this._daily)==null?void 0:l.participants())??{},i=n==null?void 0:n[this._botId],s={local:{audio:(m=(p=(c=n==null?void 0:n.local)==null?void 0:c.tracks)==null?void 0:p.audio)==null?void 0:m.persistentTrack,video:(_=(w=(h=n==null?void 0:n.local)==null?void 0:h.tracks)==null?void 0:w.video)==null?void 0:_.persistentTrack}};return i&&(s.bot={audio:(M=(S=i==null?void 0:i.tracks)==null?void 0:S.audio)==null?void 0:M.persistentTrack,video:(F=(D=i==null?void 0:i.tracks)==null?void 0:D.video)==null?void 0:F.persistentTrack}),s}async initDevices(){var c,p,m,h,w,_,S,M;if(!this._daily)throw new Dt("Transport instance not initialized");this.state="initializing";const n=await this._daily.startCamera(),{devices:i}=await this._daily.enumerateDevices(),s=i.filter(D=>D.kind==="videoinput"),l=i.filter(D=>D.kind==="audioinput");(p=(c=this._callbacks).onAvailableCamsUpdated)==null||p.call(c,s),(h=(m=this._callbacks).onAvailableMicsUpdated)==null||h.call(m,l),this._selectedCam=n.camera,(_=(w=this._callbacks).onCamUpdated)==null||_.call(w,n.camera),this._selectedMic=n.mic,(M=(S=this._callbacks).onMicUpdated)==null||M.call(S,n.mic),this._daily.isLocalAudioLevelObserverRunning()||await this._daily.startLocalAudioLevelObserver(100),this._daily.isRemoteParticipantsAudioLevelObserverRunning()||await this._daily.startRemoteParticipantsAudioLevelObserver(100),this.state="initialized"}async connect(n,i){var s,l,c;if(!this._daily)throw new Dt("Transport instance not initialized");if(!i.signal.aborted){this.state="connecting";try{await this._daily.join({url:n.room_url,token:n.token});const p=await this._daily.room();p&&"id"in p&&(this._expiry=(s=p.config)==null?void 0:s.exp)}catch{throw this.state="error",new Tm}i.signal.aborted||(this.state="connected",(c=(l=this._callbacks).onConnected)==null||c.call(l))}}async sendReadyMessage(){return new Promise(n=>{(async()=>this._daily.on("track-started",i=>{var s;(s=i.participant)!=null&&s.local||(this.state="ready",this.sendMessage(gt.clientReady()),n())}))()})}attachEventListeners(){this._daily.on("available-devices-updated",this.handleAvailableDevicesUpdated.bind(this)),this._daily.on("selected-devices-updated",this.handleSelectedDevicesUpdated.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))}async disconnect(){this._daily.stopLocalAudioLevelObserver(),this._daily.stopRemoteParticipantsAudioLevelObserver(),await this._daily.leave(),await this._daily.destroy()}sendMessage(n){this._daily.sendAppMessage(n,"*")}handleAppMessage(n){n.data.label==="rtvi-ai"&&this._onMessage({id:n.data.id,type:n.data.type,data:n.data.data})}handleAvailableDevicesUpdated(n){var i,s,l,c;(s=(i=this._callbacks).onAvailableCamsUpdated)==null||s.call(i,n.availableDevices.filter(p=>p.kind==="videoinput")),(c=(l=this._callbacks).onAvailableMicsUpdated)==null||c.call(l,n.availableDevices.filter(p=>p.kind==="audioinput"))}handleSelectedDevicesUpdated(n){var i,s,l,c,p,m;((i=this._selectedCam)==null?void 0:i.deviceId)!==n.devices.camera&&(this._selectedCam=n.devices.camera,(l=(s=this._callbacks).onCamUpdated)==null||l.call(s,n.devices.camera)),((c=this._selectedMic)==null?void 0:c.deviceId)!==n.devices.mic&&(this._selectedMic=n.devices.mic,(m=(p=this._callbacks).onMicUpdated)==null||m.call(p,n.devices.mic))}handleTrackStarted(n){var i,s;(s=(i=this._callbacks).onTrackStarted)==null||s.call(i,n.track,n.participant?fo(n.participant):void 0)}handleTrackStopped(n){var i,s;(s=(i=this._callbacks).onTrackStopped)==null||s.call(i,n.track,n.participant?fo(n.participant):void 0)}handleParticipantJoined(n){var s,l,c,p;const i=fo(n.participant);(l=(s=this._callbacks).onParticipantJoined)==null||l.call(s,i),!i.local&&(this._botId=n.participant.session_id,(p=(c=this._callbacks).onBotConnected)==null||p.call(c,i))}handleParticipantLeft(n){var s,l,c,p;const i=fo(n.participant);(l=(s=this._callbacks).onParticipantLeft)==null||l.call(s,i),!i.local&&(this._botId="",(p=(c=this._callbacks).onBotDisconnected)==null||p.call(c,i))}handleLocalAudioLevel(n){var i,s;(s=(i=this._callbacks).onLocalAudioLevel)==null||s.call(i,n.audioLevel)}handleRemoteAudioLevel(n){var l,c;const i=this._daily.participants(),s=Object.keys(n.participantsAudioLevel);for(let p=0;p({id:r.user_id,local:r.local,name:r.user_name}),dS=new Og,fS=new On({transport:dS,params:{baseUrl:"https://hackathon-test.fly.dev",endpoints:{connect:"/connect"},config:[{service:"tts",options:[{name:"voice",value:"79a125e8-cd45-4c13-8a67-188112f4dd22"}]},{service:"llm",options:[{name:"model",value:"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"},{name:"messages",value:[{role:"system",content:"You are a assistant called ExampleBot. You can ask me anything. Keep responses brief and legible. Your responses will be converted to audio, so please avoid using any special characters except '!' or '?'."}]}]}]},enableMic:!0,enableCam:!1});function pS({children:r}){return ze.jsx(Nm,{client:fS,children:r})}function hS(){const r=fa(),n=jm(),i=["connected","ready"].includes(n),s=async()=>{if(!r){console.error("RTVI client is not initialized");return}try{i?await r.disconnect():await r.connect()}catch(l){console.error("Connection error:",l)}};return ze.jsx("div",{className:"controls",children:ze.jsx("button",{className:i?"disconnect-btn":"connect-btn",onClick:s,disabled:!r||["connecting","disconnecting"].includes(n),children:i?"Disconnect":"Connect"})})}function mS(){const r=jm();return ze.jsxs("div",{className:"status",children:["Status: ",ze.jsx("span",{children:r})]})}function gS(){const r=Ee.useRef(null),n=fa(),i=Ee.useCallback(s=>{if(!r.current)return;const l=document.createElement("div");l.textContent=`${new Date().toISOString()} - ${s}`,s.startsWith("User: ")?l.style.color="#2196F3":s.startsWith("Bot: ")&&(l.style.color="#4CAF50"),r.current.appendChild(l),r.current.scrollTop=r.current.scrollHeight},[]);return pn(pe.TransportStateChanged,Ee.useCallback(s=>{i(`Transport state changed: ${s}`)},[i])),pn(pe.BotConnected,Ee.useCallback(s=>{i(`Bot connected: ${JSON.stringify(s)}`)},[i])),pn(pe.BotDisconnected,Ee.useCallback(s=>{i(`Bot disconnected: ${JSON.stringify(s)}`)},[i])),pn(pe.TrackStarted,Ee.useCallback((s,l)=>{i(`Track started: ${s.kind} from ${(l==null?void 0:l.name)||"unknown"}`)},[i])),pn(pe.TrackedStopped,Ee.useCallback((s,l)=>{i(`Track stopped: ${s.kind} from ${(l==null?void 0:l.name)||"unknown"}`)},[i])),pn(pe.BotReady,Ee.useCallback(()=>{var l,c;if(i("Bot ready"),!n)return;const s=n.tracks();i(`Available tracks: ${JSON.stringify({local:{audio:!!s.local.audio,video:!!s.local.video},bot:{audio:!!((l=s.bot)!=null&&l.audio),video:!!((c=s.bot)!=null&&c.video)}})}`)},[n,i])),pn(pe.UserTranscript,Ee.useCallback(s=>{s.final&&i(`User: ${s.text}`)},[i])),pn(pe.BotTranscript,Ee.useCallback(s=>{i(`Bot: ${s.text}`)},[i])),ze.jsxs("div",{className:"debug-panel",children:[ze.jsx("h3",{children:"Debug Info"}),ze.jsx("div",{ref:r,className:"debug-log"})]})}function vS(){return ze.jsxs("div",{className:"app",children:[ze.jsxs("div",{className:"status-bar",children:[ze.jsx(mS,{}),ze.jsx(hS,{})]}),ze.jsx(gS,{}),ze.jsx(Rm,{})]})}function yS(){return ze.jsx(pS,{children:ze.jsx(vS,{})})}Iy.createRoot(document.getElementById("root")).render(ze.jsx(lu.StrictMode,{children:ze.jsx(yS,{})}))});export default _S();