@avaturn-live/web-sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +14 -14
- package/dist/main.d.ts +21 -1
- package/dist/main.js +136 -119
- package/dist/type.d.ts +16 -0
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var na=Object.defineProperty;var ra=(t,e,n)=>e in t?na(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var Bs,Ee={},ia={get exports(){return Ee},set exports(t){Ee=t}},Ze=typeof Reflect=="object"?Reflect:null,Kr=Ze&&typeof Ze.apply=="function"?Ze.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Bs=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Qr=Number.isNaN||function(t){return t!=t};function j(){j.init.call(this)}ia.exports=j,Ee.once=function(t,e){return new Promise(function(n,r){function i(a){t.removeListener(e,s),r(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}ri(t,e,s,{once:!0}),e!=="error"&&function(a,c,l){typeof a.on=="function"&&ri(a,"error",c,l)}(t,i,{once:!0})})},j.EventEmitter=j,j.prototype._events=void 0,j.prototype._eventsCount=0,j.prototype._maxListeners=void 0;var Xr=10;function zt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Fs(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}function Zr(t,e,n,r){var i,s,a,c;if(zt(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),a===void 0)a=s[e]=n,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=Fs(t))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return t}function sa(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ei(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=sa.bind(r);return i.listener=n,r.wrapFn=i,i}function ti(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}(i):Us(i,i.length)}function ni(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function Us(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function ri(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else{if(typeof t.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(s){r.once&&t.removeEventListener(e,i),n(s)})}}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return Xr},set:function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Xr=t}}),j.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},j.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},j.prototype.getMaxListeners=function(){return Fs(this)},j.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")Kr(c,this,e);else{var l=c.length,p=Us(c,l);for(n=0;n<l;++n)Kr(p[n],this,e)}return!0},j.prototype.addListener=function(t,e){return Zr(this,t,e,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(t,e){return Zr(this,t,e,!0)},j.prototype.once=function(t,e){return zt(e),this.on(t,ei(this,t,e)),this},j.prototype.prependOnceListener=function(t,e){return zt(e),this.prependListener(t,ei(this,t,e)),this},j.prototype.removeListener=function(t,e){var n,r,i,s,a;if(zt(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():function(c,l){for(;l+1<c.length;l++)c[l]=c[l+1];c.pop()}(n,i),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,a||e)}return this},j.prototype.off=j.prototype.removeListener,j.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var i,s=Object.keys(n);for(r=0;r<s.length;++r)(i=s[r])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},j.prototype.listeners=function(t){return ti(this,t,!0)},j.prototype.rawListeners=function(t){return ti(this,t,!1)},j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ni.call(t,e)},j.prototype.listenerCount=ni,j.prototype.eventNames=function(){return this._eventsCount>0?Bs(this._events):[]};var ii=Object.prototype.hasOwnProperty;function si(t,e,n){for(n of t.keys())if(X(n,e))return n}function X(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&X(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if((i=r)&&typeof i=="object"&&!(i=si(e,i))||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if((i=r[0])&&typeof i=="object"&&!(i=si(e,i))||!X(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){for(n in r=0,t)if(ii.call(t,n)&&++r&&!ii.call(e,n)||!(n in e)||!X(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const oa={"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"},qs={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"},J={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},K={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"},Oe={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class S{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}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 n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[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 n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=S.getVersionPrecision(e),s=S.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=S.map([e,n],p=>{const h=a-S.getVersionPrecision(p),f=p+new Array(h+1).join(".0");return S.map(f.split("."),_=>new Array(20-_.length).join("0")+_).reverse()});for(r&&(c=a-Math.min(i,s)),a-=1;a>=c;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===c)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const a=n[i];typeof a=="object"&&a!==null&&Object.keys(a).forEach(c=>{r[c]=a[c]})}return e}static getBrowserAlias(e){return oa[e]}static getBrowserTypeByAlias(e){return qs[e]||""}}const I=/version\/(\d+(\.?_?\d+)+)/i,aa=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=S.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=S.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=S.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=S.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=S.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=S.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=S.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=S.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=S.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=S.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=S.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=S.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=S.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=S.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=S.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=S.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=S.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=S.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=S.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=S.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=S.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=S.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=S.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=S.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=S.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=S.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:S.getFirstMatch(e,t),version:S.getSecondMatch(e,t)}}}];var ca=[{test:[/Roku\/DVP/],describe(t){const e=S.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:K.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=S.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:K.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=S.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=S.getWindowsVersionName(e);return{name:K.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:K.iOS},n=S.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=S.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=S.getMacOSVersionName(e),r={name:K.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=S.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:K.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=S.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=S.getAndroidVersionName(e),r={name:K.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=S.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:K.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=S.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||S.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||S.getFirstMatch(/\bbb(\d+)/i,t);return{name:K.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=S.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:K.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=S.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:K.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:K.Linux})},{test:[/CrOS/],describe:()=>({name:K.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=S.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:K.PlayStation4,version:e}}}],la=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=S.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:J.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:J.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:J.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:J.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:J.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:J.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:J.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=S.getFirstMatch(/(ipod|iphone)/i,t);return{type:J.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:J.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:J.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:J.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:J.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:J.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:J.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:J.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:J.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:J.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:J.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:J.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:J.tv})}],ua=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:Oe.Blink};const e=S.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Oe.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:Oe.Trident},n=S.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:Oe.Presto},n=S.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:Oe.Gecko},n=S.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Oe.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:Oe.WebKit},n=S.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class oi{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=S.find(aa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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=S.find(ca,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=S.find(la,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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=S.find(ua,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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 S.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=S.find(a,p=>this.isOS(p));if(c){const p=this.satisfies(n[c]);if(p!==void 0)return p}const l=S.find(a,p=>this.isPlatform(p));if(l){const p=this.satisfies(n[l]);if(p!==void 0)return p}}if(s>0){const a=Object.keys(i),c=S.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=S.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(S.compareVersions(s,r,i))>-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,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}}/*!
|
|
1
|
+
"use strict";var na=Object.defineProperty;var ra=(t,e,n)=>e in t?na(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>ra(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Hr(t,e){if(t==null)return{};var n,r,i=function(a,c){if(a==null)return{};var l,p,h={},f=Object.keys(a);for(p=0;p<f.length;p++)l=f[p],c.indexOf(l)>=0||(h[l]=a[l]);return h}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t){return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(t)}function Is(t){var e=function(n,r){if(U(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r||"default");if(U(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(t,"string");return U(e)==="symbol"?e:String(e)}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Is(r.key),r)}}function fe(t,e,n){return e&&zr(t.prototype,e),n&&zr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Se(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wt(t,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},wt(t,e)}function ln(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}function un(t,e){if(e&&(U(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Se(t)}function de(t){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(t)}function Ae(t,e,n){return(e=Is(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wr(t,e,n,r,i,s,a){try{var c=t[s](a),l=c.value}catch(p){return void n(p)}c.done?e(l):Promise.resolve(l).then(r,i)}function O(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(l){Wr(s,r,i,a,c,"next",l)}function c(l){Wr(s,r,i,a,c,"throw",l)}a(void 0)})}}function Yr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $e(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,c,l,p=[],h=!0,f=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;h=!1}else for(;!(h=(s=c.call(i)).done)&&(p.push(s.value),p.length!==r);h=!0);}catch(_){f=!0,a=_}finally{try{if(!h&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(f)throw a}}return p}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Yr(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yr(n,r):void 0}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var Bs,Ee={},ia={get exports(){return Ee},set exports(t){Ee=t}},Ze=typeof Reflect=="object"?Reflect:null,Kr=Ze&&typeof Ze.apply=="function"?Ze.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Bs=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Qr=Number.isNaN||function(t){return t!=t};function j(){j.init.call(this)}ia.exports=j,Ee.once=function(t,e){return new Promise(function(n,r){function i(a){t.removeListener(e,s),r(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}ri(t,e,s,{once:!0}),e!=="error"&&function(a,c,l){typeof a.on=="function"&&ri(a,"error",c,l)}(t,i,{once:!0})})},j.EventEmitter=j,j.prototype._events=void 0,j.prototype._eventsCount=0,j.prototype._maxListeners=void 0;var Xr=10;function zt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Fs(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}function Zr(t,e,n,r){var i,s,a,c;if(zt(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),a===void 0)a=s[e]=n,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=Fs(t))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return t}function sa(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ei(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=sa.bind(r);return i.listener=n,r.wrapFn=i,i}function ti(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}(i):Us(i,i.length)}function ni(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function Us(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function ri(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else{if(typeof t.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(s){r.once&&t.removeEventListener(e,i),n(s)})}}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return Xr},set:function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Xr=t}}),j.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},j.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},j.prototype.getMaxListeners=function(){return Fs(this)},j.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")Kr(c,this,e);else{var l=c.length,p=Us(c,l);for(n=0;n<l;++n)Kr(p[n],this,e)}return!0},j.prototype.addListener=function(t,e){return Zr(this,t,e,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(t,e){return Zr(this,t,e,!0)},j.prototype.once=function(t,e){return zt(e),this.on(t,ei(this,t,e)),this},j.prototype.prependOnceListener=function(t,e){return zt(e),this.prependListener(t,ei(this,t,e)),this},j.prototype.removeListener=function(t,e){var n,r,i,s,a;if(zt(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():function(c,l){for(;l+1<c.length;l++)c[l]=c[l+1];c.pop()}(n,i),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,a||e)}return this},j.prototype.off=j.prototype.removeListener,j.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var i,s=Object.keys(n);for(r=0;r<s.length;++r)(i=s[r])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},j.prototype.listeners=function(t){return ti(this,t,!0)},j.prototype.rawListeners=function(t){return ti(this,t,!1)},j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ni.call(t,e)},j.prototype.listenerCount=ni,j.prototype.eventNames=function(){return this._eventsCount>0?Bs(this._events):[]};var ii=Object.prototype.hasOwnProperty;function si(t,e,n){for(n of t.keys())if(X(n,e))return n}function X(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&X(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if((i=r)&&typeof i=="object"&&!(i=si(e,i))||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if((i=r[0])&&typeof i=="object"&&!(i=si(e,i))||!X(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){for(n in r=0,t)if(ii.call(t,n)&&++r&&!ii.call(e,n)||!(n in e)||!X(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const oa={"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"},qs={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"},K={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"},Oe={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class S{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}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 n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[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 n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=S.getVersionPrecision(e),s=S.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=S.map([e,n],p=>{const h=a-S.getVersionPrecision(p),f=p+new Array(h+1).join(".0");return S.map(f.split("."),_=>new Array(20-_.length).join("0")+_).reverse()});for(r&&(c=a-Math.min(i,s)),a-=1;a>=c;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===c)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const a=n[i];typeof a=="object"&&a!==null&&Object.keys(a).forEach(c=>{r[c]=a[c]})}return e}static getBrowserAlias(e){return oa[e]}static getBrowserTypeByAlias(e){return qs[e]||""}}const I=/version\/(\d+(\.?_?\d+)+)/i,aa=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=S.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=S.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=S.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=S.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=S.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=S.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=S.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=S.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=S.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=S.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=S.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=S.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=S.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=S.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=S.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=S.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=S.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=S.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=S.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=S.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=S.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=S.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=S.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=S.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=S.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=S.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:S.getFirstMatch(e,t),version:S.getSecondMatch(e,t)}}}];var ca=[{test:[/Roku\/DVP/],describe(t){const e=S.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:K.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=S.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:K.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=S.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=S.getWindowsVersionName(e);return{name:K.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:K.iOS},n=S.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=S.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=S.getMacOSVersionName(e),r={name:K.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=S.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:K.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=S.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=S.getAndroidVersionName(e),r={name:K.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=S.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:K.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=S.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||S.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||S.getFirstMatch(/\bbb(\d+)/i,t);return{name:K.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=S.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:K.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=S.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:K.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:K.Linux})},{test:[/CrOS/],describe:()=>({name:K.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=S.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:K.PlayStation4,version:e}}}],la=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=S.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:V.mobile,vendor:"Huawei"};return e&&(n.model=e),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(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=S.getFirstMatch(/(ipod|iphone)/i,t);return{type:V.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:V.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:V.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:V.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:V.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:V.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:V.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:V.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:V.tv})}],ua=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:Oe.Blink};const e=S.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Oe.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:Oe.Trident},n=S.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:Oe.Presto},n=S.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:Oe.Gecko},n=S.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Oe.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:Oe.WebKit},n=S.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class oi{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=S.find(aa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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=S.find(ca,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=S.find(la,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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=S.find(ua,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));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 S.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=S.find(a,p=>this.isOS(p));if(c){const p=this.satisfies(n[c]);if(p!==void 0)return p}const l=S.find(a,p=>this.isPlatform(p));if(l){const p=this.satisfies(n[l]);if(p!==void 0)return p}}if(s>0){const a=Object.keys(i),c=S.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=S.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(S.compareVersions(s,r,i))>-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,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}}/*!
|
|
3
3
|
* Bowser - a browser detector
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
5
5
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
6
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
-
*/class da{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new oi(e,n)}static parse(e){return new oi(e).getResult()}static get BROWSER_MAP(){return qs}static get ENGINE_MAP(){return Oe}static get OS_MAP(){return K}static get PLATFORMS_MAP(){return J}}function dn(){return Date.now()+Math.random().toString()}function pt(){throw new Error("Method must be implemented in subclass")}function Vs(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function Xt(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:Vs("https://c.daily.co/call-machine/versioned/".concat("0.68.0","/static/call-machine-object-bundle.js"),t)}function St(t){try{new URL(t)}catch{return!1}return!0}const Js=Object.prototype.toString;function $s(t){switch(Js.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return He(t,Error)}}function lt(t,e){return Js.call(t)===`[object ${e}]`}function mr(t){return lt(t,"ErrorEvent")}function ai(t){return lt(t,"DOMError")}function Ge(t){return lt(t,"String")}function Gs(t){return t===null||typeof t!="object"&&typeof t!="function"}function ot(t){return lt(t,"Object")}function Zt(t){return typeof Event<"u"&&He(t,Event)}function gr(t){return!!(t&&t.then&&typeof t.then=="function")}function He(t,e){try{return t instanceof e}catch{return!1}}function et(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ci(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function ha(t,e,n=!1){return!!Ge(t)&&(lt(e,"RegExp")?e.test(t):!!Ge(e)&&(n?t===e:t.includes(e)))}function Dt(t,e=[],n=!1){return e.some(r=>ha(t,r,n))}function pa(t,e,n=250,r,i,s,a){if(!(s.exception&&s.exception.values&&a&&He(a.originalException,Error)))return;const c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,p;c&&(s.exception.values=(l=Fn(t,e,i,a.originalException,r,s.exception.values,c,0),p=n,l.map(h=>(h.value&&(h.value=et(h.value,p)),h))))}function Fn(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(He(r[i],Error)){li(a,c);const p=t(e,r[i]),h=l.length;ui(p,i,h,c),l=Fn(t,e,n,r[i],i,[p,...l],p,h)}return Array.isArray(r.errors)&&r.errors.forEach((p,h)=>{if(He(p,Error)){li(a,c);const f=t(e,p),_=l.length;ui(f,`errors[${h}]`,_,c),l=Fn(t,e,n,p,i,[f,...l],f,_)}}),l}function li(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function ui(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t){return t&&t.Math==Math?t:void 0}const ie=typeof globalThis=="object"&&Lt(globalThis)||typeof window=="object"&&Lt(window)||typeof self=="object"&&Lt(self)||typeof global=="object"&&Lt(global)||function(){return this}()||{};function At(){return ie}function vr(t,e,n){const r=n||ie,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const fa=At(),ma=80;function Un(t,e={}){try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let p;const h=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||ma;for(;n&&s++<r&&(p=ga(n,h),!(p==="html"||s>1&&a+i.length*l+p.length>=f));)i.push(p),a+=p.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function ga(t,e){const n=t,r=[];let i,s,a,c,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const p=e&&e.length?e.filter(f=>n.getAttribute(f)).map(f=>[f,n.getAttribute(f)]):null;if(p&&p.length)p.forEach(f=>{r.push(`[${f[0]}="${f[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Ge(i))for(s=i.split(/\s+/),l=0;l<s.length;l++)r.push(`.${s[l]}`);const h=["aria-label","type","name","title","alt"];for(l=0;l<h.length;l++)a=h[l],c=n.getAttribute(a),c&&r.push(`[${a}="${c}"]`);return r.join("")}const en=["debug","info","warn","error","log","assert","trace"];function Hs(t){if(!("console"in ie))return t();const e=ie.console,n={};en.forEach(r=>{const i=e[r]&&e[r].__sentry_original__;r in e&&i&&(n[r]=e[r],e[r]=i)});try{return t()}finally{Object.keys(n).forEach(r=>{e[r]=n[r]})}}function di(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?en.forEach(n=>{e[n]=(...r)=>{t&&Hs(()=>{ie.console[n](`Sentry Logger [${n}]:`,...r)})}}):en.forEach(n=>{e[n]=()=>{}}),e}let R;R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?vr("logger",di):di();const va=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function tn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:a,protocol:c,publicKey:l}=t;return`${c}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function hi(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ya(t){const e=typeof t=="string"?function(n){const r=va.exec(n);if(!r)return void console.error(`Invalid Sentry Dsn: ${n}`);const[i,s,a="",c,l="",p]=r.slice(1);let h="",f=p;const _=f.split("/");if(_.length>1&&(h=_.slice(0,-1).join("/"),f=_.pop()),f){const k=f.match(/^\d+/);k&&(f=k[0])}return hi({host:c,pass:a,path:h,projectId:f,port:l,protocol:i,publicKey:s})}(t):hi(t);if(e&&function(n){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(R.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(R.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(R.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(R.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}class le extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function z(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if(typeof i=="function")try{zs(i,r)}catch{}t[e]=i}function yr(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function zs(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,yr(t,"__sentry_original__",e)}function _r(t){return t.__sentry_original__}function Ws(t){if($s(t))return{message:t.message,name:t.name,stack:t.stack,...fi(t)};if(Zt(t)){const e={type:t.type,target:pi(t.target),currentTarget:pi(t.currentTarget),...fi(t)};return typeof CustomEvent<"u"&&He(t,CustomEvent)&&(e.detail=t.detail),e}return t}function pi(t){try{return e=t,typeof Element<"u"&&He(e,Element)?Un(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function fi(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function hn(t){return qn(t,new Map)}function qn(t,e){if(ot(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))t[i]!==void 0&&(r[i]=qn(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(qn(i,e))}),r}return t}const mi="<anonymous>";function Le(t){try{return t&&typeof t=="function"&&t.name||mi}catch{return mi}}const wn=At();function Vn(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function _a(){if(!function(){if(!("fetch"in wn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Vn(wn.fetch))return!0;let t=!1;const e=wn.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Vn(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}const Nt=At(),V=At(),vt="__sentry_xhr_v2__",_t={},gi={};function ba(t){if(!gi[t])switch(gi[t]=!0,t){case"console":(function(){"console"in V&&en.forEach(function(e){e in V.console&&z(V.console,e,function(n){return function(...r){ae("console",{args:r,level:e}),n&&n.apply(V.console,r)}})})})();break;case"dom":(function(){if(!("document"in V))return;const e=ae.bind(null,"dom"),n=yi(e,!0);V.document.addEventListener("click",n,!1),V.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach(r=>{const i=V[r]&&V[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(z(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__=p.__sentry_instrumentation_handlers__||{},f=h[a]=h[a]||{refCount:0};if(!f.handler){const _=yi(e);f.handler=_,s.call(this,a,_,l)}f.refCount++}catch{}return s.call(this,a,c,l)}}),z(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__||{},f=h[a];f&&(f.refCount--,f.refCount<=0&&(s.call(this,a,f.handler,l),f.handler=void 0,delete h[a]),Object.keys(h).length===0&&delete p.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in V))return;const e=XMLHttpRequest.prototype;z(e,"open",function(n){return function(...r){const i=r[1],s=this[vt]={method:Ge(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Ge(i)&&s.method==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const c=this[vt];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}ae("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?z(this,"onreadystatechange",function(c){return function(...l){return a(),c.apply(this,l)}}):this.addEventListener("readystatechange",a),z(this,"setRequestHeader",function(c){return function(...l){const[p,h]=l,f=this[vt];return f&&(f.request_headers[p.toLowerCase()]=h),c.apply(this,l)}}),n.apply(this,r)}}),z(e,"send",function(n){return function(...r){const i=this[vt];return i&&r[0]!==void 0&&(i.body=r[0]),ae("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}})})();break;case"fetch":(function(){_a()&&z(V,"fetch",function(e){return function(...n){const{method:r,url:i}=function(a){if(a.length===0)return{method:"GET",url:""};if(a.length===2){const[l,p]=a;return{url:vi(l),method:Jn(p,"method")?String(p.method).toUpperCase():"GET"}}const c=a[0];return{url:vi(c),method:Jn(c,"method")?String(c.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:r,url:i},startTimestamp:Date.now()};return ae("fetch",{...s}),e.apply(V,n).then(a=>(ae("fetch",{...s,endTimestamp:Date.now(),response:a}),a),a=>{throw ae("fetch",{...s,endTimestamp:Date.now(),error:a}),a})}})})();break;case"history":(function(){if(!function(){const r=Nt.chrome,i=r&&r.app&&r.app.runtime,s="history"in Nt&&!!Nt.history.pushState&&!!Nt.history.replaceState;return!i&&s}())return;const e=V.onpopstate;function n(r){return function(...i){const s=i.length>2?i[2]:void 0;if(s){const a=jt,c=String(s);jt=c,ae("history",{from:a,to:c})}return r.apply(this,i)}}V.onpopstate=function(...r){const i=V.location.href,s=jt;if(jt=i,ae("history",{from:s,to:i}),e)try{return e.apply(this,r)}catch{}},z(V.history,"pushState",n),z(V.history,"replaceState",n)})();break;case"error":Bt=V.onerror,V.onerror=function(e,n,r,i,s){return ae("error",{column:i,error:s,line:r,msg:e,url:n}),!(!Bt||Bt.__SENTRY_LOADER__)&&Bt.apply(this,arguments)},V.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Ft=V.onunhandledrejection,V.onunhandledrejection=function(e){return ae("unhandledrejection",e),!(Ft&&!Ft.__SENTRY_LOADER__)||Ft.apply(this,arguments)},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("unknown instrumentation type:",t))}}function Ue(t,e){_t[t]=_t[t]||[],_t[t].push(e),ba(t)}function ae(t,e){if(t&&_t[t])for(const n of _t[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Error while triggering instrumentation handler.
|
|
7
|
+
*/class da{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new oi(e,n)}static parse(e){return new oi(e).getResult()}static get BROWSER_MAP(){return qs}static get ENGINE_MAP(){return Oe}static get OS_MAP(){return K}static get PLATFORMS_MAP(){return V}}function dn(){return Date.now()+Math.random().toString()}function pt(){throw new Error("Method must be implemented in subclass")}function Js(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function Xt(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:Js("https://c.daily.co/call-machine/versioned/".concat("0.68.0","/static/call-machine-object-bundle.js"),t)}function St(t){try{new URL(t)}catch{return!1}return!0}const Vs=Object.prototype.toString;function $s(t){switch(Vs.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return He(t,Error)}}function lt(t,e){return Vs.call(t)===`[object ${e}]`}function mr(t){return lt(t,"ErrorEvent")}function ai(t){return lt(t,"DOMError")}function Ge(t){return lt(t,"String")}function Gs(t){return t===null||typeof t!="object"&&typeof t!="function"}function ot(t){return lt(t,"Object")}function Zt(t){return typeof Event<"u"&&He(t,Event)}function gr(t){return!!(t&&t.then&&typeof t.then=="function")}function He(t,e){try{return t instanceof e}catch{return!1}}function et(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ci(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function ha(t,e,n=!1){return!!Ge(t)&&(lt(e,"RegExp")?e.test(t):!!Ge(e)&&(n?t===e:t.includes(e)))}function Dt(t,e=[],n=!1){return e.some(r=>ha(t,r,n))}function pa(t,e,n=250,r,i,s,a){if(!(s.exception&&s.exception.values&&a&&He(a.originalException,Error)))return;const c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,p;c&&(s.exception.values=(l=Fn(t,e,i,a.originalException,r,s.exception.values,c,0),p=n,l.map(h=>(h.value&&(h.value=et(h.value,p)),h))))}function Fn(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(He(r[i],Error)){li(a,c);const p=t(e,r[i]),h=l.length;ui(p,i,h,c),l=Fn(t,e,n,r[i],i,[p,...l],p,h)}return Array.isArray(r.errors)&&r.errors.forEach((p,h)=>{if(He(p,Error)){li(a,c);const f=t(e,p),_=l.length;ui(f,`errors[${h}]`,_,c),l=Fn(t,e,n,p,i,[f,...l],f,_)}}),l}function li(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function ui(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t){return t&&t.Math==Math?t:void 0}const ie=typeof globalThis=="object"&&Lt(globalThis)||typeof window=="object"&&Lt(window)||typeof self=="object"&&Lt(self)||typeof global=="object"&&Lt(global)||function(){return this}()||{};function At(){return ie}function vr(t,e,n){const r=n||ie,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const fa=At(),ma=80;function Un(t,e={}){try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let p;const h=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||ma;for(;n&&s++<r&&(p=ga(n,h),!(p==="html"||s>1&&a+i.length*l+p.length>=f));)i.push(p),a+=p.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function ga(t,e){const n=t,r=[];let i,s,a,c,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const p=e&&e.length?e.filter(f=>n.getAttribute(f)).map(f=>[f,n.getAttribute(f)]):null;if(p&&p.length)p.forEach(f=>{r.push(`[${f[0]}="${f[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Ge(i))for(s=i.split(/\s+/),l=0;l<s.length;l++)r.push(`.${s[l]}`);const h=["aria-label","type","name","title","alt"];for(l=0;l<h.length;l++)a=h[l],c=n.getAttribute(a),c&&r.push(`[${a}="${c}"]`);return r.join("")}const en=["debug","info","warn","error","log","assert","trace"];function Hs(t){if(!("console"in ie))return t();const e=ie.console,n={};en.forEach(r=>{const i=e[r]&&e[r].__sentry_original__;r in e&&i&&(n[r]=e[r],e[r]=i)});try{return t()}finally{Object.keys(n).forEach(r=>{e[r]=n[r]})}}function di(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?en.forEach(n=>{e[n]=(...r)=>{t&&Hs(()=>{ie.console[n](`Sentry Logger [${n}]:`,...r)})}}):en.forEach(n=>{e[n]=()=>{}}),e}let R;R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?vr("logger",di):di();const va=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function tn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:a,protocol:c,publicKey:l}=t;return`${c}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function hi(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ya(t){const e=typeof t=="string"?function(n){const r=va.exec(n);if(!r)return void console.error(`Invalid Sentry Dsn: ${n}`);const[i,s,a="",c,l="",p]=r.slice(1);let h="",f=p;const _=f.split("/");if(_.length>1&&(h=_.slice(0,-1).join("/"),f=_.pop()),f){const k=f.match(/^\d+/);k&&(f=k[0])}return hi({host:c,pass:a,path:h,projectId:f,port:l,protocol:i,publicKey:s})}(t):hi(t);if(e&&function(n){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(R.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(R.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(R.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(R.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}class le extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function z(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if(typeof i=="function")try{zs(i,r)}catch{}t[e]=i}function yr(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function zs(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,yr(t,"__sentry_original__",e)}function _r(t){return t.__sentry_original__}function Ws(t){if($s(t))return{message:t.message,name:t.name,stack:t.stack,...fi(t)};if(Zt(t)){const e={type:t.type,target:pi(t.target),currentTarget:pi(t.currentTarget),...fi(t)};return typeof CustomEvent<"u"&&He(t,CustomEvent)&&(e.detail=t.detail),e}return t}function pi(t){try{return e=t,typeof Element<"u"&&He(e,Element)?Un(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function fi(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function hn(t){return qn(t,new Map)}function qn(t,e){if(ot(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))t[i]!==void 0&&(r[i]=qn(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(qn(i,e))}),r}return t}const mi="<anonymous>";function Le(t){try{return t&&typeof t=="function"&&t.name||mi}catch{return mi}}const wn=At();function Jn(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function _a(){if(!function(){if(!("fetch"in wn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Jn(wn.fetch))return!0;let t=!1;const e=wn.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Jn(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}const Nt=At(),J=At(),vt="__sentry_xhr_v2__",_t={},gi={};function ba(t){if(!gi[t])switch(gi[t]=!0,t){case"console":(function(){"console"in J&&en.forEach(function(e){e in J.console&&z(J.console,e,function(n){return function(...r){ae("console",{args:r,level:e}),n&&n.apply(J.console,r)}})})})();break;case"dom":(function(){if(!("document"in J))return;const e=ae.bind(null,"dom"),n=yi(e,!0);J.document.addEventListener("click",n,!1),J.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach(r=>{const i=J[r]&&J[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(z(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__=p.__sentry_instrumentation_handlers__||{},f=h[a]=h[a]||{refCount:0};if(!f.handler){const _=yi(e);f.handler=_,s.call(this,a,_,l)}f.refCount++}catch{}return s.call(this,a,c,l)}}),z(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__||{},f=h[a];f&&(f.refCount--,f.refCount<=0&&(s.call(this,a,f.handler,l),f.handler=void 0,delete h[a]),Object.keys(h).length===0&&delete p.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in J))return;const e=XMLHttpRequest.prototype;z(e,"open",function(n){return function(...r){const i=r[1],s=this[vt]={method:Ge(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Ge(i)&&s.method==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const c=this[vt];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}ae("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?z(this,"onreadystatechange",function(c){return function(...l){return a(),c.apply(this,l)}}):this.addEventListener("readystatechange",a),z(this,"setRequestHeader",function(c){return function(...l){const[p,h]=l,f=this[vt];return f&&(f.request_headers[p.toLowerCase()]=h),c.apply(this,l)}}),n.apply(this,r)}}),z(e,"send",function(n){return function(...r){const i=this[vt];return i&&r[0]!==void 0&&(i.body=r[0]),ae("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}})})();break;case"fetch":(function(){_a()&&z(J,"fetch",function(e){return function(...n){const{method:r,url:i}=function(a){if(a.length===0)return{method:"GET",url:""};if(a.length===2){const[l,p]=a;return{url:vi(l),method:Vn(p,"method")?String(p.method).toUpperCase():"GET"}}const c=a[0];return{url:vi(c),method:Vn(c,"method")?String(c.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:r,url:i},startTimestamp:Date.now()};return ae("fetch",{...s}),e.apply(J,n).then(a=>(ae("fetch",{...s,endTimestamp:Date.now(),response:a}),a),a=>{throw ae("fetch",{...s,endTimestamp:Date.now(),error:a}),a})}})})();break;case"history":(function(){if(!function(){const r=Nt.chrome,i=r&&r.app&&r.app.runtime,s="history"in Nt&&!!Nt.history.pushState&&!!Nt.history.replaceState;return!i&&s}())return;const e=J.onpopstate;function n(r){return function(...i){const s=i.length>2?i[2]:void 0;if(s){const a=jt,c=String(s);jt=c,ae("history",{from:a,to:c})}return r.apply(this,i)}}J.onpopstate=function(...r){const i=J.location.href,s=jt;if(jt=i,ae("history",{from:s,to:i}),e)try{return e.apply(this,r)}catch{}},z(J.history,"pushState",n),z(J.history,"replaceState",n)})();break;case"error":Bt=J.onerror,J.onerror=function(e,n,r,i,s){return ae("error",{column:i,error:s,line:r,msg:e,url:n}),!(!Bt||Bt.__SENTRY_LOADER__)&&Bt.apply(this,arguments)},J.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Ft=J.onunhandledrejection,J.onunhandledrejection=function(e){return ae("unhandledrejection",e),!(Ft&&!Ft.__SENTRY_LOADER__)||Ft.apply(this,arguments)},J.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("unknown instrumentation type:",t))}}function Ue(t,e){_t[t]=_t[t]||[],_t[t].push(e),ba(t)}function ae(t,e){if(t&&_t[t])for(const n of _t[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Error while triggering instrumentation handler.
|
|
8
8
|
Type: ${t}
|
|
9
9
|
Name: ${Le(n)}
|
|
10
|
-
Error:`,r)}}function
|
|
10
|
+
Error:`,r)}}function Vn(t,e){return!!t&&typeof t=="object"&&!!t[e]}function vi(t){return typeof t=="string"?t:t?Vn(t,"url")?t.url:t.toString?t.toString():"":""}let jt;const wa=1e3;let It,Sn;function yi(t,e=!1){return n=>{if(!n||Sn===n||function(i){if(i.type!=="keypress")return!1;try{const s=i.target;if(!s||!s.tagName)return!0;if(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable)return!1}catch{}return!0}(n))return;const r=n.type==="keypress"?"input":n.type;(It===void 0||function(i,s){if(!i||i.type!==s.type)return!0;try{if(i.target!==s.target)return!0}catch{}return!1}(Sn,n))&&(t({event:n,name:r,global:e}),Sn=n),clearTimeout(It),It=J.setTimeout(()=>{It=void 0},wa)}}let Bt=null,Ft=null;function xe(){const t=ie,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");const n=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Ys(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Pe(t){const{message:e,event_id:n}=t;if(e)return e;const r=Ys(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function $n(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function kt(t,e){const n=Ys(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const i={...r&&r.data,...e.data};n.mechanism.data=i}}function _i(t){if(t&&t.__sentry_captured__)return!0;try{yr(t,"__sentry_captured__",!0)}catch{}return!1}function Re(t,e=100,n=1/0){try{return Gn("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ks(t,e=3,n=102400){const r=Re(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?Ks(t,e-1,n):r;var i}function Gn(t,e,n=1/0,r=1/0,i=function(){const s=typeof WeakSet=="function",a=s?new WeakSet:[];return[function(c){if(s)return!!a.has(c)||(a.add(c),!1);for(let l=0;l<a.length;l++)if(a[l]===c)return!0;return a.push(c),!1},function(c){if(s)a.delete(c);else for(let l=0;l<a.length;l++)if(a[l]===c){a.splice(l,1);break}}]}()){const[s,a]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&(typeof(c=e)!="number"||c==c))return e;var c;const l=function(y,w){try{if(y==="domain"&&w&&typeof w=="object"&&w._events)return"[Domain]";if(y==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&w===global)return"[Global]";if(typeof window<"u"&&w===window)return"[Window]";if(typeof document<"u"&&w===document)return"[Document]";if(function(M){return ot(M)&&"nativeEvent"in M&&"preventDefault"in M&&"stopPropagation"in M}(w))return"[SyntheticEvent]";if(typeof w=="number"&&w!=w)return"[NaN]";if(typeof w=="function")return`[Function: ${Le(w)}]`;if(typeof w=="symbol")return`[${String(w)}]`;if(typeof w=="bigint")return`[BigInt: ${String(w)}]`;const T=function(M){const B=Object.getPrototypeOf(M);return B?B.constructor.name:"null prototype"}(w);return/^HTML(\w*)Element$/.test(T)?`[HTMLElement: ${T}]`:`[object ${T}]`}catch(T){return`**non-serializable** (${T})`}}(t,e);if(!l.startsWith("[object "))return l;if(e.__sentry_skip_normalization__)return e;const p=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(p===0)return l.replace("object ","");if(s(e))return"[Circular ~]";const h=e;if(h&&typeof h.toJSON=="function")try{return Gn("",h.toJSON(),p-1,r,i)}catch{}const f=Array.isArray(e)?[]:{};let _=0;const k=Ws(e);for(const y in k){if(!Object.prototype.hasOwnProperty.call(k,y))continue;if(_>=r){f[y]="[MaxProperties ~]";break}const w=k[y];f[y]=Gn(y,w,p-1,r,i),_++}return a(e),f}var ke;function ze(t){return new Q(e=>{e(t)})}function nn(t){return new Q((e,n)=>{n(t)})}(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(ke||(ke={}));class Q{__init(){this._state=ke.PENDING}__init2(){this._handlers=[]}constructor(e){Q.prototype.__init.call(this),Q.prototype.__init2.call(this),Q.prototype.__init3.call(this),Q.prototype.__init4.call(this),Q.prototype.__init5.call(this),Q.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Q((r,i)=>{this._handlers.push([!1,s=>{if(e)try{r(e(s))}catch(a){i(a)}else r(s)},s=>{if(n)try{r(n(s))}catch(a){i(a)}else i(s)}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Q((n,r)=>{let i,s;return this.then(a=>{s=!1,i=a,e&&e()},a=>{s=!0,i=a,e&&e()}).then(()=>{s?r(i):n(i)})})}__init3(){this._resolve=e=>{this._setResult(ke.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(ke.REJECTED,e)}}__init5(){this._setResult=(e,n)=>{this._state===ke.PENDING&&(gr(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===ke.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===ke.RESOLVED&&n[1](this._value),this._state===ke.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Sa(t){const e=[];function n(r){return e.splice(e.indexOf(r),1)[0]}return{$:e,add:function(r){if(!(t===void 0||e.length<t))return nn(new le("Not adding Promise because buffer limit was reached."));const i=r();return e.indexOf(i)===-1&&e.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(r){return new Q((i,s)=>{let a=e.length;if(!a)return i(!0);const c=setTimeout(()=>{r&&r>0&&i(!1)},r);e.forEach(l=>{ze(l).then(()=>{--a||(clearTimeout(c),i(!0))},s)})})}}}function kn(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const ka=["fatal","error","warning","log","info","debug"],Qs=At(),Hn={nowSeconds:()=>Date.now()/1e3},En=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:t}=Qs;if(!(!t||!t.now))return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}():function(){try{return(t=module,e="perf_hooks",t.require(e)).performance}catch{return}var t,e}(),bi=En===void 0?Hn:{nowSeconds:()=>(En.timeOrigin+En.now())/1e3},pn=Hn.nowSeconds.bind(Hn),Xs=bi.nowSeconds.bind(bi);function Et(t,e=[]){return[t,e]}function Ea(t,e){const[n,r]=t;return[n,[...r,e]]}function wi(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function zn(t,e){return(e||new TextEncoder).encode(t)}function Ta(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[zn(i,e),a]:i.push(typeof a=="string"?zn(a,e):a)}for(const a of r){const[c,l]=a;if(s(`
|
|
11
11
|
${JSON.stringify(c)}
|
|
12
|
-
`),typeof l=="string"||l instanceof Uint8Array)s(l);else{let p;try{p=JSON.stringify(l)}catch{p=JSON.stringify(Re(l))}s(p)}}return typeof i=="string"?i:function(a){const c=a.reduce((h,f)=>h+f.length,0),l=new Uint8Array(c);let p=0;for(const h of a)l.set(h,p),p+=h.length;return l}(i)}function Ca(t,e){const n=typeof t.data=="string"?zn(t.data,e):t.data;return[hn({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}(()=>{const{performance:t}=Qs;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+n-r):e;(s||c<e)&&i<=c&&t.timeOrigin})();const Ma={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 Si(t){return Ma[t]}function Zs(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Oa=6e4;function Aa(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(const c of s.trim().split(",")){const[l,p]=c.split(":",2),h=parseInt(l,10),f=1e3*(isNaN(h)?60:h);if(p)for(const _ of p.split(";"))i[_]=r+f;else i.all=r+f}else a?i.all=r+function(c,l=Date.now()){const p=parseInt(`${c}`,10);if(!isNaN(p))return 1e3*p;const h=Date.parse(`${c}`);return isNaN(h)?Oa:h-l}(a,r):e===429&&(i.all=r+6e4);return i}const br="production";function Pa(t){const e=Xs(),n={sid:xe(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return hn({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&at(n,t),n}function at(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Xs(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:xe()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}class Ve{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ki()}static clone(e){const n=new Ve;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&at(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,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},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,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,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(typeof e=="function"){const n=e(this);return n instanceof Ve?n:this}return e instanceof Ve?(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)):ot(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=ki(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:pn(),...e};return this._breadcrumbs=[...this._breadcrumbs,i].slice(-r),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,n={}){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 r=this._span.transaction;if(r){e.sdkProcessingMetadata={dynamicSamplingContext:r.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const i=r.name;i&&(e.tags={transaction:i,...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([...eo(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,n,r,i=0){return new Q((s,a)=>{const c=e[i];if(n===null||typeof c!="function")s(n);else{const l=c({...n},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&c.id&&l===null&&R.log(`Event processor "${c.id}" dropped event`),gr(l)?l.then(p=>this._notifyEventProcessors(e,p,r,i+1).then(s)).then(null,a):this._notifyEventProcessors(e,l,r,i+1).then(s).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){var n;e.fingerprint=e.fingerprint?(n=e.fingerprint,Array.isArray(n)?n:[n]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function eo(){return vr("globalEventProcessors",()=>[])}function to(t){eo().push(t)}function ki(){return{traceId:xe(),spanId:xe().substring(16),sampled:!1}}const no=4,Ra=100;class wr{constructor(e,n=new Ve,r=no){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=Ve.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 n=this.pushScope();try{e(n)}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,n){const r=this._lastEventId=n&&n.event_id?n.event_id:xe(),i=new Error("Sentry syntheticException");return this._withClient((s,a)=>{s.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:xe(),s=new Error(e);return this._withClient((a,c)=>{a.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},c)}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:xe();return e.type||(this._lastEventId=r),this._withClient((i,s)=>{i.captureEvent(e,{...n,event_id:r},s)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:a=Ra}=i.getOptions&&i.getOptions()||{};if(a<=0)return;const c={timestamp:pn(),...e},l=s?Hs(()=>s(c,n)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,n),r.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=Ei(this);try{e(this)}finally{Ei(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||r||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
12
|
+
`),typeof l=="string"||l instanceof Uint8Array)s(l);else{let p;try{p=JSON.stringify(l)}catch{p=JSON.stringify(Re(l))}s(p)}}return typeof i=="string"?i:function(a){const c=a.reduce((h,f)=>h+f.length,0),l=new Uint8Array(c);let p=0;for(const h of a)l.set(h,p),p+=h.length;return l}(i)}function Ca(t,e){const n=typeof t.data=="string"?zn(t.data,e):t.data;return[hn({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}(()=>{const{performance:t}=Qs;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+n-r):e;(s||c<e)&&i<=c&&t.timeOrigin})();const Ma={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 Si(t){return Ma[t]}function Zs(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Oa=6e4;function Aa(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(const c of s.trim().split(",")){const[l,p]=c.split(":",2),h=parseInt(l,10),f=1e3*(isNaN(h)?60:h);if(p)for(const _ of p.split(";"))i[_]=r+f;else i.all=r+f}else a?i.all=r+function(c,l=Date.now()){const p=parseInt(`${c}`,10);if(!isNaN(p))return 1e3*p;const h=Date.parse(`${c}`);return isNaN(h)?Oa:h-l}(a,r):e===429&&(i.all=r+6e4);return i}const br="production";function Pa(t){const e=Xs(),n={sid:xe(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return hn({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&at(n,t),n}function at(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Xs(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:xe()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}class Je{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ki()}static clone(e){const n=new Je;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&at(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,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},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,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,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(typeof e=="function"){const n=e(this);return n instanceof Je?n:this}return e instanceof Je?(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)):ot(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=ki(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:pn(),...e};return this._breadcrumbs=[...this._breadcrumbs,i].slice(-r),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,n={}){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 r=this._span.transaction;if(r){e.sdkProcessingMetadata={dynamicSamplingContext:r.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const i=r.name;i&&(e.tags={transaction:i,...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([...eo(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,n,r,i=0){return new Q((s,a)=>{const c=e[i];if(n===null||typeof c!="function")s(n);else{const l=c({...n},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&c.id&&l===null&&R.log(`Event processor "${c.id}" dropped event`),gr(l)?l.then(p=>this._notifyEventProcessors(e,p,r,i+1).then(s)).then(null,a):this._notifyEventProcessors(e,l,r,i+1).then(s).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){var n;e.fingerprint=e.fingerprint?(n=e.fingerprint,Array.isArray(n)?n:[n]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function eo(){return vr("globalEventProcessors",()=>[])}function to(t){eo().push(t)}function ki(){return{traceId:xe(),spanId:xe().substring(16),sampled:!1}}const no=4,Ra=100;class wr{constructor(e,n=new Je,r=no){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=Je.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 n=this.pushScope();try{e(n)}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,n){const r=this._lastEventId=n&&n.event_id?n.event_id:xe(),i=new Error("Sentry syntheticException");return this._withClient((s,a)=>{s.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:xe(),s=new Error(e);return this._withClient((a,c)=>{a.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},c)}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:xe();return e.type||(this._lastEventId=r),this._withClient((i,s)=>{i.captureEvent(e,{...n,event_id:r},s)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:a=Ra}=i.getOptions&&i.getOptions()||{};if(a<=0)return;const c={timestamp:pn(),...e},l=s?Hs(()=>s(c,n)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,n),r.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=Ei(this);try{e(this)}finally{Ei(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||r||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
13
13
|
Sentry.addTracingExtensions();
|
|
14
14
|
Sentry.init({...});
|
|
15
|
-
`),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,n=e.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),at(r,s)}(n),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=br}=r&&r.getOptions()||{},{userAgent:a}=ie.navigator||{},c=Pa({release:i,environment:s,user:n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession&&n.getSession();return l&&l.status==="ok"&&at(l,{status:"exited"}),this.endSession(),n.setSession(c),c}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){const{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){const r=rn().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function rn(){return ie.__SENTRY__=ie.__SENTRY__||{extensions:{},hub:void 0},ie}function Ei(t){const e=rn(),n=Wn(e);return ro(e,t),n}function te(){const t=rn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(e=rn()){n=e,n&&n.__SENTRY__&&n.__SENTRY__.hub&&!Wn(e).isOlderThan(no)||ro(e,new wr);var n;return Wn(e)}(t)}function Wn(t){return vr("hub",()=>new wr,t)}function ro(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const xa="7";function Da(t,e){return n={sentry_key:t.publicKey,sentry_version:xa,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function La(t,e,n,r){const i=Zs(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,p,h){const f=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!p&&{dsn:tn(h)},...f&&{trace:hn({...f})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,Et(a,[[{type:s},t]])}const Ti=[];function Ci(t,e){e[t.name]=t,Ti.indexOf(t.name)===-1&&(t.setupOnce(to,te),Ti.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Na(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||xe(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:y,maxValueLength:w=250}=f;"environment"in h||(h.environment="environment"in f?_:br),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&y!==void 0&&(h.dist=y),h.message&&(h.message=et(h.message,w));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,w));const M=h.request;M&&M.url&&(M.url=et(M.url,w))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=ie._sentryDebugIds;if(!_)return;let k;const y=Mi.get(f);y?k=y:(k=new Map,Mi.set(f,k));const w=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let ne=B.length-1;ne>=0;ne--){const Ne=B[ne];if(Ne.filename){T[Ne.filename]=_[M];break}}return T},{});try{h.exception.values.forEach(T=>{T.stacktrace.frames.forEach(M=>{M.filename&&(M.debug_id=w[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Ve.clone(l).update(n.captureContext));let p=ze(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(y=>{y.stacktrace.frames.forEach(w=>{w.debug_id&&(w.abs_path?_[w.abs_path]=w.debug_id:w.filename&&(_[w.filename]=w.debug_id),delete w.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(y=>{k.push({type:"sourcemap",code_file:y,debug_id:_[y]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const y={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(w=>({...w,...w.data&&{data:Re(w.data,_,k)}}))},...f.user&&{user:Re(f.user,_,k)},...f.contexts&&{contexts:Re(f.contexts,_,k)},...f.extra&&{extra:Re(f.extra,_,k)}};return f.contexts&&f.contexts.trace&&y.contexts&&(y.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(y.contexts.trace.data=Re(f.contexts.trace.data,_,k))),f.spans&&(y.spans=f.spans.map(w=>(w.data&&(w.data=Re(w.data,_,k)),w))),y}(h,i,s):h))}const Mi=new WeakMap,Oi="Not capturing exception because it's already been captured.";class qe{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(qe.prototype.__init.call(this),qe.prototype.__init2.call(this),qe.prototype.__init3.call(this),qe.prototype.__init4.call(this),qe.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=ya(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("No DSN provided, client will not do anything."),this._dsn){const n=function(r,i={}){const s=typeof i=="string"?i:i.tunnel,a=typeof i!="string"&&i._metadata?i._metadata.sdk:void 0;return s||`${function(c){return`${function(l){const p=l.protocol?`${l.protocol}:`:"",h=l.port?`:${l.port}`:"";return`${p}//${l.host}${h}${l.path?`/${l.path}`:""}/api/`}(c)}${c.projectId}/envelope/`}(r)}?${Da(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(_i(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const a=Gs(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&_i(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));let i=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(s=>{i=s})),i}captureSession(e){this._isEnabled()?typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),at(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.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 n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i)):ze(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const n={};return e.forEach(r=>{r&&Ci(r,n)}),n}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Ci(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=La(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Ea(r,Ca(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}}sendSession(e){if(this._dsn){const n=function(r,i,s,a){const c=Zs(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Q(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Na(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,y,w){const T=y.getOptions(),{publicKey:M}=y.getDsn()||{},{segment:B}=w&&w.getUser()||{},L=hn({environment:T.environment||br,release:T.release,user_segment:B,public_key:M,trace_id:k});return y.emit&&y.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new le("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Ai(e),l=e.type||"error",p=`before send for type \`${l}\``;if(c&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),nn(new le(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",h,e),new le("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return f;const _=function(k,y,w){const{beforeSend:T,beforeSendTransaction:M}=k;return Ai(y)&&T?T(y,w):Pi(y)&&M?M(y,w):y}(i,f,n);return function(k,y){const w=`${y} must return \`null\` or a valid event.`;if(gr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new le(w);return T},T=>{throw new le(`${y} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new le(w);return k}(_,p)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",h,e),new le(`${p} returned \`null\`, will not send event.`,"log");const _=r&&r.getSession();!a&&_&&this._updateSessionFromEvent(_,f);const k=f.transaction_info;if(a&&k&&f.transaction!==e.transaction){const y="custom";f.transaction_info={...k,source:y}}return this.sendEvent(f,n),f}).then(null,f=>{throw f instanceof le?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new le(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
15
|
+
`),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,n=e.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),at(r,s)}(n),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=br}=r&&r.getOptions()||{},{userAgent:a}=ie.navigator||{},c=Pa({release:i,environment:s,user:n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession&&n.getSession();return l&&l.status==="ok"&&at(l,{status:"exited"}),this.endSession(),n.setSession(c),c}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){const{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){const r=rn().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function rn(){return ie.__SENTRY__=ie.__SENTRY__||{extensions:{},hub:void 0},ie}function Ei(t){const e=rn(),n=Wn(e);return ro(e,t),n}function te(){const t=rn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(e=rn()){n=e,n&&n.__SENTRY__&&n.__SENTRY__.hub&&!Wn(e).isOlderThan(no)||ro(e,new wr);var n;return Wn(e)}(t)}function Wn(t){return vr("hub",()=>new wr,t)}function ro(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const xa="7";function Da(t,e){return n={sentry_key:t.publicKey,sentry_version:xa,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function La(t,e,n,r){const i=Zs(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,p,h){const f=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!p&&{dsn:tn(h)},...f&&{trace:hn({...f})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,Et(a,[[{type:s},t]])}const Ti=[];function Ci(t,e){e[t.name]=t,Ti.indexOf(t.name)===-1&&(t.setupOnce(to,te),Ti.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Na(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||xe(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:y,maxValueLength:w=250}=f;"environment"in h||(h.environment="environment"in f?_:br),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&y!==void 0&&(h.dist=y),h.message&&(h.message=et(h.message,w));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,w));const M=h.request;M&&M.url&&(M.url=et(M.url,w))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=ie._sentryDebugIds;if(!_)return;let k;const y=Mi.get(f);y?k=y:(k=new Map,Mi.set(f,k));const w=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let ne=B.length-1;ne>=0;ne--){const Ne=B[ne];if(Ne.filename){T[Ne.filename]=_[M];break}}return T},{});try{h.exception.values.forEach(T=>{T.stacktrace.frames.forEach(M=>{M.filename&&(M.debug_id=w[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Je.clone(l).update(n.captureContext));let p=ze(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(y=>{y.stacktrace.frames.forEach(w=>{w.debug_id&&(w.abs_path?_[w.abs_path]=w.debug_id:w.filename&&(_[w.filename]=w.debug_id),delete w.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(y=>{k.push({type:"sourcemap",code_file:y,debug_id:_[y]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const y={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(w=>({...w,...w.data&&{data:Re(w.data,_,k)}}))},...f.user&&{user:Re(f.user,_,k)},...f.contexts&&{contexts:Re(f.contexts,_,k)},...f.extra&&{extra:Re(f.extra,_,k)}};return f.contexts&&f.contexts.trace&&y.contexts&&(y.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(y.contexts.trace.data=Re(f.contexts.trace.data,_,k))),f.spans&&(y.spans=f.spans.map(w=>(w.data&&(w.data=Re(w.data,_,k)),w))),y}(h,i,s):h))}const Mi=new WeakMap,Oi="Not capturing exception because it's already been captured.";class qe{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(qe.prototype.__init.call(this),qe.prototype.__init2.call(this),qe.prototype.__init3.call(this),qe.prototype.__init4.call(this),qe.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=ya(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("No DSN provided, client will not do anything."),this._dsn){const n=function(r,i={}){const s=typeof i=="string"?i:i.tunnel,a=typeof i!="string"&&i._metadata?i._metadata.sdk:void 0;return s||`${function(c){return`${function(l){const p=l.protocol?`${l.protocol}:`:"",h=l.port?`:${l.port}`:"";return`${p}//${l.host}${h}${l.path?`/${l.path}`:""}/api/`}(c)}${c.projectId}/envelope/`}(r)}?${Da(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(_i(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const a=Gs(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&_i(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));let i=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(s=>{i=s})),i}captureSession(e){this._isEnabled()?typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),at(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.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 n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i)):ze(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const n={};return e.forEach(r=>{r&&Ci(r,n)}),n}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Ci(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=La(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Ea(r,Ca(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}}sendSession(e){if(this._dsn){const n=function(r,i,s,a){const c=Zs(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Q(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Na(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,y,w){const T=y.getOptions(),{publicKey:M}=y.getDsn()||{},{segment:B}=w&&w.getUser()||{},L=hn({environment:T.environment||br,release:T.release,user_segment:B,public_key:M,trace_id:k});return y.emit&&y.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new le("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Ai(e),l=e.type||"error",p=`before send for type \`${l}\``;if(c&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),nn(new le(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",h,e),new le("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return f;const _=function(k,y,w){const{beforeSend:T,beforeSendTransaction:M}=k;return Ai(y)&&T?T(y,w):Pi(y)&&M?M(y,w):y}(i,f,n);return function(k,y){const w=`${y} must return \`null\` or a valid event.`;if(gr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new le(w);return T},T=>{throw new le(`${y} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new le(w);return k}(_,p)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",h,e),new le(`${p} returned \`null\`, will not send event.`,"log");const _=r&&r.getSession();!a&&_&&this._updateSessionFromEvent(_,f);const k=f.transaction_info;if(a&&k&&f.transaction!==e.transaction){const y="custom";f.transaction_info={...k,source:y}}return this.sendEvent(f,n),f}).then(null,f=>{throw f instanceof le?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new le(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
16
16
|
Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function Ai(t){return t.type===void 0}function Pi(t){return t.type==="transaction"}const ja=30;function Ia(t,e,n=Sa(t.bufferSize||ja)){let r={};function i(s){const a=[];if(wi(s,(p,h)=>{const f=Si(h);if(function(_,k,y=Date.now()){return function(w,T){return w[T]||w.all||0}(_,k)>y}(r,f)){const _=Ri(p,h);t.recordDroppedEvent("ratelimit_backoff",f,_)}else a.push(p)}),a.length===0)return ze();const c=Et(s[0],a),l=p=>{wi(c,(h,f)=>{const _=Ri(h,f);t.recordDroppedEvent(p,Si(f),_)})};return n.add(()=>e({body:Ta(c,t.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),r=Aa(r,p),p),p=>{throw l("network_error"),p})).then(p=>p,p=>{if(p instanceof le)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Skipped sending event because buffer is full."),l("queue_overflow"),ze();throw p})}return i.__sentry__baseTransport__=!0,{send:i,flush:s=>n.drain(s)}}function Ri(t,e){if(e==="event"||e==="transaction")return Array.isArray(t)?t[1]:void 0}const xi="7.60.1";let Di;class Tt{constructor(){Tt.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Tt.id}setupOnce(){Di=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=_r(this)||this;return Di.apply(n,e)}}catch{}}}Tt.__initStatic();const Ba=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Fa=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class tt{static __initStatic(){this.id="InboundFilters"}__init(){this.name=tt.id}constructor(e={}){this._options=e,tt.prototype.__init.call(this)}setupOnce(e,n){const r=i=>{const s=n();if(s){const a=s.getIntegration(tt);if(a){const c=s.getClient(),l=c?c.getOptions():{},p=function(h={},f={}){return{allowUrls:[...h.allowUrls||[],...f.allowUrls||[]],denyUrls:[...h.denyUrls||[],...f.denyUrls||[]],ignoreErrors:[...h.ignoreErrors||[],...f.ignoreErrors||[],...h.disableErrorDefaults?[]:Ba],ignoreTransactions:[...h.ignoreTransactions||[],...f.ignoreTransactions||[],...h.disableTransactionDefaults?[]:Fa],ignoreInternal:h.ignoreInternal===void 0||h.ignoreInternal}}(a._options,l);return function(h,f){return f.ignoreInternal&&function(_){try{return _.exception.values[0].type==="SentryError"}catch{}return!1}(h)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being internal Sentry Error.
|
|
17
17
|
Event: ${Pe(h)}`),!0):function(_,k){return _.type||!k||!k.length?!1:function(y){if(y.message)return[y.message];if(y.exception){const{values:w}=y.exception;try{const{type:T="",value:M=""}=w&&w[w.length-1]||{};return[`${M}`,`${T}: ${M}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract message for event ${Pe(y)}`),[]}}return[]}(_).some(y=>Dt(y,k))}(h,f.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
18
18
|
Event: ${Pe(h)}`),!0):function(_,k){if(_.type!=="transaction"||!k||!k.length)return!1;const y=_.transaction;return!!y&&Dt(y,k)}(h,f.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
@@ -20,15 +20,15 @@ Event: ${Pe(h)}`),!0):function(_,k){if(!k||!k.length)return!1;const y=Ut(_);retu
|
|
|
20
20
|
Event: ${Pe(h)}.
|
|
21
21
|
Url: ${Ut(h)}`),!0):function(_,k){if(!k||!k.length)return!0;const y=Ut(_);return!y||Dt(y,k)}(h,f.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
22
22
|
Event: ${Pe(h)}.
|
|
23
|
-
Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Pe(t)}`),null}}tt.__initStatic();var Ua=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=ie;let Yn=0;function io(){return Yn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(_r(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const a=i.map(c=>ct(c,e));return t.apply(this,a)}catch(a){throw Yn++,setTimeout(()=>{Yn--}),s=c=>{var l,p;c.addEventProcessor(h=>(e.mechanism&&($n(h,void 0),kt(h,e.mechanism)),h.extra={...h.extra,arguments:i},h)),l=a,te().captureException(l,{captureContext:p})},te().withScope(s),a}var s};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}zs(r,t),yr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function so(t,e){const n=Sr(t,e),r={type:e&&e.name,value:Va(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Tn(t,e){return{exception:{values:[so(t,e)]}}}function Sr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(qa.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const qa=/Minified React error #\d+;/i;function Va(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function kr(t,e,n,r,i){let s;if(mr(e)&&e.error)return Tn(t,e.error);if(ai(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(ai(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=Kn(t,l,n,r),$n(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return $s(e)?Tn(t,e):ot(e)||Zt(e)?(s=function(a,c,l,p){const h=te().getClient(),f=h&&h.getOptions().normalizeDepth,_={exception:{values:[{type:Zt(c)?c.constructor.name:p?"UnhandledRejection":"Error",value:Ja(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Ks(c,f)}};if(l){const k=Sr(a,l);k.length&&(_.exception.values[0].stacktrace={frames:k})}return _}(t,e,n,i),kt(s,{synthetic:!0}),s):(s=Kn(t,e,n,r),$n(s,`${e}`),kt(s,{synthetic:!0}),s)}function Kn(t,e,n,r){const i={message:e};if(r&&n){const s=Sr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Ja(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Ws(i));if(a.sort(),!a.length)return"[object has no keys]";if(a[0].length>=s)return et(a[0],s);for(let c=a.length;c>0;c--){const l=a.slice(0,c).join(", ");if(!(l.length>s))return c===a.length?l:et(l,s)}return""}(t),r=e?"promise rejection":"exception";return mr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Zt(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const Li=1024,oo="Breadcrumbs";class Ct{static __initStatic(){this.id=oo}__init(){this.name=Ct.id}constructor(e){Ct.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ue("console",$a),this.options.dom&&Ue("dom",function(e){function n(r){let i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Li&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=Li),typeof s=="string"&&(s=[s]);try{const c=r.event;i=function(l){return!!l&&!!l.target}(c)?Un(c.target,{keyAttrs:s,maxStringLength:a}):Un(c,{keyAttrs:s,maxStringLength:a})}catch{i="<unknown>"}i.length!==0&&te().addBreadcrumb({category:`ui.${r.name}`,message:i},{event:r.event,name:r.name,global:r.global})}return n}(this.options.dom)),this.options.xhr&&Ue("xhr",Ga),this.options.fetch&&Ue("fetch",Ha),this.options.history&&Ue("history",za)}addSentryBreadcrumb(e){this.options.sentry&&te().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Pe(e)},{event:e})}}function $a(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:(n=t.level,n==="warn"?"warning":ka.includes(n)?n:"log"),message:ci(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ci(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}te().addBreadcrumb(e,{input:t.args,level:t.level})}function Ga(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[vt];if(!e||!n||!r)return;const{method:i,url:s,status_code:a,body:c}=r,l={method:i,url:s,status_code:a},p={xhr:t.xhr,input:c,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"xhr",data:l,type:"http"},p)}function Ha(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!=="POST"))if(t.error){const r=t.fetchData,i={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...t.fetchData,status_code:t.response&&t.response.status},i={input:t.args,response:t.response,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function za(t){let e=t.from,n=t.to;const r=kn(F.location.href);let i=kn(e);const s=kn(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),te().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}Ct.__initStatic();class Wa extends qe{constructor(e){const n=F.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:xi}],version:xi},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=kr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),ze(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const p=Kn(i,s,c&&c.syntheticException||void 0,l);return p.level=a,c&&c.event_id&&(p.event_id=c.event_id),ze(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(oo);r&&r.addSentryBreadcrumb&&r.addSentryBreadcrumb(e),super.sendEvent(e,n)}captureUserFeedback(e){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:tn(a)}};return Et(c,[function(p){return[{type:"user_report"},p]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("Sending outcomes:",e);const n=(r=e,Et((i=this._options.tunnel&&tn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||pn(),discarded_events:r}]]));var r,i,s;this._sendEnvelope(n)}}let ft;function Ya(t,e=function(){if(ft)return ft;if(Vn(F.fetch))return ft=F.fetch.bind(F);const n=F.document;let r=F.fetch;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s.fetch&&(r=s.fetch),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return ft=r.bind(F)}()){let n=0,r=0;return Ia(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ft=void 0,n-=s,r--,nn(c)}})}class De{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=De.id}__init2(){this._installFunc={onerror:Ka,onunhandledrejection:Qa}}constructor(e){De.prototype.__init.call(this),De.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const i=this._installFunc[r];i&&e[r]&&(n=r,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Global Handler attached: ${n}`),i(),this._installFunc[r]=void 0)}var n}}function Ka(){Ue("error",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(io()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const y=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let w=mr(h)?h.message:h,T="Error";const M=w.match(y);return M&&(T=M[1],w=M[2]),Ni({exception:{values:[{type:T,value:w}]}},f,_,k)}(i,s,a,c):Ni(kr(n,l||i,void 0,r,!1),s,a,c);p.level="error",ao(e,l,p,"onerror")})}function Qa(){Ue("unhandledrejection",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(io()||i&&i.__sentry_own_request__)return!0;const s=Gs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:kr(n,i,void 0,r,!0);s.level="error",ao(e,i,s,"onunhandledrejection")})}function Ni(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,f=Ge(e)&&e.length>0?e:function(){try{return fa.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function ao(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function co(){const t=te(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}De.__initStatic();const Xa=["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 Mt{static __initStatic(){this.id="TryCatch"}__init(){this.name=Mt.id}constructor(e){Mt.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&z(F,"setTimeout",ji),this._options.setInterval&&z(F,"setInterval",ji),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Za),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",ec);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Xa).forEach(tc)}}function ji(t){return function(...e){const n=e[0];return e[0]=ct(n,{mechanism:{data:{function:Le(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Za(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!0,type:"instrument"}})])}}function ec(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&z(n,r,function(i){const s={mechanism:{data:{function:r,handler:Le(i)},handled:!0,type:"instrument"}},a=_r(i);return a&&(s.mechanism.data.handler=Le(a)),ct(i,s)})}),t.apply(this,e)}}function tc(t){const e=F,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(z(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=ct(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(s),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,ct(s,{mechanism:{data:{function:"addEventListener",handler:Le(s),target:t},handled:!0,type:"instrument"}}),a])}}),z(n,"removeEventListener",function(r){return function(i,s,a){const c=s;try{const l=c&&c.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,c,a)}}))}Mt.__initStatic();class nt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=nt.id}constructor(e={}){nt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,n){e((r,i)=>{const s=n(),a=s.getClient(),c=s.getIntegration(nt);if(!a||!c)return r;const l=a.getOptions();return pa(so,l.stackParser,l.maxValueLength,c._key,c._limit,r,i),r})}}nt.__initStatic();class rt{constructor(){rt.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=rt.id}setupOnce(){to(e=>{if(te().getIntegration(rt)){if(!F.navigator&&!F.location&&!F.document)return e;const n=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:i}=F.navigator||{},s={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},a={...e.request,...n&&{url:n},headers:s};return{...e,request:a}}return e})}}rt.__initStatic();class it{constructor(){it.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=it.id}setupOnce(e,n){const r=i=>{if(i.type)return i;const s=n().getIntegration(it);if(s){try{if(function(a,c){return c?!!(function(l,p){const h=l.message,f=p.message;return!(!h&&!f||h&&!f||!h&&f||h!==f||!Bi(l,p)||!Ii(l,p))}(a,c)||function(l,p){const h=Fi(p),f=Fi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Bi(l,p)||!Ii(l,p))}(a,c)):!1}(i,s._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return s._previousEvent=i}return s._previousEvent=i}return i};r.id=this.name,e(r)}}function Ii(t,e){let n=Ui(t),r=Ui(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Bi(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Fi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Ui(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var nc=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:De,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let lo={};F.Sentry&&F.Sentry.Integrations&&(lo=F.Sentry.Integrations);const qi={...lo,...Ua,...nc};var Vi="new",Ji="loading",$i="loaded",Qn="joining-meeting",Qe="joined-meeting",Ie="left-meeting",Ce="error",Cn="unknown",rc="full",ic="base",sc="*",oc="iframe-ready-for-launch-config",ac="iframe-launch-config",cc="theme-updated",lc="loading",uc="load-attempt-failed",Gi="loaded",dc="started-camera",hc="camera-error",pc="joining-meeting",fc="joined-meeting",mc="left-meeting",gc="participant-joined",vc="participant-updated",yc="participant-left",_c="participant-counts-updated",bc="access-state-updated",wc="meeting-session-summary-updated",Sc="meeting-session-state-updated",kc="waiting-participant-added",Ec="waiting-participant-updated",Tc="waiting-participant-removed",Cc="track-started",Mc="track-stopped",Oc="transcription-started",Ac="transcription-stopped",Pc="transcription-error",Hi="recording-started",zi="recording-stopped",Rc="recording-stats",xc="recording-error",Dc="recording-upload-completed",Lc="recording-data",Nc="app-message",jc="transcription-message",Ic="remote-media-player-started",Bc="remote-media-player-updated",Fc="remote-media-player-stopped",Uc="local-screen-share-started",qc="local-screen-share-stopped",Vc="local-screen-share-canceled",Jc="active-speaker-change",$c="active-speaker-mode-change",Gc="network-quality-change",Hc="network-connection",zc="cpu-load-change",Wc="face-counts-updated",qt="fullscreen",Vt="exited-fullscreen",Yc="live-streaming-started",Kc="live-streaming-updated",Qc="live-streaming-stopped",Xc="live-streaming-error",Zc="lang-updated",el="receive-settings-updated",tl="input-settings-updated",Wi="nonfatal-error",Yi="error",Ki=102400,Mn="iframe-call-message",Qi="local-screen-start",Xi="daily-method-update-live-streaming-endpoints",Jt="transmit-log",yt="daily-custom-track",Wt={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},uo={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Zi=10,On=["jpg","png","jpeg"],nl="add-endpoints",rl="remove-endpoints",es="sip-call-transfer";function he(){return!N()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function N(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function ho(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function il(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(t,e){if(!t||!e)return!0;switch(t){case"Chrome":return e.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(e.major===13&&e.minor===0&&e.point===0);case"Firefox":return e.major>=67}return!0}(We(),er())||N())}function ts(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var sl=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function po(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!sl&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(We())}():function(){if(Zn())return!1;var e=We();if(e==="Safari"){var n=Tr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Er().major>=77:e==="Firefox"?Cr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var ol=["Chrome","Firefox"];function fo(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&ol.includes(We())}function ns(){return ho()&&!function(){var t,e=We();if(!he())return!0;switch(e){case"Chrome":return(t=Er()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Cr()).major<91;case"Safari":return(t=Tr()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Zn(){var t,e,n=he(),r=n.match(/Mac/)&&(!N()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(e=t.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!he().match(/DailyAnd\//)||void 0}function We(){if(typeof window<"u"){var t=he();return mo()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function er(){switch(We()){case"Chrome":return Er();case"Safari":return Tr();case"Firefox":return Cr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function Er(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=he(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function mo(){return!!he().match(/iPad|iPhone|iPod/i)&&ho()}function Tr(){var t=0,e=0,n=0;if(typeof window<"u"){var r=he().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else mo()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Cr(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var go=function(){function t(){pe(this,t)}return fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){pt()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){pt()}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){pt()}},{key:"sendMessageToDailyJs",value:function(e,n){pt()}},{key:"removeListener",value:function(e){pt()}}]),t}();function rs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function An(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rs(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function al(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var cl=function(t){ln(n,go);var e=al(n);function n(){var r;return pe(this,n),(r=e.call(this))._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){var a=this,c=function(l){if(l.data&&l.data.what==="iframe-call-message"&&(!l.data.callClientId||l.data.callClientId===i)&&(!l.data.from||l.data.from!=="module")){var p=An({},l.data);if(delete p.from,p.callbackStamp&&a._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;a._messageCallbacks[h].call(s,p),delete a._messageCallbacks[h]}delete p.what,delete p.callbackStamp,r.call(s,p)}};this._wrappedListeners[r]=c,window.addEventListener("message",c)}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){var a=function(c){var l;if(!(!c.data||c.data.what!==Mn||!c.data.action||c.data.from&&c.data.from!=="module"||c.data.callClientId&&i&&c.data.callClientId!==i||c!=null&&(l=c.data)!==null&&l!==void 0&&l.callFrameId)){var p=c.data;r.call(s,p)}};this._wrappedListeners[r]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(r,i,s,a){if(!a)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var c=An({},r);if(c.what=Mn,c.from="module",c.callClientId=a,i){var l=dn();this._messageCallbacks[l]=i,c.callbackStamp=l}var p=s?s.contentWindow:window,h=this._callMachineTargetOrigin(s);h&&p.postMessage(c,h)}},{key:"sendMessageToDailyJs",value:function(r,i){r.what=Mn,r.callClientId=i,r.from="embedded",window.postMessage(r,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"forwardPackagedMessageToCallMachine",value:function(r,i,s){var a=An({},r);a.callClientId=s;var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(a,l)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(r,i){var s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===i)&&(!a.data.from||a.data.from!=="module")){var c=a.data;r(c)}};return this._wrappedListeners[r]=s,window.addEventListener("message",s),r}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"_callMachineTargetOrigin",value:function(r){return r?r.src?new URL(r.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),n}();function ll(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var ul=function(t){ln(n,go);var e=ll(n);function n(){var r;return pe(this,n),r=e.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Ee.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Ee.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){this._addListener(r,global.callMachineToDailyJsEmitter,s,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){this._addListener(r,global.dailyJsToCallMachineEmitter,s,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(r,i){this._sendMessage(r,global.dailyJsToCallMachineEmitter,"sending message to call machine",i)}},{key:"sendMessageToDailyJs",value:function(r){this._sendMessage(r,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(global.callMachineToDailyJsEmitter.removeListener("message",i),global.dailyJsToCallMachineEmitter.removeListener("message",i),delete this._wrappedListeners[r])}},{key:"_addListener",value:function(r,i,s,a){var c=this,l=function(p){if(p.callbackStamp&&c._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;c._messageCallbacks[h].call(s,p),delete c._messageCallbacks[h]}r.call(s,p)};this._wrappedListeners[r]=l,i.addListener("message",l)}},{key:"_sendMessage",value:function(r,i,s,a){if(a){var c=dn();this._messageCallbacks[c]=a,r.callbackStamp=c}i.emit("message",r)}}]),n}(),tr="replace",nr="shallow-merge",is=[tr,nr],dl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?tr:r;pe(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return fe(t,[{key:"isNoOp",value:function(){return t.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,n){return Object.keys(e).length===0&&n===nr}},{key:"_validateMergeStrategy",value:function(e){if(!is.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(is,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||U(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===tr){var i=JSON.parse(r);X(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===nr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));X(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Ki)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Ki,"."))}}]),t}();function rr(t,e,n){return rr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(r,i,s){var a=[null];a.push.apply(a,i);var c=new(Function.bind.apply(r,a));return s&&wt(c,s.prototype),c},rr.apply(null,arguments)}function ir(t){var e=typeof Map=="function"?new Map:void 0;return ir=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return rr(n,arguments,de(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wt(i,n)},ir(t)}function hl(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function ss(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var pl=function(){function t(e){pe(this,t),this._currentLoad=null,this._callClientId=e}return fe(t,[{key:"load",value:function(){var e,n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void i(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new fl(r,function(){i(!1)},function(a,c){c||ss(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),ss(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),fl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;pe(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r}return fe(t,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new os(this._dailyConfig,this._successCallback,function n(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new os(e._dailyConfig,e._successCallback,n),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}}]),t}(),Pn=function(t){ln(n,ir(Error));var e=hl(n);function n(){return pe(this,n),e.apply(this,arguments)}return fe(n)}(),sn=2e4,os=function(){function t(n,r,i){pe(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new ml(n,r,i):new gl(n,r,i)}var e;return fe(t,[{key:"start",value:(e=O(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),t}(),ml=function(){function t(s,a,c){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c}var e,n,r,i;return fe(t,[{key:"start",value:(i=O(function*(){var s=Xt(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=O(function*(s){if(!this._iosCache)return!1;try{var a=yield this._iosCache.get(s);return!!this.cancelled||!!a&&(a.code?(Function('"use strict";'+a.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=a.refetchHeaders,!1))}catch{return!1}}),function(s){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=O(function*(s){var a=this;this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(s),type:"timeout"})},sn);try{var c=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(s,c);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Pn;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new Pn;Function('"use strict";'+p)(),this._iosCache&&this._iosCache.set(s,p,l.headers),this.succeeded=!0,this._successCallback()}catch(h){if(clearTimeout(this._networkTimeout),h instanceof Pn||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(h),type:h.message})}}),function(s){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=O(function*(s,a){if(a.ok)return yield a.text();if(this._iosCache&&a.status===304)return(yield this._iosCache.renew(s,a.headers)).code;throw new Error("Received ".concat(a.status," response"))}),function(s,a){return e.apply(this,arguments)})}]),t}(),gl=function(){function t(e,n,r){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=dn(),this._networkTimeout=null,this._scriptElement=null}return fe(t,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Xt(this._dailyConfig);(typeof document>"u"?"undefined":U(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var n=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){n._stopLoading(),n._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(e),type:"timeout"})},sn);var r=document.getElementsByTagName("head")[0],i=document.createElement("script");this._scriptElement=i,i.onload=function(){n._stopLoading(),n.succeeded=!0,n._successCallback()},i.onerror=function(s){n._stopLoading(),n._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},i.src=e,r.appendChild(i)}},{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)}}]),t}(),$t=function(t,e,n){return yl(t.local,e,n)===!0},vl=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Xe=function(t,e,n,r){var i=_l(t,e,n,r);return i&&i.pendingTrack},yl=function(t,e,n){if(!t)return!1;var r=function(s){switch(s){case"avatar":return!0;case"staged":return s;default:return!!s}},i=t.public.subscribedTracks;return i&&i[e]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)===-1&&i[e].custom?[!0,"staged"].includes(i[e].custom)?r(i[e].custom):r(i[e].custom[n]):r(i[e][n]):!i||r(i.ALL)},_l=function(t,e,n,r){var i=Object.values(t.streams||{}).filter(function(s){return s.participantId===e&&s.type===n&&s.pendingTrack&&s.pendingTrack.kind===r}).sort(function(s,a){return new Date(a.starttime)-new Date(s.starttime)});return i&&i[0]},bl=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function as(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],p=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[p];if(h){var f=t.local?vl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function cs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!wl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?bl(n,r):Xe(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function wl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function ls(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&$t(r,t.session_id,"cam-audio")){var a=Xe(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&$t(r,t.session_id,"cam-video")){var c=Xe(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&$t(r,t.session_id,"screen-audio")){var l=Xe(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&$t(r,t.session_id,"screen-video")){var p=Xe(r,t.session_id,"screen","video");p&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===p.id?t.screenVideoTrack=p:p.muted||(t.screenVideoTrack=p))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function Sl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return us(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return us(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
+
Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Pe(t)}`),null}}tt.__initStatic();var Ua=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=ie;let Yn=0;function io(){return Yn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(_r(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const a=i.map(c=>ct(c,e));return t.apply(this,a)}catch(a){throw Yn++,setTimeout(()=>{Yn--}),s=c=>{var l,p;c.addEventProcessor(h=>(e.mechanism&&($n(h,void 0),kt(h,e.mechanism)),h.extra={...h.extra,arguments:i},h)),l=a,te().captureException(l,{captureContext:p})},te().withScope(s),a}var s};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}zs(r,t),yr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function so(t,e){const n=Sr(t,e),r={type:e&&e.name,value:Ja(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Tn(t,e){return{exception:{values:[so(t,e)]}}}function Sr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(qa.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const qa=/Minified React error #\d+;/i;function Ja(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function kr(t,e,n,r,i){let s;if(mr(e)&&e.error)return Tn(t,e.error);if(ai(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(ai(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=Kn(t,l,n,r),$n(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return $s(e)?Tn(t,e):ot(e)||Zt(e)?(s=function(a,c,l,p){const h=te().getClient(),f=h&&h.getOptions().normalizeDepth,_={exception:{values:[{type:Zt(c)?c.constructor.name:p?"UnhandledRejection":"Error",value:Va(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Ks(c,f)}};if(l){const k=Sr(a,l);k.length&&(_.exception.values[0].stacktrace={frames:k})}return _}(t,e,n,i),kt(s,{synthetic:!0}),s):(s=Kn(t,e,n,r),$n(s,`${e}`),kt(s,{synthetic:!0}),s)}function Kn(t,e,n,r){const i={message:e};if(r&&n){const s=Sr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Va(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Ws(i));if(a.sort(),!a.length)return"[object has no keys]";if(a[0].length>=s)return et(a[0],s);for(let c=a.length;c>0;c--){const l=a.slice(0,c).join(", ");if(!(l.length>s))return c===a.length?l:et(l,s)}return""}(t),r=e?"promise rejection":"exception";return mr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Zt(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const Li=1024,oo="Breadcrumbs";class Ct{static __initStatic(){this.id=oo}__init(){this.name=Ct.id}constructor(e){Ct.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ue("console",$a),this.options.dom&&Ue("dom",function(e){function n(r){let i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Li&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=Li),typeof s=="string"&&(s=[s]);try{const c=r.event;i=function(l){return!!l&&!!l.target}(c)?Un(c.target,{keyAttrs:s,maxStringLength:a}):Un(c,{keyAttrs:s,maxStringLength:a})}catch{i="<unknown>"}i.length!==0&&te().addBreadcrumb({category:`ui.${r.name}`,message:i},{event:r.event,name:r.name,global:r.global})}return n}(this.options.dom)),this.options.xhr&&Ue("xhr",Ga),this.options.fetch&&Ue("fetch",Ha),this.options.history&&Ue("history",za)}addSentryBreadcrumb(e){this.options.sentry&&te().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Pe(e)},{event:e})}}function $a(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:(n=t.level,n==="warn"?"warning":ka.includes(n)?n:"log"),message:ci(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ci(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}te().addBreadcrumb(e,{input:t.args,level:t.level})}function Ga(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[vt];if(!e||!n||!r)return;const{method:i,url:s,status_code:a,body:c}=r,l={method:i,url:s,status_code:a},p={xhr:t.xhr,input:c,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"xhr",data:l,type:"http"},p)}function Ha(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!=="POST"))if(t.error){const r=t.fetchData,i={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...t.fetchData,status_code:t.response&&t.response.status},i={input:t.args,response:t.response,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function za(t){let e=t.from,n=t.to;const r=kn(F.location.href);let i=kn(e);const s=kn(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),te().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}Ct.__initStatic();class Wa extends qe{constructor(e){const n=F.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:xi}],version:xi},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=kr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),ze(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const p=Kn(i,s,c&&c.syntheticException||void 0,l);return p.level=a,c&&c.event_id&&(p.event_id=c.event_id),ze(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(oo);r&&r.addSentryBreadcrumb&&r.addSentryBreadcrumb(e),super.sendEvent(e,n)}captureUserFeedback(e){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:tn(a)}};return Et(c,[function(p){return[{type:"user_report"},p]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("Sending outcomes:",e);const n=(r=e,Et((i=this._options.tunnel&&tn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||pn(),discarded_events:r}]]));var r,i,s;this._sendEnvelope(n)}}let ft;function Ya(t,e=function(){if(ft)return ft;if(Jn(F.fetch))return ft=F.fetch.bind(F);const n=F.document;let r=F.fetch;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s.fetch&&(r=s.fetch),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return ft=r.bind(F)}()){let n=0,r=0;return Ia(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ft=void 0,n-=s,r--,nn(c)}})}class De{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=De.id}__init2(){this._installFunc={onerror:Ka,onunhandledrejection:Qa}}constructor(e){De.prototype.__init.call(this),De.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const i=this._installFunc[r];i&&e[r]&&(n=r,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Global Handler attached: ${n}`),i(),this._installFunc[r]=void 0)}var n}}function Ka(){Ue("error",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(io()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const y=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let w=mr(h)?h.message:h,T="Error";const M=w.match(y);return M&&(T=M[1],w=M[2]),Ni({exception:{values:[{type:T,value:w}]}},f,_,k)}(i,s,a,c):Ni(kr(n,l||i,void 0,r,!1),s,a,c);p.level="error",ao(e,l,p,"onerror")})}function Qa(){Ue("unhandledrejection",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(io()||i&&i.__sentry_own_request__)return!0;const s=Gs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:kr(n,i,void 0,r,!0);s.level="error",ao(e,i,s,"onunhandledrejection")})}function Ni(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,f=Ge(e)&&e.length>0?e:function(){try{return fa.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function ao(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function co(){const t=te(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}De.__initStatic();const Xa=["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 Mt{static __initStatic(){this.id="TryCatch"}__init(){this.name=Mt.id}constructor(e){Mt.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&z(F,"setTimeout",ji),this._options.setInterval&&z(F,"setInterval",ji),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Za),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",ec);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Xa).forEach(tc)}}function ji(t){return function(...e){const n=e[0];return e[0]=ct(n,{mechanism:{data:{function:Le(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Za(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!0,type:"instrument"}})])}}function ec(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&z(n,r,function(i){const s={mechanism:{data:{function:r,handler:Le(i)},handled:!0,type:"instrument"}},a=_r(i);return a&&(s.mechanism.data.handler=Le(a)),ct(i,s)})}),t.apply(this,e)}}function tc(t){const e=F,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(z(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=ct(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(s),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,ct(s,{mechanism:{data:{function:"addEventListener",handler:Le(s),target:t},handled:!0,type:"instrument"}}),a])}}),z(n,"removeEventListener",function(r){return function(i,s,a){const c=s;try{const l=c&&c.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,c,a)}}))}Mt.__initStatic();class nt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=nt.id}constructor(e={}){nt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,n){e((r,i)=>{const s=n(),a=s.getClient(),c=s.getIntegration(nt);if(!a||!c)return r;const l=a.getOptions();return pa(so,l.stackParser,l.maxValueLength,c._key,c._limit,r,i),r})}}nt.__initStatic();class rt{constructor(){rt.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=rt.id}setupOnce(){to(e=>{if(te().getIntegration(rt)){if(!F.navigator&&!F.location&&!F.document)return e;const n=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:i}=F.navigator||{},s={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},a={...e.request,...n&&{url:n},headers:s};return{...e,request:a}}return e})}}rt.__initStatic();class it{constructor(){it.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=it.id}setupOnce(e,n){const r=i=>{if(i.type)return i;const s=n().getIntegration(it);if(s){try{if(function(a,c){return c?!!(function(l,p){const h=l.message,f=p.message;return!(!h&&!f||h&&!f||!h&&f||h!==f||!Bi(l,p)||!Ii(l,p))}(a,c)||function(l,p){const h=Fi(p),f=Fi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Bi(l,p)||!Ii(l,p))}(a,c)):!1}(i,s._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return s._previousEvent=i}return s._previousEvent=i}return i};r.id=this.name,e(r)}}function Ii(t,e){let n=Ui(t),r=Ui(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Bi(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Fi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Ui(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var nc=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:De,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let lo={};F.Sentry&&F.Sentry.Integrations&&(lo=F.Sentry.Integrations);const qi={...lo,...Ua,...nc};var Ji="new",Vi="loading",$i="loaded",Qn="joining-meeting",Qe="joined-meeting",Ie="left-meeting",Ce="error",Cn="unknown",rc="full",ic="base",sc="*",oc="iframe-ready-for-launch-config",ac="iframe-launch-config",cc="theme-updated",lc="loading",uc="load-attempt-failed",Gi="loaded",dc="started-camera",hc="camera-error",pc="joining-meeting",fc="joined-meeting",mc="left-meeting",gc="participant-joined",vc="participant-updated",yc="participant-left",_c="participant-counts-updated",bc="access-state-updated",wc="meeting-session-summary-updated",Sc="meeting-session-state-updated",kc="waiting-participant-added",Ec="waiting-participant-updated",Tc="waiting-participant-removed",Cc="track-started",Mc="track-stopped",Oc="transcription-started",Ac="transcription-stopped",Pc="transcription-error",Hi="recording-started",zi="recording-stopped",Rc="recording-stats",xc="recording-error",Dc="recording-upload-completed",Lc="recording-data",Nc="app-message",jc="transcription-message",Ic="remote-media-player-started",Bc="remote-media-player-updated",Fc="remote-media-player-stopped",Uc="local-screen-share-started",qc="local-screen-share-stopped",Jc="local-screen-share-canceled",Vc="active-speaker-change",$c="active-speaker-mode-change",Gc="network-quality-change",Hc="network-connection",zc="cpu-load-change",Wc="face-counts-updated",qt="fullscreen",Jt="exited-fullscreen",Yc="live-streaming-started",Kc="live-streaming-updated",Qc="live-streaming-stopped",Xc="live-streaming-error",Zc="lang-updated",el="receive-settings-updated",tl="input-settings-updated",Wi="nonfatal-error",Yi="error",Ki=102400,Mn="iframe-call-message",Qi="local-screen-start",Xi="daily-method-update-live-streaming-endpoints",Vt="transmit-log",yt="daily-custom-track",Wt={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},uo={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Zi=10,On=["jpg","png","jpeg"],nl="add-endpoints",rl="remove-endpoints",es="sip-call-transfer";function he(){return!N()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function N(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function ho(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function il(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(t,e){if(!t||!e)return!0;switch(t){case"Chrome":return e.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(e.major===13&&e.minor===0&&e.point===0);case"Firefox":return e.major>=67}return!0}(We(),er())||N())}function ts(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var sl=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function po(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!sl&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(We())}():function(){if(Zn())return!1;var e=We();if(e==="Safari"){var n=Tr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Er().major>=77:e==="Firefox"?Cr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var ol=["Chrome","Firefox"];function fo(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&ol.includes(We())}function ns(){return ho()&&!function(){var t,e=We();if(!he())return!0;switch(e){case"Chrome":return(t=Er()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Cr()).major<91;case"Safari":return(t=Tr()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Zn(){var t,e,n=he(),r=n.match(/Mac/)&&(!N()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(e=t.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!he().match(/DailyAnd\//)||void 0}function We(){if(typeof window<"u"){var t=he();return mo()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function er(){switch(We()){case"Chrome":return Er();case"Safari":return Tr();case"Firefox":return Cr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function Er(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=he(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function mo(){return!!he().match(/iPad|iPhone|iPod/i)&&ho()}function Tr(){var t=0,e=0,n=0;if(typeof window<"u"){var r=he().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else mo()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Cr(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var go=function(){function t(){pe(this,t)}return fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){pt()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){pt()}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){pt()}},{key:"sendMessageToDailyJs",value:function(e,n){pt()}},{key:"removeListener",value:function(e){pt()}}]),t}();function rs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function An(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rs(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function al(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var cl=function(t){ln(n,go);var e=al(n);function n(){var r;return pe(this,n),(r=e.call(this))._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){var a=this,c=function(l){if(l.data&&l.data.what==="iframe-call-message"&&(!l.data.callClientId||l.data.callClientId===i)&&(!l.data.from||l.data.from!=="module")){var p=An({},l.data);if(delete p.from,p.callbackStamp&&a._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;a._messageCallbacks[h].call(s,p),delete a._messageCallbacks[h]}delete p.what,delete p.callbackStamp,r.call(s,p)}};this._wrappedListeners[r]=c,window.addEventListener("message",c)}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){var a=function(c){var l;if(!(!c.data||c.data.what!==Mn||!c.data.action||c.data.from&&c.data.from!=="module"||c.data.callClientId&&i&&c.data.callClientId!==i||c!=null&&(l=c.data)!==null&&l!==void 0&&l.callFrameId)){var p=c.data;r.call(s,p)}};this._wrappedListeners[r]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(r,i,s,a){if(!a)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var c=An({},r);if(c.what=Mn,c.from="module",c.callClientId=a,i){var l=dn();this._messageCallbacks[l]=i,c.callbackStamp=l}var p=s?s.contentWindow:window,h=this._callMachineTargetOrigin(s);h&&p.postMessage(c,h)}},{key:"sendMessageToDailyJs",value:function(r,i){r.what=Mn,r.callClientId=i,r.from="embedded",window.postMessage(r,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"forwardPackagedMessageToCallMachine",value:function(r,i,s){var a=An({},r);a.callClientId=s;var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(a,l)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(r,i){var s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===i)&&(!a.data.from||a.data.from!=="module")){var c=a.data;r(c)}};return this._wrappedListeners[r]=s,window.addEventListener("message",s),r}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"_callMachineTargetOrigin",value:function(r){return r?r.src?new URL(r.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),n}();function ll(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var ul=function(t){ln(n,go);var e=ll(n);function n(){var r;return pe(this,n),r=e.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Ee.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Ee.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){this._addListener(r,global.callMachineToDailyJsEmitter,s,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){this._addListener(r,global.dailyJsToCallMachineEmitter,s,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(r,i){this._sendMessage(r,global.dailyJsToCallMachineEmitter,"sending message to call machine",i)}},{key:"sendMessageToDailyJs",value:function(r){this._sendMessage(r,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(global.callMachineToDailyJsEmitter.removeListener("message",i),global.dailyJsToCallMachineEmitter.removeListener("message",i),delete this._wrappedListeners[r])}},{key:"_addListener",value:function(r,i,s,a){var c=this,l=function(p){if(p.callbackStamp&&c._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;c._messageCallbacks[h].call(s,p),delete c._messageCallbacks[h]}r.call(s,p)};this._wrappedListeners[r]=l,i.addListener("message",l)}},{key:"_sendMessage",value:function(r,i,s,a){if(a){var c=dn();this._messageCallbacks[c]=a,r.callbackStamp=c}i.emit("message",r)}}]),n}(),tr="replace",nr="shallow-merge",is=[tr,nr],dl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?tr:r;pe(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return fe(t,[{key:"isNoOp",value:function(){return t.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,n){return Object.keys(e).length===0&&n===nr}},{key:"_validateMergeStrategy",value:function(e){if(!is.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(is,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||U(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===tr){var i=JSON.parse(r);X(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===nr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));X(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Ki)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Ki,"."))}}]),t}();function rr(t,e,n){return rr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(r,i,s){var a=[null];a.push.apply(a,i);var c=new(Function.bind.apply(r,a));return s&&wt(c,s.prototype),c},rr.apply(null,arguments)}function ir(t){var e=typeof Map=="function"?new Map:void 0;return ir=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return rr(n,arguments,de(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wt(i,n)},ir(t)}function hl(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function ss(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var pl=function(){function t(e){pe(this,t),this._currentLoad=null,this._callClientId=e}return fe(t,[{key:"load",value:function(){var e,n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void i(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new fl(r,function(){i(!1)},function(a,c){c||ss(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),ss(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),fl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;pe(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r}return fe(t,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new os(this._dailyConfig,this._successCallback,function n(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new os(e._dailyConfig,e._successCallback,n),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}}]),t}(),Pn=function(t){ln(n,ir(Error));var e=hl(n);function n(){return pe(this,n),e.apply(this,arguments)}return fe(n)}(),sn=2e4,os=function(){function t(n,r,i){pe(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new ml(n,r,i):new gl(n,r,i)}var e;return fe(t,[{key:"start",value:(e=O(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),t}(),ml=function(){function t(s,a,c){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c}var e,n,r,i;return fe(t,[{key:"start",value:(i=O(function*(){var s=Xt(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=O(function*(s){if(!this._iosCache)return!1;try{var a=yield this._iosCache.get(s);return!!this.cancelled||!!a&&(a.code?(Function('"use strict";'+a.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=a.refetchHeaders,!1))}catch{return!1}}),function(s){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=O(function*(s){var a=this;this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(s),type:"timeout"})},sn);try{var c=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(s,c);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Pn;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new Pn;Function('"use strict";'+p)(),this._iosCache&&this._iosCache.set(s,p,l.headers),this.succeeded=!0,this._successCallback()}catch(h){if(clearTimeout(this._networkTimeout),h instanceof Pn||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(h),type:h.message})}}),function(s){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=O(function*(s,a){if(a.ok)return yield a.text();if(this._iosCache&&a.status===304)return(yield this._iosCache.renew(s,a.headers)).code;throw new Error("Received ".concat(a.status," response"))}),function(s,a){return e.apply(this,arguments)})}]),t}(),gl=function(){function t(e,n,r){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=dn(),this._networkTimeout=null,this._scriptElement=null}return fe(t,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Xt(this._dailyConfig);(typeof document>"u"?"undefined":U(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var n=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){n._stopLoading(),n._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(e),type:"timeout"})},sn);var r=document.getElementsByTagName("head")[0],i=document.createElement("script");this._scriptElement=i,i.onload=function(){n._stopLoading(),n.succeeded=!0,n._successCallback()},i.onerror=function(s){n._stopLoading(),n._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},i.src=e,r.appendChild(i)}},{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)}}]),t}(),$t=function(t,e,n){return yl(t.local,e,n)===!0},vl=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Xe=function(t,e,n,r){var i=_l(t,e,n,r);return i&&i.pendingTrack},yl=function(t,e,n){if(!t)return!1;var r=function(s){switch(s){case"avatar":return!0;case"staged":return s;default:return!!s}},i=t.public.subscribedTracks;return i&&i[e]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)===-1&&i[e].custom?[!0,"staged"].includes(i[e].custom)?r(i[e].custom):r(i[e].custom[n]):r(i[e][n]):!i||r(i.ALL)},_l=function(t,e,n,r){var i=Object.values(t.streams||{}).filter(function(s){return s.participantId===e&&s.type===n&&s.pendingTrack&&s.pendingTrack.kind===r}).sort(function(s,a){return new Date(a.starttime)-new Date(s.starttime)});return i&&i[0]},bl=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function as(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],p=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[p];if(h){var f=t.local?vl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function cs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!wl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?bl(n,r):Xe(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function wl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function ls(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&$t(r,t.session_id,"cam-audio")){var a=Xe(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&$t(r,t.session_id,"cam-video")){var c=Xe(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&$t(r,t.session_id,"screen-audio")){var l=Xe(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&$t(r,t.session_id,"screen-video")){var p=Xe(r,t.session_id,"screen","video");p&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===p.id?t.screenVideoTrack=p:p.muted||(t.screenVideoTrack=p))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function Sl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return us(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return us(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
24
24
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function us(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ve=new Map,st=null;function kl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ds(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ds(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
25
25
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ds(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ye=new Map,bt=null,El=3e3;function Tl(t){vo()?function(e){ve.has(e)||(ve.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ve.has(e)&&(ve.get(e).lastDevicesString=JSON.stringify(n),st||(st=function(){var r=O(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=Sl(ve.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==ve.get(c).lastDevicesString&&(ve.get(c).lastDevicesString=l,c(s))}}catch(p){a.e(p)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",st)))}).catch(function(){}))}(t):function(e){ye.has(e)||(ye.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ye.has(e)&&(ye.get(e).lastDevicesString=JSON.stringify(n),bt||(bt=setInterval(O(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=kl(ye.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==ye.get(a).lastDevicesString&&(ye.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),El)))}))}(t)}function Cl(t){vo()?function(e){ve.has(e)&&(ve.delete(e),ve.size===0&&st&&(navigator.mediaDevices.removeEventListener("devicechange",st),st=null))}(t):function(e){ye.has(e)&&(ye.delete(e),ye.size===0&&bt&&(clearInterval(bt),bt=null))}(t)}function vo(){return N()||navigator.mediaDevices.ondevicechange!==void 0}var Ml=new Set;function Ol(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Ml.has(n.id)}(t)}var Al=["result"],Pl=["preserveIframe"];function hs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Rl(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function ps(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return fs(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return fs(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function fs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Be={},ms="video",xl="voice",gs=N()?{data:{}}:{data:{},topology:"none"},vs={present:0,hidden:0},yo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(yo),ys=["state","volume","simulcastEncodings"],_s={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},on={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},sr={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"}},Fe={customIntegrations:{validate:Co,help:Eo()},customTrayButtons:{validate:To,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(on))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return Mo(t,_s)},help:"reactNativeConfig should look like ".concat(JSON.stringify(_s),", all fields optional")},lang:{validate:function(t){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},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(t){try{return _o(t),!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(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.videoDeviceId=t),e._preloadCache.videoDeviceId=t,!0}},audioSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.audioDeviceId=t),e._preloadCache.audioDeviceId=t,!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return U(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.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 e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.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(t){return bo(t,{allowAllParticipantsKey:!1})},help:ko({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!wo(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),So(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig),t.audio&&(e._preloadCache.inputSettings.audio=t.audio),t.video&&(e._preloadCache.inputSettings.video=t.video),!0)},help:or()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Gt={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!N()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function i(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),p=!n.includes(s[c]);if(l||p)return!1}return!0}(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(N()?"":" | '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(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=$e(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=ps(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(y){l.e(y)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=ps(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(y){_.e(y)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));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)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Dl=function(t){ln(re,Ee);var e,n,r,i,s,a,c,l,p,h,f,_,k,y,w,T,M,B,L,ne,Ne,oe,_e,ht,xr,Dr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Vr,Jr,$r,Gr,ea=Rl(re);function re(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pe(this,re),Ae(Se(d=ea.call(this)),"startListeningForDeviceChanges",function(){Tl(d.handleDeviceChange)}),Ae(Se(d),"stopListeningForDeviceChanges",function(){Cl(d.handleDeviceChange)}),Ae(Se(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Ae(Se(d),"handleNativeAppStateChange",function(){var E=O(function*(C){if(C==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield d.destroy());var x=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(x?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Ae(Se(d),"handleNativeAudioFocusChange",function(E){d.disableReactNativeAutoDeviceManagement("audio")||(d._hasNativeAudioFocus=E,d.toggleParticipantAudioBasedOnNativeAudioFocus(),d._hasNativeAudioFocus?d.micUnmutedBeforeLosingNativeAudioFocus&&d.setLocalAudio(!0):(d.micUnmutedBeforeLosingNativeAudioFocus=d.localAudio(),d.setLocalAudio(!1)))}),Ae(Se(d),"handleNativeSystemScreenCaptureStop",function(){d.stopScreenShare()}),d.strictMode=m.strictMode===void 0||m.strictMode,d.allowMultipleCallInstances=(u=m.allowMultipleCallInstances)!==null&&u!==void 0&&u,Object.keys(Be).length&&(d._logDuplicateInstanceAttempt(),!d.allowMultipleCallInstances)){if(d.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),d.callClientId=dn(),g=Se(d),Be[g.callClientId]=g,window._daily.instances[d.callClientId]={},d._sharedTracks={},window._daily.instances[d.callClientId].tracks=d._sharedTracks,m.dailyJsVersion=re.version(),d._iframe=o,d._callObjectMode=m.layout==="none"&&!d._iframe,d._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},m.showLocalVideo!==void 0?d._callObjectMode?console.error("showLocalVideo is not available in call object mode"):d._showLocalVideo=!!m.showLocalVideo:d._showLocalVideo=!0,m.showParticipantsBar!==void 0?d._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):d._showParticipantsBar=!!m.showParticipantsBar:d._showParticipantsBar=!0,m.customIntegrations!==void 0?d._callObjectMode?console.error("customIntegrations is not available in call object mode"):d._customIntegrations=m.customIntegrations:d._customIntegrations={},m.customTrayButtons!==void 0?d._callObjectMode?console.error("customTrayButtons is not available in call object mode"):d._customTrayButtons=m.customTrayButtons:d._customTrayButtons={},m.activeSpeakerMode!==void 0?d._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):d._activeSpeakerMode=!!m.activeSpeakerMode:d._activeSpeakerMode=!1,m.receiveSettings?d._callObjectMode?d._receiveSettings=m.receiveSettings:console.error("receiveSettings is only available in call object mode"):d._receiveSettings={},d.validateProperties(m),d.properties=A({},m),d._preloadCache.inputSettings||(d._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(d._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(d._preloadCache.inputSettings.video=m.inputSettings.video),d._callObjectLoader=d._callObjectMode?new pl(d.callClientId):null,d._callState=Vi,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(gs,d._callObjectMode),d._nativeInCallAudioMode=ms,d._participants={},d._isScreenSharing=!1,d._participantCounts=vs,d._rmpPlayerState={},d._waitingParticipants={},d._network={threshold:"good",quality:100},d._activeSpeaker={},d._localAudioLevel=0,d._isLocalAudioLevelObserverRunning=!1,d._remoteParticipantsAudioLevel={},d._isRemoteParticipantsAudioLevelObserverRunning=!1,d._messageChannel=N()?new ul:new cl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Vt}),d.sendMessageToCallMachine({action:Vt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Vt}),d.sendMessageToCallMachine({action:Vt}))})),N()){var b=d.nativeUtils();b.addAudioFocusChangeListener&&b.removeAudioFocusChangeListener&&b.addAppStateChangeListener&&b.removeAppStateChangeListener&&b.addSystemScreenCaptureStopListener&&b.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,b.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),b.addAppStateChangeListener(d.handleNativeAppStateChange),b.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,Se(d)),d}return fe(re,[{key:"destroy",value:(Gr=O(function*(){var o,u;try{yield this.leave()}catch{}var d=this._iframe;if(d){var g=d.parentElement;g&&g.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),N()){var m=this.nativeUtils();m.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),m.removeAppStateChangeListener(this.handleNativeAppStateChange),m.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Be[this.callClientId],!((o=window)===null||o===void 0||(u=o._daily)===null||u===void 0)&&u.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return Gr.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return D(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return D(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ce(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ce(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,u){for(var d in u){if(!Gt[d])throw new Error("unrecognized updateParticipant property ".concat(d));if(Gt[d].validate&&!Gt[d].validate(u[d],this,this._participants[o]))throw new Error(Gt[d].help)}}},{key:"updateParticipant",value:function(o,u){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&u&&(this.validateParticipantProperties(o,u),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:u})),this}},{key:"updateParticipants",value:function(o){var u=this._participants.local&&this._participants.local.session_id;for(var d in o)d===u&&(d="local"),d&&o[d]&&this.validateParticipantProperties(d,o[d]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:($r=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ce(this._callObjectMode,"updateWaitingParticipant()"),q(this._callState,"updateWaitingParticipant()"),typeof u!="string"||U(d)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(g,m){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:u,updates:d},function(b){b.error&&m(b.error),b.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:b.id})})})}),function(){return $r.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"updateWaitingParticipants()"),q(this._callState,"updateWaitingParticipants()"),U(u)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:u},function(m){m.error&&g(m.error),m.ids||g(new Error("unknown error in updateWaitingParticipants()")),d({ids:m.ids})})})}),function(){return Jr.apply(this,arguments)})},{key:"requestAccess",value:(Vr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:rc}:d,m=u.name,b=m===void 0?"":m;return ce(this._callObjectMode,"requestAccess()"),q(this._callState,"requestAccess()"),new Promise(function(E,C){o.sendMessageToCallMachine({action:"daily-method-request-access",access:g,name:b},function(x){x.error&&C(x.error),x.access||C(new Error("unknown error in requestAccess()")),E({access:x.access,granted:x.granted})})})}),function(){return Vr.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(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in u&&(N()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),u={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),u={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:u}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"getReceiveSettings",value:(qr=O(function*(o){var u=this,d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,g=d!==void 0&&d;if(ce(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(U(o)){case"string":return new Promise(function(m){u.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:g},function(b){m(b.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(o){return qr.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Ur=O(function*(o){var u=this;if(ce(this._callObjectMode,"updateReceiveSettings()"),!bo(o,{allowAllParticipantsKey:!0}))throw new Error(ko({allowAllParticipantsKey:!0}));return q(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(d){u.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(g){d({receiveSettings:g.receiveSettings})})})}),function(o){return Ur.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,b,E,C,x;if(o){var W={},G=((u=o.audio)===null||u===void 0||(d=u.processor)===null||d===void 0?void 0:d.type)==="none"&&((g=o.audio)===null||g===void 0||(m=g.processor)===null||m===void 0?void 0:m._isDefaultWhenNone);if(o.audio&&!G){var be=A({},o.audio.processor);delete be._isDefaultWhenNone,W.audio=A(A({},o.audio),{},{processor:be})}var Te=((b=o.video)===null||b===void 0||(E=b.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(x=C.processor)===null||x===void 0?void 0:x._isDefaultWhenNone);if(o.video&&!Te){var we=A({},o.video.processor);delete we._isDefaultWhenNone,W.video=A(A({},o.video),{},{processor:we})}return W}}},{key:"getInputSettings",value:function(){var o=this;return D(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,b,E,C,x={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||x,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||x):(o=((m=this._preloadCache)===null||m===void 0||(b=m.inputSettings)===null||b===void 0?void 0:b.video)||x,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||x);var W={audio:u,video:o};return this._prepInputSettingsToPresentToUser(W)}},{key:"updateInputSettings",value:(Fr=O(function*(o){var u=this;return D(),wo(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),So(o,this.properties.dailyConfig),o.audio&&(this._preloadCache.inputSettings.audio=o.audio),o.video&&(this._preloadCache.inputSettings.video=o.video)),o.video||o.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(m){m.error?g(m.error):d({inputSettings:u._prepInputSettingsToPresentToUser(m.inputSettings)})})}):this._getInputSettings()):(console.error(or()),Promise.reject(or()))}),function(o){return Fr.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(D(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(D(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Ce].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Br=O(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),q(this._callState,"getMeetingSession()"),new Promise(function(u){o.sendMessageToCallMachine({action:"get-meeting-session"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}),function(){return Br.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return q(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ce(this._callObjectMode,"setMeetingSessionData()"),q(this._callState,"setMeetingSessionData");try{(function(d,g){new dl({data:d,mergeStrategy:g})})(o,u)}catch(d){throw console.error(d),d}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:u})}catch(d){throw new Error("Error setting meeting session data: ".concat(d))}}},{key:"setUserName",value:function(o,u){var d=this;return this.properties.userName=o,new Promise(function(g){d.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:N()||!!u&&!!u.thisMeetingOnly},function(m){delete m.action,delete m.callbackStamp,g(m)})})}},{key:"setUserData",value:(Ir=O(function*(o){var u=this;try{_o(o)}catch(d){throw console.error(d),d}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(d){try{u.sendMessageToCallMachine({action:"set-user-data",userData:o},function(g){delete g.action,delete g.callbackStamp,d(g)})}catch(g){throw new Error("Error setting user data: ".concat(g))}})}),function(o){return Ir.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var u=this;if(typeof AudioWorkletNode>"u"&&!N())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(m){u._isLocalAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var u=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(m){u._isRemoteParticipantsAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"startCamera()"),xn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=A(A({},this.properties),u)}return new Promise(function(d){o.sendMessageToCallMachine({action:"start-camera",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(g){delete g.action,delete g.callbackStamp,d(g)})})}),function(){return jr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))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(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return D(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return D(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),Ht(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Nr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Nr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return D(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(Lr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,b=o.videoSource;return D(),m!==void 0&&(d=m),b!==void 0&&(g=b),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return Lr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(Dr=O(function*(o){var u=this,d=o.outputDeviceId;return D(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return Dr.apply(this,arguments)})},{key:"getInputDevices",value:(xr=O(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-input-devices"},function(d){delete d.action,delete d.callbackStamp,d.returnPreloadCache?u({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):u(d)})})}),function(){return xr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[ms,xl].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Yt(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(ht=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"preAuth()"),xn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=A(A({},this.properties),u),new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(m){return m.error?g(m.error):m.access?(o._didPreAuth=!0,void d({access:m.access})):g(new Error("unknown error in preAuth()"))})})}),function(){return ht.apply(this,arguments)})},{key:"load",value:(_e=O(function*(o){var u=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=A(A({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Ji),this.emitDailyJSEvent({action:lc}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(b){u._bundleLoadTime=b?"no-op":Date.now()-m,u._updateCallState($i),b&&u.emitDailyJSEvent({action:Gi}),d()},function(b,E){if(u.emitDailyJSEvent({action:uc}),!E){u._updateCallState(Ce),u.resetMeetingDependentVars();var C={action:Yi,errorMsg:b.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:b,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(b.msg)}})}):(this._iframe.src=Vs(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Ce?(u._updateCallState($i),(u.properties.cssFile||u.properties.cssText)&&u.loadCss(u.properties),d()):g(m)}}))}}),function(o){return _e.apply(this,arguments)})},{key:"join",value:(oe=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var d=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(u)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(d=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(u.url&&!this._callObjectMode&&u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(u.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(u),this.properties=A(A({},this.properties),u)}return u.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!u.showLocalVideo),u.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!u.showParticipantsBar),this._callState===Qe||this._callState===Qn?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Qn,!1),this.emitDailyJSEvent({action:pc}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),u.inputSettings&&u.inputSettings.audio&&(this._preloadCache.inputSettings.audio=u.inputSettings.audio),u.inputSettings&&u.inputSettings.video&&(this._preloadCache.inputSettings.video=u.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ke(this.properties,this.callClientId),preloadCache:Ke(this._preloadCache,this.callClientId)}),new Promise(function(g,m){o._joinedCallback=function(b,E){if(o._callState!==Ce){if(o._updateCallState(Qe),b)for(var C in b){if(o._callObjectMode){var x=o._callMachine().store;as(b[C],x),cs(b[C],x),ls(b[C],o._participants[C],x)}o._participants[C]=A({},b[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(b)}else m(E)}}))}),function(){return oe.apply(this,arguments)})},{key:"leave",value:(Ne=O(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(u){o._callState===Ie||o._callState===Ce?u():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Ie),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Ie}),u()):(o._resolveLeave=u,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return Ne.apply(this,arguments)})},{key:"startScreenShare",value:(ne=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ht(this._callMachineInitialized,"startScreenShare()"),u.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",u.screenVideoSendSettings),u.mediaStream&&(this._sharedTracks.screenMediaStream=u.mediaStream,u.mediaStream=yt),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var d=this.nativeUtils();if(yield d.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Wi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Qi,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Qi,captureOptions:u})}),function(){return ne.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Ht(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:d,instanceId:g})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:d,instanceId:g})}},{key:"addLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Xi,endpointsOp:nl,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Xi,endpointsOp:rl,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),he().match(/Linux; Android/)&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!Ss(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var b in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(b)){if(typeof m[b]!="number")throw new Error("".concat(b," must be a number"));if(u){var E=u[b],C=E.min,x=E.max;if(!Ss(m[b],C,x))throw new Error("".concat(b," value not in range. valid range: ").concat(C," to ").concat(x))}}else if(!["active","scalabilityMode"].includes(b))throw new Error("Invalid key ".concat(b,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(b){if(typeof b!="string")throw new Error('url parameter must be "string" type')})(d),ws(m),function(b){for(var E in b)if(!ys.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(ys));b.simulcastEncodings&&this.validateSimulcastEncodings(b.simulcastEncodings,yo,!0)}(m)}catch(b){throw console.error("invalid argument Error: ".concat(b)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function fs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Be={},ms="video",xl="voice",gs=N()?{data:{}}:{data:{},topology:"none"},vs={present:0,hidden:0},yo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(yo),ys=["state","volume","simulcastEncodings"],_s={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},on={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},sr={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"}},Fe={customIntegrations:{validate:Co,help:Eo()},customTrayButtons:{validate:To,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(on))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return Mo(t,_s)},help:"reactNativeConfig should look like ".concat(JSON.stringify(_s),", all fields optional")},lang:{validate:function(t){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},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(t){try{return _o(t),!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(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.videoDeviceId=t),e._preloadCache.videoDeviceId=t,!0}},audioSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.audioDeviceId=t),e._preloadCache.audioDeviceId=t,!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return U(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.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 e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.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(t){return bo(t,{allowAllParticipantsKey:!1})},help:ko({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!wo(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),So(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig),t.audio&&(e._preloadCache.inputSettings.audio=t.audio),t.video&&(e._preloadCache.inputSettings.video=t.video),!0)},help:or()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Gt={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!N()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function i(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),p=!n.includes(s[c]);if(l||p)return!1}return!0}(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(N()?"":" | '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(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=$e(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=ps(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(y){l.e(y)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=ps(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(y){_.e(y)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));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)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Dl=function(t){ln(re,Ee);var e,n,r,i,s,a,c,l,p,h,f,_,k,y,w,T,M,B,L,ne,Ne,oe,_e,ht,xr,Dr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Jr,Vr,$r,Gr,ea=Rl(re);function re(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pe(this,re),Ae(Se(d=ea.call(this)),"startListeningForDeviceChanges",function(){Tl(d.handleDeviceChange)}),Ae(Se(d),"stopListeningForDeviceChanges",function(){Cl(d.handleDeviceChange)}),Ae(Se(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Ae(Se(d),"handleNativeAppStateChange",function(){var E=O(function*(C){if(C==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield d.destroy());var x=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(x?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Ae(Se(d),"handleNativeAudioFocusChange",function(E){d.disableReactNativeAutoDeviceManagement("audio")||(d._hasNativeAudioFocus=E,d.toggleParticipantAudioBasedOnNativeAudioFocus(),d._hasNativeAudioFocus?d.micUnmutedBeforeLosingNativeAudioFocus&&d.setLocalAudio(!0):(d.micUnmutedBeforeLosingNativeAudioFocus=d.localAudio(),d.setLocalAudio(!1)))}),Ae(Se(d),"handleNativeSystemScreenCaptureStop",function(){d.stopScreenShare()}),d.strictMode=m.strictMode===void 0||m.strictMode,d.allowMultipleCallInstances=(u=m.allowMultipleCallInstances)!==null&&u!==void 0&&u,Object.keys(Be).length&&(d._logDuplicateInstanceAttempt(),!d.allowMultipleCallInstances)){if(d.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),d.callClientId=dn(),g=Se(d),Be[g.callClientId]=g,window._daily.instances[d.callClientId]={},d._sharedTracks={},window._daily.instances[d.callClientId].tracks=d._sharedTracks,m.dailyJsVersion=re.version(),d._iframe=o,d._callObjectMode=m.layout==="none"&&!d._iframe,d._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},m.showLocalVideo!==void 0?d._callObjectMode?console.error("showLocalVideo is not available in call object mode"):d._showLocalVideo=!!m.showLocalVideo:d._showLocalVideo=!0,m.showParticipantsBar!==void 0?d._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):d._showParticipantsBar=!!m.showParticipantsBar:d._showParticipantsBar=!0,m.customIntegrations!==void 0?d._callObjectMode?console.error("customIntegrations is not available in call object mode"):d._customIntegrations=m.customIntegrations:d._customIntegrations={},m.customTrayButtons!==void 0?d._callObjectMode?console.error("customTrayButtons is not available in call object mode"):d._customTrayButtons=m.customTrayButtons:d._customTrayButtons={},m.activeSpeakerMode!==void 0?d._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):d._activeSpeakerMode=!!m.activeSpeakerMode:d._activeSpeakerMode=!1,m.receiveSettings?d._callObjectMode?d._receiveSettings=m.receiveSettings:console.error("receiveSettings is only available in call object mode"):d._receiveSettings={},d.validateProperties(m),d.properties=A({},m),d._preloadCache.inputSettings||(d._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(d._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(d._preloadCache.inputSettings.video=m.inputSettings.video),d._callObjectLoader=d._callObjectMode?new pl(d.callClientId):null,d._callState=Ji,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(gs,d._callObjectMode),d._nativeInCallAudioMode=ms,d._participants={},d._isScreenSharing=!1,d._participantCounts=vs,d._rmpPlayerState={},d._waitingParticipants={},d._network={threshold:"good",quality:100},d._activeSpeaker={},d._localAudioLevel=0,d._isLocalAudioLevelObserverRunning=!1,d._remoteParticipantsAudioLevel={},d._isRemoteParticipantsAudioLevelObserverRunning=!1,d._messageChannel=N()?new ul:new cl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))})),N()){var b=d.nativeUtils();b.addAudioFocusChangeListener&&b.removeAudioFocusChangeListener&&b.addAppStateChangeListener&&b.removeAppStateChangeListener&&b.addSystemScreenCaptureStopListener&&b.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,b.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),b.addAppStateChangeListener(d.handleNativeAppStateChange),b.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,Se(d)),d}return fe(re,[{key:"destroy",value:(Gr=O(function*(){var o,u;try{yield this.leave()}catch{}var d=this._iframe;if(d){var g=d.parentElement;g&&g.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),N()){var m=this.nativeUtils();m.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),m.removeAppStateChangeListener(this.handleNativeAppStateChange),m.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Be[this.callClientId],!((o=window)===null||o===void 0||(u=o._daily)===null||u===void 0)&&u.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return Gr.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return D(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return D(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ce(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ce(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,u){for(var d in u){if(!Gt[d])throw new Error("unrecognized updateParticipant property ".concat(d));if(Gt[d].validate&&!Gt[d].validate(u[d],this,this._participants[o]))throw new Error(Gt[d].help)}}},{key:"updateParticipant",value:function(o,u){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&u&&(this.validateParticipantProperties(o,u),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:u})),this}},{key:"updateParticipants",value:function(o){var u=this._participants.local&&this._participants.local.session_id;for(var d in o)d===u&&(d="local"),d&&o[d]&&this.validateParticipantProperties(d,o[d]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:($r=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ce(this._callObjectMode,"updateWaitingParticipant()"),q(this._callState,"updateWaitingParticipant()"),typeof u!="string"||U(d)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(g,m){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:u,updates:d},function(b){b.error&&m(b.error),b.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:b.id})})})}),function(){return $r.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Vr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"updateWaitingParticipants()"),q(this._callState,"updateWaitingParticipants()"),U(u)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:u},function(m){m.error&&g(m.error),m.ids||g(new Error("unknown error in updateWaitingParticipants()")),d({ids:m.ids})})})}),function(){return Vr.apply(this,arguments)})},{key:"requestAccess",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:rc}:d,m=u.name,b=m===void 0?"":m;return ce(this._callObjectMode,"requestAccess()"),q(this._callState,"requestAccess()"),new Promise(function(E,C){o.sendMessageToCallMachine({action:"daily-method-request-access",access:g,name:b},function(x){x.error&&C(x.error),x.access||C(new Error("unknown error in requestAccess()")),E({access:x.access,granted:x.granted})})})}),function(){return Jr.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(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in u&&(N()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),u={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),u={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:u}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"getReceiveSettings",value:(qr=O(function*(o){var u=this,d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,g=d!==void 0&&d;if(ce(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(U(o)){case"string":return new Promise(function(m){u.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:g},function(b){m(b.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(o){return qr.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Ur=O(function*(o){var u=this;if(ce(this._callObjectMode,"updateReceiveSettings()"),!bo(o,{allowAllParticipantsKey:!0}))throw new Error(ko({allowAllParticipantsKey:!0}));return q(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(d){u.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(g){d({receiveSettings:g.receiveSettings})})})}),function(o){return Ur.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,b,E,C,x;if(o){var W={},H=((u=o.audio)===null||u===void 0||(d=u.processor)===null||d===void 0?void 0:d.type)==="none"&&((g=o.audio)===null||g===void 0||(m=g.processor)===null||m===void 0?void 0:m._isDefaultWhenNone);if(o.audio&&!H){var be=A({},o.audio.processor);delete be._isDefaultWhenNone,W.audio=A(A({},o.audio),{},{processor:be})}var Te=((b=o.video)===null||b===void 0||(E=b.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(x=C.processor)===null||x===void 0?void 0:x._isDefaultWhenNone);if(o.video&&!Te){var we=A({},o.video.processor);delete we._isDefaultWhenNone,W.video=A(A({},o.video),{},{processor:we})}return W}}},{key:"getInputSettings",value:function(){var o=this;return D(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,b,E,C,x={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||x,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||x):(o=((m=this._preloadCache)===null||m===void 0||(b=m.inputSettings)===null||b===void 0?void 0:b.video)||x,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||x);var W={audio:u,video:o};return this._prepInputSettingsToPresentToUser(W)}},{key:"updateInputSettings",value:(Fr=O(function*(o){var u=this;return D(),wo(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),So(o,this.properties.dailyConfig),o.audio&&(this._preloadCache.inputSettings.audio=o.audio),o.video&&(this._preloadCache.inputSettings.video=o.video)),o.video||o.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(m){m.error?g(m.error):d({inputSettings:u._prepInputSettingsToPresentToUser(m.inputSettings)})})}):this._getInputSettings()):(console.error(or()),Promise.reject(or()))}),function(o){return Fr.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(D(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(D(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Ce].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Br=O(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),q(this._callState,"getMeetingSession()"),new Promise(function(u){o.sendMessageToCallMachine({action:"get-meeting-session"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}),function(){return Br.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return q(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ce(this._callObjectMode,"setMeetingSessionData()"),q(this._callState,"setMeetingSessionData");try{(function(d,g){new dl({data:d,mergeStrategy:g})})(o,u)}catch(d){throw console.error(d),d}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:u})}catch(d){throw new Error("Error setting meeting session data: ".concat(d))}}},{key:"setUserName",value:function(o,u){var d=this;return this.properties.userName=o,new Promise(function(g){d.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:N()||!!u&&!!u.thisMeetingOnly},function(m){delete m.action,delete m.callbackStamp,g(m)})})}},{key:"setUserData",value:(Ir=O(function*(o){var u=this;try{_o(o)}catch(d){throw console.error(d),d}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(d){try{u.sendMessageToCallMachine({action:"set-user-data",userData:o},function(g){delete g.action,delete g.callbackStamp,d(g)})}catch(g){throw new Error("Error setting user data: ".concat(g))}})}),function(o){return Ir.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var u=this;if(typeof AudioWorkletNode>"u"&&!N())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(m){u._isLocalAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var u=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(m){u._isRemoteParticipantsAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"startCamera()"),xn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=A(A({},this.properties),u)}return new Promise(function(d){o.sendMessageToCallMachine({action:"start-camera",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(g){delete g.action,delete g.callbackStamp,d(g)})})}),function(){return jr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))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(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return D(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return D(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),Ht(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Nr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Nr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return D(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(Lr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,b=o.videoSource;return D(),m!==void 0&&(d=m),b!==void 0&&(g=b),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return Lr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(Dr=O(function*(o){var u=this,d=o.outputDeviceId;return D(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return Dr.apply(this,arguments)})},{key:"getInputDevices",value:(xr=O(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-input-devices"},function(d){delete d.action,delete d.callbackStamp,d.returnPreloadCache?u({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):u(d)})})}),function(){return xr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[ms,xl].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Yt(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(ht=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"preAuth()"),xn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=A(A({},this.properties),u),new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(m){return m.error?g(m.error):m.access?(o._didPreAuth=!0,void d({access:m.access})):g(new Error("unknown error in preAuth()"))})})}),function(){return ht.apply(this,arguments)})},{key:"load",value:(_e=O(function*(o){var u=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=A(A({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Vi),this.emitDailyJSEvent({action:lc}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(b){u._bundleLoadTime=b?"no-op":Date.now()-m,u._updateCallState($i),b&&u.emitDailyJSEvent({action:Gi}),d()},function(b,E){if(u.emitDailyJSEvent({action:uc}),!E){u._updateCallState(Ce),u.resetMeetingDependentVars();var C={action:Yi,errorMsg:b.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:b,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(b.msg)}})}):(this._iframe.src=Js(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Ce?(u._updateCallState($i),(u.properties.cssFile||u.properties.cssText)&&u.loadCss(u.properties),d()):g(m)}}))}}),function(o){return _e.apply(this,arguments)})},{key:"join",value:(oe=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var d=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(u)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(d=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(u.url&&!this._callObjectMode&&u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(u.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(u),this.properties=A(A({},this.properties),u)}return u.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!u.showLocalVideo),u.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!u.showParticipantsBar),this._callState===Qe||this._callState===Qn?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Qn,!1),this.emitDailyJSEvent({action:pc}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),u.inputSettings&&u.inputSettings.audio&&(this._preloadCache.inputSettings.audio=u.inputSettings.audio),u.inputSettings&&u.inputSettings.video&&(this._preloadCache.inputSettings.video=u.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ke(this.properties,this.callClientId),preloadCache:Ke(this._preloadCache,this.callClientId)}),new Promise(function(g,m){o._joinedCallback=function(b,E){if(o._callState!==Ce){if(o._updateCallState(Qe),b)for(var C in b){if(o._callObjectMode){var x=o._callMachine().store;as(b[C],x),cs(b[C],x),ls(b[C],o._participants[C],x)}o._participants[C]=A({},b[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(b)}else m(E)}}))}),function(){return oe.apply(this,arguments)})},{key:"leave",value:(Ne=O(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(u){o._callState===Ie||o._callState===Ce?u():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Ie),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Ie}),u()):(o._resolveLeave=u,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return Ne.apply(this,arguments)})},{key:"startScreenShare",value:(ne=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ht(this._callMachineInitialized,"startScreenShare()"),u.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",u.screenVideoSendSettings),u.mediaStream&&(this._sharedTracks.screenMediaStream=u.mediaStream,u.mediaStream=yt),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var d=this.nativeUtils();if(yield d.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Wi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Qi,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Qi,captureOptions:u})}),function(){return ne.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Ht(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:d,instanceId:g})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:d,instanceId:g})}},{key:"addLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Xi,endpointsOp:nl,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Xi,endpointsOp:rl,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),he().match(/Linux; Android/)&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!Ss(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var b in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(b)){if(typeof m[b]!="number")throw new Error("".concat(b," must be a number"));if(u){var E=u[b],C=E.min,x=E.max;if(!Ss(m[b],C,x))throw new Error("".concat(b," value not in range. valid range: ").concat(C," to ").concat(x))}}else if(!["active","scalabilityMode"].includes(b))throw new Error("Invalid key ".concat(b,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(b){if(typeof b!="string")throw new Error('url parameter must be "string" type')})(d),ws(m),function(b){for(var E in b)if(!ys.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(ys));b.simulcastEncodings&&this.validateSimulcastEncodings(b.simulcastEncodings,yo,!0)}(m)}catch(b){throw console.error("invalid argument Error: ".concat(b)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
27
27
|
{ url: "playback url",
|
|
28
28
|
settings?:
|
|
29
29
|
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),b}return new Promise(function(b,E){u.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:d,settings:m},function(C){C.error?E({error:C.error,errorMsg:C.errorMsg}):b({session_id:C.session_id,remoteMediaPlayerState:{state:C.state,settings:C.settings}})})})}),function(o){return L.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(B=O(function*(o){var u=this;if(typeof o!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(d,g){u.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:o},function(m){m.error?g({error:m.error,errorMsg:m.errorMsg}):d()})})}),function(o){return B.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(M=O(function*(o){var u=this,d=o.session_id,g=o.settings;try{ws(g)}catch(m){throw console.error("invalid argument Error: ".concat(m)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
|
|
30
30
|
session_id: "participant session",
|
|
31
|
-
{ settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,b){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?b({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(A({action:"daily-method-start-transcription"},o))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(T=O(function*(o){var u=this;q(this._callState,"startDialOut()");var d=function(g){if(g){if(!Array.isArray(g))throw new Error("Error starting dial out: audio codec must be an array");if(g.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");g.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: audio codec must be a string");if(m!=="OPUS"&&m!=="PCMU"&&m!=="PCMA"&&m!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(g){if(g&&(d(g.audio),g.video)){if(!Array.isArray(g.video))throw new Error("Error starting dial out: video codec must be an array");if(g.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");g.video.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: video codec must be a string");if(m!=="H264"&&m!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&d(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(g,m){u.sendMessageToCallMachine(A({action:"dialout-start"},o),function(b){b.error?m(b.error):g(b)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(w=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,bs(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return w.apply(this,arguments)})},{key:"sipRefer",value:(y=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,bs(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return y.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var b=/[^0-9A-D*#]/g,E=m.match(b);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:"send-dtmf"},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==Qe?{stats:{latest:{}}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-calc-stats"},function(d){u(A({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(Dn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Ol(o)||(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:(f=O(function*(){var o=this;D(),ce(this._callObjectMode,"testCallQuality()"),Ht(this._callMachineInitialized,"testCallQuality()",null,!0),xn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(b){var E=b.results,C=E.result,x=Hr(E,Al);if(C==="failed"){var W,G=A({},x);(W=x.error)!==null&&W!==void 0&&W.details?(x.error.details=JSON.parse(x.error.details),G.error=A(A({},G.error),{},{details:A({},G.error.details)}),G.error.details.duringTest="testCallQuality"):(G.error=G.error?A({},G.error):{},G.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(G)}d(!1),m(A({result:C},x))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,b){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?b(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===Qe?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(d){u(d.cpuStats)}):u({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var u;if(!(((u=Object.keys(o))===null||u===void 0?void 0:u.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Rn))}},{key:"_validateVideoSendSettings",value:function(o,u){var d=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],g="Video send settings should be either an object or one of the supported presets: ".concat(d.join());if(typeof u=="string"){if(!d.includes(u))throw new Error(g)}else{if(U(u)!=="object")throw new Error(g);if(!u.maxQuality&&!u.encodings&&u.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(u.maxQuality&&["low","medium","high"].indexOf(u.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(u.encodings){var m=!1;switch(Object.keys(u.encodings).length){case 1:m=!u.encodings.low;break;case 2:m=!u.encodings.low||!u.encodings.medium;break;case 3:m=!u.encodings.low||!u.encodings.medium||!u.encodings.high;break;default:m=!0}if(m)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");u.encodings.low&&this._validateEncodingLayerHasValidProperties(u.encodings.low),u.encodings.medium&&this._validateEncodingLayerHasValidProperties(u.encodings.medium),u.encodings.high&&this._validateEncodingLayerHasValidProperties(u.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var u=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(d){var g=$e(d,2),m=g[0],b=g[1];u._validateVideoSendSettings(m,b)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.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 D(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return D(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return We()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,b=d.getCapabilities();g.facing=(b==null||(m=b.facingMode)===null||m===void 0?void 0:m.length)>=1?b.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return D(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(A({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return ee(this._callObjectMode,"setShowNamesMode()"),D(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowLocalVideo()"),D(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return ee(this._callObjectMode,"showLocalVideo()"),D(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowParticipantsBar()"),D(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return ee(this._callObjectMode,"showParticipantsBar()"),D(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return D(),ee(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return D(),ee(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Co(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(D(),ee(this._callObjectMode,"startCustomIntegrations()"),q(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:d}),this)}},{key:"stopCustomIntegrations",value:function(o){var u=this;if(D(),ee(this._callObjectMode,"stopCustomIntegrations()"),q(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:d}),this)}},{key:"customTrayButtons",value:function(){return ee(this._callObjectMode,"customTrayButtons()"),D(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return ee(this._callObjectMode,"updateCustomTrayButtons()"),D(),q(this._callState,"updateCustomTrayButtons()"),To(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(on))),this)}},{key:"theme",value:function(){return ee(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var u=this;return ee(this._callObjectMode,"setTheme()"),new Promise(function(d,g){try{u.validateProperties({theme:o}),u.properties.theme=A({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:cc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(D(),this._iframe&&!document.fullscreenElement&&ts())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){D(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return D(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(D(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return Ee.prototype.on.call(this,o,u)}},{key:"once",value:function(o,u){return Ee.prototype.once.call(this,o,u)}},{key:"off",value:function(o,u){return Ee.prototype.off.call(this,o,u)}},{key:"validateProperties",value:function(o){for(var u in o){if(!Fe[u])throw new Error("unrecognized property '".concat(u,"'"));if(Fe[u].validate&&!Fe[u].validate(o[u],this))throw new Error("property '".concat(u,"': ").concat(Fe[u].help))}}},{key:"assembleMeetingUrl",value:function(){var o,u,d=A(A({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((u=this.properties.dailyConfig)===null||u===void 0?void 0:u.proxyUrl):void 0}),g=d.url.match(/\?/)?"&":"?";return d.url+g+Object.keys(Fe).filter(function(m){return Fe[m].queryString&&d[m]!==void 0}).map(function(m){return"".concat(Fe[m].queryString,"=").concat(d[m])}).join("&")}},{key:"needsLoad",value:function(){return[Vi,Ji,Ie,Ce].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,u){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,u,this._iframe,this.callClientId)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case oc:this.sendMessageToCallMachine(A({action:ac},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var u={action:Jt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Xt(this.properties.dailyConfig)}};this.sendMessageToCallMachine(u),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Gi:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case fc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case gc:case vc:if(this._callState===Ie)return;if(o.participant&&o.participant.session_id){var d=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var g=this._callMachine().store;as(o.participant,g),cs(o.participant,g),ls(o.participant,this._participants[d],g)}try{this.maybeParticipantTracksStopped(this._participants[d],o.participant),this.maybeParticipantTracksStarted(this._participants[d],o.participant),this.maybeEventRecordingStopped(this._participants[d],o.participant),this.maybeEventRecordingStarted(this._participants[d],o.participant)}catch(bn){console.error("track events error",bn)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[d])||(this._participants[d]=A({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case yc:if(o.participant&&o.participant.session_id){var m=this._participants[o.participant.session_id];m&&this.maybeParticipantTracksStopped(m,null),delete this._participants[o.participant.session_id],this.emitDailyJSEvent(o)}break;case _c:X(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case bc:var b={access:o.access};o.awaitingAccess&&(b.awaitingAccess=o.awaitingAccess),X(this._accessState,b)||(this._accessState=b,this.emitDailyJSEvent(o));break;case wc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=A(A({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(E)}break;case Yi:var C;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Ce),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var x=Hr(o,Pl);x!=null&&(C=x.error)!==null&&C!==void 0&&C.details&&(x.error.details=JSON.parse(x.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,x),this._joinedCallback=null),this.emitDailyJSEvent(x);break;case mc:this._callState!==Ce&&this._updateCallState(Ie),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Gc:var W=o.threshold,G=o.quality;W===this._network.threshold&&G===this._network.quality||(this._network.quality=G,this._network.threshold=W,this.emitDailyJSEvent(o));break;case zc:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Wc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Jc:var be=o.activeSpeaker;this._activeSpeaker.peerId!==be.peerId&&(this._activeSpeaker.peerId=be.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Te=o.show;this._showLocalVideo=Te,this.emitDailyJSEvent({action:o.action,show:Te});break;case $c:var we=o.enabled;this._activeSpeakerMode!==we&&(this._activeSpeakerMode=we,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case kc:case Ec:case Tc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case el:X(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case tl:if(!X(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},X(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":X(this._sendSettings,o.sendSettings)||(this._sendSettings=o.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:o.action,sendSettings:o.sendSettings}));break;case"local-audio-level":this._localAudioLevel=o.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=o.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case Ic:var Y=o.session_id;this._rmpPlayerState[Y]=o.playerState,this.emitDailyJSEvent(o);break;case Fc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Bc:var ge=o.session_id,je=this._rmpPlayerState[ge];je&&this.compareEqualForRMPUpdateEvent(je,o.remoteMediaPlayerState)||(this._rmpPlayerState[ge]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case Sc:var xt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||xt)&&this.emitDailyJSEvent(o);break;case Uc:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case qc:case Vc:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Hi:case zi:case Rc:case xc:case Dc:case Oc:case Ac:case Pc:case dc:case hc:case Nc:case jc:case Hc:case Lc:case Yc:case Kc:case Qc:case Xc:case Wi:case Zc:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,u){var d="record";o&&(u.local||u[d]!==!1||o[d]===u[d]||this.emitDailyJSEvent({action:zi}))}},{key:"maybeEventRecordingStarted",value:function(o,u){var d="record";o&&(u.local||u[d]!==!0||o[d]===u[d]||this.emitDailyJSEvent({action:Hi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Mc,track:o,participant:d,type:g}))}},{key:"maybeEventTrackStarted",value:function(o,u,d,g){u&&(o&&o.readyState!=="ended"&&u.id===o.id||this.emitDailyJSEvent({action:Cc,track:u,participant:d,type:g}))}},{key:"maybeParticipantTracksStopped",value:function(o,u){if(o)for(var d in o.tracks)this.maybeEventTrackStopped(o.tracks[d].track,u&&u.tracks[d]?u.tracks[d].track:null,u,d)}},{key:"maybeParticipantTracksStarted",value:function(o,u){if(u)for(var d in u.tracks)this.maybeEventTrackStarted(o&&o.tracks[d]?o.tracks[d].track:null,u.tracks[d].track,u,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,u){var d,g;return o.state===u.state&&((d=o.settings)===null||d===void 0?void 0:d.volume)===((g=u.settings)===null||g===void 0?void 0:g.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(u){console.log("could not emit",o,u)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,u){return!!X(o,u)&&(!o.videoTrack||!u.videoTrack||o.videoTrack.id===u.videoTrack.id&&o.videoTrack.muted===u.videoTrack.muted&&o.videoTrack.enabled===u.videoTrack.enabled)&&(!o.audioTrack||!u.audioTrack||o.audioTrack.id===u.audioTrack.id&&o.audioTrack.muted===u.audioTrack.muted&&o.audioTrack.enabled===u.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return N()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||u!==this._isPreparingToJoin){var d=this._callState,g=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=u;var m=Yt(d,g),b=Yt(this._callState,this._isPreparingToJoin);m!==b&&(this.updateKeepDeviceAwake(b),this.updateDeviceAudioMode(b),this.updateShowAndroidOngoingMeetingNotification(b),this.updateNoOpRecordingEnsuringBackgroundContinuity(b))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=vs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(gs,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var b=this.properties.reactNativeConfig.androidInCallNotification;u=b.title,d=b.subtitle,g=b.iconName,m=b.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Jt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}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 d={action:Jt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Jt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,b,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,x="production";C&&C.host.includes(".staging.daily")&&(x="staging");var W,G,be,Te,we,_n=new Wa({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:Ya,integrations:[new qi.GlobalHandlers({onunhandledrejection:!1}),new qi.HttpContext],environment:x}),Y=new wr(_n,void 0,re.version());if(this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var ge=A({},this.properties);ge.userName=ge.userName?"[Filtered]":void 0,ge.userData=ge.userData?"[Filtered]":void 0,ge.token=ge.token?"[Filtered]":void 0,Y.setExtra("properties",ge)}if(C){var je=C.searchParams.get("domain");if(!je){var xt=C.host.match(/(.*?)\./);je=xt&&xt[1]||""}je&&Y.setTag("domain",je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((W=o.error.details)===null||W===void 0)&&W.uri&&Y.setTag("serverAddress",o.error.details.uri),!((G=o.error.details)===null||G===void 0)&&G.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((be=o.error.details)===null||be===void 0)&&be.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((Te=o.error.details)===null||Te===void 0)&&Te.on&&Y.setTag("connectionAttempt",o.error.details.on),(we=o.error.details)!==null&&we!==void 0&&we.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?N()?"reactNative":(g=this.properties)!==null&&g!==void 0&&(m=g.dailyConfig)!==null&&m!==void 0&&(b=m.callMode)!==null&&b!==void 0&&b.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:re.version()});var bn=((E=o.error)===null||E===void 0?void 0:E.msg)||o.errorMsg;Y.run(function(ta){ta.captureException(new Error(bn))})}}},{key:"_callMachine",value:function(){var o,u,d;return(o=window._daily)===null||o===void 0||(u=o.instances)===null||u===void 0||(d=u[this.callClientId])===null||d===void 0?void 0:d.callMachine}}],[{key:"supportedBrowser",value:function(){if(N())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=da.getParser(he());return{supported:!!ns(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!ts(),supportsScreenShare:!!il(),supportsSfu:!!ns(),supportsVideoProcessing:po(),supportsAudioProcessing:fo()}}},{key:"version",value:function(){return"0.68.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new re(null,o)}},{key:"wrap",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(D(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new re(o,u)}},{key:"createFrame",value:function(o,u){var d,g;D(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===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 b=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?b.allow="microphone, camera":b.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",b.style.visibility="hidden",d.appendChild(b),b.style.visibility=null,Object.keys(m).forEach(function(E){return b.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new re(b,g)}catch(E){throw d.removeChild(b),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};D();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
|
|
31
|
+
{ settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,b){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?b({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(A({action:"daily-method-start-transcription"},o))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(T=O(function*(o){var u=this;q(this._callState,"startDialOut()");var d=function(g){if(g){if(!Array.isArray(g))throw new Error("Error starting dial out: audio codec must be an array");if(g.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");g.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: audio codec must be a string");if(m!=="OPUS"&&m!=="PCMU"&&m!=="PCMA"&&m!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(g){if(g&&(d(g.audio),g.video)){if(!Array.isArray(g.video))throw new Error("Error starting dial out: video codec must be an array");if(g.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");g.video.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: video codec must be a string");if(m!=="H264"&&m!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&d(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(g,m){u.sendMessageToCallMachine(A({action:"dialout-start"},o),function(b){b.error?m(b.error):g(b)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(w=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,bs(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return w.apply(this,arguments)})},{key:"sipRefer",value:(y=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,bs(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return y.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var b=/[^0-9A-D*#]/g,E=m.match(b);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:"send-dtmf"},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==Qe?{stats:{latest:{}}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-calc-stats"},function(d){u(A({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(Dn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Ol(o)||(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:(f=O(function*(){var o=this;D(),ce(this._callObjectMode,"testCallQuality()"),Ht(this._callMachineInitialized,"testCallQuality()",null,!0),xn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(b){var E=b.results,C=E.result,x=Hr(E,Al);if(C==="failed"){var W,H=A({},x);(W=x.error)!==null&&W!==void 0&&W.details?(x.error.details=JSON.parse(x.error.details),H.error=A(A({},H.error),{},{details:A({},H.error.details)}),H.error.details.duringTest="testCallQuality"):(H.error=H.error?A({},H.error):{},H.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(H)}d(!1),m(A({result:C},x))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,b){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?b(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===Qe?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(d){u(d.cpuStats)}):u({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var u;if(!(((u=Object.keys(o))===null||u===void 0?void 0:u.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Rn))}},{key:"_validateVideoSendSettings",value:function(o,u){var d=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],g="Video send settings should be either an object or one of the supported presets: ".concat(d.join());if(typeof u=="string"){if(!d.includes(u))throw new Error(g)}else{if(U(u)!=="object")throw new Error(g);if(!u.maxQuality&&!u.encodings&&u.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(u.maxQuality&&["low","medium","high"].indexOf(u.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(u.encodings){var m=!1;switch(Object.keys(u.encodings).length){case 1:m=!u.encodings.low;break;case 2:m=!u.encodings.low||!u.encodings.medium;break;case 3:m=!u.encodings.low||!u.encodings.medium||!u.encodings.high;break;default:m=!0}if(m)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");u.encodings.low&&this._validateEncodingLayerHasValidProperties(u.encodings.low),u.encodings.medium&&this._validateEncodingLayerHasValidProperties(u.encodings.medium),u.encodings.high&&this._validateEncodingLayerHasValidProperties(u.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var u=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(d){var g=$e(d,2),m=g[0],b=g[1];u._validateVideoSendSettings(m,b)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.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 D(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return D(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return We()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,b=d.getCapabilities();g.facing=(b==null||(m=b.facingMode)===null||m===void 0?void 0:m.length)>=1?b.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return D(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(A({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return ee(this._callObjectMode,"setShowNamesMode()"),D(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowLocalVideo()"),D(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return ee(this._callObjectMode,"showLocalVideo()"),D(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowParticipantsBar()"),D(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return ee(this._callObjectMode,"showParticipantsBar()"),D(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return D(),ee(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return D(),ee(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Co(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(D(),ee(this._callObjectMode,"startCustomIntegrations()"),q(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:d}),this)}},{key:"stopCustomIntegrations",value:function(o){var u=this;if(D(),ee(this._callObjectMode,"stopCustomIntegrations()"),q(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:d}),this)}},{key:"customTrayButtons",value:function(){return ee(this._callObjectMode,"customTrayButtons()"),D(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return ee(this._callObjectMode,"updateCustomTrayButtons()"),D(),q(this._callState,"updateCustomTrayButtons()"),To(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(on))),this)}},{key:"theme",value:function(){return ee(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var u=this;return ee(this._callObjectMode,"setTheme()"),new Promise(function(d,g){try{u.validateProperties({theme:o}),u.properties.theme=A({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:cc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(D(),this._iframe&&!document.fullscreenElement&&ts())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){D(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return D(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(D(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return Ee.prototype.on.call(this,o,u)}},{key:"once",value:function(o,u){return Ee.prototype.once.call(this,o,u)}},{key:"off",value:function(o,u){return Ee.prototype.off.call(this,o,u)}},{key:"validateProperties",value:function(o){for(var u in o){if(!Fe[u])throw new Error("unrecognized property '".concat(u,"'"));if(Fe[u].validate&&!Fe[u].validate(o[u],this))throw new Error("property '".concat(u,"': ").concat(Fe[u].help))}}},{key:"assembleMeetingUrl",value:function(){var o,u,d=A(A({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((u=this.properties.dailyConfig)===null||u===void 0?void 0:u.proxyUrl):void 0}),g=d.url.match(/\?/)?"&":"?";return d.url+g+Object.keys(Fe).filter(function(m){return Fe[m].queryString&&d[m]!==void 0}).map(function(m){return"".concat(Fe[m].queryString,"=").concat(d[m])}).join("&")}},{key:"needsLoad",value:function(){return[Ji,Vi,Ie,Ce].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,u){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,u,this._iframe,this.callClientId)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case oc:this.sendMessageToCallMachine(A({action:ac},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var u={action:Vt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Xt(this.properties.dailyConfig)}};this.sendMessageToCallMachine(u),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Gi:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case fc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case gc:case vc:if(this._callState===Ie)return;if(o.participant&&o.participant.session_id){var d=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var g=this._callMachine().store;as(o.participant,g),cs(o.participant,g),ls(o.participant,this._participants[d],g)}try{this.maybeParticipantTracksStopped(this._participants[d],o.participant),this.maybeParticipantTracksStarted(this._participants[d],o.participant),this.maybeEventRecordingStopped(this._participants[d],o.participant),this.maybeEventRecordingStarted(this._participants[d],o.participant)}catch(bn){console.error("track events error",bn)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[d])||(this._participants[d]=A({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case yc:if(o.participant&&o.participant.session_id){var m=this._participants[o.participant.session_id];m&&this.maybeParticipantTracksStopped(m,null),delete this._participants[o.participant.session_id],this.emitDailyJSEvent(o)}break;case _c:X(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case bc:var b={access:o.access};o.awaitingAccess&&(b.awaitingAccess=o.awaitingAccess),X(this._accessState,b)||(this._accessState=b,this.emitDailyJSEvent(o));break;case wc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=A(A({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(E)}break;case Yi:var C;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Ce),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var x=Hr(o,Pl);x!=null&&(C=x.error)!==null&&C!==void 0&&C.details&&(x.error.details=JSON.parse(x.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,x),this._joinedCallback=null),this.emitDailyJSEvent(x);break;case mc:this._callState!==Ce&&this._updateCallState(Ie),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Gc:var W=o.threshold,H=o.quality;W===this._network.threshold&&H===this._network.quality||(this._network.quality=H,this._network.threshold=W,this.emitDailyJSEvent(o));break;case zc:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Wc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Vc:var be=o.activeSpeaker;this._activeSpeaker.peerId!==be.peerId&&(this._activeSpeaker.peerId=be.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Te=o.show;this._showLocalVideo=Te,this.emitDailyJSEvent({action:o.action,show:Te});break;case $c:var we=o.enabled;this._activeSpeakerMode!==we&&(this._activeSpeakerMode=we,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case kc:case Ec:case Tc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case el:X(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case tl:if(!X(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},X(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":X(this._sendSettings,o.sendSettings)||(this._sendSettings=o.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:o.action,sendSettings:o.sendSettings}));break;case"local-audio-level":this._localAudioLevel=o.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=o.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case Ic:var Y=o.session_id;this._rmpPlayerState[Y]=o.playerState,this.emitDailyJSEvent(o);break;case Fc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Bc:var ge=o.session_id,je=this._rmpPlayerState[ge];je&&this.compareEqualForRMPUpdateEvent(je,o.remoteMediaPlayerState)||(this._rmpPlayerState[ge]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case Sc:var xt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||xt)&&this.emitDailyJSEvent(o);break;case Uc:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case qc:case Jc:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Hi:case zi:case Rc:case xc:case Dc:case Oc:case Ac:case Pc:case dc:case hc:case Nc:case jc:case Hc:case Lc:case Yc:case Kc:case Qc:case Xc:case Wi:case Zc:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,u){var d="record";o&&(u.local||u[d]!==!1||o[d]===u[d]||this.emitDailyJSEvent({action:zi}))}},{key:"maybeEventRecordingStarted",value:function(o,u){var d="record";o&&(u.local||u[d]!==!0||o[d]===u[d]||this.emitDailyJSEvent({action:Hi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Mc,track:o,participant:d,type:g}))}},{key:"maybeEventTrackStarted",value:function(o,u,d,g){u&&(o&&o.readyState!=="ended"&&u.id===o.id||this.emitDailyJSEvent({action:Cc,track:u,participant:d,type:g}))}},{key:"maybeParticipantTracksStopped",value:function(o,u){if(o)for(var d in o.tracks)this.maybeEventTrackStopped(o.tracks[d].track,u&&u.tracks[d]?u.tracks[d].track:null,u,d)}},{key:"maybeParticipantTracksStarted",value:function(o,u){if(u)for(var d in u.tracks)this.maybeEventTrackStarted(o&&o.tracks[d]?o.tracks[d].track:null,u.tracks[d].track,u,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,u){var d,g;return o.state===u.state&&((d=o.settings)===null||d===void 0?void 0:d.volume)===((g=u.settings)===null||g===void 0?void 0:g.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(u){console.log("could not emit",o,u)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,u){return!!X(o,u)&&(!o.videoTrack||!u.videoTrack||o.videoTrack.id===u.videoTrack.id&&o.videoTrack.muted===u.videoTrack.muted&&o.videoTrack.enabled===u.videoTrack.enabled)&&(!o.audioTrack||!u.audioTrack||o.audioTrack.id===u.audioTrack.id&&o.audioTrack.muted===u.audioTrack.muted&&o.audioTrack.enabled===u.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return N()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||u!==this._isPreparingToJoin){var d=this._callState,g=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=u;var m=Yt(d,g),b=Yt(this._callState,this._isPreparingToJoin);m!==b&&(this.updateKeepDeviceAwake(b),this.updateDeviceAudioMode(b),this.updateShowAndroidOngoingMeetingNotification(b),this.updateNoOpRecordingEnsuringBackgroundContinuity(b))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=vs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(gs,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var b=this.properties.reactNativeConfig.androidInCallNotification;u=b.title,d=b.subtitle,g=b.iconName,m=b.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Vt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}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 d={action:Vt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Vt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,b,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,x="production";C&&C.host.includes(".staging.daily")&&(x="staging");var W,H,be,Te,we,_n=new Wa({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:Ya,integrations:[new qi.GlobalHandlers({onunhandledrejection:!1}),new qi.HttpContext],environment:x}),Y=new wr(_n,void 0,re.version());if(this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var ge=A({},this.properties);ge.userName=ge.userName?"[Filtered]":void 0,ge.userData=ge.userData?"[Filtered]":void 0,ge.token=ge.token?"[Filtered]":void 0,Y.setExtra("properties",ge)}if(C){var je=C.searchParams.get("domain");if(!je){var xt=C.host.match(/(.*?)\./);je=xt&&xt[1]||""}je&&Y.setTag("domain",je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((W=o.error.details)===null||W===void 0)&&W.uri&&Y.setTag("serverAddress",o.error.details.uri),!((H=o.error.details)===null||H===void 0)&&H.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((be=o.error.details)===null||be===void 0)&&be.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((Te=o.error.details)===null||Te===void 0)&&Te.on&&Y.setTag("connectionAttempt",o.error.details.on),(we=o.error.details)!==null&&we!==void 0&&we.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?N()?"reactNative":(g=this.properties)!==null&&g!==void 0&&(m=g.dailyConfig)!==null&&m!==void 0&&(b=m.callMode)!==null&&b!==void 0&&b.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:re.version()});var bn=((E=o.error)===null||E===void 0?void 0:E.msg)||o.errorMsg;Y.run(function(ta){ta.captureException(new Error(bn))})}}},{key:"_callMachine",value:function(){var o,u,d;return(o=window._daily)===null||o===void 0||(u=o.instances)===null||u===void 0||(d=u[this.callClientId])===null||d===void 0?void 0:d.callMachine}}],[{key:"supportedBrowser",value:function(){if(N())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=da.getParser(he());return{supported:!!ns(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!ts(),supportsScreenShare:!!il(),supportsSfu:!!ns(),supportsVideoProcessing:po(),supportsAudioProcessing:fo()}}},{key:"version",value:function(){return"0.68.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new re(null,o)}},{key:"wrap",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(D(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new re(o,u)}},{key:"createFrame",value:function(o,u){var d,g;D(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===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 b=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?b.allow="microphone, camera":b.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",b.style.visibility="hidden",d.appendChild(b),b.style.visibility=null,Object.keys(m).forEach(function(E){return b.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new re(b,g)}catch(E){throw d.removeChild(b),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};D();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
|
|
32
32
|
position: fixed;
|
|
33
33
|
top: 0;
|
|
34
34
|
left: 0;
|
|
@@ -36,12 +36,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
36
|
height: 100%;
|
|
37
37
|
border: 0;
|
|
38
38
|
pointer-events: none;
|
|
39
|
-
`,document.body.appendChild(u),o.layout||(o.layout="custom-v1"),re.wrap(u,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?Be[o]:Object.values(Be)[0]}}]),re}();function Ke(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)n[r]=yt;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function q(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==Qe){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function Yt(t,e){return[Qn,Qe].includes(t)||e}function xn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Yt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Ht(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function Dn(t){if(t){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function ce(t){if(!t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function ee(t){if(t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function D(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function _o(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),X(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function bo(t,e){for(var n=e.allowAllParticipantsKey,r=function(f){var _=["local"];return n||_.push("*"),f&&!_.includes(f)},i=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!i(f.video))&&!(f.screenVideo&&!i(f.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];if(!r(p)||!s(h))return!1}return!0}function wo(t){return U(t)==="object"&&!(t.video&&(U(t.video)!=="object"||!function(i){var s=["type","config"];return!i||U(i)!=="object"||!function(a){return typeof a!="string"?!1:Object.values(Wt).includes(a)?!0:(console.error("inputSettings video processor type invalid"),!1)}(i.type)||i.config&&(U(i.config)!=="object"||!function(a,c){var l=Object.keys(c);if(l.length===0)return!0;var p="invalid object in inputSettings -> video -> processor -> config";switch(a){case Wt.BGBLUR:return l.length>1||l[0]!=="strength"?(console.error(p),!1):!(typeof c.strength!="number"||c.strength<=0||c.strength>1||isNaN(c.strength))||(console.error("".concat(p,"; expected: {0 < strength <= 1}, got: ").concat(c.strength)),!1);case Wt.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var y=new URL(k),w=y.pathname;if(y.protocol==="data:")try{var T=w.substring(w.indexOf(":")+1,w.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=w.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Zi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Zi)),!1):(h.type="daily-preselect",!0);var f,_}(c));default:return!0}}(i.type,i.config))?!1:(Object.keys(i).filter(function(a){return!s.includes(a)}).forEach(function(a){console.warn("invalid key inputSettings -> video -> processor : ".concat(a)),delete i[a]}),!0)}(t.video.processor)))&&!(t.audio&&(U(t.audio)!=="object"||(n=t.audio.processor,r=["type"],!n||U(n)!=="object"||(Object.keys(n).filter(function(i){return!r.includes(i)}).forEach(function(i){console.warn("invalid key inputSettings -> audio -> processor : ".concat(i)),delete n[i]}),e=n.type,typeof e!="string"||!Object.values(uo).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function So(t,e){var n,r=[];t.video&&!po((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!fo()&&(delete t.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function or(){var t=Object.values(Wt).join(" | "),e=Object.values(uo).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ko(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(ic).concat(e?' | "'.concat(sc,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function Eo(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function To(t){if(t&&U(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(on),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=$e(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=$e(s[i],2),c=a[0],l=a[1];if(c==="iconPath"&&!St(l)||c==="iconPathDarkMode"&&!St(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var p=on.id[c];if(!p)return console.error("customTrayButton does not support key ".concat(c)),!1;if(U(l)!==p)return console.error("customTrayButton ".concat(c," should be a ").concat(p,".")),!1}return!0}function Co(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(Eo()),!1;for(var e=function(f){return"".concat(f," should be ").concat(sr.id[f])},n=function(f,_){return console.error("customIntegration ".concat(f,": ").concat(_))},r=0,i=Object.entries(t);r<i.length;r++){var s=$e(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];switch(p){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(p)),!1;break;case"iconURL":if(!St(h))return n(s,"".concat(p," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!St(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(p)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(p)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(f){return typeof f!="string"})))return n(s,e(p)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(f){return typeof f!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(p)),!1;break;default:if(!sr.id[p])return console.error("customIntegration does not support key ".concat(p)),!1}}}return!0}function Mo(t,e){if(e===void 0)return!1;switch(U(e)){case"string":return U(t)===e;case"object":if(U(t)!=="object")return!1;for(var n in t)if(!Mo(t[n],e[n]))return!1;return!0;default:return!1}}function bs(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'))}function ws(t){if(U(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Xn).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Xn));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function Ss(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Oo(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ll}=Object.prototype,{getPrototypeOf:Mr}=Object,fn=(t=>e=>{const n=Ll.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),me=t=>(t=t.toLowerCase(),e=>fn(e)===t),mn=t=>e=>typeof e===t,{isArray:ut}=Array,Ot=mn("undefined");function Nl(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ao=me("ArrayBuffer");function jl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ao(t.buffer),e}const Il=mn("string"),se=mn("function"),Po=mn("number"),gn=t=>t!==null&&typeof t=="object",Bl=t=>t===!0||t===!1,Kt=t=>{if(fn(t)!=="object")return!1;const e=Mr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Fl=me("Date"),Ul=me("File"),ql=me("Blob"),Vl=me("FileList"),Jl=t=>gn(t)&&se(t.pipe),$l=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=fn(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Gl=me("URLSearchParams"),[Hl,zl,Wl,Yl]=["ReadableStream","Request","Response","Headers"].map(me),Kl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ut(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function Ro(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const xo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Do=t=>!Ot(t)&&t!==xo;function ar(){const{caseless:t}=Do(this)&&this||{},e={},n=(r,i)=>{const s=t&&Ro(e,i)||i;Kt(e[s])&&Kt(r)?e[s]=ar(e[s],r):Kt(r)?e[s]=ar({},r):ut(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Pt(arguments[r],n);return e}const Ql=(t,e,n,{allOwnKeys:r}={})=>(Pt(e,(i,s)=>{n&&se(i)?t[s]=Oo(i,n):t[s]=i},{allOwnKeys:r}),t),Xl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Zl=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},eu=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Mr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},tu=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},nu=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Po(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ru=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Mr(Uint8Array)),iu=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},su=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ou=me("HTMLFormElement"),au=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),ks=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),cu=me("RegExp"),Lo=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pt(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},lu=t=>{Lo(t,(e,n)=>{if(se(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(se(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},uu=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},du=()=>{},hu=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",Es="0123456789",No={DIGIT:Es,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+Es},pu=(t=16,e=No.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function fu(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const mu=t=>{const e=new Array(10),n=(r,i)=>{if(gn(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=ut(r)?[]:{};return Pt(r,(a,c)=>{const l=n(a,i+1);!Ot(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},gu=me("AsyncFunction"),vu=t=>t&&(gn(t)||se(t))&&se(t.then)&&se(t.catch),v={isArray:ut,isArrayBuffer:Ao,isBuffer:Nl,isFormData:$l,isArrayBufferView:jl,isString:Il,isNumber:Po,isBoolean:Bl,isObject:gn,isPlainObject:Kt,isReadableStream:Hl,isRequest:zl,isResponse:Wl,isHeaders:Yl,isUndefined:Ot,isDate:Fl,isFile:Ul,isBlob:ql,isRegExp:cu,isFunction:se,isStream:Jl,isURLSearchParams:Gl,isTypedArray:ru,isFileList:Vl,forEach:Pt,merge:ar,extend:Ql,trim:Kl,stripBOM:Xl,inherits:Zl,toFlatObject:eu,kindOf:fn,kindOfTest:me,endsWith:tu,toArray:nu,forEachEntry:iu,matchAll:su,isHTMLForm:ou,hasOwnProperty:ks,hasOwnProp:ks,reduceDescriptors:Lo,freezeMethods:lu,toObjectSet:uu,toCamelCase:au,noop:du,toFiniteNumber:hu,findKey:Ro,global:xo,isContextDefined:Do,ALPHABET:No,generateString:pu,isSpecCompliantForm:fu,toJSONObject:mu,isAsyncFn:gu,isThenable:vu};function P(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}v.inherits(P,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jo=P.prototype,Io={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Io[t]={value:t}});Object.defineProperties(P,Io);Object.defineProperty(jo,"isAxiosError",{value:!0});P.from=(t,e,n,r,i,s)=>{const a=Object.create(jo);return v.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),P.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const yu=null;function cr(t){return v.isPlainObject(t)||v.isArray(t)}function Bo(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function Ts(t,e,n){return t?t.concat(e).map(function(i,s){return i=Bo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function _u(t){return v.isArray(t)&&!t.some(cr)}const bu=v.toFlatObject(v,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!v.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=v.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,T){return!v.isUndefined(T[w])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(e);if(!v.isFunction(i))throw new TypeError("visitor must be a function");function p(y){if(y===null)return"";if(v.isDate(y))return y.toISOString();if(!l&&v.isBlob(y))throw new P("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(y)||v.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,T){let M=y;if(y&&!T&&typeof y=="object"){if(v.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(v.isArray(y)&&_u(y)||(v.isFileList(y)||v.endsWith(w,"[]"))&&(M=v.toArray(y)))return w=Bo(w),M.forEach(function(L,ne){!(v.isUndefined(L)||L===null)&&e.append(a===!0?Ts([w],ne,s):a===null?w:w+"[]",p(L))}),!1}return cr(y)?!0:(e.append(Ts(T,w,s),p(y)),!1)}const f=[],_=Object.assign(bu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(y,w){if(!v.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(y),v.forEach(y,function(M,B){(!(v.isUndefined(M)||M===null)&&i.call(e,M,v.isString(B)?B.trim():B,w,_))===!0&&k(M,w?w.concat(B):[B])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Cs(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Or(t,e){this._pairs=[],t&&vn(t,this,e)}const Fo=Or.prototype;Fo.append=function(e,n){this._pairs.push([e,n])};Fo.toString=function(e){const n=e?function(r){return e.call(this,r,Cs)}:Cs;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function wu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Uo(t,e,n){if(!e)return t;const r=n&&n.encode||wu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=v.isURLSearchParams(e)?e.toString():new Or(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Ms{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){v.forEach(this.handlers,function(r){r!==null&&e(r)})}}const qo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Su=typeof URLSearchParams<"u"?URLSearchParams:Or,ku=typeof FormData<"u"?FormData:null,Eu=typeof Blob<"u"?Blob:null,Tu={isBrowser:!0,classes:{URLSearchParams:Su,FormData:ku,Blob:Eu},protocols:["http","https","file","blob","url","data"]},Ar=typeof window<"u"&&typeof document<"u",Cu=(t=>Ar&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ou=Ar&&window.location.href||"http://localhost",Au=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ar,hasStandardBrowserEnv:Cu,hasStandardBrowserWebWorkerEnv:Mu,origin:Ou},Symbol.toStringTag,{value:"Module"})),ue={...Au,...Tu};function Pu(t,e){return vn(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ue.isNode&&v.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Ru(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xu(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Vo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&v.isArray(i)?i.length:a,l?(v.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!v.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&v.isArray(i[a])&&(i[a]=xu(i[a])),!c)}if(v.isFormData(t)&&v.isFunction(t.entries)){const n={};return v.forEachEntry(t,(r,i)=>{e(Ru(r),i,n,0)}),n}return null}function Du(t,e,n){if(v.isString(t))try{return(e||JSON.parse)(t),v.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:qo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=v.isObject(e);if(s&&v.isHTMLForm(e)&&(e=new FormData(e)),v.isFormData(e))return i?JSON.stringify(Vo(e)):e;if(v.isArrayBuffer(e)||v.isBuffer(e)||v.isStream(e)||v.isFile(e)||v.isBlob(e)||v.isReadableStream(e))return e;if(v.isArrayBufferView(e))return e.buffer;if(v.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Pu(e,this.formSerializer).toString();if((c=v.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Du(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(v.isResponse(e)||v.isReadableStream(e))return e;if(e&&v.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?P.from(c,P.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Lu=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nu=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
39
|
+
`,document.body.appendChild(u),o.layout||(o.layout="custom-v1"),re.wrap(u,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?Be[o]:Object.values(Be)[0]}}]),re}();function Ke(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)n[r]=yt;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function q(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==Qe){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function Yt(t,e){return[Qn,Qe].includes(t)||e}function xn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Yt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Ht(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function Dn(t){if(t){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function ce(t){if(!t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function ee(t){if(t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function D(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function _o(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),X(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function bo(t,e){for(var n=e.allowAllParticipantsKey,r=function(f){var _=["local"];return n||_.push("*"),f&&!_.includes(f)},i=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!i(f.video))&&!(f.screenVideo&&!i(f.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];if(!r(p)||!s(h))return!1}return!0}function wo(t){return U(t)==="object"&&!(t.video&&(U(t.video)!=="object"||!function(i){var s=["type","config"];return!i||U(i)!=="object"||!function(a){return typeof a!="string"?!1:Object.values(Wt).includes(a)?!0:(console.error("inputSettings video processor type invalid"),!1)}(i.type)||i.config&&(U(i.config)!=="object"||!function(a,c){var l=Object.keys(c);if(l.length===0)return!0;var p="invalid object in inputSettings -> video -> processor -> config";switch(a){case Wt.BGBLUR:return l.length>1||l[0]!=="strength"?(console.error(p),!1):!(typeof c.strength!="number"||c.strength<=0||c.strength>1||isNaN(c.strength))||(console.error("".concat(p,"; expected: {0 < strength <= 1}, got: ").concat(c.strength)),!1);case Wt.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var y=new URL(k),w=y.pathname;if(y.protocol==="data:")try{var T=w.substring(w.indexOf(":")+1,w.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=w.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Zi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Zi)),!1):(h.type="daily-preselect",!0);var f,_}(c));default:return!0}}(i.type,i.config))?!1:(Object.keys(i).filter(function(a){return!s.includes(a)}).forEach(function(a){console.warn("invalid key inputSettings -> video -> processor : ".concat(a)),delete i[a]}),!0)}(t.video.processor)))&&!(t.audio&&(U(t.audio)!=="object"||(n=t.audio.processor,r=["type"],!n||U(n)!=="object"||(Object.keys(n).filter(function(i){return!r.includes(i)}).forEach(function(i){console.warn("invalid key inputSettings -> audio -> processor : ".concat(i)),delete n[i]}),e=n.type,typeof e!="string"||!Object.values(uo).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function So(t,e){var n,r=[];t.video&&!po((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!fo()&&(delete t.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function or(){var t=Object.values(Wt).join(" | "),e=Object.values(uo).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ko(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(ic).concat(e?' | "'.concat(sc,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function Eo(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function To(t){if(t&&U(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(on),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=$e(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=$e(s[i],2),c=a[0],l=a[1];if(c==="iconPath"&&!St(l)||c==="iconPathDarkMode"&&!St(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var p=on.id[c];if(!p)return console.error("customTrayButton does not support key ".concat(c)),!1;if(U(l)!==p)return console.error("customTrayButton ".concat(c," should be a ").concat(p,".")),!1}return!0}function Co(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(Eo()),!1;for(var e=function(f){return"".concat(f," should be ").concat(sr.id[f])},n=function(f,_){return console.error("customIntegration ".concat(f,": ").concat(_))},r=0,i=Object.entries(t);r<i.length;r++){var s=$e(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];switch(p){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(p)),!1;break;case"iconURL":if(!St(h))return n(s,"".concat(p," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!St(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(p)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(p)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(f){return typeof f!="string"})))return n(s,e(p)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(f){return typeof f!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(p)),!1;break;default:if(!sr.id[p])return console.error("customIntegration does not support key ".concat(p)),!1}}}return!0}function Mo(t,e){if(e===void 0)return!1;switch(U(e)){case"string":return U(t)===e;case"object":if(U(t)!=="object")return!1;for(var n in t)if(!Mo(t[n],e[n]))return!1;return!0;default:return!1}}function bs(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'))}function ws(t){if(U(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Xn).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Xn));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function Ss(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Oo(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ll}=Object.prototype,{getPrototypeOf:Mr}=Object,fn=(t=>e=>{const n=Ll.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),me=t=>(t=t.toLowerCase(),e=>fn(e)===t),mn=t=>e=>typeof e===t,{isArray:ut}=Array,Ot=mn("undefined");function Nl(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ao=me("ArrayBuffer");function jl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ao(t.buffer),e}const Il=mn("string"),se=mn("function"),Po=mn("number"),gn=t=>t!==null&&typeof t=="object",Bl=t=>t===!0||t===!1,Kt=t=>{if(fn(t)!=="object")return!1;const e=Mr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Fl=me("Date"),Ul=me("File"),ql=me("Blob"),Jl=me("FileList"),Vl=t=>gn(t)&&se(t.pipe),$l=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=fn(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Gl=me("URLSearchParams"),[Hl,zl,Wl,Yl]=["ReadableStream","Request","Response","Headers"].map(me),Kl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ut(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function Ro(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const xo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Do=t=>!Ot(t)&&t!==xo;function ar(){const{caseless:t}=Do(this)&&this||{},e={},n=(r,i)=>{const s=t&&Ro(e,i)||i;Kt(e[s])&&Kt(r)?e[s]=ar(e[s],r):Kt(r)?e[s]=ar({},r):ut(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Pt(arguments[r],n);return e}const Ql=(t,e,n,{allOwnKeys:r}={})=>(Pt(e,(i,s)=>{n&&se(i)?t[s]=Oo(i,n):t[s]=i},{allOwnKeys:r}),t),Xl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Zl=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},eu=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Mr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},tu=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},nu=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Po(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ru=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Mr(Uint8Array)),iu=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},su=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ou=me("HTMLFormElement"),au=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),ks=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),cu=me("RegExp"),Lo=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pt(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},lu=t=>{Lo(t,(e,n)=>{if(se(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(se(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},uu=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},du=()=>{},hu=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",Es="0123456789",No={DIGIT:Es,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+Es},pu=(t=16,e=No.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function fu(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const mu=t=>{const e=new Array(10),n=(r,i)=>{if(gn(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=ut(r)?[]:{};return Pt(r,(a,c)=>{const l=n(a,i+1);!Ot(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},gu=me("AsyncFunction"),vu=t=>t&&(gn(t)||se(t))&&se(t.then)&&se(t.catch),v={isArray:ut,isArrayBuffer:Ao,isBuffer:Nl,isFormData:$l,isArrayBufferView:jl,isString:Il,isNumber:Po,isBoolean:Bl,isObject:gn,isPlainObject:Kt,isReadableStream:Hl,isRequest:zl,isResponse:Wl,isHeaders:Yl,isUndefined:Ot,isDate:Fl,isFile:Ul,isBlob:ql,isRegExp:cu,isFunction:se,isStream:Vl,isURLSearchParams:Gl,isTypedArray:ru,isFileList:Jl,forEach:Pt,merge:ar,extend:Ql,trim:Kl,stripBOM:Xl,inherits:Zl,toFlatObject:eu,kindOf:fn,kindOfTest:me,endsWith:tu,toArray:nu,forEachEntry:iu,matchAll:su,isHTMLForm:ou,hasOwnProperty:ks,hasOwnProp:ks,reduceDescriptors:Lo,freezeMethods:lu,toObjectSet:uu,toCamelCase:au,noop:du,toFiniteNumber:hu,findKey:Ro,global:xo,isContextDefined:Do,ALPHABET:No,generateString:pu,isSpecCompliantForm:fu,toJSONObject:mu,isAsyncFn:gu,isThenable:vu};function P(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}v.inherits(P,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jo=P.prototype,Io={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Io[t]={value:t}});Object.defineProperties(P,Io);Object.defineProperty(jo,"isAxiosError",{value:!0});P.from=(t,e,n,r,i,s)=>{const a=Object.create(jo);return v.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),P.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const yu=null;function cr(t){return v.isPlainObject(t)||v.isArray(t)}function Bo(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function Ts(t,e,n){return t?t.concat(e).map(function(i,s){return i=Bo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function _u(t){return v.isArray(t)&&!t.some(cr)}const bu=v.toFlatObject(v,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!v.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=v.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,T){return!v.isUndefined(T[w])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(e);if(!v.isFunction(i))throw new TypeError("visitor must be a function");function p(y){if(y===null)return"";if(v.isDate(y))return y.toISOString();if(!l&&v.isBlob(y))throw new P("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(y)||v.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,T){let M=y;if(y&&!T&&typeof y=="object"){if(v.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(v.isArray(y)&&_u(y)||(v.isFileList(y)||v.endsWith(w,"[]"))&&(M=v.toArray(y)))return w=Bo(w),M.forEach(function(L,ne){!(v.isUndefined(L)||L===null)&&e.append(a===!0?Ts([w],ne,s):a===null?w:w+"[]",p(L))}),!1}return cr(y)?!0:(e.append(Ts(T,w,s),p(y)),!1)}const f=[],_=Object.assign(bu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(y,w){if(!v.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(y),v.forEach(y,function(M,B){(!(v.isUndefined(M)||M===null)&&i.call(e,M,v.isString(B)?B.trim():B,w,_))===!0&&k(M,w?w.concat(B):[B])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Cs(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Or(t,e){this._pairs=[],t&&vn(t,this,e)}const Fo=Or.prototype;Fo.append=function(e,n){this._pairs.push([e,n])};Fo.toString=function(e){const n=e?function(r){return e.call(this,r,Cs)}:Cs;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function wu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Uo(t,e,n){if(!e)return t;const r=n&&n.encode||wu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=v.isURLSearchParams(e)?e.toString():new Or(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Ms{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){v.forEach(this.handlers,function(r){r!==null&&e(r)})}}const qo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Su=typeof URLSearchParams<"u"?URLSearchParams:Or,ku=typeof FormData<"u"?FormData:null,Eu=typeof Blob<"u"?Blob:null,Tu={isBrowser:!0,classes:{URLSearchParams:Su,FormData:ku,Blob:Eu},protocols:["http","https","file","blob","url","data"]},Ar=typeof window<"u"&&typeof document<"u",Cu=(t=>Ar&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ou=Ar&&window.location.href||"http://localhost",Au=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ar,hasStandardBrowserEnv:Cu,hasStandardBrowserWebWorkerEnv:Mu,origin:Ou},Symbol.toStringTag,{value:"Module"})),ue={...Au,...Tu};function Pu(t,e){return vn(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ue.isNode&&v.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Ru(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xu(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Jo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&v.isArray(i)?i.length:a,l?(v.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!v.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&v.isArray(i[a])&&(i[a]=xu(i[a])),!c)}if(v.isFormData(t)&&v.isFunction(t.entries)){const n={};return v.forEachEntry(t,(r,i)=>{e(Ru(r),i,n,0)}),n}return null}function Du(t,e,n){if(v.isString(t))try{return(e||JSON.parse)(t),v.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:qo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=v.isObject(e);if(s&&v.isHTMLForm(e)&&(e=new FormData(e)),v.isFormData(e))return i?JSON.stringify(Jo(e)):e;if(v.isArrayBuffer(e)||v.isBuffer(e)||v.isStream(e)||v.isFile(e)||v.isBlob(e)||v.isReadableStream(e))return e;if(v.isArrayBufferView(e))return e.buffer;if(v.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Pu(e,this.formSerializer).toString();if((c=v.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Du(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(v.isResponse(e)||v.isReadableStream(e))return e;if(e&&v.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?P.from(c,P.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Lu=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nu=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
40
40
|
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&Lu[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Os=Symbol("internals");function gt(t){return t&&String(t).trim().toLowerCase()}function Qt(t){return t===!1||t==null?t:v.isArray(t)?t.map(Qt):String(t)}function ju(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const Iu=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,r,i){if(v.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!v.isString(e)){if(v.isString(r))return e.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(e)}}function Bu(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Fu(t,e){const n=v.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,a){return this[r].call(this,e,i,s,a)},configurable:!0})})}class Z{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,p){const h=gt(l);if(!h)throw new Error("header name must be a non-empty string");const f=v.findKey(i,h);(!f||i[f]===void 0||p===!0||p===void 0&&i[f]!==!1)&&(i[f||l]=Qt(c))}const a=(c,l)=>v.forEach(c,(p,h)=>s(p,h,l));if(v.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(v.isString(e)&&(e=e.trim())&&!Iu(e))a(Nu(e),n);else if(v.isHeaders(e))for(const[c,l]of e.entries())s(l,c,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=gt(e),e){const r=v.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return ju(i);if(v.isFunction(n))return n.call(this,i,r);if(v.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=gt(e),e){const r=v.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||jn(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(a){if(a=gt(a),a){const c=v.findKey(r,a);c&&(!n||jn(r,r[c],c,n))&&(delete r[c],i=!0)}}return v.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||jn(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return v.forEach(this,(i,s)=>{const a=v.findKey(r,s);if(a){n[a]=Qt(i),delete n[s];return}const c=e?Bu(s):String(s).trim();c!==s&&delete n[s],n[c]=Qt(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return v.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&v.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
41
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Os]=this[Os]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(Fu(i,a),r[c]=!0)}return v.isArray(e)?e.forEach(s):s(e),this}}Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(Z.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});v.freezeMethods(Z);function In(t,e){const n=this||Rt,r=e||n,i=Z.from(r.headers);let s=r.data;return v.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Jo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){P.call(this,t??"canceled",P.ERR_CANCELED,e,n),this.name="CanceledError"}v.inherits(dt,P,{__CANCEL__:!0});function $o(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new P("Request failed with status code "+n.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Uu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qu(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const p=Date.now(),h=r[s];a||(a=p),n[i]=l,r[i]=p;let f=s,_=0;for(;f!==i;)_+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),p-a<e)return;const k=h&&p-h;return k?Math.round(_*1e3/k):void 0}}function Vu(t,e){let n=0;const r=1e3/e;let i=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>r)return i&&(clearTimeout(i),i=null),n=c,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const an=(t,e,n=3)=>{let r=0;const i=qu(50,250);return Vu(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,p=i(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:p||void 0,estimated:p&&c&&h?(c-a)/p:void 0,event:s,lengthComputable:c!=null};f[e?"download":"upload"]=!0,t(f)},n)},Ju=ue.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const c=v.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),$u=ue.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];v.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),v.isString(r)&&a.push("path="+r),v.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gu(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Hu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Go(t,e){return t&&!Gu(e)?Hu(t,e):e}const As=t=>t instanceof Z?{...t}:t;function Ye(t,e){e=e||{};const n={};function r(p,h,f){return v.isPlainObject(p)&&v.isPlainObject(h)?v.merge.call({caseless:f},p,h):v.isPlainObject(h)?v.merge({},h):v.isArray(h)?h.slice():h}function i(p,h,f){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!v.isUndefined(h))return r(void 0,h)}function a(p,h){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(As(p),As(h),!0)};return v.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);v.isUndefined(_)&&f!==c||(n[h]=_)}),n}const Ho=t=>{const e=Ye({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=Z.from(a),e.url=Uo(Go(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(v.isFormData(n)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[p,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...h].join("; "))}}if(ue.hasStandardBrowserEnv&&(r&&v.isFunction(r)&&(r=r(e)),r||r!==!1&&Ju(e.url))){const p=i&&s&&$u.read(s);p&&a.set(i,p)}return e},zu=typeof XMLHttpRequest<"u",Wu=zu&&function(t){return new Promise(function(n,r){const i=Ho(t);let s=i.data;const a=Z.from(i.headers).normalize();let{responseType:c}=i,l;function p(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function f(){if(!h)return;const k=Z.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),w={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};$o(function(M){n(M),p()},function(M){r(M),p()},w),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new P("Request aborted",P.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new P("Network Error",P.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||qo;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new P(y,w.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&v.forEach(a.toJSON(),function(y,w){h.setRequestHeader(w,y)}),v.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Uu(i.url);if(_&&ue.protocols.indexOf(_)===-1){r(new P("Unsupported protocol "+_+":",P.ERR_BAD_REQUEST,t));return}h.send(s||null)})},Yu=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,a();const p=l instanceof Error?l:this.reason;n.abort(p instanceof P?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new P(`timeout ${e} of ms exceeded`,P.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},Ku=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},Qu=async function*(t,e,n){for await(const r of t)yield*Ku(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=Qu(t,e,i);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:p}=await s.next();if(l){c.close(),r();return}let h=p.byteLength;n&&n(a+=h),c.enqueue(new Uint8Array(p))},cancel(c){return r(c),s.return()}},{highWaterMark:2})},Rs=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},yn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",zo=yn&&typeof ReadableStream=="function",lr=yn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Xu=zo&&(()=>{let t=!1;const e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),xs=64*1024,ur=zo&&!!(()=>{try{return v.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=v.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new P(`Response type '${e}' is not supported`,P.ERR_NOT_SUPPORT,r)})})})(new Response);const Zu=async t=>{if(t==null)return 0;if(v.isBlob(t))return t.size;if(v.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(v.isArrayBufferView(t))return t.byteLength;if(v.isURLSearchParams(t)&&(t=t+""),v.isString(t))return(await lr(t)).byteLength},ed=async(t,e)=>{const n=v.toFiniteNumber(t.getContentLength());return n??Zu(e)},td=yn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:p,headers:h,withCredentials:f="same-origin",fetchOptions:_}=Ho(t);p=p?(p+"").toLowerCase():"text";let[k,y]=i||s||a?Yu([i,s],a):[],w,T;const M=()=>{!w&&setTimeout(()=>{k&&k.unsubscribe()}),w=!0};let B;try{if(l&&Xu&&n!=="get"&&n!=="head"&&(B=await ed(h,r))!==0){let oe=new Request(e,{method:"POST",body:r,duplex:"half"}),_e;v.isFormData(r)&&(_e=oe.headers.get("content-type"))&&h.setContentType(_e),oe.body&&(r=Ps(oe.body,xs,Rs(B,an(l)),null,lr))}v.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const ne=ur&&(p==="stream"||p==="response");if(ur&&(c||ne)){const oe={};["status","statusText","headers"].forEach(ht=>{oe[ht]=L[ht]});const _e=v.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,xs,c&&Rs(_e,an(c,!0)),ne&&M,lr),oe)}p=p||"text";let Ne=await cn[v.findKey(cn,p)||"text"](L,t);return!ne&&M(),y&&y(),await new Promise((oe,_e)=>{$o(oe,_e,{data:Ne,headers:Z.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:T})})}catch(L){throw M(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new P("Network Error",P.ERR_NETWORK,t,T),{cause:L.cause||L}):P.from(L,L&&L.code,t,T)}}),dr={http:yu,xhr:Wu,fetch:td};v.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ds=t=>`- ${t}`,nd=t=>v.isFunction(t)||t===null||t===!1,Wo={getAdapter:t=>{t=v.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!nd(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new P(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
41
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Os]=this[Os]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(Fu(i,a),r[c]=!0)}return v.isArray(e)?e.forEach(s):s(e),this}}Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(Z.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});v.freezeMethods(Z);function In(t,e){const n=this||Rt,r=e||n,i=Z.from(r.headers);let s=r.data;return v.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Vo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){P.call(this,t??"canceled",P.ERR_CANCELED,e,n),this.name="CanceledError"}v.inherits(dt,P,{__CANCEL__:!0});function $o(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new P("Request failed with status code "+n.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Uu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qu(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const p=Date.now(),h=r[s];a||(a=p),n[i]=l,r[i]=p;let f=s,_=0;for(;f!==i;)_+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),p-a<e)return;const k=h&&p-h;return k?Math.round(_*1e3/k):void 0}}function Ju(t,e){let n=0;const r=1e3/e;let i=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>r)return i&&(clearTimeout(i),i=null),n=c,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const an=(t,e,n=3)=>{let r=0;const i=qu(50,250);return Ju(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,p=i(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:p||void 0,estimated:p&&c&&h?(c-a)/p:void 0,event:s,lengthComputable:c!=null};f[e?"download":"upload"]=!0,t(f)},n)},Vu=ue.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const c=v.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),$u=ue.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];v.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),v.isString(r)&&a.push("path="+r),v.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gu(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Hu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Go(t,e){return t&&!Gu(e)?Hu(t,e):e}const As=t=>t instanceof Z?{...t}:t;function Ye(t,e){e=e||{};const n={};function r(p,h,f){return v.isPlainObject(p)&&v.isPlainObject(h)?v.merge.call({caseless:f},p,h):v.isPlainObject(h)?v.merge({},h):v.isArray(h)?h.slice():h}function i(p,h,f){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!v.isUndefined(h))return r(void 0,h)}function a(p,h){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(As(p),As(h),!0)};return v.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);v.isUndefined(_)&&f!==c||(n[h]=_)}),n}const Ho=t=>{const e=Ye({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=Z.from(a),e.url=Uo(Go(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(v.isFormData(n)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[p,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...h].join("; "))}}if(ue.hasStandardBrowserEnv&&(r&&v.isFunction(r)&&(r=r(e)),r||r!==!1&&Vu(e.url))){const p=i&&s&&$u.read(s);p&&a.set(i,p)}return e},zu=typeof XMLHttpRequest<"u",Wu=zu&&function(t){return new Promise(function(n,r){const i=Ho(t);let s=i.data;const a=Z.from(i.headers).normalize();let{responseType:c}=i,l;function p(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function f(){if(!h)return;const k=Z.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),w={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};$o(function(M){n(M),p()},function(M){r(M),p()},w),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new P("Request aborted",P.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new P("Network Error",P.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||qo;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new P(y,w.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&v.forEach(a.toJSON(),function(y,w){h.setRequestHeader(w,y)}),v.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Uu(i.url);if(_&&ue.protocols.indexOf(_)===-1){r(new P("Unsupported protocol "+_+":",P.ERR_BAD_REQUEST,t));return}h.send(s||null)})},Yu=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,a();const p=l instanceof Error?l:this.reason;n.abort(p instanceof P?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new P(`timeout ${e} of ms exceeded`,P.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},Ku=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},Qu=async function*(t,e,n){for await(const r of t)yield*Ku(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=Qu(t,e,i);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:p}=await s.next();if(l){c.close(),r();return}let h=p.byteLength;n&&n(a+=h),c.enqueue(new Uint8Array(p))},cancel(c){return r(c),s.return()}},{highWaterMark:2})},Rs=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},yn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",zo=yn&&typeof ReadableStream=="function",lr=yn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Xu=zo&&(()=>{let t=!1;const e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),xs=64*1024,ur=zo&&!!(()=>{try{return v.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=v.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new P(`Response type '${e}' is not supported`,P.ERR_NOT_SUPPORT,r)})})})(new Response);const Zu=async t=>{if(t==null)return 0;if(v.isBlob(t))return t.size;if(v.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(v.isArrayBufferView(t))return t.byteLength;if(v.isURLSearchParams(t)&&(t=t+""),v.isString(t))return(await lr(t)).byteLength},ed=async(t,e)=>{const n=v.toFiniteNumber(t.getContentLength());return n??Zu(e)},td=yn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:p,headers:h,withCredentials:f="same-origin",fetchOptions:_}=Ho(t);p=p?(p+"").toLowerCase():"text";let[k,y]=i||s||a?Yu([i,s],a):[],w,T;const M=()=>{!w&&setTimeout(()=>{k&&k.unsubscribe()}),w=!0};let B;try{if(l&&Xu&&n!=="get"&&n!=="head"&&(B=await ed(h,r))!==0){let oe=new Request(e,{method:"POST",body:r,duplex:"half"}),_e;v.isFormData(r)&&(_e=oe.headers.get("content-type"))&&h.setContentType(_e),oe.body&&(r=Ps(oe.body,xs,Rs(B,an(l)),null,lr))}v.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const ne=ur&&(p==="stream"||p==="response");if(ur&&(c||ne)){const oe={};["status","statusText","headers"].forEach(ht=>{oe[ht]=L[ht]});const _e=v.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,xs,c&&Rs(_e,an(c,!0)),ne&&M,lr),oe)}p=p||"text";let Ne=await cn[v.findKey(cn,p)||"text"](L,t);return!ne&&M(),y&&y(),await new Promise((oe,_e)=>{$o(oe,_e,{data:Ne,headers:Z.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:T})})}catch(L){throw M(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new P("Network Error",P.ERR_NETWORK,t,T),{cause:L.cause||L}):P.from(L,L&&L.code,t,T)}}),dr={http:yu,xhr:Wu,fetch:td};v.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ds=t=>`- ${t}`,nd=t=>v.isFunction(t)||t===null||t===!1,Wo={getAdapter:t=>{t=v.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!nd(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new P(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
42
42
|
`+s.map(Ds).join(`
|
|
43
|
-
`):" "+Ds(s[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:dr};function Bn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ls(t){return Bn(t),t.headers=Z.from(t.headers),t.data=In.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Wo.getAdapter(t.adapter||Rt.adapter)(t).then(function(r){return Bn(t),r.data=In.call(t,t.transformResponse,r),r.headers=Z.from(r.headers),r},function(r){return
|
|
44
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ye(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),i!=null&&(v.isFunction(i)?n.paramsSerializer={serialize:i}:hr.assertOptions(i,{encode:Me.function,serialize:Me.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&v.merge(s.common,s[n.method]);s&&v.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=Z.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(l=l&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const p=[];this.interceptors.response.forEach(function(w){p.push(w.fulfilled,w.rejected)});let h,f=0,_;if(!l){const y=[Ls.bind(this),void 0];for(y.unshift.apply(y,c),y.push.apply(y,p),_=y.length,h=Promise.resolve(n);f<_;)h=h.then(y[f++],y[f++]);return h}_=c.length;let k=n;for(f=0;f<_;){const y=c[f++],w=c[f++];try{k=y(k)}catch(T){w.call(this,T);break}}try{h=Ls.call(this,k)}catch(y){return Promise.reject(y)}for(f=0,_=p.length;f<_;)h=h.then(p[f++],p[f++]);return h}getUri(e){e=Ye(this.defaults,e);const n=Go(e.baseURL,e.url);return Uo(n,e.params,e.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(e){
|
|
43
|
+
`):" "+Ds(s[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:dr};function Bn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ls(t){return Bn(t),t.headers=Z.from(t.headers),t.data=In.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Wo.getAdapter(t.adapter||Rt.adapter)(t).then(function(r){return Bn(t),r.data=In.call(t,t.transformResponse,r),r.headers=Z.from(r.headers),r},function(r){return Vo(r)||(Bn(t),r&&r.response&&(r.response.data=In.call(t,t.transformResponse,r.response),r.response.headers=Z.from(r.response.headers))),Promise.reject(r)})}const Yo="1.7.2",Pr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pr[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ns={};Pr.transitional=function(e,n,r){function i(s,a){return"[Axios v"+Yo+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new P(i(a," has been removed"+(n?" in "+n:"")),P.ERR_DEPRECATED);return n&&!Ns[a]&&(Ns[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,c):!0}};function rd(t,e,n){if(typeof t!="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const c=t[s],l=c===void 0||a(c,s,t);if(l!==!0)throw new P("option "+s+" must be "+l,P.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new P("Unknown option "+s,P.ERR_BAD_OPTION)}}const hr={assertOptions:rd,validators:Pr},Me=hr.validators;class Ve{constructor(e){this.defaults=e,this.interceptors={request:new Ms,response:new Ms}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
44
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ye(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),i!=null&&(v.isFunction(i)?n.paramsSerializer={serialize:i}:hr.assertOptions(i,{encode:Me.function,serialize:Me.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&v.merge(s.common,s[n.method]);s&&v.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=Z.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(l=l&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const p=[];this.interceptors.response.forEach(function(w){p.push(w.fulfilled,w.rejected)});let h,f=0,_;if(!l){const y=[Ls.bind(this),void 0];for(y.unshift.apply(y,c),y.push.apply(y,p),_=y.length,h=Promise.resolve(n);f<_;)h=h.then(y[f++],y[f++]);return h}_=c.length;let k=n;for(f=0;f<_;){const y=c[f++],w=c[f++];try{k=y(k)}catch(T){w.call(this,T);break}}try{h=Ls.call(this,k)}catch(y){return Promise.reject(y)}for(f=0,_=p.length;f<_;)h=h.then(p[f++],p[f++]);return h}getUri(e){e=Ye(this.defaults,e);const n=Go(e.baseURL,e.url);return Uo(n,e.params,e.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(n,r){return this.request(Ye(r||{},{method:e,url:n,data:(r||{}).data}))}});v.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(Ye(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ve.prototype[e]=n(),Ve.prototype[e+"Form"]=n(!0)});class Rr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new dt(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Rr(function(i){e=i}),cancel:e}}}function id(t){return function(n){return t.apply(null,n)}}function sd(t){return v.isObject(t)&&t.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pr).forEach(([t,e])=>{pr[e]=t});function Ko(t){const e=new Ve(t),n=Oo(Ve.prototype.request,e);return v.extend(n,Ve.prototype,e,{allOwnKeys:!0}),v.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ko(Ye(t,i))},n}const $=Ko(Rt);$.Axios=Ve;$.CanceledError=dt;$.CancelToken=Rr;$.isCancel=Vo;$.VERSION=Yo;$.toFormData=vn;$.AxiosError=P;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=id;$.isAxiosError=sd;$.mergeConfig=Ye;$.AxiosHeaders=Z;$.formToJSON=t=>Jo(v.isHTMLForm(t)?new FormData(t):t);$.getAdapter=Wo.getAdapter;$.HttpStatusCode=pr;$.default=$;const od=`
|
|
45
45
|
precision mediump float;
|
|
46
46
|
|
|
47
47
|
// our textures
|
|
@@ -76,4 +76,4 @@ void main() {
|
|
|
76
76
|
// the same data for our texcoords.
|
|
77
77
|
v_texCoord = a_position;
|
|
78
78
|
}
|
|
79
|
-
`;function js(t,e,n){const r=t.createShader(n);if(!r)throw Error("Unable to create shader");if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(r);throw t.deleteShader(r),Error(i||"unknown error")}return r}function cd(t,e){const n=t.createProgram();if(!n)throw Error("Unable to create program");for(const r of e)t.attachShader(n,r);if(t.linkProgram(n),!t.getProgramParameter(n,t.LINK_STATUS)){const r=t.getProgramInfoLog(n);throw t.deleteProgram(n),Error(r||"unknown error")}return n}const Qo=new WeakMap;function ld(t){const e={antialias:!1,powerPreference:"low-power",depth:!1,premultipliedAlpha:!0},n=t.getContext("webgl2",e)??t.getContext("webgl",e);if(!n)throw Error("Couldn't create GL context");const r=js(n,od,n.FRAGMENT_SHADER),i=js(n,ad,n.VERTEX_SHADER),s=cd(n,[r,i]);n.useProgram(s);const a=n.getAttribLocation(s,"a_position"),c=n.getUniformLocation(s,"u_frame");n.uniform1i(c,0);const l=n.getUniformLocation(s,"u_matrix");Qo.set(n,n.getUniformLocation(s,"u_premultipliedAlpha")),ud(n);const p=n.createBuffer(),h=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);n.bindBuffer(n.ARRAY_BUFFER,p),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW),n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0),n.uniformMatrix3fv(l,!1,[2,0,0,0,-2,0,-1,1,1]);const f=n.createTexture();return n.bindTexture(n.TEXTURE_2D,f),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n}function ud(t,e){t.uniform1f(Qo.get(t),0)}function dd(t,e){const n=t.canvas,r=e.videoWidth,i=Math.floor(e.videoHeight/2);(n.width!==r||n.height!==i)&&(n.width=r,n.height=i,t.viewport(0,0,r,i)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.drawArrays(t.TRIANGLES,0,6)}var fr;(function(t){t.Send="conversation_engine.message.send"})(fr||(fr={}));const Xo="https://api.avaturn.live";class Zo{constructor(e,n){
|
|
79
|
+
`;function js(t,e,n){const r=t.createShader(n);if(!r)throw Error("Unable to create shader");if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(r);throw t.deleteShader(r),Error(i||"unknown error")}return r}function cd(t,e){const n=t.createProgram();if(!n)throw Error("Unable to create program");for(const r of e)t.attachShader(n,r);if(t.linkProgram(n),!t.getProgramParameter(n,t.LINK_STATUS)){const r=t.getProgramInfoLog(n);throw t.deleteProgram(n),Error(r||"unknown error")}return n}const Qo=new WeakMap;function ld(t){const e={antialias:!1,powerPreference:"low-power",depth:!1,premultipliedAlpha:!0},n=t.getContext("webgl2",e)??t.getContext("webgl",e);if(!n)throw Error("Couldn't create GL context");const r=js(n,od,n.FRAGMENT_SHADER),i=js(n,ad,n.VERTEX_SHADER),s=cd(n,[r,i]);n.useProgram(s);const a=n.getAttribLocation(s,"a_position"),c=n.getUniformLocation(s,"u_frame");n.uniform1i(c,0);const l=n.getUniformLocation(s,"u_matrix");Qo.set(n,n.getUniformLocation(s,"u_premultipliedAlpha")),ud(n);const p=n.createBuffer(),h=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);n.bindBuffer(n.ARRAY_BUFFER,p),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW),n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0),n.uniformMatrix3fv(l,!1,[2,0,0,0,-2,0,-1,1,1]);const f=n.createTexture();return n.bindTexture(n.TEXTURE_2D,f),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n}function ud(t,e){t.uniform1f(Qo.get(t),0)}function dd(t,e){const n=t.canvas,r=e.videoWidth,i=Math.floor(e.videoHeight/2);(n.width!==r||n.height!==i)&&(n.width=r,n.height=i,t.viewport(0,0,r,i)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.drawArrays(t.TRIANGLES,0,6)}var fr;(function(t){t.Send="conversation_engine.external.message.send"})(fr||(fr={}));const Xo="https://api.avaturn.live";class Zo{constructor(e,n){G(this,"inited",!1);G(this,"mediaStream");G(this,"session_id","");G(this,"sessionData",null);G(this,"uiConfig",{background:{transparent:!0}});G(this,"config");G(this,"shadow",null);G(this,"frameHandle",0);G(this,"rootElement");G(this,"abortController");G(this,"timeout",0);G(this,"keepAlive",!1);G(this,"fetcher");G(this,"call");G(this,"handlers",{});if(typeof window>"u")throw new Error("Unfortunately, SDK only works on the client side.");const[r,i]=this.parseConfig(e,n),{apiHost:s=Xo,sessionToken:a,preloadBundle:c,preconnect:l,keepAlive:p,audioSource:h=!1}=this.config=r;this.rootElement=i,this.abortController=new AbortController,this.fetcher=$.create({baseURL:`${s}/_sdk/v0`,headers:{"X-Session-Token":a},signal:this.abortController.signal}),this.keepAlive=!!p,this.mediaStream=new MediaStream,this.call=Dl.createCallObject({videoSource:!1,audioSource:h,dailyConfig:{avoidEval:!0}}),c&&this.call.load(),l&&this.fetcher.post("/sessions/start_stream")}parseConfig(e,n){try{let r,i;if(e instanceof HTMLElement){if(r=e,!n)throw new Error("Options are required when providing a DOM element.");i=n}else i=e;return typeof i.immediatelyJoin>"u"&&(i.immediatelyJoin=!0),[i,r]}catch{throw new Error("Filed to parse configuration object. Bad configuration!")}}dispatch(e,n){var r;(r=this.handlers[e])==null||r.forEach(i=>i(n))}drawUI(){if(!this.rootElement||!this.inited)return;if(!this.shadow){const a=document.createElement("div");a.style.width="100%",a.style.height="100%",a.style.position="relative",a.style.overflow="hidden",this.rootElement.appendChild(a),this.shadow=a.attachShadow({mode:"closed"})}const e=this.shadow;this.shadow.innerHTML="";const n=document.createElement("video");if(n.srcObject=this.mediaStream,n.autoplay=!0,n.style.position="absolute",n.style.opacity="0",n.style.objectFit="cover",n.style.pointerEvents="none",n.playsInline=!0,e.appendChild(n),!this.uiConfig.background.transparent){n.style.width="100%",n.style.height="100%",n.style.opacity="1",n.style.pointerEvents="all";return}const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.objectFit="cover",e.appendChild(r);const i=ld(r),s=()=>{dd(i,n),this.frameHandle=requestAnimationFrame(s)};s()}startIdleTimeout(){this.timeout=setTimeout(()=>{var e;(e=this.handlers.idle)==null||e.forEach(n=>n({data:null})),this.keepAlive||(console.info("[SDK_IDLE]: Stream was terminated due to inactivity"),this.dispose())},5*60*1e3)}restartIdleTimeout(){clearTimeout(this.timeout),this.startIdleTimeout()}updateConfig(){this.call.sendAppMessage({type:fr.Send,data:{prompt_update:!0}})}toggleLocalAudio(){const e=this.call.localAudio();this.call.setLocalAudio(!e),this.dispatch("local_audio_change",!e)}setOutputDevice(e){if(!this.call)throw new Error("Session not initialized");return this.call.setOutputDeviceAsync(e)}setInputDevices(e){return this.call.setInputDevicesAsync(e)}requestMediaDevices(){return this.call.enumerateDevices()}async cancelAllTasks(){const{data:e}=await this.fetcher.post("/sessions/cancel_all_speech_tasks");return e}async patchConfig(e){await this.fetcher.patch("/sessions/config",e)}async changeVoice(e){await this.patchConfig({conversation_engine:{type:"text-echo",tts:e}})}applyEventHandlers(e){return new Promise((n,r)=>{var a,c;const i=e!=null&&e.timeout&&e.timeout>0?e==null?void 0:e.timeout:3e4,s=e!=null&&e.timeout?setTimeout(()=>r("Connection timeout"),i):null;(a=this.call)==null||a.on("participant-updated",({participant:l})=>{var f,_;if(!l.owner)return;this.dispatch("local_audio_change",this.call.localAudio());const{video:p,audio:h}=l.tracks;p.persistentTrack&&(this.mediaStream.getVideoTracks().forEach(k=>this.mediaStream.removeTrack(k)),(f=this.mediaStream)==null||f.addTrack(p.persistentTrack)),h.persistentTrack&&(this.mediaStream.getAudioTracks().forEach(k=>this.mediaStream.removeTrack(k)),(_=this.mediaStream)==null||_.addTrack(h.persistentTrack)),s&&clearTimeout(s),p.persistentTrack&&(this.inited=!0,this.drawUI(),n())}),this.call.on("error",l=>{console.error("[SKD_ERROR]: ",l)}),(c=this.call)==null||c.on("app-message",({data:l})=>{var p;this.restartIdleTimeout(),l.type&&((p=this.handlers[l.type])==null||p.forEach(h=>h(l)))})})}attachDOMNode(e){cancelAnimationFrame(this.frameHandle),this.rootElement&&(this.rootElement.innerHTML=""),this.rootElement=e,this.shadow=null,this.drawUI()}async init(e){if(this.inited)return;this.startIdleTimeout();const{data:n}=await this.fetcher.get("/sessions");return this.session_id=n.id,this.sessionData=n,this.uiConfig.background.transparent=n.session_config.uses_stacked_alpha,!this.abortController.signal.aborted&&this.config.immediatelyJoin&&await this.join(),this.applyEventHandlers(e)}async join(){if(!this.sessionData)throw new Error("Session not initialized");await this.call.join({token:this.sessionData.limited_access_token,url:this.sessionData.room_url}),this.call.setLocalAudio(this.config.audioSource||!1)}async task(e){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();const{data:n}=await this.fetcher.post("/sessions/tasks",{text:e});return n}on(e,n){this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)}off(e,n){this.handlers[e]&&(this.handlers[e]=this.handlers[e].filter(r=>r!==n))}async dispose(){this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await this.call.destroy(),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal}}class hd extends Zo{constructor(n){super(n);G(this,"assistantSessionToken","");G(this,"assistantFetcher");G(this,"sessionToken","");this.assistantSessionToken=n.assistantSessionToken,this.sessionToken=n.sessionToken,this.assistantFetcher=$.create({baseURL:`${n.apiHost||Xo}/`,headers:{Authorization:`Bearer ${n.assistantSessionToken}`},signal:this.abortController.signal})}async task(n,r){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();const{data:i}=await this.assistantFetcher.post("/assistants/tasks",{text:n});return i}async dispose(){var n;this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await((n=this.call)==null?void 0:n.destroy()),await this.assistantFetcher.delete("/assistants/sessions"),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal,this.assistantFetcher.defaults.signal=this.abortController.signal}}exports.AvaturnAssistantHead=hd;exports.AvaturnHead=Zo;
|