-
Notifications
You must be signed in to change notification settings - Fork 11
/
bundle.js
2 lines (2 loc) · 236 KB
/
bundle.js
1
2
/*! For license information please see bundle.js.LICENSE.txt */
(()=>{"use strict";var e={473:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function a(e){i(s,r,o,a,c,"next",e)}function c(e){i(s,r,o,a,c,"throw",e)}a(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(t)?t:String(t)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function u(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function f(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.r(t),n.d(t,{DAILY_ACCESS_LEVEL_FULL:()=>kr,DAILY_ACCESS_LEVEL_LOBBY:()=>Tr,DAILY_ACCESS_LEVEL_NONE:()=>Cr,DAILY_ACCESS_UNKNOWN:()=>Er,DAILY_CAMERA_ERROR_CAM_AND_MIC_IN_USE:()=>Vr,DAILY_CAMERA_ERROR_CAM_IN_USE:()=>Br,DAILY_CAMERA_ERROR_CONSTRAINTS:()=>$r,DAILY_CAMERA_ERROR_MIC_IN_USE:()=>Ur,DAILY_CAMERA_ERROR_NOT_FOUND:()=>qr,DAILY_CAMERA_ERROR_PERMISSIONS:()=>Yr,DAILY_CAMERA_ERROR_UNDEF_MEDIADEVICES:()=>Gr,DAILY_CAMERA_ERROR_UNKNOWN:()=>Jr,DAILY_EVENT_ACCESS_STATE_UPDATED:()=>li,DAILY_EVENT_ACTIVE_SPEAKER_CHANGE:()=>Ri,DAILY_EVENT_ACTIVE_SPEAKER_MODE_CHANGE:()=>xi,DAILY_EVENT_APP_MSG:()=>Mi,DAILY_EVENT_CAMERA_ERROR:()=>ei,DAILY_EVENT_CPU_LOAD_CHANGE:()=>Bi,DAILY_EVENT_ERROR:()=>Ki,DAILY_EVENT_EXIT_FULLSCREEN:()=>Vi,DAILY_EVENT_FULLSCREEN:()=>Ui,DAILY_EVENT_IFRAME_LAUNCH_CONFIG:()=>Hr,DAILY_EVENT_IFRAME_READY_FOR_LAUNCH_CONFIG:()=>Wr,DAILY_EVENT_INPUT_SETTINGS_UPDATED:()=>Hi,DAILY_EVENT_JOINED_MEETING:()=>ni,DAILY_EVENT_JOINING_MEETING:()=>ti,DAILY_EVENT_LANG_UPDATED:()=>Ji,DAILY_EVENT_LEFT_MEETING:()=>ri,DAILY_EVENT_LIVE_STREAMING_ERROR:()=>$i,DAILY_EVENT_LIVE_STREAMING_STARTED:()=>Yi,DAILY_EVENT_LIVE_STREAMING_STOPPED:()=>qi,DAILY_EVENT_LIVE_STREAMING_UPDATED:()=>Gi,DAILY_EVENT_LOADED:()=>Xr,DAILY_EVENT_LOADING:()=>Kr,DAILY_EVENT_LOAD_ATTEMPT_FAILED:()=>Qr,DAILY_EVENT_LOCAL_SCREEN_SHARE_CANCELED:()=>Ni,DAILY_EVENT_LOCAL_SCREEN_SHARE_STARTED:()=>Di,DAILY_EVENT_LOCAL_SCREEN_SHARE_STOPPED:()=>Ii,DAILY_EVENT_MEETING_SESSION_DATA_ERROR:()=>hi,DAILY_EVENT_MEETING_SESSION_STATE_UPDATED:()=>di,DAILY_EVENT_MEETING_SESSION_SUMMARY_UPDATED:()=>ui,DAILY_EVENT_NETWORK_CONNECTION:()=>Fi,DAILY_EVENT_NETWORK_QUALITY_CHANGE:()=>ji,DAILY_EVENT_NONFATAL_ERROR:()=>zi,DAILY_EVENT_PARTICIPANT_COUNTS_UPDATED:()=>ci,DAILY_EVENT_PARTICIPANT_JOINED:()=>oi,DAILY_EVENT_PARTICIPANT_LEFT:()=>ai,DAILY_EVENT_PARTICIPANT_UPDATED:()=>si,DAILY_EVENT_RECEIVE_SETTINGS_UPDATED:()=>Wi,DAILY_EVENT_RECORDING_DATA:()=>Ci,DAILY_EVENT_RECORDING_ERROR:()=>ki,DAILY_EVENT_RECORDING_STARTED:()=>wi,DAILY_EVENT_RECORDING_STATS:()=>Ei,DAILY_EVENT_RECORDING_STOPPED:()=>Si,DAILY_EVENT_RECORDING_UPLOAD_COMPLETED:()=>Ti,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STARTED:()=>Oi,DAILY_EVENT_REMOTE_MEDIA_PLAYER_STOPPED:()=>Pi,DAILY_EVENT_REMOTE_MEDIA_PLAYER_UPDATED:()=>Li,DAILY_EVENT_STARTED_CAMERA:()=>Zr,DAILY_EVENT_THEME_UPDATED:()=>zr,DAILY_EVENT_TRACK_STARTED:()=>gi,DAILY_EVENT_TRACK_STOPPED:()=>vi,DAILY_EVENT_TRANSCRIPTION_ERROR:()=>bi,DAILY_EVENT_TRANSCRIPTION_MSG:()=>Ai,DAILY_EVENT_TRANSCRIPTION_STARTED:()=>_i,DAILY_EVENT_TRANSCRIPTION_STOPPED:()=>yi,DAILY_EVENT_WAITING_PARTICIPANT_ADDED:()=>pi,DAILY_EVENT_WAITING_PARTICIPANT_REMOVED:()=>mi,DAILY_EVENT_WAITING_PARTICIPANT_UPDATED:()=>fi,DAILY_FATAL_ERROR_CONNECTION:()=>Fr,DAILY_FATAL_ERROR_EJECTED:()=>Or,DAILY_FATAL_ERROR_EOL:()=>xr,DAILY_FATAL_ERROR_EXP_ROOM:()=>Dr,DAILY_FATAL_ERROR_EXP_TOKEN:()=>Ir,DAILY_FATAL_ERROR_MEETING_FULL:()=>Rr,DAILY_FATAL_ERROR_NBF_ROOM:()=>Lr,DAILY_FATAL_ERROR_NBF_TOKEN:()=>Pr,DAILY_FATAL_ERROR_NOT_ALLOWED:()=>jr,DAILY_FATAL_ERROR_NO_ROOM:()=>Nr,DAILY_RECEIVE_SETTINGS_ALL_PARTICIPANTS_KEY:()=>Ar,DAILY_RECEIVE_SETTINGS_BASE_KEY:()=>Mr,DAILY_STATE_ERROR:()=>gr,DAILY_STATE_JOINED:()=>fr,DAILY_STATE_JOINING:()=>pr,DAILY_STATE_LEFT:()=>mr,DAILY_STATE_NEW:()=>ur,DAILY_TRACK_STATE_BLOCKED:()=>vr,DAILY_TRACK_STATE_INTERRUPTED:()=>wr,DAILY_TRACK_STATE_LOADING:()=>br,DAILY_TRACK_STATE_OFF:()=>_r,DAILY_TRACK_STATE_PLAYABLE:()=>Sr,DAILY_TRACK_STATE_SENDABLE:()=>yr,default:()=>Os}),e=n.hmd(e);var y,b={},w={get exports(){return b},set exports(e){b=e}},S="object"==typeof Reflect?Reflect:null,E=S&&"function"==typeof S.apply?S.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};y=S&&"function"==typeof S.ownKeys?S.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var k=Number.isNaN||function(e){return e!=e};function T(){T.init.call(this)}w.exports=T,b.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}R(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&R(e,"error",t,{once:!0})}(e,i)}))},T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var C=10;function M(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function A(e){return void 0===e._maxListeners?T.defaultMaxListeners:e._maxListeners}function O(e,t,n,r){var i,o,s,a;if(M(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=A(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function L(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function P(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=L.bind(r);return i.listener=n,r.wrapFn=i,i}function D(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):N(i,i.length)}function I(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function N(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function R(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return C},set:function(e){if("number"!=typeof e||e<0||k(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");C=e}}),T.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},T.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||k(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},T.prototype.getMaxListeners=function(){return A(this)},T.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)E(a,this,t);else{var c=a.length,l=N(a,c);for(n=0;n<c;++n)E(l[n],this,t)}return!0},T.prototype.addListener=function(e,t){return O(this,e,t,!1)},T.prototype.on=T.prototype.addListener,T.prototype.prependListener=function(e,t){return O(this,e,t,!0)},T.prototype.once=function(e,t){return M(t),this.on(e,P(this,e,t)),this},T.prototype.prependOnceListener=function(e,t){return M(t),this.prependListener(e,P(this,e,t)),this},T.prototype.removeListener=function(e,t){var n,r,i,o,s;if(M(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},T.prototype.off=T.prototype.removeListener,T.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},T.prototype.listeners=function(e){return D(this,e,!0)},T.prototype.rawListeners=function(e){return D(this,e,!1)},T.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):I.call(e,t)},T.prototype.listenerCount=I,T.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]};var x=Object.prototype.hasOwnProperty;function j(e,t,n){for(n of e.keys())if(F(n,t))return n}function F(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&F(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=j(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=j(t,i)))return!1;if(!F(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(x.call(e,n)&&++r&&!x.call(t,n))return!1;if(!(n in t)||!F(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}const B={"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"},U={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"},V={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Y={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"},G={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class q{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map((e=>parseInt(e,10)||0));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=q.getVersionPrecision(e),i=q.getVersionPrecision(t);let o=Math.max(r,i),s=0;const a=q.map([e,t],(e=>{const t=o-q.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return q.map(n.split("."),(e=>new Array(20-e.length).join("0")+e)).reverse()}));for(n&&(s=o-Math.min(r,i)),o-=1;o>=s;){if(a[0][o]>a[1][o])return 1;if(a[0][o]===a[1][o]){if(o===s)return 0;o-=1}else if(a[0][o]<a[1][o])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];"object"==typeof e&&null!==e&&Object.keys(e).forEach((t=>{n[t]=e[t]}))}return e}static getBrowserAlias(e){return B[e]}static getBrowserTypeByAlias(e){return U[e]||""}}const $=/version\/(\d+(\.?_?\d+)+)/i,J=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=q.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=q.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=q.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=q.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=q.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=q.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=q.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=q.getFirstMatch($,e)||q.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=q.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=q.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=q.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=q.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=q.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=q.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=q.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=q.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=q.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=q.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=q.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=q.getFirstMatch($,e)||q.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=q.getFirstMatch($,e)||q.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=q.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=q.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=q.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=q.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=q.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=q.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=q.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=q.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=q.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=q.getFirstMatch($,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:q.getFirstMatch(t,e),version:q.getSecondMatch(t,e)}}}];var W=[{test:[/Roku\/DVP/],describe(e){const t=q.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Y.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=q.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Y.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=q.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=q.getWindowsVersionName(t);return{name:Y.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Y.iOS},n=q.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=q.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=q.getMacOSVersionName(t),r={name:Y.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=q.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Y.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=q.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=q.getAndroidVersionName(t),r={name:Y.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=q.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Y.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=q.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||q.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||q.getFirstMatch(/\bbb(\d+)/i,e);return{name:Y.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=q.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Y.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=q.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Y.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Y.Linux})},{test:[/CrOS/],describe:()=>({name:Y.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=q.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Y.PlayStation4,version:t}}}],H=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=q.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:V.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:V.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:V.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:V.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:V.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=q.getFirstMatch(/(ipod|iphone)/i,e);return{type:V.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:V.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:V.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:V.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:V.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:V.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:V.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:V.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:V.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:V.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:V.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:V.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:V.tv})}],z=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:G.Blink};const t=q.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:G.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:G.Trident},n=q.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:G.Presto},n=q.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:G.Gecko},n=q.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:G.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:G.WebKit},n=q.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class K{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=q.find(J,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=q.find(W,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=q.find(H,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=q.find(z,(e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some((e=>this.test(e)));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return q.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach((o=>{const s=e[o];"string"==typeof s?(r[o]=s,i+=1):"object"==typeof s&&(t[o]=s,n+=1)})),n>0){const e=Object.keys(t),n=q.find(e,(e=>this.isOS(e)));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=q.find(e,(e=>this.isPlatform(e)));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=q.find(e,(e=>this.isBrowser(e,!0)));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=q.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(q.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some((e=>this.is(e)))}}class Q{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new K(e,t)}static parse(e){return new K(e).getResult()}static get BROWSER_MAP(){return U}static get ENGINE_MAP(){return G}static get OS_MAP(){return Y}static get PLATFORMS_MAP(){return V}}function X(){return Date.now()+Math.random().toString()}function Z(){throw new Error("Method must be implemented in subclass")}function ee(e){return window._dailyConfig&&window._dailyConfig.proxyUrl?window._dailyConfig.proxyUrl+("/"===window._dailyConfig.proxyUrl.slice(-1)?"":"/")+e.substring(8):e}function te(){return window._dailyConfig&&window._dailyConfig.callObjectBundleUrlOverride?window._dailyConfig.callObjectBundleUrlOverride:ee("https://c.daily.co/call-machine/versioned/".concat("0.58.0","/static/call-machine-object-bundle.js"))}function ne(e){try{new URL(e)}catch(e){return!1}return!0}const re=Object.prototype.toString;function ie(e){switch(re.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return pe(e,Error)}}function oe(e,t){return re.call(e)===`[object ${t}]`}function se(e){return oe(e,"ErrorEvent")}function ae(e){return oe(e,"DOMError")}function ce(e){return oe(e,"String")}function le(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function ue(e){return oe(e,"Object")}function de(e){return"undefined"!=typeof Event&&pe(e,Event)}function he(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function pe(e,t){try{return e instanceof t}catch(e){return!1}}function fe(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function me(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function ge(e,t=[],n=!1){return t.some((t=>function(e,t,n=!1){return!!ce(e)&&(oe(t,"RegExp")?t.test(e):!!ce(t)&&(n?e===t:e.includes(t)))}(e,t,n)))}function ve(e,t,n=250,r,i,o,s){if(!(o.exception&&o.exception.values&&s&&pe(s.originalException,Error)))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var c,l;a&&(o.exception.values=(c=_e(e,t,i,s.originalException,r,o.exception.values,a,0),l=n,c.map((e=>(e.value&&(e.value=fe(e.value,l)),e)))))}function _e(e,t,n,r,i,o,s,a){if(o.length>=n+1)return o;let c=[...o];if(pe(r[i],Error)){ye(s,a);const o=e(t,r[i]),l=c.length;be(o,i,l,a),c=_e(e,t,n,r[i],i,[o,...c],o,l)}return Array.isArray(r.errors)&&r.errors.forEach(((r,o)=>{if(pe(r,Error)){ye(s,a);const l=e(t,r),u=c.length;be(l,`errors[${o}]`,u,a),c=_e(e,t,n,r,i,[l,...c],l,u)}})),c}function ye(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function be(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function we(e){return e&&e.Math==Math?e:void 0}const Se="object"==typeof globalThis&&we(globalThis)||"object"==typeof window&&we(window)||"object"==typeof self&&we(self)||"object"==typeof n.g&&we(n.g)||function(){return this}()||{};function Ee(){return Se}function ke(e,t,n){const r=n||Se,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}const Te=Ee(),Ce=80;function Me(e,t={}){try{let n=e;const r=5,i=[];let o=0,s=0;const a=" > ",c=a.length;let l;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Ce;for(;n&&o++<r&&(l=Ae(n,u),!("html"===l||o>1&&s+i.length*c+l.length>=d));)i.push(l),s+=l.length,n=n.parentNode;return i.reverse().join(a)}catch(e){return"<unknown>"}}function Ae(e,t){const n=e,r=[];let i,o,s,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const l=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(l&&l.length)l.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&ce(i))for(o=i.split(/\s+/),c=0;c<o.length;c++)r.push(`.${o[c]}`);const u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)s=u[c],a=n.getAttribute(s),a&&r.push(`[${s}="${a}"]`);return r.join("")}const Oe=["debug","info","warn","error","log","assert","trace"];function Le(e){if(!("console"in Se))return e();const t=Se.console,n={};Oe.forEach((e=>{const r=t[e]&&t[e].__sentry_original__;e in t&&r&&(n[e]=t[e],t[e]=r)}));try{return e()}finally{Object.keys(n).forEach((e=>{t[e]=n[e]}))}}function Pe(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Oe.forEach((n=>{t[n]=(...t)=>{e&&Le((()=>{Se.console[n](`Sentry Logger [${n}]:`,...t)}))}})):Oe.forEach((e=>{t[e]=()=>{}})),t}let De;De="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?ke("logger",Pe):Pe();const Ie=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ne(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${s}`}function Re(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class xe extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function je(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);if("function"==typeof i)try{Be(i,r)}catch(e){}e[t]=i}function Fe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Be(e,t){const n=t.prototype||{};e.prototype=t.prototype=n,Fe(e,"__sentry_original__",t)}function Ue(e){return e.__sentry_original__}function Ve(e){if(ie(e))return{message:e.message,name:e.name,stack:e.stack,...Ge(e)};if(de(e)){const t={type:e.type,target:Ye(e.target),currentTarget:Ye(e.currentTarget),...Ge(e)};return"undefined"!=typeof CustomEvent&&pe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Ye(e){try{return"undefined"!=typeof Element&&pe(e,Element)?Me(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function Ge(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function qe(e){return $e(e,new Map)}function $e(e,t){if(ue(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=$e(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push($e(e,t))})),r}return e}const Je="<anonymous>";function We(e){try{return e&&"function"==typeof e&&e.name||Je}catch(e){return Je}}const He=Ee();function ze(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const Ke=Ee(),Qe=Ee(),Xe="__sentry_xhr_v2__",Ze={},et={};function tt(e,t){Ze[e]=Ze[e]||[],Ze[e].push(t),function(e){if(!et[e])switch(et[e]=!0,e){case"console":"console"in Qe&&Oe.forEach((function(e){e in Qe.console&&je(Qe.console,e,(function(t){return function(...n){nt("console",{args:n,level:e}),t&&t.apply(Qe.console,n)}}))}));break;case"dom":!function(){if(!("document"in Qe))return;const e=nt.bind(null,"dom"),t=lt(e,!0);Qe.document.addEventListener("click",t,!1),Qe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=Qe[t]&&Qe[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(je(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=o[n]=o[n]||{refCount:0};if(!s.handler){const r=lt(e);s.handler=r,t.call(this,n,r,i)}s.refCount++}catch(e){}return t.call(this,n,r,i)}})),je(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in Qe))return;const e=XMLHttpRequest.prototype;je(e,"open",(function(e){return function(...t){const n=t[1],r=this[Xe]={method:ce(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};ce(n)&&"POST"===r.method&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const e=this[Xe];if(e&&4===this.readyState){try{e.status_code=this.status}catch(e){}nt("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?je(this,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(this,t)}})):this.addEventListener("readystatechange",i),je(this,"setRequestHeader",(function(e){return function(...t){const[n,r]=t,i=this[Xe];return i&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}})),e.apply(this,t)}})),je(e,"send",(function(e){return function(...t){const n=this[Xe];return n&&void 0!==t[0]&&(n.body=t[0]),nt("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":(function(){if(!function(){if(!("fetch"in He))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if(ze(He.fetch))return!0;let e=!1;const t=He.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=ze(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&je(Qe,"fetch",(function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:it(t),method:rt(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:it(t),method:rt(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return nt("fetch",{...i}),e.apply(Qe,t).then((e=>(nt("fetch",{...i,endTimestamp:Date.now(),response:e}),e)),(e=>{throw nt("fetch",{...i,endTimestamp:Date.now(),error:e}),e}))}}));break;case"history":!function(){if(!function(){const e=Ke.chrome,t=e&&e.app&&e.app.runtime,n="history"in Ke&&!!Ke.history.pushState&&!!Ke.history.replaceState;return!t&&n}())return;const e=Qe.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=ot,t=String(n);ot=t,nt("history",{from:e,to:t})}return e.apply(this,t)}}Qe.onpopstate=function(...t){const n=Qe.location.href,r=ot;if(ot=n,nt("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},je(Qe.history,"pushState",t),je(Qe.history,"replaceState",t)}();break;case"error":ut=Qe.onerror,Qe.onerror=function(e,t,n,r,i){return nt("error",{column:r,error:i,line:n,msg:e,url:t}),!(!ut||ut.__SENTRY_LOADER__)&&ut.apply(this,arguments)},Qe.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":dt=Qe.onunhandledrejection,Qe.onunhandledrejection=function(e){return nt("unhandledrejection",e),!(dt&&!dt.__SENTRY_LOADER__)||dt.apply(this,arguments)},Qe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("unknown instrumentation type:",e)}}(e)}function nt(e,t){if(e&&Ze[e])for(const n of Ze[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${We(n)}\nError:`,t)}}function rt(e,t){return!!e&&"object"==typeof e&&!!e[t]}function it(e){return"string"==typeof e?e:e?rt(e,"url")?e.url:e.toString?e.toString():"":""}let ot;const st=1e3;let at,ct;function lt(e,t=!1){return n=>{if(!n||ct===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===at||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(ct,n))&&(e({event:n,name:r,global:t}),ct=n),clearTimeout(at),at=Qe.setTimeout((()=>{at=void 0}),st)}}let ut=null,dt=null;function ht(){const e=Se,t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");const n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function pt(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ft(e){const{message:t,event_id:n}=e;if(t)return t;const r=pt(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function mt(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function gt(e,t){const n=pt(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function vt(e){if(e&&e.__sentry_captured__)return!0;try{Fe(e,"__sentry_captured__",!0)}catch(e){}return!1}function _t(e,t=100,n=1/0){try{return bt("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function yt(e,t=3,n=102400){const r=_t(e,t);return i=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(i))>n?yt(e,t-1,n):r;var i}function bt(e,t,r=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[s,a]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(c=t)||c==c))return t;var c;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(function(e){return ue(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${We(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const u="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===u)return l.replace("object ","");if(s(t))return"[Circular ~]";const d=t;if(d&&"function"==typeof d.toJSON)try{return bt("",d.toJSON(),u-1,i,o)}catch(e){}const h=Array.isArray(t)?[]:{};let p=0;const f=Ve(t);for(const e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(p>=i){h[e]="[MaxProperties ~]";break}const t=f[e];h[e]=bt(e,t,u-1,i,o),p++}return a(t),h}var wt;function St(e){return new kt((t=>{t(e)}))}function Et(e){return new kt(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(wt||(wt={}));class kt{__init(){this._state=wt.PENDING}__init2(){this._handlers=[]}constructor(e){kt.prototype.__init.call(this),kt.prototype.__init2.call(this),kt.prototype.__init3.call(this),kt.prototype.__init4.call(this),kt.prototype.__init5.call(this),kt.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new kt(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new kt(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init3(){this._resolve=e=>{this._setResult(wt.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(wt.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===wt.PENDING&&(he(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===wt.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===wt.RESOLVED&&e[1](this._value),this._state===wt.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function Tt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Ct=["fatal","error","warning","log","info","debug"],Mt=Ee(),At={nowSeconds:()=>Date.now()/1e3},Ot="undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__||"[object process]"!==Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(){const{performance:e}=Mt;if(e&&e.now)return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}():function(){try{return(t=e,t.require("perf_hooks")).performance}catch(t){return}var t}(),Lt=void 0===Ot?At:{nowSeconds:()=>(Ot.timeOrigin+Ot.now())/1e3},Pt=At.nowSeconds.bind(At),Dt=Lt.nowSeconds.bind(Lt);function It(e,t=[]){return[e,t]}function Nt(e,t){const[n,r]=e;return[n,[...r,t]]}function Rt(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function xt(e,t){return(t||new TextEncoder).encode(e)}function jt(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[xt(i,t),e]:i.push("string"==typeof e?xt(e,t):e)}for(const e of r){const[n,r]=e;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch(t){e=JSON.stringify(_t(r))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(i)}function Ft(e,t){const n="string"==typeof e.data?xt(e.data,t):e.data;return[qe({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=Mt;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,s=e.timing&&e.timing.navigationStart,a="number"==typeof s?Math.abs(s+n-r):t;(o||a<t)&&i<=a&&e.timeOrigin})();const Bt={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function Ut(e){return Bt[e]}function Vt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const Yt=6e4,Gt="production";function qt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Dt(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ht()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class $t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ht()}static clone(e){const t=new $t;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&qt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof $t?t:this}return e instanceof $t?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):ue(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.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=Ht(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Pt(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const t=this._span.transaction;if(t){e.sdkProcessingMetadata={dynamicSamplingContext:t.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const n=t.name;n&&(e.tags={transaction:n,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...Jt(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,t,n,r=0){return new kt(((i,o)=>{const s=e[r];if(null===t||"function"!=typeof s)i(t);else{const a=s({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&s.id&&null===a&&De.log(`Event processor "${s.id}" dropped event`),he(a)?a.then((t=>this._notifyEventProcessors(e,t,n,r+1).then(i))).then(null,o):this._notifyEventProcessors(e,a,n,r+1).then(i).then(null,o)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){var t;e.fingerprint=e.fingerprint?(t=e.fingerprint,Array.isArray(t)?t:[t]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Jt(){return ke("globalEventProcessors",(()=>[]))}function Wt(e){Jt().push(e)}function Ht(){return{traceId:ht(),spanId:ht().substring(16),sampled:!1}}const zt=4,Kt=100;class Qt{constructor(e,t=new $t,n=zt){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=$t.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1||!this.getStack().pop())}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:ht(),r=new Error("Sentry syntheticException");return this._withClient(((i,o)=>{i.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},o)})),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ht(),i=new Error(e);return this._withClient(((o,s)=>{o.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},s)})),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ht();return e.type||(this._lastEventId=n),this._withClient(((r,i)=>{r.captureEvent(e,{...t,event_id:n},i)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Kt}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const s={timestamp:Pt(),...e},a=i?Le((()=>i(s,t))):s;null!==a&&(r.emit&&r.emit("beforeAddBreadcrumb",a,t),n.addBreadcrumb(a,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Zt(this);try{e(this)}finally{Zt(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);return"undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__||n||console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e,t){let n={};"ok"===e.status&&(n={status:"exited"}),qt(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Gt}=n&&n.getOptions()||{},{userAgent:o}=Se.navigator||{},s=function(e){const t=Dt(),n={sid:ht(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return qe({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&qt(n,e),n}({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),a=t.getSession&&t.getSession();return a&&"ok"===a.status&&qt(a,{status:"exited"}),this.endSession(),t.setSession(s),s}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=Xt().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Xt(){return Se.__SENTRY__=Se.__SENTRY__||{extensions:{},hub:void 0},Se}function Zt(e){const t=Xt(),n=tn(t);return nn(t,e),n}function en(){const e=Xt();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Xt()){var t;return(t=e)&&t.__SENTRY__&&t.__SENTRY__.hub&&!tn(e).isOlderThan(zt)||nn(e,new Qt),tn(e)}(e)}function tn(e){return ke("hub",(()=>new Qt),e)}function nn(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const rn=[];function on(e,t){t[e.name]=e,-1===rn.indexOf(e.name)&&(e.setupOnce(Wt,en),rn.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log(`Integration installed: ${e.name}`))}const sn=new WeakMap,an="Not capturing exception because it's already been captured.";class cn{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(cn.prototype.__init.call(this),cn.prototype.__init2.call(this),cn.prototype.__init3.call(this),cn.prototype.__init4.call(this),cn.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Ie.exec(e);if(!t)return void console.error(`Invalid Sentry Dsn: ${e}`);const[n,r,i="",o,s="",a]=t.slice(1);let c="",l=a;const u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const e=l.match(/^\d+/);e&&(l=e[0])}return Re({host:o,pass:i,path:c,projectId:l,port:s,protocol:n,publicKey:r})}(e):Re(e);if(t&&function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(De.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(De.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(De.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(De.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("No DSN provided, client will not do anything."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return n={sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}(e,r)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(vt(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log(an));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=le(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(o.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&vt(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log(an));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),qt(e,{init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.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(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):St(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const t={};return e.forEach((e=>{e&&on(e,t)})),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){on(e,this._integrations)}sendEvent(e,t={}){if(this._dsn){let n=function(e,t,n,r){const i=Vt(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const s=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:Ne(r)},...i&&{trace:qe({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,It(s,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Nt(n,Ft(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const i=Vt(n);return It({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&{dsn:Ne(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach((e=>e(...t)))}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(qt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new kt((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),function(e,t,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=e,s={...t,event_id:t.event_id||n.event_id||ht(),timestamp:t.timestamp||Pt()},a=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Gt),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=fe(e.message,o));const s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=fe(s.value,o));const a=e.request;a&&a.url&&(a.url=fe(a.url,o))}(s,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(s,a),void 0===t.type&&function(e,t){const n=Se._sentryDebugIds;if(!n)return;let r;const i=sn.get(t);i?r=i:(r=new Map,sn.set(t,r));const o=Object.keys(n).reduce(((e,i)=>{let o;const s=r.get(i);s?o=s:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=o[e.filename])}))}))}catch(e){}}(s,e.stackParser);let c=r;n.captureContext&&(c=$t.clone(c).update(n.captureContext));let l=St(s);if(c){if(c.getAttachments){const e=[...n.attachments||[],...c.getAttachments()];e.length&&(n.attachments=e)}l=c.applyToEvent(s,n)}return l.then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"==typeof i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:_t(e.data,t,n)}})))},...e.user&&{user:_t(e.user,t,n)},...e.contexts&&{contexts:_t(e.contexts,t,n)},...e.extra&&{extra:_t(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=_t(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=_t(e.data,t,n)),e)))),r}(e,i,o):e)))}(r,e,t,n).then((e=>{if(null===e)return e;const{propagationContext:t}=e.sdkProcessingMetadata||{};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:s}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const a=s||function(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},s=qe({environment:r.environment||Gt,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",s),s}(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:a,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e;"log"===t.logLevel?De.log(t.message):De.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r;if(!this._isEnabled())return Et(new xe("SDK not enabled, will not capture event.","log"));const o=un(e),s=ln(e),a=e.type||"error",c=`before send for type \`${a}\``;if(s&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),Et(new xe(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const l="replay_event"===a?"replay":a;return this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,e),new xe("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;return ln(t)&&r?r(t,n):un(t)&&i?i(t,n):t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(he(e))return e.then((e=>{if(!ue(e)&&null!==e)throw new xe(n);return e}),(e=>{throw new xe(`${t} rejected with ${e}`)}));if(!ue(e)&&null!==e)throw new xe(n);return e}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",l,e),new xe(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const s=r.transaction_info;if(o&&s&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...s,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof xe)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new xe(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,(e=>{("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error("Error while sending event:",e)}));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function ln(e){return void 0===e.type}function un(e){return"transaction"===e.type}const dn=30;function hn(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const pn="7.60.1";let fn;class mn{constructor(){mn.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=mn.id}setupOnce(){fn=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ue(this)||this;return fn.apply(t,e)}}catch(e){}}}mn.__initStatic();const gn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],vn=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class _n{static __initStatic(){this.id="InboundFilters"}__init(){this.name=_n.id}constructor(e={}){this._options=e,_n.prototype.__init.call(this)}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(_n);if(t){const r=n.getClient(),i=r?r.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:gn],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:vn],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ft(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception){const{values:t}=e.exception;try{const{type:e="",value:n=""}=t&&t[t.length-1]||{};return[`${n}`,`${e}: ${n}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error(`Cannot extract message for event ${ft(e)}`),[]}}return[]}(e).some((e=>ge(e,t)))}(e,t.ignoreErrors)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ft(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&ge(n,t)}(e,t.ignoreTransactions)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ft(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=yn(e);return!!n&&ge(n,t)}(e,t.denyUrls)?(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ft(e)}.\nUrl: ${yn(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=yn(e);return!n||ge(n,t)}(e,t.allowUrls)&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ft(e)}.\nUrl: ${yn(e)}`),!0)}(e,o)?null:e}}return e};n.id=this.name,e(n)}}function yn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error(`Cannot extract url for event ${ft(e)}`),null}}_n.__initStatic();var bn=Object.freeze({__proto__:null,FunctionToString:mn,InboundFilters:_n});const wn=Se;let Sn=0;function En(){return Sn>0}function kn(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Ue(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map((e=>kn(e,t)));return e.apply(this,i)}catch(e){throw Sn++,setTimeout((()=>{Sn--})),i=n=>{var i;n.addEventProcessor((e=>(t.mechanism&&(mt(e,void 0,void 0),gt(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),i=e,en().captureException(i,{captureContext:void 0})},en().withScope(i),e}var i};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}Be(r,e),Fe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}function Tn(e,t){const n=Mn(e,t),r={type:t&&t.name,value:On(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Cn(e,t){return{exception:{values:[Tn(e,t)]}}}function Mn(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(An.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}const An=/Minified React error #\d+;/i;function On(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Ln(e,t,n,r,i){let o;if(se(t)&&t.error)return Cn(e,t.error);if(ae(t)||oe(t,"DOMException")){const i=t;if("stack"in t)o=Cn(e,t);else{const t=i.name||(ae(i)?"DOMError":"DOMException"),s=i.message?`${t}: ${i.message}`:t;o=Pn(e,s,n,r),mt(o,s)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return ie(t)?Cn(e,t):ue(t)||de(t)?(o=function(e,t,n,r){const i=en().getClient(),o=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:de(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Dn(t,{isUnhandledRejection:r})}]},extra:{__serialized__:yt(t,o)}};if(n){const t=Mn(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}(e,t,n,i),gt(o,{synthetic:!0}),o):(o=Pn(e,t,n,r),mt(o,`${t}`,void 0),gt(o,{synthetic:!0}),o)}function Pn(e,t,n,r){const i={message:t};if(r&&n){const r=Mn(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}return i}function Dn(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Ve(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return fe(n[0],t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:fe(r,t)}return""}(e),r=t?"promise rejection":"exception";return se(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:de(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const In="Breadcrumbs";class Nn{static __initStatic(){this.id=In}__init(){this.name=Nn.id}constructor(e){Nn.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&tt("console",Rn),this.options.dom&&tt("dom",function(e){return function(t){let n,r="object"==typeof e?e.serializeAttribute:void 0,i="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;i&&i>1024&&(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=1024),"string"==typeof r&&(r=[r]);try{const e=t.event;n=function(e){return!!e&&!!e.target}(e)?Me(e.target,{keyAttrs:r,maxStringLength:i}):Me(e,{keyAttrs:r,maxStringLength:i})}catch(e){n="<unknown>"}0!==n.length&&en().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}}(this.options.dom)),this.options.xhr&&tt("xhr",xn),this.options.fetch&&tt("fetch",jn),this.options.history&&tt("history",Fn)}addSentryBreadcrumb(e){this.options.sentry&&en().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:ft(e)},{event:e})}}function Rn(e){for(let t=0;t<e.args.length;t++)if("ref=Ref<"===e.args[t]){e.args[t+1]="viewRef";break}const t={category:"console",data:{arguments:e.args,logger:"console"},level:(n=e.level,"warn"===n?"warning":Ct.includes(n)?n:"log"),message:me(e.args," ")};var n;if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${me(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}en().addBreadcrumb(t,{input:e.args,level:e.level})}function xn(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr[Xe];if(!t||!n||!r)return;const{method:i,url:o,status_code:s,body:a}=r,c={method:i,url:o,status_code:s},l={xhr:e.xhr,input:a,startTimestamp:t,endTimestamp:n};en().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function jn(e){const{startTimestamp:t,endTimestamp:n}=e;if(n&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){const r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};en().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};en().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Fn(e){let t=e.from,n=e.to;const r=Tt(wn.location.href);let i=Tt(t);const o=Tt(n);i.path||(i=r),r.protocol===o.protocol&&r.host===o.host&&(n=o.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),en().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}Nn.__initStatic();class Bn extends cn{constructor(e){const t=wn.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:pn}],version:pn},super(e),e.sendClientReports&&wn.document&&wn.document.addEventListener("visibilitychange",(()=>{"hidden"===wn.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const i=Ln(e,t,n&&n.syntheticException||void 0,r);return gt(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),St(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=Pn(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),St(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){const n=this.getIntegrationById(In);n&&n.addSentryBreadcrumb&&n.addSentryBreadcrumb(e),super.sendEvent(e,t)}captureUserFeedback(e){if(!this._isEnabled())return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Ne(r)}},o=function(e){return[{type:"user_report"},e]}(e);return It(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log("No outcomes to send"));if(!this._dsn)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log("No dsn provided, will not send outcomes"));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log("Sending outcomes:",e);const t=(n=e,It((r=this._options.tunnel&&Ne(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Pt(),discarded_events:n}]]));var n,r;this._sendEnvelope(t)}}let Un;function Vn(e,t=function(){if(Un)return Un;if(ze(wn.fetch))return Un=wn.fetch.bind(wn);const e=wn.document;let t=wn.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Un=t.bind(wn)}()){let n=0,r=0;return function(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return Et(new xe("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then((()=>n(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(e){return new kt(((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{St(e).then((()=>{--i||(clearTimeout(o),n(!0))}),r)}))}))}}}(e.bufferSize||dn)){let r={};function i(i){const o=[];if(Rt(i,((t,n)=>{const i=Ut(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=hn(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)})),0===o.length)return St();const s=It(i[0],o),a=t=>{Rt(s,((n,r)=>{const i=hn(n,r);e.recordDroppedEvent(t,Ut(r),i)}))};return n.add((()=>t({body:jt(s,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n]=e.split(":",2),o=parseInt(t,10),s=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))i[e]=r+s;else i.all=r+s}else s?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?Yt:r-t}(s,r):429===t&&(i.all=r+6e4);return i}(r,e),e)),(e=>{throw a("network_error"),e})))).then((e=>e),(e=>{if(e instanceof xe)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.error("Skipped sending event because buffer is full."),a("queue_overflow"),St();throw e}))}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}(e,(function(i){const o=i.body.length;n+=o,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,s).then((e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return Un=void 0,n-=o,r--,Et(e)}}))}class Yn{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=Yn.id}__init2(){this._installFunc={onerror:Gn,onunhandledrejection:qn}}constructor(e){Yn.prototype.__init.call(this),Yn.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(t=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.log(`Global Handler attached: ${t}`),r(),this._installFunc[n]=void 0)}var t}}function Gn(){tt("error",(e=>{const[t,n,r]=Wn();if(!t.getIntegration(Yn))return;const{msg:i,url:o,line:s,column:a,error:c}=e;if(En()||c&&c.__sentry_own_request__)return;const l=void 0===c&&ce(i)?function(e,t,n,r){let i=se(e)?e.message:e,o="Error";const s=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return s&&(o=s[1],i=s[2]),$n({exception:{values:[{type:o,value:i}]}},t,n,r)}(i,o,s,a):$n(Ln(n,c||i,void 0,r,!1),o,s,a);l.level="error",Jn(t,c,l,"onerror")}))}function qn(){tt("unhandledrejection",(e=>{const[t,n,r]=Wn();if(!t.getIntegration(Yn))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(e){}if(En()||i&&i.__sentry_own_request__)return!0;const o=le(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Ln(n,i,void 0,r,!0);o.level="error",Jn(t,i,o,"onunhandledrejection")}))}function $n(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},c=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=ce(t)&&t.length>0?t:function(){try{return Te.document.location.href}catch(e){return""}}();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),e}function Jn(e,t,n,r){gt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Wn(){const e=en(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}Yn.__initStatic();const Hn=["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 zn{static __initStatic(){this.id="TryCatch"}__init(){this.name=zn.id}constructor(e){zn.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&je(wn,"setTimeout",Kn),this._options.setInterval&&je(wn,"setInterval",Kn),this._options.requestAnimationFrame&&je(wn,"requestAnimationFrame",Qn),this._options.XMLHttpRequest&&"XMLHttpRequest"in wn&&je(XMLHttpRequest.prototype,"send",Xn);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Hn).forEach(Zn)}}function Kn(e){return function(...t){const n=t[0];return t[0]=kn(n,{mechanism:{data:{function:We(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function Qn(e){return function(t){return e.apply(this,[kn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:We(e)},handled:!0,type:"instrument"}})])}}function Xn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&je(n,e,(function(t){const n={mechanism:{data:{function:e,handler:We(t)},handled:!0,type:"instrument"}},r=Ue(t);return r&&(n.mechanism.data.handler=We(r)),kn(t,n)}))})),e.apply(this,t)}}function Zn(e){const t=wn,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(je(n,"addEventListener",(function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=kn(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:We(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.apply(this,[n,kn(r,{mechanism:{data:{function:"addEventListener",handler:We(r),target:e},handled:!0,type:"instrument"}}),i])}})),je(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,i,r)}})))}zn.__initStatic();class er{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=er.id}constructor(e={}){er.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,t){e(((e,n)=>{const r=t(),i=r.getClient(),o=r.getIntegration(er);if(!i||!o)return e;const s=i.getOptions();return ve(Tn,s.stackParser,s.maxValueLength,o._key,o._limit,e,n),e}))}}er.__initStatic();class tr{constructor(){tr.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=tr.id}setupOnce(){Wt((e=>{if(en().getIntegration(tr)){if(!wn.navigator&&!wn.location&&!wn.document)return e;const t=e.request&&e.request.url||wn.location&&wn.location.href,{referrer:n}=wn.document||{},{userAgent:r}=wn.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};return{...e,request:o}}return e}))}}tr.__initStatic();class nr{constructor(){nr.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=nr.id}setupOnce(e,t){const n=e=>{if(e.type)return e;const n=t().getIntegration(nr);if(n){try{if(function(e,t){return!(!t||!function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!ir(e,t)||!rr(e,t))}(e,t)&&!function(e,t){const n=or(t),r=or(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&ir(e,t)&&rr(e,t))}(e,t))}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&De.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function rr(e,t){let n=sr(e),r=sr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function ir(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function or(e){return e.exception&&e.exception.values&&e.exception.values[0]}function sr(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}nr.__initStatic();var ar=Object.freeze({__proto__:null,Breadcrumbs:Nn,Dedupe:nr,GlobalHandlers:Yn,HttpContext:tr,LinkedErrors:er,TryCatch:zn});let cr={};wn.Sentry&&wn.Sentry.Integrations&&(cr=wn.Sentry.Integrations);const lr={...cr,...bn,...ar};var ur="new",dr="loading",hr="loaded",pr="joining-meeting",fr="joined-meeting",mr="left-meeting",gr="error",vr="blocked",_r="off",yr="sendable",br="loading",wr="interrupted",Sr="playable",Er="unknown",kr="full",Tr="lobby",Cr="none",Mr="base",Ar="*",Or="ejected",Lr="nbf-room",Pr="nbf-token",Dr="exp-room",Ir="exp-token",Nr="no-room",Rr="meeting-full",xr="end-of-life",jr="not-allowed",Fr="connection-error",Br="cam-in-use",Ur="mic-in-use",Vr="cam-mic-in-use",Yr="permissions",Gr="undefined-mediadevices",qr="not-found",$r="constraints",Jr="unknown",Wr="iframe-ready-for-launch-config",Hr="iframe-launch-config",zr="theme-updated",Kr="loading",Qr="load-attempt-failed",Xr="loaded",Zr="started-camera",ei="camera-error",ti="joining-meeting",ni="joined-meeting",ri="left-meeting",ii="available-devices-updated",oi="participant-joined",si="participant-updated",ai="participant-left",ci="participant-counts-updated",li="access-state-updated",ui="meeting-session-summary-updated",di="meeting-session-state-updated",hi="meeting-session-data-error",pi="waiting-participant-added",fi="waiting-participant-updated",mi="waiting-participant-removed",gi="track-started",vi="track-stopped",_i="transcription-started",yi="transcription-stopped",bi="transcription-error",wi="recording-started",Si="recording-stopped",Ei="recording-stats",ki="recording-error",Ti="recording-upload-completed",Ci="recording-data",Mi="app-message",Ai="transcription-message",Oi="remote-media-player-started",Li="remote-media-player-updated",Pi="remote-media-player-stopped",Di="local-screen-share-started",Ii="local-screen-share-stopped",Ni="local-screen-share-canceled",Ri="active-speaker-change",xi="active-speaker-mode-change",ji="network-quality-change",Fi="network-connection",Bi="cpu-load-change",Ui="fullscreen",Vi="exited-fullscreen",Yi="live-streaming-started",Gi="live-streaming-updated",qi="live-streaming-stopped",$i="live-streaming-error",Ji="lang-updated",Wi="receive-settings-updated",Hi="input-settings-updated",zi="nonfatal-error",Ki="error",Qi=102400,Xi="iframe-call-message",Zi="local-screen-start",eo="register-input-handler",to="daily-method-update-live-streaming-endpoints",no="transmit-log",ro="daily-custom-track",io={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image"},oo={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},so={PLAY:"play",PAUSE:"pause"},ao=["jpg","png","jpeg"];function co(){return!lo()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function lo(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function uo(){return!!co().match(/iPad|iPhone|iPod/i)}function ho(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function po(){if(lo())return!1;if(!document)return!1;var e=document.createElement("iframe");return!!e.requestFullscreen||!!e.webkitRequestFullscreen}function fo(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!lo()&&(e?!_o()&&["Chrome","Firefox"].includes(yo()):function(){if(_o())return!1;var e=yo();if(uo()&&"Safari"===e){var t=Eo();if(15===t.major&&t.minor<4)return!1}return["Chrome","Firefox","Safari"].includes(e)}())}var mo=["Chrome","Firefox"];function go(){return!lo()&&!_o()&&"undefined"!=typeof AudioWorkletNode&&mo.includes(yo())}function vo(){return ho()&&!function(){var e,t=yo();if(!co())return!0;switch(t){case"Chrome":return(e=wo()).major&&e.major>0&&e.major<61;case"Firefox":return(e=ko()).major<78;case"Safari":return(e=Eo()).major<12;default:return!0}}()}function _o(){var e,t,n=co(),r=n.match(/Mac/)&&(!lo()&&"undefined"!=typeof window&&null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!co().match(/DailyAnd\//)||void 0}function yo(){if("undefined"!=typeof window){var e=co();return So()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function bo(){switch(yo()){case"Chrome":return wo();case"Safari":return Eo();case"Firefox":return ko();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var n=co().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(e){}}return{major:e,minor:t}}()}}function wo(){var e=0,t=0,n=0,r=0,i=!1;if("undefined"!=typeof window){var o=co(),s=o.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(s)try{e=parseInt(s[1]),t=parseInt(s[2]),n=parseInt(s[3]),r=parseInt(s[4]),i=o.indexOf("OPR/")>-1}catch(e){}}return{major:e,minor:t,build:n,patch:r,opera:i}}function So(){return uo()&&ho()}function Eo(){var e=0,t=0,n=0;if("undefined"!=typeof window){var r=co().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch(e){}else So()&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function ko(){var e=0,t=0;if("undefined"!=typeof window){var n=co().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(e){}}return{major:e,minor:t}}var To=function(){function e(){s(this,e)}return u(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Z()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Z()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Z()}},{key:"sendMessageToDailyJs",value:function(e,t){Z()}},{key:"removeListener",value:function(e){Z()}}]),e}();function Co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Co(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Co(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ao=function(e){p(n,To);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}(n);function n(){var e;return s(this,n),(e=t.call(this))._wrappedListeners={},e._messageCallbacks={},e}return u(n,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){var r=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callFrameId||i.data.callFrameId===t)&&(!i.data.from||"module"!==i.data.from)){var o=Mo({},i.data);if(delete o.from,o.callbackStamp&&r._messageCallbacks[o.callbackStamp]){var s=o.callbackStamp;r._messageCallbacks[s].call(n,o),delete r._messageCallbacks[s]}delete o.what,delete o.callbackStamp,e.call(n,o)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){var r=function(r){if(!(!r.data||r.data.what!==Xi||!r.data.action||r.data.from&&"module"!==r.data.from||r.data.callFrameId&&t&&r.data.callFrameId!==t)){var i=r.data;e.call(n,i)}};this._wrappedListeners[e]=r,window.addEventListener("message",r)}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){if(!r)throw new Error("undefined callFrameId. Are you trying to use a DailyCall instance previously destroyed?");var i=Mo({},e);if(i.what=Xi,i.from="module",i.callFrameId=r,t){var o=X();this._messageCallbacks[o]=t,i.callbackStamp=o}var s=n?n.contentWindow:window,a=this._callMachineTargetOrigin(n);a&&s.postMessage(i,a)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=Xi,e.callFrameId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,n){var r=Mo({},e);r.callFrameId=n;var i=t?t.contentWindow:window,o=this._callMachineTargetOrigin(t);o&&i.postMessage(r,o)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var n=function(n){if(n.data&&"iframe-call-message"===n.data.what&&(!n.data.callFrameId||n.data.callFrameId===t)&&(!n.data.from||"module"!==n.data.from)){var r=n.data;e(r)}};return this._wrappedListeners[e]=n,window.addEventListener("message",n),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return"file:"===window.location.protocol?"*":window.location.origin}}]),n}(),Oo=function(e){p(r,To);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}(r);function r(){var e;return s(this,r),e=t.call(this),n.g.callMachineToDailyJsEmitter=n.g.callMachineToDailyJsEmitter||new b.EventEmitter,n.g.dailyJsToCallMachineEmitter=n.g.dailyJsToCallMachineEmitter||new b.EventEmitter,e._wrappedListeners={},e._messageCallbacks={},e}return u(r,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,r){this._addListener(e,n.g.callMachineToDailyJsEmitter,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,r){this._addListener(e,n.g.dailyJsToCallMachineEmitter,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t){this._sendMessage(e,n.g.dailyJsToCallMachineEmitter,"sending message to call machine",t)}},{key:"sendMessageToDailyJs",value:function(e){this._sendMessage(e,n.g.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(n.g.callMachineToDailyJsEmitter.removeListener("message",t),n.g.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,n,r){var i=this,o=function(t){if(t.callbackStamp&&i._messageCallbacks[t.callbackStamp]){var r=t.callbackStamp;i._messageCallbacks[r].call(n,t),delete i._messageCallbacks[r]}e.call(n,t)};this._wrappedListeners[e]=o,t.addListener("message",o)}},{key:"_sendMessage",value:function(e,t,n,r){if(r){var i=X();this._messageCallbacks[i]=r,e.callbackStamp=i}t.emit("message",e)}}]),r}(),Lo="replace",Po="shallow-merge",Do=[Lo,Po],Io=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data,r=t.mergeStrategy,i=void 0===r?Lo:r;s(this,e),e._validateMergeStrategy(i),e._validateData(n,i),this.mergeStrategy=i,this.data=n}return u(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return 0===Object.keys(e).length&&t===Po}},{key:"_validateMergeStrategy",value:function(e){if(!Do.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Do,"]"))}},{key:"_validateData",value:function(e,t){if(!function(e){if(null==e||"object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var n;try{if(n=JSON.stringify(e),t===Lo){var r=JSON.parse(n);F(r,e)||console.warn("The meeting session data provided will be modified when serialized.",r,e)}else if(t===Po)for(var i in e)if(Object.hasOwnProperty.call(e,i)&&void 0!==e[i]){var o=JSON.parse(JSON.stringify(e[i]));F(e[i],o)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",o,e[i])}}catch(e){throw Error("Meeting session data must be serializable to JSON: ".concat(e))}if(n.length>Qi)throw Error("Meeting session data is too large (".concat(n.length," characters). Maximum size suppported is ").concat(Qi,"."))}}]),e}();function No(e,t,n){return No=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&h(i,n.prototype),i},No.apply(null,arguments)}function Ro(e){var t="function"==typeof Map?new Map:void 0;return Ro=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return No(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,e)},Ro(e)}var xo=function(){function e(){s(this,e),this._currentLoad=null}return u(e,[{key:"load",value:function(e,t,n,r){if(this.loaded)return window._dailyCallObjectSetup(e),void n(!0);!function(e,t){window._dailyConfig||(window._dailyConfig={}),window._dailyConfig.callFrameId=e,window._dailyConfig.avoidEval=t}(e,t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new jo((function(){n(!1)}),r),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel()}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),e}(),jo=function(){function e(t,n){s(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._successCallback=t,this._failureCallback=n}return u(e,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new Uo(this._successCallback,(function t(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout((function(){e._currentAttempt.cancelled||(e._currentAttempt=new Uo(e._successCallback,t),e._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}}]),e}(),Fo=function(e){p(n,Ro(Error));var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}(n);function n(){return s(this,n),t.apply(this,arguments)}return u(n)}(),Bo=2e4,Uo=function(){function e(t,n){s(this,e),this._loadAttemptImpl=lo()||!_dailyConfig.avoidEval?new Vo(t,n):new Yo(t,n)}var t;return u(e,[{key:"start",value:(t=o((function*(){return this._loadAttemptImpl.start()})),function(){return t.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}}]),e}(),Vo=function(){function e(t,n){s(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._successCallback=t,this._failureCallback=n}var t,n,r,i;return u(e,[{key:"start",value:(i=o((function*(){var e=te();!(yield this._tryLoadFromIOSCache(e))&&this._loadFromNetwork(e)})),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=o((function*(e){if(!this._iosCache)return!1;try{var t=yield this._iosCache.get(e);return!!this.cancelled||!!t&&(t.code?(Function('"use strict";'+t.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=t.refetchHeaders,!1))}catch(e){return!1}})),function(e){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=o((function*(e){var t=this;this._networkTimeout=setTimeout((function(){t._networkTimedOut=!0,t._failureCallback("Timed out (>".concat(Bo," ms) when loading call object bundle ").concat(e))}),Bo);try{var n=this._refetchHeaders?{headers:this._refetchHeaders}:{},r=yield fetch(e,n);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Fo;var i=yield this._getBundleCodeFromResponse(e,r);if(this.cancelled)throw new Fo;Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(e,i,r.headers),this.succeeded=!0,this._successCallback()}catch(t){if(clearTimeout(this._networkTimeout),t instanceof Fo||this.cancelled||this._networkTimedOut)return;this._failureCallback("Failed to load call object bundle ".concat(e,": ").concat(t))}})),function(e){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=o((function*(e,t){if(t.ok)return yield t.text();if(this._iosCache&&304===t.status)return(yield this._iosCache.renew(e,t.headers)).code;throw new Error("Received ".concat(t.status," response"))})),function(e,n){return t.apply(this,arguments)})}]),e}(),Yo=function(){function e(t,n){s(this,e),this.cancelled=!1,this.succeeded=!1,this._successCallback=t,this._failureCallback=n,this._attemptId=X(),this._networkTimeout=null,this._scriptElement=null}var t;return u(e,[{key:"start",value:(t=o((function*(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=te();"object"===("undefined"==typeof document?"undefined":a(document))?this._startLoading(e):this._failureCallback("Call object bundle must be loaded in a DOM/web context")})),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout((function(){t._stopLoading(),t._failureCallback("Timed out (>".concat(Bo," ms) when loading call object bundle ").concat(e))}),Bo);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=o((function*(){t._stopLoading(),t.succeeded=!0,t._successCallback()})),r.onerror=function(){var e=o((function*(e){t._stopLoading(),t._failureCallback("Failed to load call object bundle ".concat(e.target.src))}));return function(t){return e.apply(this,arguments)}}(),r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),e}(),Go=function(e,t,n){return!0===Jo(e.local,t,n)},qo=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===n?"Video":"Audio","Tracks")]()[0]},$o=function(e,t,n,r){var i=Wo(e,t,n,r);return i&&i.pendingTrack},Jo=function(e,t,n){if(!e)return!1;var r=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?-1===["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)&&i[t].custom?[!0,"staged"].includes(i[t].custom)?r(i[t].custom):r(i[t].custom[n]):r(i[t][n]):!i||r(i.ALL)},Wo=function(e,t,n,r){var i=Object.values(e.streams||{}).filter((function(e){return e.participantId===t&&e.type===n&&e.pendingTrack&&e.pendingTrack.kind===r})).sort((function(e,t){return new Date(t.starttime)-new Date(e.starttime)}));return i&&i[0]},Ho=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function zo(e){for(var t=store.getState(),n=0,r=["cam","screen"];n<r.length;n++)for(var i=r[n],o=0,s=["video","audio"];o<s.length;o++){var a=s[o],c="cam"===i?a:"screen".concat(a.charAt(0).toUpperCase()+a.slice(1)),l=e.tracks[c];if(l){var u=e.local?qo(t,i,a):$o(t,e.session_id,i,a);"playable"===l.state&&(l.track=u),l.persistentTrack=u}}}function Ko(e){try{var t=store.getState();for(var n in e.tracks)if(!Qo(n)){var r=e.tracks[n].kind;if(r){var i=e.tracks[n];if(i){var o=e.local?Ho(t,n):$o(t,e.session_id,n,r);"playable"===i.state&&(e.tracks[n].track=o),i.persistentTrack=o}}else console.error("unknown type for custom track")}}catch(e){console.error(e)}}function Qo(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function Xo(e,t){var n=store.getState();if(e.local){if(e.audio)try{e.audioTrack=n.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(e){}if(e.video)try{e.videoTrack=n.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(e){}if(e.screen)try{e.screenVideoTrack=n.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=n.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){}}else{var r=!0;try{var i=n.participants[e.session_id];i&&i.public&&i.public.rtcType&&"peer-to-peer"===i.public.rtcType.impl&&i.private&&!["connected","completed"].includes(i.private.peeringState)&&(r=!1)}catch(e){console.error(e)}if(!r)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(n.streams,e.audio&&Go(n,e.session_id,"cam-audio")){var o=$o(n,e.session_id,"cam","audio");o&&(t&&t.audioTrack&&t.audioTrack.id===o.id?e.audioTrack=o:o.muted||(e.audioTrack=o)),e.audioTrack||(e.audio=!1)}if(e.video&&Go(n,e.session_id,"cam-video")){var s=$o(n,e.session_id,"cam","video");s&&(t&&t.videoTrack&&t.videoTrack.id===s.id?e.videoTrack=s:s.muted||(e.videoTrack=s)),e.videoTrack||(e.video=!1)}if(e.screen&&Go(n,e.session_id,"screen-audio")){var a=$o(n,e.session_id,"screen","audio");a&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===a.id?e.screenAudioTrack=a:a.muted||(e.screenAudioTrack=a))}if(e.screen&&Go(n,e.session_id,"screen-video")){var c=$o(n,e.session_id,"screen","video");c&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===c.id?e.screenVideoTrack=c:c.muted||(e.screenVideoTrack=c))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(e){console.error("unexpected error matching up tracks",e)}}}function Zo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var es=new Map,ts=null;function ns(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rs=new Map,is=null;function os(e){ss()?function(e){es.has(e)||(es.set(e,{}),navigator.mediaDevices.enumerateDevices().then((function(t){es.has(e)&&(es.get(e).lastDevicesString=JSON.stringify(t),ts||(ts=function(){var e=o((function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zo(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(es.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==es.get(r).lastDevicesString&&(es.get(r).lastDevicesString=i,r(t))}}catch(e){n.e(e)}finally{n.f()}}));return function(){return e.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",ts)))})))}(e):function(e){rs.has(e)||(rs.set(e,{}),navigator.mediaDevices.enumerateDevices().then((function(t){rs.has(e)&&(rs.get(e).lastDevicesString=JSON.stringify(t),is||(is=setInterval(o((function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ns(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ns(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}(rs.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==rs.get(r).lastDevicesString&&(rs.get(r).lastDevicesString=i,r(t))}}catch(e){n.e(e)}finally{n.f()}})),3e3)))})))}(e)}function ss(){return lo()||void 0!==navigator.mediaDevices.ondevicechange}var as,cs=new Set,ls=["videoTrack"],us=["result"],ds=["preserveIframe"];function hs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hs(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function ms(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gs(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vs="video",_s="voice",ys=lo()?{data:{}}:{data:{},topology:"none"},bs={present:0,hidden:0},ws={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Ss=Object.keys(ws),Es=["state","volume","simulcastEncodings"],ks={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},Ts={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},Cs={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Ms={customIntegrations:{validate:Hs,help:Js()},customTrayButtons:{validate:Ws,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(Ts))},url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),window._dailyConfig||(window._dailyConfig={}),window._dailyConfig.experimentalGetUserMediaConstraintsModify=e.experimentalGetUserMediaConstraintsModify,window._dailyConfig.userMediaVideoConstraints=e.userMediaVideoConstraints,window._dailyConfig.userMediaAudioConstraints=e.userMediaAudioConstraints,window._dailyConfig.callObjectBundleUrlOverride=e.callObjectBundleUrlOverride,window._dailyConfig.proxyUrl=e.proxyUrl,window._dailyConfig.iceConfig=e.iceConfig,!0}catch(e){console.error("Failed to validate dailyConfig",e)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return zs(e,ks)},help:"reactNativeConfig should look like ".concat(JSON.stringify(ks),", all fields optional")},lang:{validate:function(e){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return Us(e),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){return t._preloadCache.videoDeviceId=e,!0}},audioSource:{validate:function(e,t){return t._preloadCache.audioDeviceId=e,!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===a(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(e){return Vs(e,{allowAllParticipantsKey:!1})},help:$s({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(e,t){try{return t.validateUpdateSendSettings(e),!0}catch(e){return console.error("Failed to validate send settings",e),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){return!!Ys(e)&&(t._preloadCache.inputSettings||(t._preloadCache.inputSettings={}),Gs(e),e.audio&&(t._preloadCache.inputSettings.audio=e.audio),e.video&&(t._preloadCache.inputSettings.video=e.video),!0)},help:qs()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0},As={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var n in e.cam)if("div"!==n&&"video"!==n)return!1;if(e.screen)for(var r in e.screen)if("div"!==r&&"video"!==r)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!lo()&&"avatar"===e)return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var o in t)if("custom"===o){if(!n.includes(t[o])&&!e(t[o],!0))return!1}else{var s=!i&&!r.includes(o),a=!n.includes(t[o]);if(s||a)return!1}return!0}(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(lo()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(e){return!1===e},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=_(n[t],2),i=r[0],o=r[1];switch(i){case"hasPresence":if("boolean"!=typeof o)return!1;break;case"canSend":if(o instanceof Set||o instanceof Array){var s,a=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],c=ms(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(!a.includes(l))return!1}}catch(e){c.e(e)}finally{c.f()}}else if("boolean"!=typeof o)return!1;o instanceof Array&&(e.canSend=new Set(o));break;case"canAdmin":if(o instanceof Set||o instanceof Array){var u,d=["participants","streaming","transcription"],h=ms(o);try{for(h.s();!(u=h.n()).done;){var p=u.value;if(!d.includes(p))return!1}}catch(e){h.e(e)}finally{h.f()}}else if("boolean"!=typeof o)return!1;o instanceof Array&&(e.canAdmin=new Set(o));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}},Os=function(e){p(Z,b);var t,n,i,c,l,h,f,m,v,y,w,S,E,k,T,C,M,A,O,L,P,D,I,N,R,x,j,B,U,V,Y,G,q,$,J,W,H,z,K=fs(Z);function Z(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,Z),g(d(t=K.call(this)),"startListeningForDeviceChanges",(function(){os(t.handleDeviceChange)})),g(d(t),"stopListeningForDeviceChanges",(function(){!function(e){ss()?function(e){es.has(e)&&(es.delete(e),0===es.size&&ts&&(navigator.mediaDevices.removeEventListener("devicechange",ts),ts=null))}(e):function(e){rs.has(e)&&(rs.delete(e),0===rs.size&&is&&(clearInterval(is),is=null))}(e)}(t.handleDeviceChange)})),g(d(t),"handleDeviceChange",(function(e){e=e.map((function(e){return JSON.parse(JSON.stringify(e))})),t.emit(ii,{action:ii,availableDevices:e})})),g(d(t),"handleNativeAppActiveStateChange",(function(e){t.disableReactNativeAutoDeviceManagement("video")||(e?t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!0):(t.camUnmutedBeforeLosingNativeActiveState=t.localVideo(),t.camUnmutedBeforeLosingNativeActiveState&&t.setLocalVideo(!1)))})),g(d(t),"handleNativeAudioFocusChange",(function(e){t.disableReactNativeAutoDeviceManagement("audio")||(t._hasNativeAudioFocus=e,t.toggleParticipantAudioBasedOnNativeAudioFocus(),t._hasNativeAudioFocus?t.micUnmutedBeforeLosingNativeAudioFocus&&t.setLocalAudio(!0):(t.micUnmutedBeforeLosingNativeAudioFocus=t.localAudio(),t.setLocalAudio(!1)))})),g(d(t),"handleNativeSystemScreenCaptureStop",(function(){t.stopScreenShare()})),t.strictMode=void 0===r.strictMode||r.strictMode,as){if(t._logDuplicateInstanceAttempt(),t.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed")}else n=d(t),as=n;if(r.dailyJsVersion=Z.version(),t._iframe=e,t._callObjectMode="none"===r.layout&&!t._iframe,t._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},t._callObjectMode&&(window._dailyPreloadCache=t._preloadCache),void 0!==r.showLocalVideo?t._callObjectMode?console.error("showLocalVideo is not available in call object mode"):t._showLocalVideo=!!r.showLocalVideo:t._showLocalVideo=!0,void 0!==r.showParticipantsBar?t._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):t._showParticipantsBar=!!r.showParticipantsBar:t._showParticipantsBar=!0,void 0!==r.customIntegrations?t._callObjectMode?console.error("customIntegrations is not available in call object mode"):t._customIntegrations=r.customIntegrations:t._customIntegrations={},void 0!==r.customTrayButtons?t._callObjectMode?console.error("customTrayButtons is not available in call object mode"):t._customTrayButtons=r.customTrayButtons:t._customTrayButtons={},void 0!==r.activeSpeakerMode?t._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):t._activeSpeakerMode=!!r.activeSpeakerMode:t._activeSpeakerMode=!1,r.receiveSettings?t._callObjectMode?t._receiveSettings=r.receiveSettings:console.error("receiveSettings is only available in call object mode"):t._receiveSettings={},t.validateProperties(r),t.properties=ps({},r),t._preloadCache.inputSettings||(t._preloadCache.inputSettings={}),r.inputSettings&&r.inputSettings.audio&&(t._preloadCache.inputSettings.audio=r.inputSettings.audio),r.inputSettings&&r.inputSettings.video&&(t._preloadCache.inputSettings.video=r.inputSettings.video),t._callObjectLoader=t._callObjectMode?new xo:null,t._callState=ur,t._isPreparingToJoin=!1,t._accessState={access:Er},t._meetingSessionSummary={},t._finalSummaryOfPrevSession={},t._meetingSessionState=Xs(ys,t._callObjectMode),t._nativeInCallAudioMode=vs,t._participants={},t._participantCounts=bs,t._rmpPlayerState={},t._waitingParticipants={},t._inputEventsOn={},t._network={threshold:"good",quality:100},t._activeSpeaker={},t._callFrameId=X(),t._localAudioLevel=0,t._remoteParticipantsAudioLevel={},t._messageChannel=lo()?new Oo:new Ao,t._iframe&&(t._iframe.requestFullscreen?t._iframe.addEventListener("fullscreenchange",(function(){document.fullscreenElement===t._iframe?(t.emit(Ui,{action:Ui}),t.sendMessageToCallMachine({action:Ui})):(t.emit(Vi,{action:Vi}),t.sendMessageToCallMachine({action:Vi}))})):t._iframe.webkitRequestFullscreen&&t._iframe.addEventListener("webkitfullscreenchange",(function(){document.webkitFullscreenElement===t._iframe?(t.emit(Ui,{action:Ui}),t.sendMessageToCallMachine({action:Ui})):(t.emit(Vi,{action:Vi}),t.sendMessageToCallMachine({action:Vi}))}))),lo()){var i=t.nativeUtils();i.addAudioFocusChangeListener&&i.removeAudioFocusChangeListener&&i.addAppActiveStateChangeListener&&i.removeAppActiveStateChangeListener&&i.addSystemScreenCaptureStopListener&&i.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),t._hasNativeAudioFocus=!0,i.addAudioFocusChangeListener(t.handleNativeAudioFocusChange),i.addAppActiveStateChangeListener(t.handleNativeAppActiveStateChange),i.addSystemScreenCaptureStopListener(t.handleNativeSystemScreenCaptureStop)}return t._callObjectMode&&t.startListeningForDeviceChanges(),t._messageChannel.addListenerForMessagesFromCallMachine(t.handleMessageFromCallMachine,t._callFrameId,d(t)),t}return u(Z,[{key:"destroy",value:(z=o((function*(){try{yield this.leave()}catch(e){}var e=this._iframe;if(e){var t=e.parentElement;t&&t.removeChild(e)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),lo()){var n=this.nativeUtils();n.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),n.removeAppActiveStateChangeListener(this.handleNativeAppActiveStateChange),n.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0;try{this.emit("call-instance-destroyed",{action:"call-instance-destroyed"})}catch(e){console.log("could not emit call-instance-destroyed")}this.strictMode&&(this._callFrameId=void 0),as=void 0})),function(){return z.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(e){var t=e.bodyClass,n=e.cssFile,r=e.cssText;return Fs(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(n),bodyClass:t,cssText:r}),this}},{key:"iframe",value:function(){return Fs(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return xs(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return xs(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var n in t){if(!As[n])throw new Error("unrecognized updateParticipant property ".concat(n));if(As[n].validate&&!As[n].validate(t[n],this,this._participants[e]))throw new Error(As[n].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var n in e)n===t&&(n="local"),n&&e[n]&&this.validateParticipantProperties(n,e[n]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:(H=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(xs(this._callObjectMode,"updateWaitingParticipant()"),Ps(this._callState,"updateWaitingParticipant()"),"string"!=typeof t||"object"!==a(n))throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise((function(r,i){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:n},(function(e){e.error&&i(e.error),e.id||i(new Error("unknown error in updateWaitingParticipant()")),r({id:e.id})}))}))})),function(){return H.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(W=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(xs(this._callObjectMode,"updateWaitingParticipants()"),Ps(this._callState,"updateWaitingParticipants()"),"object"!==a(t))throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise((function(n,r){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},(function(e){e.error&&r(e.error),e.ids||r(new Error("unknown error in updateWaitingParticipants()")),n({ids:e.ids})}))}))})),function(){return W.apply(this,arguments)})},{key:"requestAccess",value:(J=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.access,r=void 0===n?{level:kr}:n,i=t.name,o=void 0===i?"":i;return xs(this._callObjectMode,"requestAccess()"),Ps(this._callState,"requestAccess()"),new Promise((function(t,n){e.sendMessageToCallMachine({action:"daily-method-request-access",access:r,name:o},(function(e){e.error&&n(e.error),e.access||n(new Error("unknown error in requestAccess()")),t({access:e.access,granted:e.granted})}))}))})),function(){return J.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(e){return this.sendMessageToCallMachine({action:"local-audio",state:e}),this}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"getReceiveSettings",value:($=o((function*(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).showInheritedValues,r=void 0!==n&&n;if(xs(this._callObjectMode,"getReceiveSettings()"),!this._dailyMainExecuted)return this._receiveSettings;switch(a(e)){case"string":return new Promise((function(n){t.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:e,showInheritedValues:r},(function(e){n(e.receiveSettings)}))}));case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}})),function(e){return $.apply(this,arguments)})},{key:"updateReceiveSettings",value:(q=o((function*(e){var t=this;if(xs(this._callObjectMode,"updateReceiveSettings()"),!Vs(e,{allowAllParticipantsKey:!0}))throw new Error($s({allowAllParticipantsKey:!0}));return Ps(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise((function(n){t.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:e},(function(e){n({receiveSettings:e.receiveSettings})}))}))})),function(e){return q.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(e){var t,n,r,i,o,s,a,c;if(e){var l={},u="none"===(null===(t=e.audio)||void 0===t||null===(n=t.processor)||void 0===n?void 0:n.type)&&(null===(r=e.audio)||void 0===r||null===(i=r.processor)||void 0===i?void 0:i._isDefaultWhenNone);if(e.audio&&!u){var d=ps({},e.audio.processor);delete d._isDefaultWhenNone,l.audio=ps(ps({},e.audio),{},{processor:d})}var h="none"===(null===(o=e.video)||void 0===o||null===(s=o.processor)||void 0===s?void 0:s.type)&&(null===(a=e.video)||void 0===a||null===(c=a.processor)||void 0===c?void 0:c._isDefaultWhenNone);if(e.video&&!h){var p=ps({},e.video.processor);delete p._isDefaultWhenNone,l.video=ps(ps({},e.video),{},{processor:p})}return l}}},{key:"getInputSettings",value:function(){var e=this;return new Promise((function(t){t(e._getInputSettings())}))}},{key:"_getInputSettings",value:function(){var e,t,n,r,i,o,s,a,c={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(e=(null===(n=this._inputSettings)||void 0===n?void 0:n.video)||c,t=(null===(r=this._inputSettings)||void 0===r?void 0:r.audio)||c):(e=(null===(i=this._preloadCache)||void 0===i||null===(o=i.inputSettings)||void 0===o?void 0:o.video)||c,t=(null===(s=this._preloadCache)||void 0===s||null===(a=s.inputSettings)||void 0===a?void 0:a.audio)||c);var l={audio:t,video:e};return this._prepInputSettingsToPresentToUser(l)}},{key:"updateInputSettings",value:(G=o((function*(e){var t=this;return Ys(e)?(e&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),Gs(e),e.audio&&(this._preloadCache.inputSettings.audio=e.audio),e.video&&(this._preloadCache.inputSettings.video=e.video)),Ys(e)?this._callObjectMode&&this.needsLoad()?this._getInputSettings():new Promise((function(n,r){t.sendMessageToCallMachine({action:"update-input-settings",inputSettings:e},(function(e){e.error?r(e.error):n({inputSettings:t._prepInputSettingsToPresentToUser(e.inputSettings)})}))})):this._getInputSettings()):(console.error(qs()),Promise.reject(qs()))})),function(e){return G.apply(this,arguments)})},{key:"setBandwidth",value:function(e){var t=e.kbs,n=e.trackConstraints;if(Fs(),this._dailyMainExecuted)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:n}),this}},{key:"getDailyLang",value:function(){var e=this;if(Fs(),this._dailyMainExecuted)return new Promise((function(t){e.sendMessageToCallMachine({action:"get-daily-lang"},(function(e){delete e.action,delete e.callbackStamp,t(e)}))}))}},{key:"setDailyLang",value:function(e){return Fs(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"setProxyUrl",value:function(e){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:e}),this}},{key:"setIceConfig",value:function(e){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:e}),this}},{key:"meetingSessionSummary",value:function(){return[mr,gr].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Y=o((function*(){var e=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Ps(this._callState,"getMeetingSession()"),new Promise((function(t){e.sendMessageToCallMachine({action:"get-meeting-session"},(function(e){delete e.action,delete e.callbackStamp,delete e.callFrameId,t(e)}))}))})),function(){return Y.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Ps(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";xs(this._callObjectMode,"setMeetingSessionData()"),Ps(this._callState,"setMeetingSessionData");try{!function(e,t){new Io({data:e,mergeStrategy:t})}(e,t)}catch(e){throw console.error(e),e}try{this.sendMessageToCallMachine({action:"set-session-data",data:e,mergeStrategy:t})}catch(e){throw new Error("Error setting meeting session data: ".concat(e))}}},{key:"setUserName",value:function(e,t){var n=this;return this.properties.userName=e,new Promise((function(r){n.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:lo()||!!t&&!!t.thisMeetingOnly},(function(e){delete e.action,delete e.callbackStamp,r(e)}))}))}},{key:"setUserData",value:(V=o((function*(e){var t=this;try{Us(e)}catch(e){throw console.error(e),e}if(this.properties.userData=e,this._dailyMainExecuted)return new Promise((function(n){try{t.sendMessageToCallMachine({action:"set-user-data",userData:e},(function(e){delete e.action,delete e.callbackStamp,delete e.callFrameId,n(e)}))}catch(e){throw new Error("Error setting user data: ".concat(e))}}))})),function(e){return V.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(e){if(e&&(e<100||"number"!=typeof e))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(e){var t=this;if(Fs(),this.validateAudioLevelInterval(e),this._dailyMainExecuted)return new Promise((function(n,r){t.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:e},(function(e){e.error?r({error:e.error}):n()}))}));this._preloadCache.localAudioLevelObserver={enabled:!0,interval:e}}},{key:"stopLocalAudioLevelObserver",value:(U=o((function*(){Fs(),this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})})),function(){return U.apply(this,arguments)})},{key:"startRemoteParticipantsAudioLevelObserver",value:function(e){var t=this;if(Fs(),this.validateAudioLevelInterval(e),this._dailyMainExecuted)return new Promise((function(n,r){t.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:e},(function(e){e.error?r({error:e.error}):n()}))}));this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:e}}},{key:"stopRemoteParticipantsAudioLevelObserver",value:(B=o((function*(){Fs(),this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})})),function(){return B.apply(this,arguments)})},{key:"startCamera",value:(j=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(xs(this._callObjectMode,"startCamera()"),Is(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),Rs(this._testCallInProgress,"startCamera()"),this.needsLoad())try{yield this.load(t)}catch(e){return Promise.reject(e)}else{if(this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(t),this.properties=ps(ps({},this.properties),t)}return new Promise((function(t){e.sendMessageToCallMachine({action:"start-camera",properties:Ls(e.properties),preloadCache:Ls(e._preloadCache)},(function(e){delete e.action,delete e.callbackStamp,t(e)}))}))})),function(){return j.apply(this,arguments)})},{key:"validateCustomTrack",value:function(e,t,n){if(n&&n.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(t&&"music"!==t&&"speech"!==t&&!(t instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(n&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(n))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(e instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{track,mode,trackName};return Fs(),Ps(this._callState,"startCustomTrack()"),this.validateCustomTrack(t.track,t.mode,t.trackName),new Promise((function(n,r){window._dailyPreloadCache.customTrack=t.track,t.track=ro,e.sendMessageToCallMachine({action:"start-custom-track",properties:t},(function(e){e.error?r({error:e.error}):n(e.mediaTag)}))}))}},{key:"stopCustomTrack",value:function(e){var t=this;return Fs(),Ps(this._callState,"stopCustomTrack()"),new Promise((function(n){t.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:e},(function(e){n(e.mediaTag)}))}))}},{key:"setCamera",value:function(e){var t=this;return Bs(),Ns(this._dailyMainExecuted,"setCamera()"),new Promise((function(n){t.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:e},(function(e){n({device:e.device})}))}))}},{key:"setAudioDevice",value:(x=o((function*(e){return Bs(),this.nativeUtils().setAudioDevice(e),{deviceId:yield this.nativeUtils().getAudioDevice()}})),function(e){return x.apply(this,arguments)})},{key:"cycleCamera",value:function(){var e=this;return new Promise((function(t){e.sendMessageToCallMachine({action:"cycle-camera"},(function(e){t({device:e.device})}))}))}},{key:"cycleMic",value:function(){var e=this;return Fs(),new Promise((function(t){e.sendMessageToCallMachine({action:"cycle-mic"},(function(e){t({device:e.device})}))}))}},{key:"getCameraFacingMode",value:function(){var e=this;return Bs(),new Promise((function(t){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},(function(e){t(e.facingMode)}))}))}},{key:"setInputDevicesAsync",value:(R=o((function*(e){var t=this,n=e.audioDeviceId,r=e.videoDeviceId,i=e.audioSource,o=e.videoSource;return Fs(),void 0!==i&&(n=i),void 0!==o&&(r=o),n&&(this._preloadCache.audioDeviceId=n),r&&(this._preloadCache.videoDeviceId=r),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(n instanceof MediaStreamTrack&&(n=ro),r instanceof MediaStreamTrack&&(r=ro),new Promise((function(e){t.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:n,videoDeviceId:r},(function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?e({camera:{deviceId:t._preloadCache.videoDeviceId},mic:{deviceId:t._preloadCache.audioDeviceId},speaker:{deviceId:t._preloadCache.outputDeviceId}}):e(n)}))})))})),function(e){return R.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(N=o((function*(e){var t=this,n=e.outputDeviceId;return Fs(),n&&(this._preloadCache.outputDeviceId=n),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise((function(e){t.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:n},(function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?e({camera:{deviceId:t._preloadCache.videoDeviceId},mic:{deviceId:t._preloadCache.audioDeviceId},speaker:{deviceId:t._preloadCache.outputDeviceId}}):e(n)}))}))})),function(e){return N.apply(this,arguments)})},{key:"getInputDevices",value:(I=o((function*(){var e=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise((function(t){e.sendMessageToCallMachine({action:"get-input-devices"},(function(n){delete n.action,delete n.callbackStamp,n.returnPreloadCache?t({camera:{deviceId:e._preloadCache.videoDeviceId},mic:{deviceId:e._preloadCache.audioDeviceId},speaker:{deviceId:e._preloadCache.outputDeviceId}}):t(n)}))}))})),function(){return I.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Bs(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(Bs(),[vs,_s].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&Ds(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:(D=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(xs(this._callObjectMode,"preAuth()"),Is(this._callState,this._isPreparingToJoin,"preAuth()"),Rs(this._testCallInProgress,"preAuth()"),this.needsLoad()&&(yield this.load(t)),!t.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(t),this.properties=ps(ps({},this.properties),t),new Promise((function(t,n){e.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ls(e.properties),preloadCache:Ls(e._preloadCache)},(function(r){return r.error?n(r.error):r.access?(e._didPreAuth=!0,void t({access:r.access})):n(new Error("unknown error in preAuth()"))}))}))})),function(){return D.apply(this,arguments)})},{key:"load",value:(P=o((function*(e){var t=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(e&&(this.validateProperties(e),this.properties=ps(ps({},this.properties),e)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");this._updateCallState(dr);try{this.emit(Kr,{action:Kr})}catch(e){console.log("could not emit 'loading'",e)}return this._callObjectMode?new Promise((function(e,n){t._callObjectLoader.cancel();var r=Date.now();t._callObjectLoader.load(t._callFrameId,t.properties.dailyConfig&&t.properties.dailyConfig.avoidEval,(function(n){t._bundleLoadTime=n?"no-op":Date.now()-r,t._updateCallState(hr),n&&t.emit(Xr,{action:Xr}),e()}),(function(e,r){if(t.emit(Qr,{action:Qr,errorMsg:e}),!r){t._updateCallState(gr),t.resetMeetingDependentVars();var i={action:Ki,errorMsg:e,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:new Error(e),bundleUrl:te()}}};t._maybeSendToSentry(i),t.emit(Ki,i),n(e)}}))})):(this._iframe.src=ee(this.assembleMeetingUrl()),new Promise((function(e,n){t._loadedCallback=function(r){if(t._callState!==gr){for(var i in t._updateCallState(hr),(t.properties.cssFile||t.properties.cssText)&&t.loadCss(t.properties),t._inputEventsOn)t.sendMessageToCallMachine({action:eo,on:i});e()}else n(r)}})))}})),function(e){return P.apply(this,arguments)})},{key:"join",value:(L=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rs(this._testCallInProgress,"join()");var n=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(t)}catch(e){return this.updateIsPreparingToJoin(!1),Promise.reject(e)}}else{if(n=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(t.url&&!this._callObjectMode&&t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(t),this.properties=ps(ps({},this.properties),t)}if(void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._callState===fr||this._callState===pr)return console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1);this._updateCallState(pr,!1);try{this.emit(ti,{action:ti})}catch(e){console.log("could not emit 'joining-meeting'",e)}return this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),t.inputSettings&&t.inputSettings.audio&&(this._preloadCache.inputSettings.audio=t.inputSettings.audio),t.inputSettings&&t.inputSettings.video&&(this._preloadCache.inputSettings.video=t.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ls(this.properties),preloadCache:Ls(this._preloadCache)}),new Promise((function(t,r){e._joinedCallback=function(i,o){if(e._callState!==gr){if(e._updateCallState(fr),i)for(var s in i)e._callObjectMode&&(zo(i[s]),Ko(i[s]),Xo(i[s],e._participants[s])),e._participants[s]=ps({},i[s]),e.toggleParticipantAudioBasedOnNativeAudioFocus();n&&e.loadCss(e.properties),t(i)}else r(o)}}))})),function(){return L.apply(this,arguments)})},{key:"leave",value:(O=o((function*(){var e=this;return Rs(this._testCallInProgress,"leave()"),new Promise((function(t){if(e._callState===mr||e._callState===gr)t();else if(e._callObjectLoader&&!e._callObjectLoader.loaded){e._callObjectLoader.cancel(),e._updateCallState(mr),e.resetMeetingDependentVars();try{e.emit(mr,{action:mr})}catch(e){console.log("could not emit 'left-meeting'",e)}t()}else e._resolveLeave=t,e.sendMessageToCallMachine({action:"leave-meeting"})}))})),function(){return O.apply(this,arguments)})},{key:"startScreenShare",value:(A=o((function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ns(this._dailyMainExecuted,"startScreenShare()"),t.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",t.screenVideoSendSettings),t.mediaStream&&(this._preloadCache.screenMediaStream=t.mediaStream,t.mediaStream=ro),"undefined"!=typeof DailyNativeUtils&&void 0!==DailyNativeUtils.isIOS&&DailyNativeUtils.isIOS){var n=this.nativeUtils();if(yield n.isScreenBeingCaptured())return void this.emit(zi,{action:zi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});n.setSystemScreenCaptureStartCallback((function(){n.setSystemScreenCaptureStartCallback(null),e.sendMessageToCallMachine({action:Zi,captureOptions:t})})),n.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Zi,captureOptions:t})})),function(){return A.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Ns(this._dailyMainExecuted,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(ps({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:n,instanceId:r})}},{key:"stopRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(ps({action:"local-recording-stop"},e))}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(ps({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:n,instanceId:r})}},{key:"addLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:to,endpointsOp:"add-endpoints",endpoints:t,instanceId:n})}},{key:"removeLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:to,endpointsOp:"remove-endpoints",endpoints:t,instanceId:n})}},{key:"stopLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(ps({action:"daily-method-stop-live-streaming"},e))}},{key:"validateDailyConfig",value:function(e){e.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(e.camSimulcastEncodings)),e.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings.")}},{key:"validateSimulcastEncodings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(!(e instanceof Array))throw new Error("encodings must be an Array");if(!Qs(e.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var r=0;r<e.length;r++){var i=e[r];for(var o in this._validateEncodingLayerHasValidProperties(i),i){if(!Ss.includes(o))throw new Error("Invalid key ".concat(o,", valid keys are:")+Object.values(Ss));if("number"!=typeof i[o])throw new Error("".concat(o," must be a number"));if(t){var s=t[o],a=s.min,c=s.max;if(!Qs(i[o],a,c))throw new Error("".concat(o," value not in range. valid range: ").concat(a," to ").concat(c))}}if(n&&!i.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(M=o((function*(e){var t=this,n=e.url,r=e.settings,i=void 0===r?{state:so.PLAY}:r;try{!function(e){if("string"!=typeof e)throw new Error('url parameter must be "string" type')}(n),Ks(i),function(e){for(var t in e)if(!Es.includes(t))throw new Error("Invalid key ".concat(t,", valid keys are: ").concat(Es));e.simulcastEncodings&&this.validateSimulcastEncodings(e.simulcastEncodings,ws,!0)}(i)}catch(e){throw console.error("invalid argument Error: ".concat(e)),console.error('startRemoteMediaPlayer arguments must be of the form:\n { url: "playback url",\n settings?:\n {state: "play"|"pause", simulcastEncodings?: [{}] } }'),e}return new Promise((function(e,r){t.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:n,settings:i},(function(t){t.error?r({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})}))}))})),function(e){return M.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(C=o((function*(e){var t=this;if("string"!=typeof e)throw new Error(" remotePlayerID must be of type string");return new Promise((function(n,r){t.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:e},(function(e){e.error?r({error:e.error,errorMsg:e.errorMsg}):n()}))}))})),function(e){return C.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(T=o((function*(e){var t=this,n=e.session_id,r=e.settings;try{Ks(r)}catch(e){throw console.error("invalid argument Error: ".concat(e)),console.error('updateRemoteMediaPlayer arguments must be of the form:\n session_id: "participant session",\n { settings?: {state: "play"|"pause"} }'),e}return new Promise((function(e,i){t.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:n,settings:r},(function(t){t.error?i({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})}))}))})),function(e){return T.apply(this,arguments)})},{key:"startTranscription",value:function(e){this.sendMessageToCallMachine(ps({action:"daily-method-start-transcription"},e))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(k=o((function*(e){var t=this;Ps(this._callState,"startDialOut()");var n=function(e){if(e){if(!Array.isArray(e))throw new Error("Error starting dial out: audio codec must be an array");if(e.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");e.forEach((function(e){if("string"!=typeof e)throw new Error("Error starting dial out: audio codec must be a string");if("OPUS"!==e&&"PCMU"!==e&&"PCMA"!==e&&"G722"!==e)throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")}))}};if(!e.sipUri&&!e.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(e.sipUri&&e.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(e.sipUri){if("string"!=typeof e.sipUri)throw new Error("Error starting dial out: sipUri must be a string");if(!e.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(e.video&&"boolean"!=typeof e.video)throw new Error("Error starting dial out: video must be a boolean value");!function(e){if(e&&(n(e.audio),e.video)){if(!Array.isArray(e.video))throw new Error("Error starting dial out: video codec must be an array");if(e.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");e.video.forEach((function(e){if("string"!=typeof e)throw new Error("Error starting dial out: video codec must be a string");if("H264"!==e&&"VP8"!==e)throw new Error("Error starting dial out: video codec must be H264 or VP8")}))}}(e.codecs)}if(e.phoneNumber){if("string"!=typeof e.phoneNumber)throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(e.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");e.codecs&&n(e.codecs.audio)}return new Promise((function(n,r){t.sendMessageToCallMachine(ps({action:"dialout-start"},e),(function(e){e.error?r(e.error):n(e)}))}))})),function(e){return k.apply(this,arguments)})},{key:"stopDialOut",value:function(e){var t=this;return Ps(this._callState,"stopDialOut()"),new Promise((function(n,r){t.sendMessageToCallMachine(ps({action:"dialout-stop"},e),(function(e){e.error?r(e.error):n(e)}))}))}},{key:"sendDTMF",value:(E=o((function*(e){var t=this;return Ps(this._callState,"sendDTMF()"),function(e){var t=e.sessionId,n=e.tones;if(!t||!n)throw new Error("sessionId and tones are mandatory parameter");if("string"!=typeof t||"string"!=typeof n)throw new Error("sessionId and tones should be of string type");if(n.length>20)throw new Error("tones string must be upto 20 characters");var r=n.match(/[^0-9A-D*#]/g);if(r&&r[0])throw new Error("".concat(r[0]," is not valid DTMF tone"))}(e),new Promise((function(n,r){t.sendMessageToCallMachine(ps({action:"send-dtmf"},e),(function(e){e.error?r(e.error):n(e)}))}))})),function(e){return E.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var e=this;return this._callState!==fr?{stats:{latest:{}}}:new Promise((function(t){e.sendMessageToCallMachine({action:"get-calc-stats"},(function(n){t(ps({stats:n.stats},e._network))}))}))}},{key:"testWebsocketConnectivity",value:(S=o((function*(){var e=this;if(Rs(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}return new Promise((function(t,n){e.sendMessageToCallMachine({action:"test-websocket-connectivity"},(function(e){e.error?n(e.error):t(e.results)}))}))})),function(){return S.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(e){return e?e instanceof MediaStreamTrack?!!function(e,t){return e&&"live"===e.readyState&&!function(e,t){return(!t.isLocalScreenVideo||"Chrome"!==yo())&&e.muted&&!cs.has(e.id)}(e,{isLocalScreenVideo:false})}(e)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(w=o((function*(e){var t=this;if(function(e){var t=arguments.length>2?arguments[2]:void 0;if(e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," can not be called after preAuth(), startCamera(), or join() and call state has been initialized.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}(this._dailyMainExecuted,"testCallQuality()"),e.videoTrack&&!this._validateVideoTrackForNetworkTests(e.videoTrack))throw new Error("Video track error");var n=this._testCallAlreadyInProgress,i=function(e){n||(t._testCallInProgress=e)};i(!0);var o=e.videoTrack,s=r(e,ls);if(this._preloadCache.videoTrackForConnectionQualityTest=o,this.needsLoad())try{var a=this._callState;yield this.load(),this._callState=a}catch(e){return i(!1),Promise.reject(e)}return new Promise((function(e){t.sendMessageToCallMachine(ps(ps({action:"test-call-quality"},s),{},{dailyJsVersion:t.properties.dailyJsVersion}),(function(n){var o=n.results,s=o.result,a=r(o,us);if("failed"===s){var c,l=ps({},a);null!==(c=a.error)&&void 0!==c&&c.details?(a.error.details=JSON.parse(a.error.details),l.error=ps(ps({},l.error),{},{details:ps({},l.error.details)}),l.error.details.duringTest="testCallQuality"):(l.error=l.error?ps({},l.error):{},l.error.details={duringTest:"testCallQuality"}),t._maybeSendToSentry(l)}i(!1),e(ps({result:s},a))}))}))})),function(e){return w.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(y=o((function*(e){console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead");var t=yield this.testPeerToPeerCallQuality(e),n={result:t.result,secondsElapsed:t.secondsElapsed};return t.data&&(n.data={maxRTT:t.data.maxRoundTripTime,packetLoss:t.data.avgRecvPacketLoss}),n})),function(e){return y.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(v=o((function*(e){var t=this;if(Rs(this._testCallInProgress,"testConnectionQuality()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}var n=e.videoTrack,r=e.duration;if(!this._validateVideoTrackForNetworkTests(n))throw new Error("Video track error");return this._preloadCache.videoTrackForConnectionQualityTest=n,new Promise((function(e,n){t.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:r},(function(t){t.error?n(t.error):e(t.results)}))}))})),function(e){return v.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){console.warn("stopTestConnectionQuality() is deprecated: use stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(m=o((function*(e){var t=this;if(Rs(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(e){return Promise.reject(e)}if(!this._validateVideoTrackForNetworkTests(e))throw new Error("Video track error");return this._preloadCache.videoTrackForNetworkConnectivityTest=e,new Promise((function(e,n){t.sendMessageToCallMachine({action:"test-network-connectivity"},(function(t){t.error?n(t.error):e(t.results)}))}))})),function(e){return m.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var e=this;return new Promise((function(t,n){e._callState===fr?e.sendMessageToCallMachine({action:"get-cpu-load-stats"},(function(e){t(e.cpuStats)})):t({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})}))}},{key:"_validateEncodingLayerHasValidProperties",value:function(e){var t;if(!((null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Ss))}},{key:"_validateVideoSendSettings",value:function(e,t){var n="screenVideo"===e?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],r="Video send settings should be either an object or one of the supported presets: ".concat(n.join());if("string"==typeof t){if(!n.includes(t))throw new Error(r)}else{if("object"!==a(t))throw new Error(r);if(!t.maxQuality&&!t.encodings&&void 0===t.allowAdaptiveLayers)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(t.maxQuality&&-1===["low","medium","high"].indexOf(t.maxQuality))throw new Error("maxQuality must be either low, medium or high");if(t.encodings){var i=!1;switch(Object.keys(t.encodings).length){case 1:i=!t.encodings.low;break;case 2:i=!t.encodings.low||!t.encodings.medium;break;case 3:i=!t.encodings.low||!t.encodings.medium||!t.encodings.high;break;default:i=!0}if(i)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");t.encodings.low&&this._validateEncodingLayerHasValidProperties(t.encodings.low),t.encodings.medium&&this._validateEncodingLayerHasValidProperties(t.encodings.medium),t.encodings.high&&this._validateEncodingLayerHasValidProperties(t.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(e){var t=this;if(!e||0===Object.keys(e).length)throw new Error("Send settings must contain at least information for one track!");Object.entries(e).forEach((function(e){var n=_(e,2),r=n[0],i=n[1];t._validateVideoSendSettings(r,i)}))}},{key:"updateSendSettings",value:function(e){var t=this;return this.validateUpdateSendSettings(e),this.needsLoad()?(this._preloadCache.sendSettings=e,{sendSettings:this._preloadCache.sendSettings}):new Promise((function(n,r){t.sendMessageToCallMachine({action:"update-send-settings",sendSettings:e},(function(e){e.error?r(e.error):n(e.sendSettings)}))}))}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return Fs(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return Fs(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return Fs(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){return Ps(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:(f=o((function*(){var e=this;if(this._callObjectMode){var t=yield navigator.mediaDevices.enumerateDevices();return"Firefox"===yo()&&bo().major>115&&(t=t.filter((function(e){return"audiooutput"!==e.kind}))),{devices:t.map((function(e){return JSON.parse(JSON.stringify(e))}))}}return new Promise((function(t){e.sendMessageToCallMachine({action:"enumerate-devices"},(function(e){t({devices:e.devices})}))}))})),function(){return f.apply(this,arguments)})},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(Ps(this._callState,"sendAppMessage()"),JSON.stringify(e).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return Fs(),Ps(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(ps({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return js(this._callObjectMode,"setShowNamesMode()"),Fs(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return js(this._callObjectMode,"setShowLocalVideo()"),Fs(),Ps(this._callState,"setShowLocalVideo()"),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return js(this._callObjectMode,"showLocalVideo()"),Fs(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return js(this._callObjectMode,"setShowParticipantsBar()"),Fs(),Ps(this._callState,"setShowParticipantsBar()"),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return js(this._callObjectMode,"showParticipantsBar()"),Fs(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return Fs(),js(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(e){return Fs(),js(this._callObjectMode,"setCustomIntegrations()"),Ps(this._callState,"setCustomIntegrations()"),Hs(e)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:e}),this._customIntegrations=e,this):this}},{key:"startCustomIntegrations",value:function(e){var t=this;if(Fs(),js(this._callObjectMode,"startCustomIntegrations()"),Ps(this._callState,"startCustomIntegrations()"),Array.isArray(e)&&e.some((function(e){return"string"!=typeof e}))||!Array.isArray(e)&&"string"!=typeof e)return console.error("startCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter((function(e){return!(e in t._customIntegrations)}));return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:n}),this)}},{key:"stopCustomIntegrations",value:function(e){var t=this;if(Fs(),js(this._callObjectMode,"stopCustomIntegrations()"),Ps(this._callState,"stopCustomIntegrations()"),Array.isArray(e)&&e.some((function(e){return"string"!=typeof e}))||!Array.isArray(e)&&"string"!=typeof e)return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter((function(e){return!(e in t._customIntegrations)}));return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:n}),this)}},{key:"customTrayButtons",value:function(){return js(this._callObjectMode,"customTrayButtons()"),Fs(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(e){return js(this._callObjectMode,"updateCustomTrayButtons()"),Fs(),Ps(this._callState,"updateCustomTrayButtons()"),Ws(e)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:e}),this._customTrayButtons=e,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(Ts))),this)}},{key:"theme",value:function(){return js(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return js(this._callObjectMode,"setTheme()"),new Promise((function(n,r){try{t.validateProperties({theme:e}),t.properties.theme=ps({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emit(zr,{action:zr,theme:t.properties.theme})}catch(e){console.log("could not emit 'theme-updated'",e)}n(t.properties.theme)}catch(e){r(e)}}))}},{key:"requestFullscreen",value:(h=o((function*(){if(Fs(),this._iframe&&!document.fullscreenElement&&po())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(e){console.log("could not make video call fullscreen",e)}})),function(){return h.apply(this,arguments)})},{key:"exitFullscreen",value:function(){Fs(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(l=o((function*(){var e=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise((function(t){e.sendMessageToCallMachine({action:"get-sidebar-view"},(function(e){t(e.view)}))}))})),function(){return l.apply(this,arguments)})},{key:"setSidebarView",value:function(e){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:e}),this)}},{key:"room",value:(c=o((function*(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeRoomConfigDefaults,n=void 0===t||t;return this._accessState.access===Er||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise((function(t){e.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},(function(e){delete e.action,delete e.callbackStamp,t(e)}))}))})),function(){return c.apply(this,arguments)})},{key:"geo",value:(i=o((function*(){try{var e=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield e.json()).geo}}catch(e){return console.error("geo lookup failed",e),{current:""}}})),function(){return i.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=o((function*(e){var t=this;return Fs(),Ps(this._callState,"setNetworkTopology()"),new Promise((function(n,r){t.sendMessageToCallMachine({action:"set-network-topology",opts:e},(function(e){e.error?r({error:e.error}):n({workerId:e.workerId})}))}))})),function(e){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=o((function*(){var e=this;return new Promise((function(t,n){e.needsLoad()&&t({topology:"none"}),e.sendMessageToCallMachine({action:"get-network-topology"},(function(e){e.error?n({error:e.error}):t({topology:e.topology})}))}))})),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(e){if(Fs(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(e,t){return this._inputEventsOn[e]={},this.sendMessageToCallMachine({action:eo,on:e}),b.prototype.on.call(this,e,t)}},{key:"once",value:function(e,t){return this._inputEventsOn[e]={},this.sendMessageToCallMachine({action:eo,on:e}),b.prototype.once.call(this,e,t)}},{key:"off",value:function(e,t){return delete this._inputEventsOn[e],this.isDestroyed()||this.sendMessageToCallMachine({action:eo,off:e}),b.prototype.off.call(this,e,t)}},{key:"validateProperties",value:function(e){for(var t in e){if(!Ms[t])throw new Error("unrecognized property '".concat(t,"'"));if(Ms[t].validate&&!Ms[t].validate(e[t],this))throw new Error("property '".concat(t,"': ").concat(Ms[t].help))}}},{key:"assembleMeetingUrl",value:function(){var e,t,n=ps(ps({},this.properties),{},{emb:this._callFrameId,embHref:encodeURIComponent(window.location.href),proxy:null!==(e=window._dailyConfig)&&void 0!==e&&e.proxyUrl?encodeURIComponent(null===(t=window._dailyConfig)||void 0===t?void 0:t.proxyUrl):void 0}),r=n.url.match(/\?/)?"&":"?";return n.url+r+Object.keys(Ms).filter((function(e){return Ms[e].queryString&&void 0!==n[e]})).map((function(e){return"".concat(Ms[e].queryString,"=").concat(n[e])})).join("&")}},{key:"needsLoad",value:function(){return[ur,dr,mr,gr].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(e,t){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(e,t,this._iframe,this._callFrameId)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this._callFrameId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this._callFrameId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case Wr:this.sendMessageToCallMachine(ps({action:Hr},this.properties));break;case"daily-main-executed":this._dailyMainExecuted=!0;var t={action:no,level:"log",code:1011,stats:{event:"bundle load",time:"no-op"===this._bundleLoadTime?0:this._bundleLoadTime,preLoaded:"no-op"===this._bundleLoadTime,url:te()}};this.sendMessageToCallMachine(t),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Xr:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case ni:this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case oi:case si:if(this._callState===mr)return;if(e.participant&&e.participant.session_id){var n=e.participant.local?"local":e.participant.session_id;this._callObjectMode&&(zo(e.participant),Ko(e.participant),Xo(e.participant,this._participants[n]));try{this.maybeParticipantTracksStopped(this._participants[n],e.participant),this.maybeParticipantTracksStarted(this._participants[n],e.participant),this.maybeEventRecordingStopped(this._participants[n],e.participant),this.maybeEventRecordingStarted(this._participants[n],e.participant)}catch(e){console.error("track events error",e)}if(!this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[n])){this._participants[n]=ps({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus();try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}}break;case ai:if(e.participant&&e.participant.session_id){var i=this._participants[e.participant.session_id];i&&this.maybeParticipantTracksStopped(i,null),delete this._participants[e.participant.session_id];try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case ci:if(!F(this._participantCounts,e.participantCounts)){this._participantCounts=e.participantCounts;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case li:var o={access:e.access};if(e.awaitingAccess&&(o.awaitingAccess=e.awaitingAccess),!F(this._accessState,o)){this._accessState=o;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case ui:if(e.meetingSession){this._meetingSessionSummary=e.meetingSession;try{delete e.callFrameId,this.emit(e.action,e);var s=ps(ps({},e),{},{action:"meeting-session-updated"});this.emit(s.action,s)}catch(t){console.log("could not emit",e,t)}}break;case Ki:var a;this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this._updateCallState(gr),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),e.preserveIframe;var c=r(e,ds);null!=c&&null!==(a=c.error)&&void 0!==a&&a.details&&(c.error.details=JSON.parse(c.error.details)),this._maybeSendToSentry(e),this._joinedCallback&&(this._joinedCallback(null,c),this._joinedCallback=null);try{this.emit(e.action,c)}catch(t){console.log("could not emit",e,t)}break;case ri:this._callState!==gr&&this._updateCallState(mr),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null);try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"selected-devices-updated":if(e.devices)try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case ji:var l=e.threshold,u=e.quality;if(l!==this._network.threshold||u!==this._network.quality){this._network.quality=u,this._network.threshold=l;try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}break;case Bi:if(e&&e.cpuLoadState)try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case Ri:var d=e.activeSpeaker;if(this._activeSpeaker.peerId!==d.peerId){this._activeSpeaker.peerId=d.peerId;try{this.emit(e.action,{action:e.action,activeSpeaker:this._activeSpeaker})}catch(t){console.log("could not emit",e,t)}}break;case"show-local-video-changed":if(this._callObjectMode)return;var h=e.show;this._showLocalVideo=h;try{this.emit(e.action,{action:e.action,show:h})}catch(t){console.log("could not emit",e,t)}break;case xi:var p=e.enabled;if(this._activeSpeakerMode!==p){this._activeSpeakerMode=p;try{this.emit(e.action,{action:e.action,enabled:this._activeSpeakerMode})}catch(t){console.log("could not emit",e,t)}}break;case pi:case fi:case mi:this._waitingParticipants=e.allWaitingParticipants;try{this.emit(e.action,{action:e.action,participant:e.participant})}catch(t){console.log("could not emit",e,t)}break;case Wi:if(!F(this._receiveSettings,e.receiveSettings)){this._receiveSettings=e.receiveSettings;try{this.emit(e.action,{action:e.action,receiveSettings:e.receiveSettings})}catch(t){console.log("could not emit",e,t)}}break;case Hi:if(!F(this._inputSettings,e.inputSettings)){var f=this._getInputSettings();if(this._inputSettings=e.inputSettings,this._preloadCache.inputSettings={},!F(f,this._getInputSettings()))try{this.emit(e.action,{action:e.action,inputSettings:this._getInputSettings()})}catch(t){console.log("could not emit",e,t)}}break;case"send-settings-updated":if(!F(this._sendSettings,e.sendSettings)){this._sendSettings=e.sendSettings,this._preloadCache.sendSettings=null;try{this.emit(e.action,{action:e.action,sendSettings:e.sendSettings})}catch(t){console.log("could not emit",e,t)}}break;case"local-audio-level":this._localAudioLevel=e.audioLevel,this.emitDailyJSEvent(e);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=e.participantsAudioLevel,this.emitDailyJSEvent(e);break;case Oi:var m=e.session_id;this._rmpPlayerState[m]=e.playerState,this.emitDailyJSEvent(e);break;case Pi:delete this._rmpPlayerState[e.session_id],this.emitDailyJSEvent(e);break;case Li:var g=e.session_id,v=this._rmpPlayerState[g];v&&this.compareEqualForRMPUpdateEvent(v,e.remoteMediaPlayerState)||(this._rmpPlayerState[g]=e.remoteMediaPlayerState,this.emitDailyJSEvent(e));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(e);break;case di:var _=this._meetingSessionState.topology!==(e.meetingSessionState&&e.meetingSessionState.topology);this._meetingSessionState=Xs(e.meetingSessionState,this._callObjectMode),(this._callObjectMode||_)&&this.emitDailyJSEvent(e);break;case wi:case Si:case Ei:case ki:case Ti:case _i:case yi:case bi:case Zr:case ei:case Mi:case Ai:case Di:case Ii:case Ni:case Fi:case Ci:case Yi:case Gi:case qi:case $i:case zi:case Ji:case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-error":case"dialout-stopped":case"dialout-warning":try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var n="record";if(e&&!t.local&&!1===t[n]&&e[n]!==t[n])try{this.emit(Si,{action:Si})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventRecordingStarted",value:function(e,t){var n="record";if(e&&!t.local&&!0===t[n]&&e[n]!==t[n])try{this.emit(wi,{action:wi})}catch(e){console.log("could not emit",e)}}},{key:"maybeEventTrackStopped",value:function(e,t,n,r){if(e&&("ended"===e.readyState||!t||e.id!==t.id))try{this.emit(vi,{action:vi,track:e,participant:n,type:r})}catch(e){console.log("maybeEventTrackStopped: could not emit",e)}}},{key:"maybeEventTrackStarted",value:function(e,t,n,r){if(t&&(!e||"ended"===e.readyState||t.id!==e.id))try{this.emit(gi,{action:gi,track:t,participant:n,type:r})}catch(e){console.log("maybeEventTrackStarted: could not emit",e)}}},{key:"maybeParticipantTracksStopped",value:function(e,t){if(e)for(var n in e.tracks)this.maybeEventTrackStopped(e.tracks[n].track,t&&t.tracks[n]?t.tracks[n].track:null,t,n)}},{key:"maybeParticipantTracksStarted",value:function(e,t){if(t)for(var n in t.tracks)this.maybeEventTrackStarted(e&&e.tracks[n]?e.tracks[n].track:null,t.tracks[n].track,t,n)}},{key:"compareEqualForRMPUpdateEvent",value:function(e,t){var n,r;return e.state===t.state&&(null===(n=e.settings)||void 0===n?void 0:n.volume)===(null===(r=t.settings)||void 0===r?void 0:r.volume)}},{key:"emitDailyJSEvent",value:function(e){try{this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!(!F(e,t)||e.videoTrack&&t.videoTrack&&(e.videoTrack.id!==t.videoTrack.id||e.videoTrack.muted!==t.videoTrack.muted||e.videoTrack.enabled!==t.videoTrack.enabled)||e.audioTrack&&t.audioTrack&&(e.audioTrack.id!==t.audioTrack.id||e.audioTrack.muted!==t.audioTrack.muted||e.audioTrack.enabled!==t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return lo()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this._updateCallState(this._callState,e)}},{key:"_updateCallState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._callState||t!==this._isPreparingToJoin){var n=this._callState,r=this._isPreparingToJoin;this._callState=e,this._isPreparingToJoin=t;var i=Ds(n,r),o=Ds(this._callState,this._isPreparingToJoin);i!==o&&(this.updateKeepDeviceAwake(o),this.updateDeviceAudioMode(o),this.updateShowAndroidOngoingMeetingNotification(o),this.updateNoOpRecordingEnsuringBackgroundContinuity(o))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=bs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Er},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Xs(ys,this._callObjectMode),this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._remoteParticipantsAudioLevel={},this._dailyMainExecuted=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){lo()&&this.nativeUtils().setKeepDeviceAwake(e,this._callFrameId)}},{key:"updateDeviceAudioMode",value:function(e){if(lo()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(lo()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,n,r,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var o=this.properties.reactNativeConfig.androidInCallNotification;t=o.title,n=o.subtitle,r=o.iconName,i=o.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,n,r,this._callFrameId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){lo()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){if(lo()){var e=window.store.getState();for(var t in e.streams){var n=e.streams[t];n&&n.pendingTrack&&"audio"===n.pendingTrack.kind&&(n.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}},{key:"_logCallQualityTestResults",value:function(e){if(this._dailyMainExecuted){var t={action:no,level:"info",code:1012,results:e};this.sendMessageToCallMachine(t)}else console.warn("_logCallQualityTestResults() must be called after daily initialization")}},{key:"_logUseAfterDestroy",value:function(){if(this.needsLoad())if(as&&!as.needsLoad()){var e={action:no,level:"error",code:this.strictMode?9995:9997};as.sendMessageToCallMachine(e)}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 t={action:no,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(t,null,this._iframe,this._callFrameId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var e=as._dailyMainExecuted?as:this._dailyMainExecuted?this:void 0;e?e.sendMessageToCallMachine({action:no,level:"error",code:this.strictMode?9990:9992}):(this._delayDuplicateInstanceLog=!0,as._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(e){var t,n,r,i,o,s;if(null===(t=e.error)||void 0===t||!t.type||["connection-error","end-of-life","no-room"].includes(e.error.type)){var a=null!==(n=this.properties)&&void 0!==n&&n.url?new URL(this.properties.url):void 0,c="production";a&&a.host.includes(".staging.daily")&&(c="staging");var l,u,d,h,p,f=new Bn({dsn:"https://[email protected]/168844",transport:Vn,integrations:[new lr.GlobalHandlers({onunhandledrejection:!1})],environment:c}),m=new Qt(f,void 0,Z.version());if(this.session_id&&m.setExtra("sessionId",this.session_id),this.properties){var g=ps({},this.properties);g.userName=g.userName?"[Filtered]":void 0,g.userData=g.userData?"[Filtered]":void 0,g.token=g.token?"[Filtered]":void 0,m.setExtra("properties",g)}if(a){var v=a.searchParams.get("domain");if(!v){var _=a.host.match(/(.*?)\./);v=_&&_[1]||""}v&&m.setTag("domain",v)}e.error&&(m.setTag("fatalErrorType",e.error.type),m.setExtra("errorDetails",e.error.details),(null===(l=e.error.details)||void 0===l?void 0:l.uri)&&m.setTag("serverAddress",e.error.details.uri),(null===(u=e.error.details)||void 0===u?void 0:u.workerGroup)&&m.setTag("workerGroup",e.error.details.workerGroup),(null===(d=e.error.details)||void 0===d?void 0:d.geoGroup)&&m.setTag("geoGroup",e.error.details.geoGroup),(null===(h=e.error.details)||void 0===h?void 0:h.bundleUrl)&&m.setTag("bundleUrl",e.error.details.bundleUrl),(null===(p=e.error.details)||void 0===p?void 0:p.on)&&m.setTag("connectionAttempt",e.error.details.on)),m.setTags({callMode:this._callObjectMode?lo()?"reactNative":null!==(r=this.properties)&&void 0!==r&&null!==(i=r.dailyConfig)&&void 0!==i&&null!==(o=i.callMode)&&void 0!==o&&o.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:Z.version()});var y=(null===(s=e.error)||void 0===s?void 0:s.msg)||e.errorMsg;m.run((function(e){e.captureException(new Error(y))}))}}}],[{key:"supportedBrowser",value:function(){if(lo())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var e=Q.getParser(co());return{supported:!!vo(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsFullscreen:!!po(),supportsScreenShare:!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!0}(yo(),bo())||lo())),supportsSfu:!!vo(),supportsVideoProcessing:fo(),supportsAudioProcessing:go()}}},{key:"version",value:function(){return"0.58.0"}},{key:"createCallObject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.layout="none",new Z(null,e)}},{key:"wrap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Fs(),!e||!e.contentWindow||"string"!=typeof e.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return t.layout||(t.customLayout?t.layout="custom-v1":t.layout="browser"),new Z(e,t)}},{key:"createFrame",value:function(e,t){var n,r;Fs(),e&&t?(n=e,r=t):e&&e.append?(n=e,r={}):(n=document.body,r=e||{});var i=r.iframeStyle;i||(i=n===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",o.style.visibility="hidden",n.appendChild(o),o.style.visibility=null,Object.keys(i).forEach((function(e){return o.style[e]=i[e]})),r.layout||(r.customLayout?r.layout="custom-v1":r.layout="browser");try{return new Z(o,r)}catch(e){throw n.removeChild(o),e}}},{key:"createTransparentFrame",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Fs();var t=document.createElement("iframe");return t.allow="microphone; camera; autoplay",t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(t),e.layout||(e.layout="custom-v1"),Z.wrap(t,e)}},{key:"getCallInstance",value:function(){return as}}]),Z}();function Ls(e){var t={};for(var n in e)e[n]instanceof MediaStreamTrack?t[n]=ro:"dailyConfig"===n?(e[n].modifyLocalSdpHook&&(window._dailyConfig&&(window._dailyConfig.modifyLocalSdpHook=e[n].modifyLocalSdpHook),delete e[n].modifyLocalSdpHook),e[n].modifyRemoteSdpHook&&(window._dailyConfig&&(window._dailyConfig.modifyRemoteSdpHook=e[n].modifyRemoteSdpHook),delete e[n].modifyRemoteSdpHook),t[n]=e[n]):t[n]=e[n];return t}function Ps(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==fr){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Ds(e,t){return[pr,fr].includes(e)||t}function Is(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Ds(e,t)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Ns(e){var t=arguments.length>2?arguments[2]:void 0;if(!e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Rs(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(t),new Error(t)}}function xs(e){if(!e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function js(e){if(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function Fs(){if(lo())throw new Error("This daily-js method is not currently supported in React Native")}function Bs(){if(!lo())throw new Error("This daily-js method is only supported in React Native")}function Us(e){if(void 0===e)return!0;var t;if("string"==typeof e)t=e;else try{t=JSON.stringify(e),F(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(e){throw Error("userData must be serializable to JSON: ".concat(e))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function Vs(e,t){for(var n=t.allowAllParticipantsKey,r=function(e){var t=["local"];return n||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},o=function(e){return!(!e||e.video&&!i(e.video)||e.screenVideo&&!i(e.screenVideo))},s=0,a=Object.entries(e);s<a.length;s++){var c=_(a[s],2),l=c[0],u=c[1];if(!r(l)||!o(u))return!1}return!0}function Ys(e){return!("object"!==a(e)||!(e.video&&"object"===a(e.video)||e.audio&&"object"===a(e.audio))||e.video&&!function(e){var t=["type","config"];if(!e)return!1;if("object"!==a(e))return!1;if(!function(e){return!("string"!=typeof e||!Object.values(io).includes(e)&&(console.error("inputSettings video processor type invalid"),1))}(e.type))return!1;if(e.config){if("object"!==a(e.config))return!1;if(!function(e,t){var n=Object.keys(t);if(0===n.length)return!0;var r="invalid object in inputSettings -> video -> processor -> config";switch(e){case io.BGBLUR:return n.length>1||"strength"!==n[0]?(console.error(r),!1):!("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error("".concat(r,"; expected: {0 < strength <= 1}, got: ").concat(t.strength)),!1);case io.BGIMAGE:return!(void 0!==t.source&&!function(e){return"default"===e.source?(e.type="default",!0):e.source instanceof ArrayBuffer||(ne(e.source)?(e.type="url",!!function(e){var t=new URL(e),n=t.pathname;if("data:"===t.protocol)try{var r=n.substring(n.indexOf(":")+1,n.indexOf(";")).split("/")[1];return ao.includes(r)}catch(e){return console.error("failed to deduce blob content type",e),!1}var i=n.split(".").at(-1).toLowerCase().trim();return ao.includes(i)}(e.source)||(console.error("invalid image type; supported types: [".concat(ao.join(", "),"]")),!1)):(t=e.source,n=Number(t),isNaN(n)||!Number.isInteger(n)||n<=0||n>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(e.type="daily-preselect",!0)));var t,n}(t));default:return!0}}(e.type,e.config))return!1}return Object.keys(e).filter((function(e){return!t.includes(e)})).forEach((function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete e[t]})),!0}(e.video.processor)||e.audio&&(n=e.audio.processor,r=["type"],!n||"object"!==a(n)||(Object.keys(n).filter((function(e){return!r.includes(e)})).forEach((function(e){console.warn("invalid key inputSettings -> audio -> processor : ".concat(e)),delete n[e]})),t=n.type,"string"!=typeof t||!Object.values(oo).includes(t)&&(console.error("inputSettings audio processor type invalid"),1))));var t,n,r}function Gs(e){var t,n,r=[];e.video&&!fo(null!==(t=null===(n=window._dailyConfig)||void 0===n?void 0:n.useLegacyVideoProcessor)&&void 0!==t&&t)&&(delete e.video,r.push("video")),e.audio&&!go()&&(delete e.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function qs(){var e=Object.values(io).join(" | "),t=Object.values(oo).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function $s(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(Mr).concat(t?' | "'.concat(Ar,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function Js(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Cs),".")}function Ws(e){if(e&&"object"!==a(e)||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(Ts),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=_(n[t],1)[0],i=0,o=Object.entries(e[r]);i<o.length;i++){var s=_(o[i],2),c=s[0],l=s[1];if("iconPath"===c&&!ne(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;if("iconPathDarkMode"===c&&!ne(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var u=Ts.id[c];if(!u)return console.error("customTrayButton does not support key ".concat(c)),!1;if(a(l)!==u)return console.error("customTrayButton ".concat(c," should be a ").concat(u,".")),!1}return!0}function Hs(e){if(!e||e&&"object"!==a(e)||Array.isArray(e))return console.error(Js()),!1;for(var t=function(e){return"".concat(e," should be ").concat(Cs.id[e])},n=function(e,t){return console.error("customIntegration ".concat(e,": ").concat(t))},r=0,i=Object.entries(e);r<i.length;r++){var o=_(i[r],1)[0];if(!("label"in e[o]))return n(o,"label is required"),!1;if(!("location"in e[o]))return n(o,"location is required"),!1;if(!("src"in e[o])&&!("srcdoc"in e[o]))return n(o,"src or srcdoc is required"),!1;for(var s=0,c=Object.entries(e[o]);s<c.length;s++){var l=_(c[s],2),u=l[0],d=l[1];switch(u){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if("string"!=typeof d)return n(o,t(u)),!1;break;case"iconURL":if(!ne(d))return n(o,"".concat(u," should be a url")),!1;break;case"src":if("srcdoc"in e[o])return n(o,"cannot have both src and srcdoc"),!1;if(!ne(d))return n(o,'src "'.concat(d,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[o])return n(o,"cannot have both src and srcdoc"),!1;if("string"!=typeof d)return n(o,t(u)),!1;break;case"location":if(!["main","sidebar"].includes(d))return n(o,t(u)),!1;break;case"controlledBy":if("*"!==d&&"owners"!==d&&(!Array.isArray(d)||d.some((function(e){return"string"!=typeof e}))))return n(o,t(u)),!1;break;case"shared":if((!Array.isArray(d)||d.some((function(e){return"string"!=typeof e})))&&"owners"!==d&&"boolean"!=typeof d)return n(o,t(u)),!1;break;default:if(!Cs.id[u])return console.error("customIntegration does not support key ".concat(u)),!1}}}return!0}function zs(e,t){if(void 0===t)return!1;switch(a(t)){case"string":return a(e)===t;case"object":if("object"!==a(e))return!1;for(var n in e)if(!zs(e[n],t[n]))return!1;return!0;default:return!1}}function Ks(e){if("object"!==a(e))throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(so).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(so));if(e.volume){if("number"!=typeof e.volume)throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function Qs(e,t,n){return!("number"!=typeof e||e<t||e>n)}function Xs(e,t){return e&&!t&&delete e.data,e}},980:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Api=t.HttpClient=t.ContentType=t.CreateWebCallDTO=void 0,t.CreateWebCallDTO=class{assistantId;assistantOverrides;assistant;sipEnabled;metadata},function(e){e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain"}(n||(t.ContentType=n={}));class r{baseUrl="https://api.vapi.ai";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent("number"==typeof t?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map((e=>this.encodeQueryParam(t,e))).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter((e=>void 0!==t[e])).map((e=>Array.isArray(t[e])?this.addArrayQueryParam(t,e):this.addQueryParam(t,e))).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={[n.Json]:e=>null===e||"object"!=typeof e&&"string"!=typeof e?e:JSON.stringify(e),[n.Text]:e=>null!==e&&"string"!=typeof e?JSON.stringify(e):e,[n.FormData]:e=>Object.keys(e||{}).reduce(((t,n)=>{const r=e[n];return t.append(n,r instanceof Blob?r:"object"==typeof r&&null!==r?JSON.stringify(r):`${r}`),t}),new FormData),[n.UrlEncoded]:e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const t=this.abortControllers.get(e);return t?t.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};request=async({body:e,secure:t,path:r,type:i,query:o,format:s,baseUrl:a,cancelToken:c,...l})=>{const u=("boolean"==typeof t?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},d=this.mergeRequestParams(l,u),h=o&&this.toQueryString(o),p=this.contentFormatters[i||n.Json],f=s||d.format;return this.customFetch(`${a||this.baseUrl||""}${r}${h?`?${h}`:""}`,{...d,headers:{...d.headers||{},...i&&i!==n.FormData?{"Content-Type":i}:{}},signal:(c?this.createAbortSignal(c):d.signal)||null,body:null==e?null:p(e)}).then((async e=>{const t=e;t.data=null,t.error=null;const n=f?await e[f]().then((e=>(t.ok?t.data=e:t.error=e,t))).catch((e=>(t.error=e,t))):t;if(c&&this.abortControllers.delete(c),!e.ok)throw n;return n}))}}t.HttpClient=r,t.Api=class extends r{assistant={assistantControllerCreate:(e,t={})=>this.request({path:"/assistant",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),assistantControllerFindAll:(e,t={})=>this.request({path:"/assistant",method:"GET",query:e,secure:!0,format:"json",...t}),assistantControllerFindOne:(e,t={})=>this.request({path:`/assistant/${e}`,method:"GET",secure:!0,format:"json",...t}),assistantControllerUpdate:(e,t,r={})=>this.request({path:`/assistant/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),assistantControllerReplace:(e,t,r={})=>this.request({path:`/assistant/${e}`,method:"PUT",body:t,secure:!0,type:n.Json,format:"json",...r}),assistantControllerRemove:(e,t={})=>this.request({path:`/assistant/${e}`,method:"DELETE",secure:!0,format:"json",...t})};call={callControllerFindAll:(e,t={})=>this.request({path:"/call",method:"GET",query:e,secure:!0,format:"json",...t}),callControllerFindOne:(e,t={})=>this.request({path:`/call/${e}`,method:"GET",secure:!0,format:"json",...t}),callControllerCreatePhoneCall:(e,t={})=>this.request({path:"/call/phone",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),callControllerCreateWebCall:(e,t={})=>this.request({path:"/call/web",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t})};credential={credentialControllerCreate:(e,t={})=>this.request({path:"/credential",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),credentialControllerFindAll:(e,t={})=>this.request({path:"/credential",method:"GET",query:e,secure:!0,format:"json",...t}),credentialControllerFindOne:(e,t={})=>this.request({path:`/credential/${e}`,method:"GET",secure:!0,format:"json",...t}),credentialControllerUpdate:(e,t,r={})=>this.request({path:`/credential/${e}`,method:"PUT",body:t,secure:!0,type:n.Json,format:"json",...r}),credentialControllerRemove:(e,t={})=>this.request({path:`/credential/${e}`,method:"DELETE",secure:!0,format:"json",...t})};phoneNumber={phoneNumberControllerBuy:(e,t={})=>this.request({path:"/phone-number/buy",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerImportTwilio:(e,t={})=>this.request({path:"/phone-number/import/twilio",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerImportVonage:(e,t={})=>this.request({path:"/phone-number/import/vonage",method:"POST",body:e,secure:!0,type:n.Json,format:"json",...t}),phoneNumberControllerFindAll:(e,t={})=>this.request({path:"/phone-number",method:"GET",query:e,secure:!0,format:"json",...t}),phoneNumberControllerFindOne:(e,t={})=>this.request({path:`/phone-number/${e}`,method:"GET",secure:!0,format:"json",...t}),phoneNumberControllerUpdate:(e,t,r={})=>this.request({path:`/phone-number/${e}`,method:"PATCH",body:t,secure:!0,type:n.Json,format:"json",...r}),phoneNumberControllerRemove:(e,t={})=>this.request({path:`/phone-number/${e}`,method:"DELETE",secure:!0,format:"json",...t})};metrics={metricsControllerFindAll:(e,t={})=>this.request({path:"/metrics",method:"GET",query:e,secure:!0,format:"json",...t})};voiceLibrary={voiceLibraryControllerVoiceGetByProvider:(e,t={})=>this.request({path:`/voice-library/${e}`,method:"GET",secure:!0,format:"json",...t}),voiceLibraryControllerVoiceLibrarySyncByProvider:(e,t={})=>this.request({path:`/voice-library/sync/${e}`,method:"POST",secure:!0,format:"json",...t})};logging={loggingControllerGetLogs:(e,t={})=>this.request({path:"/logging",method:"GET",query:e,secure:!0,format:"json",...t})}}},145:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.client=void 0;const r=new(n(980).Api)({baseUrl:"https://api.vapi.ai",baseApiParams:{secure:!0},securityWorker:async e=>{if(e)return{headers:{Authorization:`Bearer ${e}`}}}});t.client=r},112:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(473)),o=r(n(7)),s=n(145);class a extends o.default{on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}emit(e,...t){return super.emit(e,...t)}removeListener(e,t){return super.removeListener(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}}t.default=class extends a{started=!1;call=null;speakingTimeout=null;averageSpeechLevel=0;constructor(e,t){super(),s.client.baseUrl=t??"https://api.vapi.ai",s.client.setSecurityData(e)}cleanup(){this.started=!1,this.call?.destroy(),this.call=null,this.speakingTimeout=null}async start(e,t){if(this.started)return null;this.started=!0;try{const n=(await s.client.call.callControllerCreateWebCall({assistant:"string"==typeof e?void 0:e,assistantId:"string"==typeof e?e:void 0,assistantOverrides:t})).data;return this.call&&this.cleanup(),this.call=i.default.createCallObject({audioSource:!0,videoSource:!1}),this.call.iframe()?.style.setProperty("display","none"),this.call.on("left-meeting",(()=>{this.emit("call-end"),this.cleanup()})),this.call.on("participant-left",(e=>{e&&function(e){const t=document.querySelector(`audio[data-participant-id="${e}"]`);t?.remove()}(e.participant.session_id)})),this.call.on("error",(e=>{this.emit("error",e)})),this.call.on("camera-error",(e=>{this.emit("error",e)})),this.call.on("track-started",(async e=>{e&&e.participant&&(e.participant?.local||"audio"===e.track.kind&&(await async function(e,t){const n=document.createElement("audio");return n.dataset.participantId=t,document.body.appendChild(n),await async function(e,t){e.muted=!1,e.autoplay=!0,null!=t&&(e.srcObject=new MediaStream([t]),await e.play())}(n,e),n}(e.track,e.participant.session_id),"Vapi Speaker"===e?.participant?.user_name&&this.call?.sendAppMessage("playable")))})),this.call.on("participant-joined",(e=>{e&&this.call&&function(e,t){e.participant.local||t.updateParticipant(e.participant.session_id,{setSubscribedTracks:{audio:!0,video:!1}})}(e,this.call)})),await this.call.join({url:n.webCallUrl,subscribeToTracksAutomatically:!1}),this.call.startRemoteParticipantsAudioLevelObserver(100),this.call.on("remote-participants-audio-level",(e=>{e&&this.handleRemoteParticipantsAudioLevel(e)})),this.call.on("app-message",(e=>this.onAppMessage(e))),this.call.updateInputSettings({audio:{processor:{type:"noise-cancellation"}}}),n}catch(e){return console.error(e),this.emit("error",e),this.cleanup(),null}}onAppMessage(e){if(e)try{if("listening"===e.data)return this.emit("call-start");try{const t=JSON.parse(e.data);this.emit("message",t)}catch(e){console.log("Error parsing message data: ",e)}}catch(e){console.error(e)}}handleRemoteParticipantsAudioLevel(e){const t=Object.values(e.participantsAudioLevel).reduce(((e,t)=>e+t),0);this.emit("volume-level",Math.min(1,t/.15)),t>.01&&(this.speakingTimeout?(clearTimeout(this.speakingTimeout),this.speakingTimeout=null):this.emit("speech-start"),this.speakingTimeout=setTimeout((()=>{this.emit("speech-end"),this.speakingTimeout=null}),1e3))}stop(){this.started=!1,this.call?.destroy(),this.call=null}send(e){this.call?.sendAppMessage(JSON.stringify(e))}setMuted(e){try{if(!this.call)throw new Error("Call object is not available.");this.call.setLocalAudio(!e)}catch(e){throw e}}isMuted(){try{return!!this.call&&!1===this.call.localAudio()}catch(e){throw e}}}},7:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,s,l;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):f(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var l=c.length,u=f(c,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e=n(112),t=n.n(e),r=document.getElementById("status"),i=document.getElementById("speaker"),o=document.getElementById("volume"),s=document.getElementById("vapiTyping"),a=document.getElementById("vapiStatusMessage"),c=document.getElementById("chat"),l=new(t())("YOUR-PUBLIC-VAPI-API-KEY"),u=!1,d=!1,h=0,p=!1;function f(){r.textContent="Status: ".concat(u?"Connected":"Disconnected"),i.textContent="Speaker: ".concat(d?"Assistant":"User")}l.on("call-start",(function(){u=!0,f()})),l.on("call-end",(function(){u=!1,f(),callWithVapi.style.boxShadow="0 0 0px 0px rgba(58,25,250,0.7)"})),l.on("speech-start",(function(){d=!0,f()})),l.on("speech-end",(function(){d=!1,f()})),l.on("message",(function(e){var t;"function-call"===e.type&&(e.functionCall&&"ChangeColor"===e.functionCall.name&&(callWithVapi.style.backgroundColor=e.functionCall.parameters.ColorCode),e.functionCall&&"WriteText"===e.functionCall.name&&(s.textContent=e.functionCall.parameters.Text)),"conversation-update"===e.type&&(t=e,c.innerHTML="",t.conversation.forEach((function(e){var t=document.createElement("div");switch(t.classList.add("message"),e.role){case"assistant":t.classList.add("assistant");break;case"user":t.classList.add("user");break;case"tool":t.classList.add("tool")}e.content?t.textContent=e.content:e.tool_calls&&e.tool_calls.length>0&&(t.textContent="Processing request..."),c.appendChild(t)})),c.scrollTop=c.scrollHeight)})),l.on("volume-level",(function(e){var t=30*(h=e);o.textContent="Volume: ".concat(h.toFixed(3)),document.getElementById("callWithVapi").style.boxShadow="0 0 ".concat(t,"px ").concat(t/2,"px rgba(58,25,250,0.7)")})),l.on("error",(function(e){u=!1,e.error.message&&(a.textContent=e.error.message),f()})),callWithVapi.addEventListener("click",(function(){p?(p=!1,callWithVapi.style.backgroundColor="#858585",l.stop()):(p=!0,callWithVapi.style.backgroundColor="#007aff",l.start(m))})),callWithVapi.style.backgroundColor="#858585";var m={name:"Lisa",voice:{voiceId:"sarah",provider:"11labs",stability:.5,similarityBoost:.75},model:{model:"gpt-3.5-turbo",messages:[{role:"system",content:"Lisa is a sophisticated AI web assistant, designed by Jannis Moore. Crafted with the persona of an experienced customer support professional in her early 30s, Lisa combines in-depth knowledge of the website's offerings with a keen sense of emotional intelligence. Her voice is clear, warm, and inviting, featuring a neutral accent to ensure accessibility for a broad user base. Lisa's primary role is to provide immediate, accurate answers to user inquiries about the Website Company, enhancing user experience and engagement.\n\nLisa's advanced programming enables her to handle a wide range of website-related questions, from basic navigation assistance to detailed explanations of services. She guides users through the website's content, offering instant feedback and support to improve their understanding and ease their journey through the site. Lisa ensures every user is met with patience, empathy, and professionalism, embodying the highest standards of customer care.\n\n**Major Mode of Interaction:** Lisa interacts primarily through text, adeptly processing written queries and responding promptly. This capability makes her an excellent resource for users seeking quick information or needing guidance on the website. Additionally, Lisa can utilize custom functions like \"WriteText\" and \"ChangeColor\" to interact with website elements directly, enhancing user interaction and providing a dynamic browsing experience.\n\n**Interaction Instructions:**\n\n- Lisa encourages users to explore the website, acknowledging each query with confirmation of her engagement, e.g., \"Yes, I'm here. How can I assist you today?\"\n- She emphasizes the importance of clear, empathetic communication, tailored to the context of each interaction.\n- Lisa demonstrates how to clarify complex or vague user inquiries by asking concise questions for clarification, ensuring a smooth and efficient communication flow.\n- She teaches users about website features and functionalities, ensuring they feel supported and informed at every step.\n- Lisa can adapt the website's appearance through her interactive commands, improving accessibility and user satisfaction according to individual preferences.\n\nLisa's overarching mission is to enhance the user experience on the website, ensuring that every visitor can navigate and interact with the site effectively and pleasantly. She's not just an information provider but a dynamic interface designed to foster a deeper connection between the website and its users."}],provider:"openai",functions:[{name:"ChangeColor",async:!1,parameters:{type:"object",properties:{ColorCode:{type:"string",description:"The HEX color code including the #"}}},description:"Changes the color of a HTML element"},{name:"WriteText",async:!1,parameters:{type:"object",properties:{Text:{type:"string",description:"The text to write"}}},description:"Writes text on a website on user request"}],maxTokens:250,temperature:.7,emotionRecognitionEnabled:!0},recordingEnabled:!0,firstMessage:"Hello, this is Jannis. How may I assist you today?",voicemailMessage:"You've reached our voicemail. Please leave a message after the beep, and we'll get back to you as soon as possible.",endCallFunctionEnabled:!1,endCallMessage:"Thank you for contacting us. Have a great day!",transcriber:{model:"nova-2",keywords:[],language:"en",provider:"deepgram"},clientMessages:["transcript","hang","function-call","speech-update","metadata","conversation-update"],serverMessages:["end-of-call-report","status-update","hang","function-call"],dialKeypadFunctionEnabled:!1,endCallPhrases:["goodbye"],hipaaEnabled:!1,voicemailDetectionEnabled:!1}})()})();