media-av 0.0.21 → 0.0.23

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.
@@ -1,9 +1,43 @@
1
- (function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T.mediaAV={}))})(this,function(T){"use strict";var Rs=Object.defineProperty;var Cs=(T,N,Y)=>N in T?Rs(T,N,{enumerable:!0,configurable:!0,writable:!0,value:Y}):T[N]=Y;var m=(T,N,Y)=>(Cs(T,typeof N!="symbol"?N+"":N,Y),Y);function N(t,e){return function(){return t.apply(e,arguments)}}const{toString:Y}=Object.prototype,{getPrototypeOf:ze}=Object,Te=(t=>e=>{const r=Y.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),k=t=>(t=t.toLowerCase(),e=>Te(e)===t),De=t=>e=>typeof e===t,{isArray:oe}=Array,ge=De("undefined");function en(t){return t!==null&&!ge(t)&&t.constructor!==null&&!ge(t.constructor)&&x(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const kt=k("ArrayBuffer");function tn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&kt(t.buffer),e}const rn=De("string"),x=De("function"),Bt=De("number"),Pe=t=>t!==null&&typeof t=="object",nn=t=>t===!0||t===!1,Le=t=>{if(Te(t)!=="object")return!1;const e=ze(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},on=k("Date"),sn=k("File"),an=k("Blob"),cn=k("FileList"),ln=t=>Pe(t)&&x(t.pipe),un=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||x(t.append)&&((e=Te(t))==="formdata"||e==="object"&&x(t.toString)&&t.toString()==="[object FormData]"))},fn=k("URLSearchParams"),dn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,o;if(typeof t!="object"&&(t=[t]),oe(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(n=0;n<s;n++)a=i[n],e.call(null,t[a],a,t)}}function Mt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,o;for(;n-- >0;)if(o=r[n],e===o.toLowerCase())return o;return null}const Ht=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$t=t=>!ge(t)&&t!==Ht;function Je(){const{caseless:t}=$t(this)&&this||{},e={},r=(n,o)=>{const i=t&&Mt(e,o)||o;Le(e[i])&&Le(n)?e[i]=Je(e[i],n):Le(n)?e[i]=Je({},n):oe(n)?e[i]=n.slice():e[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Se(arguments[n],r);return e}const pn=(t,e,r,{allOwnKeys:n}={})=>(Se(e,(o,i)=>{r&&x(o)?t[i]=N(o,r):t[i]=o},{allOwnKeys:n}),t),hn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yn=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},mn=(t,e,r,n)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&ze(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},gn=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Sn=t=>{if(!t)return null;if(oe(t))return t;let e=t.length;if(!Bt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ze(Uint8Array)),bn=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=n.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},vn=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},En=k("HTMLFormElement"),An=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Vt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),On=k("RegExp"),Gt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Se(r,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(n[i]=s||o)}),Object.defineProperties(t,n)},Rn=t=>{Gt(t,(e,r)=>{if(x(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(x(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Cn=(t,e)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(t)?n(t):n(String(t).split(e)),r},In=()=>{},Tn=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ke="abcdefghijklmnopqrstuvwxyz",Wt="0123456789",qt={DIGIT:Wt,ALPHA:Ke,ALPHA_DIGIT:Ke+Ke.toUpperCase()+Wt},Dn=(t=16,e=qt.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Pn(t){return!!(t&&x(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ln=t=>{const e=new Array(10),r=(n,o)=>{if(Pe(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[o]=n;const i=oe(n)?[]:{};return Se(n,(s,a)=>{const c=r(s,o+1);!ge(c)&&(i[a]=c)}),e[o]=void 0,i}}return n};return r(t,0)},Fn=k("AsyncFunction"),u={isArray:oe,isArrayBuffer:kt,isBuffer:en,isFormData:un,isArrayBufferView:tn,isString:rn,isNumber:Bt,isBoolean:nn,isObject:Pe,isPlainObject:Le,isUndefined:ge,isDate:on,isFile:sn,isBlob:an,isRegExp:On,isFunction:x,isStream:ln,isURLSearchParams:fn,isTypedArray:wn,isFileList:cn,forEach:Se,merge:Je,extend:pn,trim:dn,stripBOM:hn,inherits:yn,toFlatObject:mn,kindOf:Te,kindOfTest:k,endsWith:gn,toArray:Sn,forEachEntry:bn,matchAll:vn,isHTMLForm:En,hasOwnProperty:Vt,hasOwnProp:Vt,reduceDescriptors:Gt,freezeMethods:Rn,toObjectSet:Cn,toCamelCase:An,noop:In,toFiniteNumber:Tn,findKey:Mt,global:Ht,isContextDefined:$t,ALPHABET:qt,generateString:Dn,isSpecCompliantForm:Pn,toJSONObject:Ln,isAsyncFn:Fn,isThenable:t=>t&&(Pe(t)||x(t))&&x(t.then)&&x(t.catch)};function v(t,e,r,n,o){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),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}u.inherits(v,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:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jt=v.prototype,zt={};["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=>{zt[t]={value:t}}),Object.defineProperties(v,zt),Object.defineProperty(jt,"isAxiosError",{value:!0}),v.from=(t,e,r,n,o,i)=>{const s=Object.create(jt);return u.toFlatObject(t,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),v.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const Nn=null;function Qe(t){return u.isPlainObject(t)||u.isArray(t)}function Jt(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function Kt(t,e,r){return t?t.concat(e).map(function(o,i){return o=Jt(o),!r&&i?"["+o+"]":o}).join(r?".":""):e}function _n(t){return u.isArray(t)&&!t.some(Qe)}const xn=u.toFlatObject(u,{},null,function(e){return/^is[A-Z]/.test(e)});function Fe(t,e,r){if(!u.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,E){return!u.isUndefined(E[h])});const n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(e);if(!u.isFunction(o))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(!c&&u.isBlob(p))throw new v("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,h,E){let S=p;if(p&&!E&&typeof p=="object"){if(u.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&_n(p)||(u.isFileList(p)||u.endsWith(h,"[]"))&&(S=u.toArray(p)))return h=Jt(h),S.forEach(function(D,Q){!(u.isUndefined(D)||D===null)&&e.append(s===!0?Kt([h],Q,i):s===null?h:h+"[]",l(D))}),!1}return Qe(p)?!0:(e.append(Kt(E,h,i),l(p)),!1)}const f=[],y=Object.assign(xn,{defaultVisitor:d,convertValue:l,isVisitable:Qe});function w(p,h){if(!u.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));f.push(p),u.forEach(p,function(S,I){(!(u.isUndefined(S)||S===null)&&o.call(e,S,u.isString(I)?I.trim():I,h,y))===!0&&w(S,h?h.concat(I):[I])}),f.pop()}}if(!u.isObject(t))throw new TypeError("data must be an object");return w(t),e}function Qt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Xe(t,e){this._pairs=[],t&&Fe(t,this,e)}const Xt=Xe.prototype;Xt.append=function(e,r){this._pairs.push([e,r])},Xt.toString=function(e){const r=e?function(n){return e.call(this,n,Qt)}:Qt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Un(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yt(t,e,r){if(!e)return t;const n=r&&r.encode||Un,o=r&&r.serialize;let i;if(o?i=o(e,r):i=u.isURLSearchParams(e)?e.toString():new Xe(e,r).toString(n),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Zt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(n){n!==null&&e(n)})}}const er={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tr=typeof window<"u"&&typeof document<"u",Bn=(t=>tr&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",B={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tr,hasStandardBrowserEnv:Bn,hasStandardBrowserWebWorkerEnv:Mn},Symbol.toStringTag,{value:"Module"})),...kn};function Hn(t,e){return Fe(t,new B.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return B.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function $n(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Vn(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}function rr(t){function e(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=i>=r.length;return s=!s&&u.isArray(o)?o.length:s,c?(u.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!u.isObject(o[s]))&&(o[s]=[]),e(r,n,o[s],i)&&u.isArray(o[s])&&(o[s]=Vn(o[s])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const r={};return u.forEachEntry(t,(n,o)=>{e($n(n),o,r,0)}),r}return null}function Gn(t,e,r){if(u.isString(t))try{return(e||JSON.parse)(t),u.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Ye={transitional:er,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=u.isObject(e);if(i&&u.isHTMLForm(e)&&(e=new FormData(e)),u.isFormData(e))return o?JSON.stringify(rr(e)):e;if(u.isArrayBuffer(e)||u.isBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e))return e;if(u.isArrayBufferView(e))return e.buffer;if(u.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Hn(e,this.formSerializer).toString();if((a=u.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fe(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Gn(e)):e}],transformResponse:[function(e){const r=this.transitional||Ye.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(e&&u.isString(e)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?v.from(a,v.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],t=>{Ye.headers[t]={}});const Ze=Ye,Wn=u.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"]),qn=t=>{const e={};let r,n,o;return t&&t.split(`
2
- `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||e[r]&&Wn[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},nr=Symbol("internals");function we(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return t===!1||t==null?t:u.isArray(t)?t.map(Ne):String(t)}function jn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const zn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function et(t,e,r,n,o){if(u.isFunction(n))return n.call(this,e,r);if(o&&(e=r),!!u.isString(e)){if(u.isString(n))return e.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(e)}}function Jn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Kn(t,e){const r=u.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(o,i,s){return this[n].call(this,e,o,i,s)},configurable:!0})})}class _e{constructor(e){e&&this.set(e)}set(e,r,n){const o=this;function i(a,c,l){const d=we(c);if(!d)throw new Error("header name must be a non-empty string");const f=u.findKey(o,d);(!f||o[f]===void 0||l===!0||l===void 0&&o[f]!==!1)&&(o[f||c]=Ne(a))}const s=(a,c)=>u.forEach(a,(l,d)=>i(l,d,c));return u.isPlainObject(e)||e instanceof this.constructor?s(e,r):u.isString(e)&&(e=e.trim())&&!zn(e)?s(qn(e),r):e!=null&&i(r,e,n),this}get(e,r){if(e=we(e),e){const n=u.findKey(this,e);if(n){const o=this[n];if(!r)return o;if(r===!0)return jn(o);if(u.isFunction(r))return r.call(this,o,n);if(u.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=we(e),e){const n=u.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||et(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let o=!1;function i(s){if(s=we(s),s){const a=u.findKey(n,s);a&&(!r||et(n,n[a],a,r))&&(delete n[a],o=!0)}}return u.isArray(e)?e.forEach(i):i(e),o}clear(e){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!e||et(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const r=this,n={};return u.forEach(this,(o,i)=>{const s=u.findKey(n,i);if(s){r[s]=Ne(o),delete r[i];return}const a=e?Jn(i):String(i).trim();a!==i&&delete r[i],r[a]=Ne(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return u.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=e&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(o=>n.set(o)),n}static accessor(e){const n=(this[nr]=this[nr]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=we(s);n[a]||(Kn(o,s),n[a]=!0)}return u.isArray(e)?e.forEach(i):i(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(_e.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),u.freezeMethods(_e);const V=_e;function tt(t,e){const r=this||Ze,n=e||r,o=V.from(n.headers);let i=n.data;return u.forEach(t,function(a){i=a.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function or(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){v.call(this,t??"canceled",v.ERR_CANCELED,e,r),this.name="CanceledError"}u.inherits(be,v,{__CANCEL__:!0});function Qn(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new v("Request failed with status code "+r.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Xn=B.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];u.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),u.isString(n)&&s.push("path="+n),u.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.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 Yn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ir(t,e){return t&&!Yn(e)?Zn(t,e):e}const eo=B.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(s){const a=u.isString(s)?o(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function to(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ro(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),d=n[i];s||(s=l),r[o]=c,n[o]=l;let f=i,y=0;for(;f!==o;)y+=r[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s<e)return;const w=d&&l-d;return w?Math.round(y*1e3/w):void 0}}function sr(t,e){let r=0;const n=ro(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,c=n(a),l=i<=s;r=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&l?(s-i)/c:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const rt={http:Nn,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){let o=t.data;const i=V.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,c;function l(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}let d;if(u.isFormData(o)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((d=i.getContentType())!==!1){const[h,...E]=d?d.split(";").map(S=>S.trim()).filter(Boolean):[];i.setContentType([h||"multipart/form-data",...E].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const h=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(h+":"+E))}const y=ir(t.baseURL,t.url);f.open(t.method.toUpperCase(),Yt(y,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function w(){if(!f)return;const h=V.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),S={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:h,config:t,request:f};Qn(function(D){r(D),l()},function(D){n(D),l()},S),f=null}if("onloadend"in f?f.onloadend=w:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(w)},f.onabort=function(){f&&(n(new v("Request aborted",v.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new v("Network Error",v.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let E=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const S=t.transitional||er;t.timeoutErrorMessage&&(E=t.timeoutErrorMessage),n(new v(E,S.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,f)),f=null},B.hasStandardBrowserEnv&&(a&&u.isFunction(a)&&(a=a(t)),a||a!==!1&&eo(y))){const h=t.xsrfHeaderName&&t.xsrfCookieName&&Xn.read(t.xsrfCookieName);h&&i.set(t.xsrfHeaderName,h)}o===void 0&&i.setContentType(null),"setRequestHeader"in f&&u.forEach(i.toJSON(),function(E,S){f.setRequestHeader(S,E)}),u.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),s&&s!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",sr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",sr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=h=>{f&&(n(!h||h.type?new be(null,t,f):h),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const p=to(y);if(p&&B.protocols.indexOf(p)===-1){n(new v("Unsupported protocol "+p+":",v.ERR_BAD_REQUEST,t));return}f.send(o||null)})}};u.forEach(rt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ar=t=>`- ${t}`,no=t=>u.isFunction(t)||t===null||t===!1,cr={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){r=t[i];let s;if(n=r,!no(r)&&(n=rt[(s=String(r)).toLowerCase()],n===void 0))throw new v(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
4
- `+i.map(ar).join(`
5
- `):" "+ar(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:rt};function nt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function lr(t){return nt(t),t.headers=V.from(t.headers),t.data=tt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),cr.getAdapter(t.adapter||Ze.adapter)(t).then(function(n){return nt(t),n.data=tt.call(t,t.transformResponse,n),n.headers=V.from(n.headers),n},function(n){return or(n)||(nt(t),n&&n.response&&(n.response.data=tt.call(t,t.transformResponse,n.response),n.response.headers=V.from(n.response.headers))),Promise.reject(n)})}const ur=t=>t instanceof V?t.toJSON():t;function ie(t,e){e=e||{};const r={};function n(l,d,f){return u.isPlainObject(l)&&u.isPlainObject(d)?u.merge.call({caseless:f},l,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function o(l,d,f){if(u.isUndefined(d)){if(!u.isUndefined(l))return n(void 0,l,f)}else return n(l,d,f)}function i(l,d){if(!u.isUndefined(d))return n(void 0,d)}function s(l,d){if(u.isUndefined(d)){if(!u.isUndefined(l))return n(void 0,l)}else return n(void 0,d)}function a(l,d,f){if(f in e)return n(l,d);if(f in t)return n(void 0,l)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,d)=>o(ur(l),ur(d),!0)};return u.forEach(Object.keys(Object.assign({},t,e)),function(d){const f=c[d]||o,y=f(t[d],e[d],d);u.isUndefined(y)&&f!==a||(r[d]=y)}),r}const fr="1.6.7",ot={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ot[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const dr={};ot.transitional=function(e,r,n){function o(i,s){return"[Axios v"+fr+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(e===!1)throw new v(o(s," has been removed"+(r?" in "+r:"")),v.ERR_DEPRECATED);return r&&!dr[s]&&(dr[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,s,a):!0}};function oo(t,e,r){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const a=t[i],c=a===void 0||s(a,i,t);if(c!==!0)throw new v("option "+i+" must be "+c,v.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new v("Unknown option "+i,v.ERR_BAD_OPTION)}}const it={assertOptions:oo,validators:ot},q=it.validators;class xe{constructor(e){this.defaults=e,this.interceptors={request:new Zt,response:new Zt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+i):n.stack=i}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ie(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&it.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),o!=null&&(u.isFunction(o)?r.paramsSerializer={serialize:o}:it.assertOptions(o,{encode:q.function,serialize:q.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&u.merge(i.common,i[r.method]);i&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=V.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(c=c&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let d,f=0,y;if(!c){const p=[lr.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,l),y=p.length,d=Promise.resolve(r);f<y;)d=d.then(p[f++],p[f++]);return d}y=a.length;let w=r;for(f=0;f<y;){const p=a[f++],h=a[f++];try{w=p(w)}catch(E){h.call(this,E);break}}try{d=lr.call(this,w)}catch(p){return Promise.reject(p)}for(f=0,y=l.length;f<y;)d=d.then(l[f++],l[f++]);return d}getUri(e){e=ie(this.defaults,e);const r=ir(e.baseURL,e.url);return Yt(r,e.params,e.paramsSerializer)}}u.forEach(["delete","get","head","options"],function(e){xe.prototype[e]=function(r,n){return this.request(ie(n||{},{method:e,url:r,data:(n||{}).data}))}}),u.forEach(["post","put","patch"],function(e){function r(n){return function(i,s,a){return this.request(ie(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}xe.prototype[e]=r(),xe.prototype[e+"Form"]=r(!0)});const Ue=xe;class st{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},e(function(i,s,a){n.reason||(n.reason=new be(i,s,a),r(n.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new st(function(o){e=o}),cancel:e}}}const io=st;function so(t){return function(r){return t.apply(null,r)}}function ao(t){return u.isObject(t)&&t.isAxiosError===!0}const at={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(at).forEach(([t,e])=>{at[e]=t});const co=at;function pr(t){const e=new Ue(t),r=N(Ue.prototype.request,e);return u.extend(r,Ue.prototype,e,{allOwnKeys:!0}),u.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return pr(ie(t,o))},r}const O=pr(Ze);O.Axios=Ue,O.CanceledError=be,O.CancelToken=io,O.isCancel=or,O.VERSION=fr,O.toFormData=Fe,O.AxiosError=v,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=so,O.isAxiosError=ao,O.mergeConfig=ie,O.AxiosHeaders=V,O.formToJSON=t=>rr(u.isHTMLForm(t)?new FormData(t):t),O.getAdapter=cr.getAdapter,O.HttpStatusCode=co,O.default=O;function lo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function uo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var fo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0},hr=typeof Symbol<"u"&&Symbol,po=fo,ho=function(){return typeof hr!="function"||typeof Symbol!="function"||typeof hr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:po()},yr={foo:{}},yo=Object,mo=function(){return{__proto__:yr}.foo===yr.foo&&!({__proto__:null}instanceof yo)},go="Function.prototype.bind called on incompatible ",ct=Array.prototype.slice,So=Object.prototype.toString,wo="[object Function]",bo=function(e){var r=this;if(typeof r!="function"||So.call(r)!==wo)throw new TypeError(go+r);for(var n=ct.call(arguments,1),o,i=function(){if(this instanceof o){var d=r.apply(this,n.concat(ct.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,n.concat(ct.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],c=0;c<s;c++)a.push("$"+c);if(o=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var l=function(){};l.prototype=r.prototype,o.prototype=new l,l.prototype=null}return o},vo=bo,lt=Function.prototype.bind||vo,Eo=lt,Ao=Eo.call(Function.call,Object.prototype.hasOwnProperty),b,se=SyntaxError,mr=Function,ae=TypeError,ut=function(t){try{return mr('"use strict"; return ('+t+").constructor;")()}catch{}},Z=Object.getOwnPropertyDescriptor;if(Z)try{Z({},"")}catch{Z=null}var ft=function(){throw new ae},Oo=Z?function(){try{return arguments.callee,ft}catch{try{return Z(arguments,"callee").get}catch{return ft}}}():ft,ce=ho(),Ro=mo(),R=Object.getPrototypeOf||(Ro?function(t){return t.__proto__}:null),le={},Co=typeof Uint8Array>"u"||!R?b:R(Uint8Array),ee={"%AggregateError%":typeof AggregateError>"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":ce&&R?R([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":le,"%AsyncGenerator%":le,"%AsyncGeneratorFunction%":le,"%AsyncIteratorPrototype%":le,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":mr,"%GeneratorFunction%":le,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ce&&R?R(R([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ce||!R?b:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ce||!R?b:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ce&&R?R(""[Symbol.iterator]()):b,"%Symbol%":ce?Symbol:b,"%SyntaxError%":se,"%ThrowTypeError%":Oo,"%TypedArray%":Co,"%TypeError%":ae,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet};if(R)try{null.error}catch(t){var Io=R(R(t));ee["%Error.prototype%"]=Io}var To=function t(e){var r;if(e==="%AsyncFunction%")r=ut("async function () {}");else if(e==="%GeneratorFunction%")r=ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ut("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&R&&(r=R(o.prototype))}return ee[e]=r,r},gr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ve=lt,ke=Ao,Do=ve.call(Function.call,Array.prototype.concat),Po=ve.call(Function.apply,Array.prototype.splice),Sr=ve.call(Function.call,String.prototype.replace),Be=ve.call(Function.call,String.prototype.slice),Lo=ve.call(Function.call,RegExp.prototype.exec),Fo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,No=/\\(\\)?/g,_o=function(e){var r=Be(e,0,1),n=Be(e,-1);if(r==="%"&&n!=="%")throw new se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new se("invalid intrinsic syntax, expected opening `%`");var o=[];return Sr(e,Fo,function(i,s,a,c){o[o.length]=a?Sr(c,No,"$1"):s||i}),o},xo=function(e,r){var n=e,o;if(ke(gr,n)&&(o=gr[n],n="%"+o[0]+"%"),ke(ee,n)){var i=ee[n];if(i===le&&(i=To(n)),typeof i>"u"&&!r)throw new ae("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new se("intrinsic "+e+" does not exist!")},dt=function(e,r){if(typeof e!="string"||e.length===0)throw new ae("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ae('"allowMissing" argument must be a boolean');if(Lo(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_o(e),o=n.length>0?n[0]:"",i=xo("%"+o+"%",r),s=i.name,a=i.value,c=!1,l=i.alias;l&&(o=l[0],Po(n,Do([0,1],l)));for(var d=1,f=!0;d<n.length;d+=1){var y=n[d],w=Be(y,0,1),p=Be(y,-1);if((w==='"'||w==="'"||w==="`"||p==='"'||p==="'"||p==="`")&&w!==p)throw new se("property names with quotes must have matching quotes");if((y==="constructor"||!f)&&(c=!0),o+="."+y,s="%"+o+"%",ke(ee,s))a=ee[s];else if(a!=null){if(!(y in a)){if(!r)throw new ae("base intrinsic for "+e+" exists, but the property is not available.");return}if(Z&&d+1>=n.length){var h=Z(a,y);f=!!h,f&&"get"in h&&!("originalValue"in h.get)?a=h.get:a=a[y]}else f=ke(a,y),a=a[y];f&&!c&&(ee[s]=a)}}return a},wr={exports:{}};(function(t){var e=lt,r=dt,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(o,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var y=i(e,o,arguments);if(s&&a){var w=s(y,"length");w.configurable&&a(y,"length",{value:1+c(0,f.length-(arguments.length-1))})}return y};var l=function(){return i(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(wr);var Uo=wr.exports,br=dt,vr=Uo,ko=vr(br("String.prototype.indexOf")),Bo=function(e,r){var n=br(e,!!r);return typeof n=="function"&&ko(e,".prototype.")>-1?vr(n):n};const Mo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var pt=typeof Map=="function"&&Map.prototype,ht=Object.getOwnPropertyDescriptor&&pt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Me=pt&&ht&&typeof ht.get=="function"?ht.get:null,Er=pt&&Map.prototype.forEach,yt=typeof Set=="function"&&Set.prototype,mt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=yt&&mt&&typeof mt.get=="function"?mt.get:null,Ar=yt&&Set.prototype.forEach,Ho=typeof WeakMap=="function"&&WeakMap.prototype,Ee=Ho?WeakMap.prototype.has:null,$o=typeof WeakSet=="function"&&WeakSet.prototype,Ae=$o?WeakSet.prototype.has:null,Vo=typeof WeakRef=="function"&&WeakRef.prototype,Or=Vo?WeakRef.prototype.deref:null,Go=Boolean.prototype.valueOf,Wo=Object.prototype.toString,qo=Function.prototype.toString,jo=String.prototype.match,gt=String.prototype.slice,j=String.prototype.replace,zo=String.prototype.toUpperCase,Rr=String.prototype.toLowerCase,Cr=RegExp.prototype.test,Ir=Array.prototype.concat,M=Array.prototype.join,Jo=Array.prototype.slice,Tr=Math.floor,St=typeof BigInt=="function"?BigInt.prototype.valueOf:null,wt=Object.getOwnPropertySymbols,bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",P=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||!0)?Symbol.toStringTag:null,Dr=Object.prototype.propertyIsEnumerable,Pr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Lr(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Cr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Tr(-t):Tr(t);if(n!==t){var o=String(n),i=gt.call(e,o.length+1);return j.call(o,r,"$&_")+"."+j.call(j.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return j.call(e,r,"$&_")}var vt=Mo,Fr=vt.custom,Nr=Ur(Fr)?Fr:null,Ko=function t(e,r,n,o){var i=r||{};if(z(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=z(i,"customInspect")?i.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Br(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?Lr(e,c):c}if(typeof e=="bigint"){var l=String(e)+"n";return a?Lr(e,l):l}var d=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return Et(e)?"[Array]":"[Object]";var f=pi(i,n);if(typeof o>"u")o=[];else if(kr(o,e)>=0)return"[Circular]";function y(W,ye,je){if(ye&&(o=Jo.call(o),o.push(ye)),je){var me={depth:i.depth};return z(i,"quoteStyle")&&(me.quoteStyle=i.quoteStyle),t(W,me,n+1,o)}return t(W,i,n+1,o)}if(typeof e=="function"&&!xr(e)){var w=oi(e),p=$e(e,y);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(p.length>0?" { "+M.call(p,", ")+" }":"")}if(Ur(e)){var h=ue?j.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):bt.call(e);return typeof e=="object"&&!ue?Oe(h):h}if(ui(e)){for(var E="<"+Rr.call(String(e.nodeName)),S=e.attributes||[],I=0;I<S.length;I++)E+=" "+S[I].name+"="+_r(Qo(S[I].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Rr.call(String(e.nodeName))+">",E}if(Et(e)){if(e.length===0)return"[]";var D=$e(e,y);return f&&!di(D)?"["+Ot(D,f)+"]":"[ "+M.call(D,", ")+" ]"}if(Yo(e)){var Q=$e(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!Dr.call(e,"cause")?"{ ["+String(e)+"] "+M.call(Ir.call("[cause]: "+y(e.cause),Q),", ")+" }":Q.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+M.call(Q,", ")+" }"}if(typeof e=="object"&&s){if(Nr&&typeof e[Nr]=="function"&&vt)return vt(e,{depth:d-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ii(e)){var Ce=[];return Er&&Er.call(e,function(W,ye){Ce.push(y(ye,e,!0)+" => "+y(W,e))}),Mr("Map",Me.call(e),Ce,f)}if(ci(e)){var qe=[];return Ar&&Ar.call(e,function(W){qe.push(y(W,e))}),Mr("Set",He.call(e),qe,f)}if(si(e))return At("WeakMap");if(li(e))return At("WeakSet");if(ai(e))return At("WeakRef");if(ei(e))return Oe(y(Number(e)));if(ri(e))return Oe(y(St.call(e)));if(ti(e))return Oe(Go.call(e));if(Zo(e))return Oe(y(String(e)));if(!Xo(e)&&!xr(e)){var ne=$e(e,y),X=Pr?Pr(e)===Object.prototype:e instanceof Object||e.constructor===Object,pe=e instanceof Object?"":"null prototype",he=!X&&P&&Object(e)===e&&P in e?gt.call(J(e),8,-1):pe?"Object":"",Ie=X||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",U=Ie+(he||pe?"["+M.call(Ir.call([],he||[],pe||[]),": ")+"] ":"");return ne.length===0?U+"{}":f?U+"{"+Ot(ne,f)+"}":U+"{ "+M.call(ne,", ")+" }"}return String(e)};function _r(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qo(t){return j.call(String(t),/"/g,"&quot;")}function Et(t){return J(t)==="[object Array]"&&(!P||!(typeof t=="object"&&P in t))}function Xo(t){return J(t)==="[object Date]"&&(!P||!(typeof t=="object"&&P in t))}function xr(t){return J(t)==="[object RegExp]"&&(!P||!(typeof t=="object"&&P in t))}function Yo(t){return J(t)==="[object Error]"&&(!P||!(typeof t=="object"&&P in t))}function Zo(t){return J(t)==="[object String]"&&(!P||!(typeof t=="object"&&P in t))}function ei(t){return J(t)==="[object Number]"&&(!P||!(typeof t=="object"&&P in t))}function ti(t){return J(t)==="[object Boolean]"&&(!P||!(typeof t=="object"&&P in t))}function Ur(t){if(ue)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!bt)return!1;try{return bt.call(t),!0}catch{}return!1}function ri(t){if(!t||typeof t!="object"||!St)return!1;try{return St.call(t),!0}catch{}return!1}var ni=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return ni.call(t,e)}function J(t){return Wo.call(t)}function oi(t){if(t.name)return t.name;var e=jo.call(qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function kr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ii(t){if(!Me||!t||typeof t!="object")return!1;try{Me.call(t);try{He.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function si(t){if(!Ee||!t||typeof t!="object")return!1;try{Ee.call(t,Ee);try{Ae.call(t,Ae)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ai(t){if(!Or||!t||typeof t!="object")return!1;try{return Or.call(t),!0}catch{}return!1}function ci(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{Me.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function li(t){if(!Ae||!t||typeof t!="object")return!1;try{Ae.call(t,Ae);try{Ee.call(t,Ee)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ui(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Br(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Br(gt.call(t,0,e.maxStringLength),e)+n}var o=j.call(j.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fi);return _r(o,"single",e)}function fi(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+zo.call(e.toString(16))}function Oe(t){return"Object("+t+")"}function At(t){return t+" { ? }"}function Mr(t,e,r,n){var o=n?Ot(r,n):M.call(r,", ");return t+" ("+e+") {"+o+"}"}function di(t){for(var e=0;e<t.length;e++)if(kr(t[e],`
7
- `)>=0)return!1;return!0}function pi(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=M.call(Array(t.indent+1)," ");else return null;return{base:r,prev:M.call(Array(e+1),r)}}function Ot(t,e){if(t.length===0)return"";var r=`
8
- `+e.prev+e.base;return r+M.call(t,","+r)+`
9
- `+e.prev}function $e(t,e){var r=Et(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=z(t,o)?e(t[o],t):""}var i=typeof wt=="function"?wt(t):[],s;if(ue){s={};for(var a=0;a<i.length;a++)s["$"+i[a]]=i[a]}for(var c in t)z(t,c)&&(r&&String(Number(c))===c&&c<t.length||ue&&s["$"+c]instanceof Symbol||(Cr.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if(typeof wt=="function")for(var l=0;l<i.length;l++)Dr.call(t,i[l])&&n.push("["+e(i[l])+"]: "+e(t[i[l]],t));return n}var Rt=dt,fe=Bo,hi=Ko,yi=Rt("%TypeError%"),Ve=Rt("%WeakMap%",!0),Ge=Rt("%Map%",!0),mi=fe("WeakMap.prototype.get",!0),gi=fe("WeakMap.prototype.set",!0),Si=fe("WeakMap.prototype.has",!0),wi=fe("Map.prototype.get",!0),bi=fe("Map.prototype.set",!0),vi=fe("Map.prototype.has",!0),Ct=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Ei=function(t,e){var r=Ct(t,e);return r&&r.value},Ai=function(t,e,r){var n=Ct(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Oi=function(t,e){return!!Ct(t,e)},Ri=function(){var e,r,n,o={assert:function(i){if(!o.has(i))throw new yi("Side channel does not contain "+hi(i))},get:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return mi(e,i)}else if(Ge){if(r)return wi(r,i)}else if(n)return Ei(n,i)},has:function(i){if(Ve&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Si(e,i)}else if(Ge){if(r)return vi(r,i)}else if(n)return Oi(n,i);return!1},set:function(i,s){Ve&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ve),gi(e,i,s)):Ge?(r||(r=new Ge),bi(r,i,s)):(n||(n={key:{},next:null}),Ai(n,i,s))}};return o},Ci=String.prototype.replace,Ii=/%20/g,It={RFC1738:"RFC1738",RFC3986:"RFC3986"},Tt={default:It.RFC3986,formatters:{RFC1738:function(t){return Ci.call(t,Ii,"+")},RFC3986:function(t){return String(t)}},RFC1738:It.RFC1738,RFC3986:It.RFC3986},Ti=Tt,Dt=Object.prototype.hasOwnProperty,te=Array.isArray,H=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Di=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(te(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&o.push(n[i]);r.obj[r.prop]=o}}},Hr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},Pi=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(te(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Dt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var o=e;return te(e)&&!te(r)&&(o=Hr(e,n)),te(e)&&te(r)?(r.forEach(function(i,s){if(Dt.call(e,s)){var a=e[s];a&&typeof a=="object"&&i&&typeof i=="object"?e[s]=t(a,i,n):e.push(i)}else e[s]=i}),e):Object.keys(r).reduce(function(i,s){var a=r[s];return Dt.call(i,s)?i[s]=t(i[s],a,n):i[s]=a,i},o)},Li=function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},Fi=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ni=function(e,r,n,o,i){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var a="",c=0;c<s.length;++c){var l=s.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===Ti.RFC1738&&(l===40||l===41)){a+=s.charAt(c);continue}if(l<128){a=a+H[l];continue}if(l<2048){a=a+(H[192|l>>6]+H[128|l&63]);continue}if(l<55296||l>=57344){a=a+(H[224|l>>12]+H[128|l>>6&63]+H[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|s.charCodeAt(c)&1023),a+=H[240|l>>18]+H[128|l>>12&63]+H[128|l>>6&63]+H[128|l&63]}return a},_i=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var i=r[o],s=i.obj[i.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],d=s[l];typeof d=="object"&&d!==null&&n.indexOf(d)===-1&&(r.push({obj:s,prop:l}),n.push(d))}return Di(r),e},xi=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ui=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ki=function(e,r){return[].concat(e,r)},Bi=function(e,r){if(te(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(r(e[o]));return n}return r(e)},$r={arrayToObject:Hr,assign:Li,combine:ki,compact:_i,decode:Fi,encode:Ni,isBuffer:Ui,isRegExp:xi,maybeMap:Bi,merge:Pi},Vr=Ri,We=$r,Re=Tt,Mi=Object.prototype.hasOwnProperty,Gr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,Hi=Array.prototype.push,Wr=function(t,e){Hi.apply(t,G(e)?e:[e])},$i=Date.prototype.toISOString,qr=Re.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:We.encode,encodeValuesOnly:!1,format:qr,formatter:Re.formatters[qr],indices:!1,serializeDate:function(e){return $i.call(e)},skipNulls:!1,strictNullHandling:!1},Vi=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pt={},Gi=function t(e,r,n,o,i,s,a,c,l,d,f,y,w,p,h,E){for(var S=e,I=E,D=0,Q=!1;(I=I.get(Pt))!==void 0&&!Q;){var Ce=I.get(e);if(D+=1,typeof Ce<"u"){if(Ce===D)throw new RangeError("Cyclic object value");Q=!0}typeof I.get(Pt)>"u"&&(D=0)}if(typeof c=="function"?S=c(r,S):S instanceof Date?S=f(S):n==="comma"&&G(S)&&(S=We.maybeMap(S,function(me){return me instanceof Date?f(me):me})),S===null){if(i)return a&&!p?a(r,L.encoder,h,"key",y):r;S=""}if(Vi(S)||We.isBuffer(S)){if(a){var qe=p?r:a(r,L.encoder,h,"key",y);return[w(qe)+"="+w(a(S,L.encoder,h,"value",y))]}return[w(r)+"="+w(String(S))]}var ne=[];if(typeof S>"u")return ne;var X;if(n==="comma"&&G(S))p&&a&&(S=We.maybeMap(S,a)),X=[{value:S.length>0?S.join(",")||null:void 0}];else if(G(c))X=c;else{var pe=Object.keys(S);X=l?pe.sort(l):pe}for(var he=o&&G(S)&&S.length===1?r+"[]":r,Ie=0;Ie<X.length;++Ie){var U=X[Ie],W=typeof U=="object"&&typeof U.value<"u"?U.value:S[U];if(!(s&&W===null)){var ye=G(S)?typeof n=="function"?n(he,U):he:he+(d?"."+U:"["+U+"]");E.set(e,D);var je=Vr();je.set(Pt,E),Wr(ne,t(W,ye,n,o,i,s,n==="comma"&&p&&G(S)?null:a,c,l,d,f,y,w,p,h,je))}}return ne},Wi=function(e){if(!e)return L;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||L.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Re.default;if(typeof e.format<"u"){if(!Mi.call(Re.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Re.formatters[n],i=L.filter;return(typeof e.filter=="function"||G(e.filter))&&(i=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},qi=function(t,e){var r=t,n=Wi(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):G(n.filter)&&(i=n.filter,o=i);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Gr?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Gr[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var d=Vr(),f=0;f<o.length;++f){var y=o[f];n.skipNulls&&r[y]===null||Wr(s,Gi(r[y],y,c,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var w=s.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),w.length>0?p+w:""},de=$r,Lt=Object.prototype.hasOwnProperty,ji=Array.isArray,C={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:de.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},zi=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},jr=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ji="utf8=%26%2310003%3B",Ki="utf8=%E2%9C%93",Qi=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,i),a=-1,c,l=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===Ki?l="utf-8":s[c]===Ji&&(l="iso-8859-1"),a=c,c=s.length);for(c=0;c<s.length;++c)if(c!==a){var d=s[c],f=d.indexOf("]="),y=f===-1?d.indexOf("="):f+1,w,p;y===-1?(w=r.decoder(d,C.decoder,l,"key"),p=r.strictNullHandling?null:""):(w=r.decoder(d.slice(0,y),C.decoder,l,"key"),p=de.maybeMap(jr(d.slice(y+1),r),function(h){return r.decoder(h,C.decoder,l,"value")})),p&&r.interpretNumericEntities&&l==="iso-8859-1"&&(p=zi(p)),d.indexOf("[]=")>-1&&(p=ji(p)?[p]:p),Lt.call(n,w)?n[w]=de.combine(n[w],p):n[w]=p}return n},Xi=function(t,e,r,n){for(var o=n?e:jr(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if(a==="[]"&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!r.parseArrays&&c===""?s={0:o}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[],s[l]=o):c!=="__proto__"&&(s[c]=o)}o=s}return o},Yi=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(i),l=c?i.slice(0,c.index):i,d=[];if(l){if(!n.plainObjects&&Lt.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var f=0;n.depth>0&&(c=a.exec(i))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&Lt.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}return c&&d.push("["+i.slice(c.index)+"]"),Xi(d,r,n,o)}},Zi=function(e){if(!e)return C;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?C.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:C.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:C.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:C.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:C.comma,decoder:typeof e.decoder=="function"?e.decoder:C.decoder,delimiter:typeof e.delimiter=="string"||de.isRegExp(e.delimiter)?e.delimiter:C.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:C.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:C.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:C.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:C.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},es=function(t,e){var r=Zi(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Qi(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s<i.length;++s){var a=i[s],c=Yi(a,n[a],r,typeof t=="string");o=de.merge(o,c,r)}return r.allowSparse===!0?o:de.compact(o)},ts=qi,rs=es,ns=Tt,os={formats:ns,parse:rs,stringify:ts};const is=lo(os);class zr{constructor(e){m(this,"axiosInstance");this.axiosInstance=O.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((r,n)=>{this.axiosInstance.request(e).then(o=>r(o)).catch(o=>n(o))})}Get(e,r,n){return new Promise((o,i)=>{r&&(n?n.params=r:n={params:r}),n&&(n.paramsSerializer={serialize:(s,a)=>is.stringify(s,{indices:!1})}),this.axiosInstance.get(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Post(e,r,n){return new Promise((o,i)=>{this.axiosInstance.post(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Put(e,r,n){return new Promise((o,i)=>{this.axiosInstance.put(e,r,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}Delete(e,r,n){return new Promise((o,i)=>{r&&(n?n.data=r:n={data:r}),this.axiosInstance.delete(e,n??{}).then(({data:s})=>o(s)).catch(s=>i(s))})}}class ss{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}onDataChannelMessage(e){console.debug("onDataChannelMessage:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}var g=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t[t.AUDIO_PUSH=4]="AUDIO_PUSH",t[t.VIDEO_PUSH=5]="VIDEO_PUSH",t[t.AUDIO_HALF=6]="AUDIO_HALF",t[t.VIDEO_HALF=7]="VIDEO_HALF",t))(g||{}),K=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(K||{});class Ft{constructor(e){m(this,"peerConnection");m(this,"sessionListener",new ss);m(this,"isCallOut",!1);m(this,"sessionType",g.UNKNOWN);m(this,"localStream");m(this,"remoteStream");m(this,"dataChannel");m(this,"hasSetRemoteSdp",!1);m(this,"facingMode",K.FRONT_FACING);m(this,"facingChanging",!1);m(this,"muted",!1);m(this,"openCamera",!1);m(this,"desktopSharing",!1);this.sessionType=e}setListener(e){this.sessionListener=e}start(e,r){if(!e&&!r){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=K.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(n=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})):(console.debug("webrtc call in: ",r),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:r})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(n=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(n).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(o=>{this.error(o)})}).catch(n=>{this.error(n)})}).catch(n=>{this.error(n)}))},this.peerConnection.onicegatheringstatechange=()=>{var n;console.debug("webrtc onicegatheringstatechange",(n=this.peerConnection)==null?void 0:n.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=n=>{console.debug("webrtc ontrack");for(let o=0;o<n.streams.length;o++)this.remoteStream?n.streams[o].getTracks().forEach(i=>{var s;(s=this.remoteStream)==null||s.addTrack(i)}):this.remoteStream=new MediaStream(n.streams[o]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=n=>{var o,i,s,a,c;console.debug("oniceconnectionstatechange",(o=this.peerConnection)==null?void 0:o.iceConnectionState),(((i=this.peerConnection)==null?void 0:i.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((c=this.peerConnection)==null?void 0:c.iceConnectionState)=="closed")&&(this.dataChannel=void 0,this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case g.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case g.AUDIO_PUSH:case g.VIDEO_PUSH:case g.AUDIO_HALF:case g.VIDEO_HALF:case g.VIDEO:case g.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(r=>{this.error(r),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(r=>{this.peerConnection.addIceCandidate(r).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(n=>console.log(n))})}sendStringData(e){try{this.dataChannel&&this.dataChannel.send(e)}catch(r){console.debug("sendStringData failed",r)}}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==g.VIDEO_PUSH||this.sessionType==g.AUDIO_PUSH||this.sessionType==g.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.localStream)for(let r of this.localStream.getTracks())this.localStream.removeTrack(r),r.stop();this.desktopSharing&&(this.desktopSharing=!1,this.sessionListener.onStopDesktopShare()),this.peerConnection=void 0,this.dataChannel=void 0,this.localStream=void 0,this.remoteStream=void 0,this.isCallOut=!1,this.sessionType=g.UNKNOWN,this.hasSetRemoteSdp=!1,this.facingMode=K.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.openCamera=!1,this.desktopSharing=!1}changeFacing(){return new Promise((e,r)=>{if(this.sessionType!==g.VIDEO&&this.sessionType!==g.VIDEO_PUSH){r(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){r(new Error("not in calling or not video call"));return}if(this.facingChanging){r(new Error("camera switching in progress"));return}if(!/mobile/i.test(navigator.userAgent)){r(new Error("not mobile device"));return}this.facingChanging=!0,this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(n=>r(n))})}changeMuted(){return new Promise((e,r)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?r(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(n=>{n.enabled=!n.enabled,this.muted=!n.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,r)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?r(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(n=>{n.enabled=!n.enabled,this.openCamera=!n.enabled}),e(this.openCamera))})}startDesktopShare(){return new Promise((e,r)=>{if(this.desktopSharing){r(new Error("desktop sharing has opened"));return}if(this.sessionType!=g.VIDEO&&this.sessionType!=g.VIDEO_PUSH){r(new Error("desktop sharing not in video calling"));return}if(!this.localStream){r(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(n=>{let o=this.changeVideoTrack(n,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});o?(this.desktopSharing=!1,r(o)):e()}).catch(n=>{this.desktopSharing=!1,r(n)})):r(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,r){if(!this.localStream||!this.peerConnection){for(let n of e.getTracks())e.removeTrack(n),n.stop();return new Error("localStream undefined or peerConnection undefined")}for(let n of this.localStream.getVideoTracks())this.localStream.removeTrack(n),n.stop();for(let n of e.getTracks())e.removeTrack(n),n.kind=="video"?(this.localStream.addTrack(n),r&&(n.onended=o=>{r()})):n.stop();for(let n of this.peerConnection.getSenders())n.track&&n.track.kind==="video"&&n.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(o=>{console.error(o)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case g.VIDEO:case g.VIDEO_PUSH:case g.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280}};break}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(r=>{this.getMediaSuccess(r)}).catch(r=>{this.getMediaFailed(r)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===g.VIDEO||this.sessionType===g.VIDEO_PUSH||this.sessionType===g.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(r=>{switch(this.sessionType){case g.AUDIO_PUSH:case g.VIDEO_PUSH:this.peerConnection.addTransceiver(r,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(r,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===g.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===g.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=g.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=r=>{this.onDataChannelReceive(r.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==g.VIDEO_HALF||this.sessionType==g.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,r)=>{let n;if(this.facingMode===K.FRONT_FACING?n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:"environment"}}:n={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:"user"}},navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(n).then(o=>{this.changeCameraSuccess(o),e()}).catch(o=>{this.changeCameraFailed(o),r(o)});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),r(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}this.localStream.getVideoTracks().forEach(r=>{this.localStream.removeTrack(r),r.stop()}),e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(n=>{console.log(n)})}),this.facingMode===K.FRONT_FACING?this.facingMode=K.BACK_FACING:this.facingMode=K.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class as{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class Jr{constructor(e,r){m(this,"url");m(this,"offerSdp");this.url=e,this.offerSdp=r}}const cs="/media-server/video-play/webrtc";class ls{constructor(e,r){m(this,"rtspUrl");m(this,"webrtcSession",new Ft(g.RTSP_PULL));m(this,"sessionListener",new as);m(this,"httpClient");this.rtspUrl=e,this.httpClient=r,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer:",e.sdp),this.httpClient.Post(cs,new Jr(this.rtspUrl,e.sdp??"")).then(r=>{var n,o,i,s;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("rtsp answer",(n=r.data)==null?void 0:n.sdp),console.debug("rtsp answer",(o=r.data)==null?void 0:o.candidateList),this.webrtcSession.setRemoteSdp(((i=r.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=r.data)==null?void 0:s.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var A=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(A||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),$=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))($||{}),re=(t=>(t.IN="in",t.OUT="out",t))(re||{}),_=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(_||{});function Kr(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function us(){return"browser-"+fs()+ds(6)}function fs(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function ds(t){let e="",r=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let n=0;n<t;n++)e+=r[Math.floor(Math.random()*(r.length-1))];return e}class ps{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"callMode");this.tel=e,this.callMode=n,this.mediaType=r}}class Qr{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class Xr{constructor(e,r,n){m(this,"tel","");m(this,"status",A.OFFLINE);m(this,"mediaType",F.AUDIO);m(this,"callMode",$.FULL);m(this,"callDirect",re.OUT);m(this,"called","");m(this,"callId");m(this,"remoteSdp");m(this,"candidate");m(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));m(this,"ringtone",new Audio("sound/ringtone.wav"));m(this,"dtmfAudio",new Audio("sound/dtmf.wav"));m(this,"ws");m(this,"wsConnected",!1);m(this,"closeBySelf",!1);m(this,"webrtcSession");m(this,"sessionListener",new Qr);m(this,"wsUrl");m(this,"accountId");this.tel=r??"",this.wsUrl=e,this.accountId=n,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var r;if(this.status!=A.RING){console.debug("session is not ring state");return}if(this.callDirect!=re.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==$.HALF?e=F.VIDEO==this.mediaType?g.VIDEO_HALF:g.AUDIO_HALF:e=F.VIDEO==this.mediaType?g.VIDEO:g.AUDIO,this.webrtcCreate(e),(r=this.webrtcSession)==null||r.start(!1,this.remoteSdp)}hangup(){this.status<=A.IDLE||(this.status==A.TALK?this.sendHangup(this.callId??""):this.callDirect==re.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==A.TALK?!1:(this.sendDtmf(e),!0)}changeCamera(){return new Promise((e,r)=>{var n;this.webrtcSession||r(new Error("webrtc session not start")),(n=this.webrtcSession)==null||n.changeFacing().then(o=>e(o)).catch(o=>r(o))})}changeMuted(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeMuted().then(n=>e(n)).catch(n=>r(n))})}changeCameraOpened(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.changeCameraOpened().then(n=>e(n)).catch(n=>r(n))})}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.status!=A.TALK&&r(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.status==A.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,r=F.AUDIO,n=$.FULL){var o;try{if(!Kr()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==A.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}this.status>A.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=r,this.callMode=n,this.called=e,this.callDirect=re.OUT,this.callId=us();let i;this.callMode==$.HALF?i=F.VIDEO==r?g.VIDEO_HALF:g.AUDIO_HALF:i=F.VIDEO==r?g.VIDEO:g.AUDIO,this.webrtcCreate(i),(o=this.webrtcSession)==null||o.start(!0),this.status=A.TRY}catch(i){this.status=A.IDLE,this.sessionListener.onError(new Error(""+i))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=A.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=r=>{console.error("ws on close: ",r),this.wsConnected=!1,this.close(),this.status=A.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(r.reason)),this.ws=void 0},this.ws.onmessage=r=>{try{let n=JSON.parse(r.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",n),n.type){case _.Invite:this.inviteHandler(n);break;case _.ANSWER:this.answerHandler(n);break;case _.RING:this.ringHandler(n);break;case _.HANGUP:this.hangupHandler(n);break;case _.LOGIN:this.loginHandler(n);break}}catch(n){console.error("receive msg from server, but process error: ",n,r)}},this.ws.onerror=r=>{console.error("ws on error: ",r)}}sendTo(e){var r;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(r=this.ws)==null||r.send(JSON.stringify(e))):console.error("ws not connected.")}catch(n){console.debug("FullSession sendTo error: ",n)}}sendLogin(){this.sendTo({type:_.LOGIN,username:this.tel,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:_.LOGOUT,username:this.tel}),this.status=A.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:_.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=A.TRY}sendRing(){this.sendTo({type:_.RING,callId:this.callId,code:180}),this.status=A.RING}sendAnswer(e){this.sendTo({type:_.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=A.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:_.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(r=>console.debug(r))}sendHangup(e,r=800){this.sendTo({type:_.HANGUP,callId:e,code:r}),e==this.callId&&(this.status=A.IDLE,this.callId=void 0)}loginHandler(e){var r;if(e.code!=200){(r=this.ws)==null||r.close(),this.wsConnected=!1,this.ws=void 0,this.status=A.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=A.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Kr()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>A.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??$.FULL,this.called=e.from??"",this.callDirect=re.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new ps(this.called,this.mediaType,this.callMode))}ringHandler(e){var r,n;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=A.RING)}answerHandler(e){var r,n;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=A.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Ft(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==re.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var r;e.type=="answer"?(this.sendAnswer(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class hs{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const ys="/media-server/broadcast/webrtc";class ms{constructor(e,r,n){m(this,"tel");m(this,"mediaType");m(this,"webrtcSession");m(this,"sessionListener",new hs);m(this,"httpClient");this.tel=e,this.httpClient=r,this.mediaType=n===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Ft(n==F.VIDEO?g.VIDEO_PUSH:g.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,r)=>{this.webrtcSession||r(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(n=>r(n))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(ys,new Jr(this.tel,e.sdp??"")).then(r=>{var n,o,i;if(r.code!=200){this.stop(),this.sessionListener.onError(new Error(r.message));return}console.debug("answer",(n=r.data)==null?void 0:n.sdp),this.webrtcSession.setRemoteSdp(((o=r.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((i=r.data)==null?void 0:i.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Nt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Nt||{});class gs extends Qr{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class Ss extends Xr{constructor(r,n,o){super(r,n,o);m(this,"sessionListener",new gs)}setCallSessionListener(r){this.sessionListener=r}audioHalfCall(r){this.makeCall(r,F.AUDIO,$.HALF)}videoHalfCall(r){this.makeCall(r,F.VIDEO,$.HALF)}tbcpRequest(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_REQUEST})))}tbcpRelease(){var r;this.callMode==$.HALF&&this.status==A.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:Nt.TB_RELEASE})))}onDataChannelMessage(r){try{this.sessionListener.onTbcpMessage(JSON.parse(r))}catch(n){console.debug("onDataChannelMessage err: ",n,r)}}}let _t=new zr("/"),Yr="/media-server/ws/voip",Zr="/media-server/ws/b-trun-c",xt=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+Yr),Ut=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+Zr);function ws(t){_t=new zr(t)}function bs(t){return new ls(t,_t)}function vs(t,e){return new ms(t,_t,e)}function Es(t){xt=new URL(t),xt.pathname=Yr,Ut=new URL(t),Ut.pathname=Zr}function As(t){return new Xr(xt.toString(),t)}function Os(t,e){return new Ss(Ut.toString(),t,e)}T.createAppCallSession=Os,T.createBroadcastSession=vs,T.createCallSession=As,T.createRtspPullSession=bs,T.videoModuleInit=ws,T.voipModuleInit=Es,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
1
+ (function(A,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(A=typeof globalThis<"u"?globalThis:A||self,w(A.mediaAV={}))})(this,function(A){"use strict";var cc=Object.defineProperty;var lc=(A,w,ne)=>w in A?cc(A,w,{enumerable:!0,configurable:!0,writable:!0,value:ne}):A[w]=ne;var S=(A,w,ne)=>lc(A,typeof w!="symbol"?w+"":w,ne);function w(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function ne(t,e){return function(){return t.apply(e,arguments)}}const{toString:mi}=Object.prototype,{getPrototypeOf:it}=Object,Me=(t=>e=>{const n=mi.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),G=t=>(t=t.toLowerCase(),e=>Me(e)===t),Fe=t=>e=>typeof e===t,{isArray:pe}=Array,Ee=Fe("undefined");function yi(t){return t!==null&&!Ee(t)&&t.constructor!==null&&!Ee(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const tr=G("ArrayBuffer");function gi(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&tr(t.buffer),e}const Si=Fe("string"),B=Fe("function"),rr=Fe("number"),Ne=t=>t!==null&&typeof t=="object",vi=t=>t===!0||t===!1,Ue=t=>{if(Me(t)!=="object")return!1;const e=it(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ci=G("Date"),bi=G("File"),Ri=G("Blob"),Ti=G("FileList"),Ei=t=>Ne(t)&&B(t.pipe),Pi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=Me(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Oi=G("URLSearchParams"),[Ai,Di,_i,Ii]=["ReadableStream","Request","Response","Headers"].map(G),Li=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pe(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),pe(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(r=0;r<s;r++)a=o[r],e.call(null,t[a],a,t)}}function nr(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 ie=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ir=t=>!Ee(t)&&t!==ie;function ot(){const{caseless:t}=ir(this)&&this||{},e={},n=(r,i)=>{const o=t&&nr(e,i)||i;Ue(e[o])&&Ue(r)?e[o]=ot(e[o],r):Ue(r)?e[o]=ot({},r):pe(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Pe(arguments[r],n);return e}const ki=(t,e,n,{allOwnKeys:r}={})=>(Pe(e,(i,o)=>{n&&B(i)?t[o]=ne(i,n):t[o]=i},{allOwnKeys:r}),t),xi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Mi=(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)},Fi=(t,e,n,r)=>{let i,o,s;const a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&it(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ni=(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},Ui=t=>{if(!t)return null;if(pe(t))return t;let e=t.length;if(!rr(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},wi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&it(Uint8Array)),Bi=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},ji=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},$i=G("HTMLFormElement"),Hi=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),or=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Gi=G("RegExp"),sr=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pe(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},Vi=t=>{sr(t,(e,n)=>{if(B(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(B(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+"'")})}})},zi=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return pe(t)?r(t):r(String(t).split(e)),n},qi=()=>{},Ji=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,st="abcdefghijklmnopqrstuvwxyz",ar="0123456789",cr={DIGIT:ar,ALPHA:st,ALPHA_DIGIT:st+st.toUpperCase()+ar},Wi=(t=16,e=cr.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Ki(t){return!!(t&&B(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Qi=t=>{const e=new Array(10),n=(r,i)=>{if(Ne(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const o=pe(r)?[]:{};return Pe(r,(s,a)=>{const l=n(s,i+1);!Ee(l)&&(o[a]=l)}),e[i]=void 0,o}}return r};return n(t,0)},Xi=G("AsyncFunction"),Yi=t=>t&&(Ne(t)||B(t))&&B(t.then)&&B(t.catch),lr=((t,e)=>t?setImmediate:e?((n,r)=>(ie.addEventListener("message",({source:i,data:o})=>{i===ie&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ie.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",B(ie.postMessage)),Zi=typeof queueMicrotask<"u"?queueMicrotask.bind(ie):typeof process<"u"&&process.nextTick||lr,p={isArray:pe,isArrayBuffer:tr,isBuffer:yi,isFormData:Pi,isArrayBufferView:gi,isString:Si,isNumber:rr,isBoolean:vi,isObject:Ne,isPlainObject:Ue,isReadableStream:Ai,isRequest:Di,isResponse:_i,isHeaders:Ii,isUndefined:Ee,isDate:Ci,isFile:bi,isBlob:Ri,isRegExp:Gi,isFunction:B,isStream:Ei,isURLSearchParams:Oi,isTypedArray:wi,isFileList:Ti,forEach:Pe,merge:ot,extend:ki,trim:Li,stripBOM:xi,inherits:Mi,toFlatObject:Fi,kindOf:Me,kindOfTest:G,endsWith:Ni,toArray:Ui,forEachEntry:Bi,matchAll:ji,isHTMLForm:$i,hasOwnProperty:or,hasOwnProp:or,reduceDescriptors:sr,freezeMethods:Vi,toObjectSet:zi,toCamelCase:Hi,noop:qi,toFiniteNumber:Ji,findKey:nr,global:ie,isContextDefined:ir,ALPHABET:cr,generateString:Wi,isSpecCompliantForm:Ki,toJSONObject:Qi,isAsyncFn:Xi,isThenable:Yi,setImmediate:lr,asap:Zi};function b(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)}p.inherits(b,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:p.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ur=b.prototype,fr={};["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=>{fr[t]={value:t}}),Object.defineProperties(b,fr),Object.defineProperty(ur,"isAxiosError",{value:!0}),b.from=(t,e,n,r,i,o)=>{const s=Object.create(ur);return p.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),b.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const eo=null;function at(t){return p.isPlainObject(t)||p.isArray(t)}function pr(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function dr(t,e,n){return t?t.concat(e).map(function(i,o){return i=pr(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function to(t){return p.isArray(t)&&!t.some(at)}const ro=p.toFlatObject(p,{},null,function(e){return/^is[A-Z]/.test(e)});function we(t,e,n){if(!p.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=p.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,g){return!p.isUndefined(g[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(e);if(!p.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(p.isDate(h))return h.toISOString();if(!l&&p.isBlob(h))throw new b("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(h)||p.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,g){let C=h;if(h&&!g&&typeof h=="object"){if(p.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(p.isArray(h)&&to(h)||(p.isFileList(h)||p.endsWith(y,"[]"))&&(C=p.toArray(h)))return y=pr(y),C.forEach(function(R,I){!(p.isUndefined(R)||R===null)&&e.append(s===!0?dr([y],I,o):s===null?y:y+"[]",c(R))}),!1}return at(h)?!0:(e.append(dr(g,y,o),c(h)),!1)}const f=[],d=Object.assign(ro,{defaultVisitor:u,convertValue:c,isVisitable:at});function m(h,y){if(!p.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),p.forEach(h,function(C,P){(!(p.isUndefined(C)||C===null)&&i.call(e,C,p.isString(P)?P.trim():P,y,d))===!0&&m(C,y?y.concat(P):[P])}),f.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return m(t),e}function hr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ct(t,e){this._pairs=[],t&&we(t,this,e)}const mr=ct.prototype;mr.append=function(e,n){this._pairs.push([e,n])},mr.toString=function(e){const n=e?function(r){return e.call(this,r,hr)}:hr;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function no(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function yr(t,e,n){if(!e)return t;const r=n&&n.encode||no,i=n&&n.serialize;let o;if(i?o=i(e,n):o=p.isURLSearchParams(e)?e.toString():new ct(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class gr{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){p.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},io={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ct,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},lt=typeof window<"u"&&typeof document<"u",oo=(t=>lt&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),so=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ao=lt&&window.location.href||"http://localhost",V={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:lt,hasStandardBrowserEnv:oo,hasStandardBrowserWebWorkerEnv:so,origin:ao},Symbol.toStringTag,{value:"Module"})),...io};function co(t,e){return we(t,new V.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return V.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function lo(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function uo(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function vr(t){function e(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=o>=n.length;return s=!s&&p.isArray(i)?i.length:s,l?(p.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!p.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&p.isArray(i[s])&&(i[s]=uo(i[s])),!a)}if(p.isFormData(t)&&p.isFunction(t.entries)){const n={};return p.forEachEntry(t,(r,i)=>{e(lo(r),i,n,0)}),n}return null}function fo(t,e,n){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Oe={transitional:Sr,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=p.isObject(e);if(o&&p.isHTMLForm(e)&&(e=new FormData(e)),p.isFormData(e))return i?JSON.stringify(vr(e)):e;if(p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)||p.isReadableStream(e))return e;if(p.isArrayBufferView(e))return e.buffer;if(p.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return co(e,this.formSerializer).toString();if((a=p.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return we(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),fo(e)):e}],transformResponse:[function(e){const n=this.transitional||Oe.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(p.isResponse(e)||p.isReadableStream(e))return e;if(e&&p.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:V.classes.FormData,Blob:V.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{Oe.headers[t]={}});const po=p.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"]),ho=t=>{const e={};let n,r,i;return t&&t.split(`
2
+ `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&po[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Cr=Symbol("internals");function Ae(t){return t&&String(t).trim().toLowerCase()}function Be(t){return t===!1||t==null?t:p.isArray(t)?t.map(Be):String(t)}function mo(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 yo=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ut(t,e,n,r,i){if(p.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!p.isString(e)){if(p.isString(r))return e.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(e)}}function go(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function So(t,e){const n=p.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}let U=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(a,l,c){const u=Ae(l);if(!u)throw new Error("header name must be a non-empty string");const f=p.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Be(a))}const s=(a,l)=>p.forEach(a,(c,u)=>o(c,u,l));if(p.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(p.isString(e)&&(e=e.trim())&&!yo(e))s(ho(e),n);else if(p.isHeaders(e))for(const[a,l]of e.entries())o(l,a,r);else e!=null&&o(n,e,r);return this}get(e,n){if(e=Ae(e),e){const r=p.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return mo(i);if(p.isFunction(n))return n.call(this,i,r);if(p.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ae(e),e){const r=p.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ut(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=Ae(s),s){const a=p.findKey(r,s);a&&(!n||ut(r,r[a],a,n))&&(delete r[a],i=!0)}}return p.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||ut(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return p.forEach(this,(i,o)=>{const s=p.findKey(r,o);if(s){n[s]=Be(i),delete n[o];return}const a=e?go(o):String(o).trim();a!==o&&delete n[o],n[a]=Be(i),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return p.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&p.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(`
3
+ `)}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[Cr]=this[Cr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ae(s);r[a]||(So(i,s),r[a]=!0)}return p.isArray(e)?e.forEach(o):o(e),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(U.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),p.freezeMethods(U);function ft(t,e){const n=this||Oe,r=e||n,i=U.from(r.headers);let o=r.data;return p.forEach(t,function(a){o=a.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function br(t){return!!(t&&t.__CANCEL__)}function de(t,e,n){b.call(this,t??"canceled",b.ERR_CANCELED,e,n),this.name="CanceledError"}p.inherits(de,b,{__CANCEL__:!0});function Rr(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vo(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Co(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];s||(s=c),n[i]=l,r[i]=c;let f=o,d=0;for(;f!==i;)d+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(d*1e3/m):void 0}}function bo(t,e){let n=0,r=1e3/e,i,o;const s=(c,u=Date.now())=>{n=u,i=null,o&&(clearTimeout(o),o=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const je=(t,e,n=3)=>{let r=0;const i=Co(50,250);return bo(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,c=i(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},Tr=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Er=t=>(...e)=>p.asap(()=>t(...e)),Ro=V.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{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(s){const a=p.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),To=V.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];p.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),p.isString(r)&&s.push("path="+r),p.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.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 Eo(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Po(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Pr(t,e){return t&&!Eo(e)?Po(t,e):e}const Or=t=>t instanceof U?{...t}:t;function oe(t,e){e=e||{};const n={};function r(c,u,f){return p.isPlainObject(c)&&p.isPlainObject(u)?p.merge.call({caseless:f},c,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function i(c,u,f){if(p.isUndefined(u)){if(!p.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function o(c,u){if(!p.isUndefined(u))return r(void 0,u)}function s(c,u){if(p.isUndefined(u)){if(!p.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>i(Or(c),Or(u),!0)};return p.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,d=f(t[u],e[u],u);p.isUndefined(d)&&f!==a||(n[u]=d)}),n}const Ar=t=>{const e=oe({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=e;e.headers=s=U.from(s),e.url=yr(Pr(e.baseURL,e.url),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(p.isFormData(n)){if(V.hasStandardBrowserEnv||V.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(V.hasStandardBrowserEnv&&(r&&p.isFunction(r)&&(r=r(e)),r||r!==!1&&Ro(e.url))){const c=i&&o&&To.read(o);c&&s.set(i,c)}return e},Oo=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=Ar(t);let o=i.data;const s=U.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,f,d,m,h;function y(){m&&m(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function C(){if(!g)return;const R=U.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),$={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:R,config:t,request:g};Rr(function(L){n(L),y()},function(L){r(L),y()},$),g=null}"onloadend"in g?g.onloadend=C:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(C)},g.onabort=function(){g&&(r(new b("Request aborted",b.ECONNABORTED,t,g)),g=null)},g.onerror=function(){r(new b("Network Error",b.ERR_NETWORK,t,g)),g=null},g.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const $=i.transitional||Sr;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new b(I,$.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,t,g)),g=null},o===void 0&&s.setContentType(null),"setRequestHeader"in g&&p.forEach(s.toJSON(),function(I,$){g.setRequestHeader($,I)}),p.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),a&&a!=="json"&&(g.responseType=i.responseType),c&&([d,h]=je(c,!0),g.addEventListener("progress",d)),l&&g.upload&&([f,m]=je(l),g.upload.addEventListener("progress",f),g.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(u=R=>{g&&(r(!R||R.type?new de(null,t,g):R),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const P=vo(i.url);if(P&&V.protocols.indexOf(P)===-1){r(new b("Unsupported protocol "+P+":",b.ERR_BAD_REQUEST,t));return}g.send(o||null)})},Ao=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,s();const c=l instanceof Error?l:this.reason;n.abort(c instanceof b?c:new de(c instanceof Error?c.message:c))}};let o=e&&setTimeout(()=>{i(new b(`timeout ${e} of ms exceeded`,b.ETIMEDOUT))},e);const s=()=>{t&&(o&&clearTimeout(o),o=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:a}=n;return a.unsubscribe=s,[a,()=>{o&&clearTimeout(o),o=null}]},Do=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},_o=async function*(t,e,n){for await(const r of t)yield*Do(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Dr=(t,e,n,r,i)=>{const o=_o(t,e,i);let s=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await o.next();if(u){l(),c.close();return}let d=f.byteLength;if(n){let m=s+=d;n(m)}c.enqueue(new Uint8Array(f))}catch(u){throw l(u),u}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},$e=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_r=$e&&typeof ReadableStream=="function",pt=$e&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Ir=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Io=_r&&Ir(()=>{let t=!1;const e=new Request(V.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Lr=64*1024,dt=_r&&Ir(()=>p.isReadableStream(new Response("").body)),He={stream:dt&&(t=>t.body)};$e&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!He[e]&&(He[e]=p.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new b(`Response type '${e}' is not supported`,b.ERR_NOT_SUPPORT,r)})})})(new Response);const Lo=async t=>{if(t==null)return 0;if(p.isBlob(t))return t.size;if(p.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(p.isArrayBufferView(t)||p.isArrayBuffer(t))return t.byteLength;if(p.isURLSearchParams(t)&&(t=t+""),p.isString(t))return(await pt(t)).byteLength},ko=async(t,e)=>{const n=p.toFiniteNumber(t.getContentLength());return n??Lo(e)},ht={http:eo,xhr:Oo,fetch:$e&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Ar(t);c=c?(c+"").toLowerCase():"text";let[m,h]=i||o||s?Ao([i,o],s):[],y,g;const C=()=>{!y&&setTimeout(()=>{m&&m.unsubscribe()}),y=!0};let P;try{if(l&&Io&&n!=="get"&&n!=="head"&&(P=await ko(u,r))!==0){let N=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(p.isFormData(r)&&(L=N.headers.get("content-type"))&&u.setContentType(L),N.body){const[H,z]=Tr(P,je(Er(l)));r=Dr(N.body,Lr,H,z,pt)}}p.isString(f)||(f=f?"include":"omit"),g=new Request(e,{...d,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:f});let R=await fetch(g);const I=dt&&(c==="stream"||c==="response");if(dt&&(a||I)){const N={};["status","statusText","headers"].forEach(X=>{N[X]=R[X]});const L=p.toFiniteNumber(R.headers.get("content-length")),[H,z]=a&&Tr(L,je(Er(a),!0))||[];R=new Response(Dr(R.body,Lr,H,()=>{z&&z(),I&&C()},pt),N)}c=c||"text";let $=await He[p.findKey(He,c)||"text"](R,t);return!I&&C(),h&&h(),await new Promise((N,L)=>{Rr(N,L,{data:$,headers:U.from(R.headers),status:R.status,statusText:R.statusText,config:t,request:g})})}catch(R){throw C(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,t,g),{cause:R.cause||R}):b.from(R,R&&R.code,t,g)}})};p.forEach(ht,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const kr=t=>`- ${t}`,xo=t=>p.isFunction(t)||t===null||t===!1,xr={getAdapter:t=>{t=p.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o<e;o++){n=t[o];let s;if(r=n,!xo(n)&&(r=ht[(s=String(n)).toLowerCase()],r===void 0))throw new b(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since :
4
+ `+o.map(kr).join(`
5
+ `):" "+kr(o[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ht};function mt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new de(null,t)}function Mr(t){return mt(t),t.headers=U.from(t.headers),t.data=ft.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),xr.getAdapter(t.adapter||Oe.adapter)(t).then(function(r){return mt(t),r.data=ft.call(t,t.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return br(r)||(mt(t),r&&r.response&&(r.response.data=ft.call(t,t.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Fr="1.7.4",yt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{yt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Nr={};yt.transitional=function(e,n,r){function i(o,s){return"[Axios v"+Fr+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(e===!1)throw new b(i(s," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!Nr[s]&&(Nr[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};function Mo(t,e,n){if(typeof t!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new b("option "+o+" must be "+l,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const gt={assertOptions:Mo,validators:yt},Z=gt.validators;let se=class{constructor(e){this.defaults=e,this.interceptors={request:new gr,response:new gr}}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 o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=oe(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&gt.assertOptions(r,{silentJSONParsing:Z.transitional(Z.boolean),forcedJSONParsing:Z.transitional(Z.boolean),clarifyTimeoutError:Z.transitional(Z.boolean)},!1),i!=null&&(p.isFunction(i)?n.paramsSerializer={serialize:i}:gt.assertOptions(i,{encode:Z.function,serialize:Z.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&p.merge(o.common,o[n.method]);o&&p.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=U.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(l=l&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,f=0,d;if(!l){const h=[Mr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),d=h.length,u=Promise.resolve(n);f<d;)u=u.then(h[f++],h[f++]);return u}d=a.length;let m=n;for(f=0;f<d;){const h=a[f++],y=a[f++];try{m=h(m)}catch(g){y.call(this,g);break}}try{u=Mr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,d=c.length;f<d;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=oe(this.defaults,e);const n=Pr(e.baseURL,e.url);return yr(n,e.params,e.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(e){se.prototype[e]=function(n,r){return this.request(oe(r||{},{method:e,url:n,data:(r||{}).data}))}}),p.forEach(["post","put","patch"],function(e){function n(r){return function(o,s,a){return this.request(oe(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}se.prototype[e]=n(),se.prototype[e+"Form"]=n(!0)});let Fo=class hi{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,a){r.reason||(r.reason=new de(o,s,a),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 hi(function(i){e=i}),cancel:e}}};function No(t){return function(n){return t.apply(null,n)}}function Uo(t){return p.isObject(t)&&t.isAxiosError===!0}const St={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(St).forEach(([t,e])=>{St[e]=t});function Ur(t){const e=new se(t),n=ne(se.prototype.request,e);return p.extend(n,se.prototype,e,{allOwnKeys:!0}),p.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ur(oe(t,i))},n}const O=Ur(Oe);O.Axios=se,O.CanceledError=de,O.CancelToken=Fo,O.isCancel=br,O.VERSION=Fr,O.toFormData=we,O.AxiosError=b,O.Cancel=O.CanceledError,O.all=function(e){return Promise.all(e)},O.spread=No,O.isAxiosError=Uo,O.mergeConfig=oe,O.AxiosHeaders=U,O.formToJSON=t=>vr(p.isHTMLForm(t)?new FormData(t):t),O.getAdapter=xr.getAdapter,O.HttpStatusCode=St,O.default=O;const{Axios:yc,AxiosError:gc,CanceledError:Sc,isCancel:vc,CancelToken:Cc,VERSION:bc,all:Rc,Cancel:Tc,isAxiosError:Ec,spread:Pc,toFormData:Oc,AxiosHeaders:Ac,HttpStatusCode:Dc,formToJSON:_c,getAdapter:Ic,mergeConfig:Lc}=O;function wr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Bo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},Br=typeof Symbol<"u"&&Symbol,jo=Bo,$o=function(){return typeof Br!="function"||typeof Symbol!="function"||typeof Br("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:jo()},jr={foo:{}},Ho=Object,Go=function(){return{__proto__:jr}.foo===jr.foo&&!({__proto__:null}instanceof Ho)},Vo="Function.prototype.bind called on incompatible ",vt=Array.prototype.slice,zo=Object.prototype.toString,qo="[object Function]",Jo=function(e){var n=this;if(typeof n!="function"||zo.call(n)!==qo)throw new TypeError(Vo+n);for(var r=vt.call(arguments,1),i,o=function(){if(this instanceof i){var u=n.apply(this,r.concat(vt.call(arguments)));return Object(u)===u?u:this}else return n.apply(e,r.concat(vt.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i},Wo=Jo,Ct=Function.prototype.bind||Wo,Ko=Ct,Qo=Ko.call(Function.call,Object.prototype.hasOwnProperty),T,he=SyntaxError,$r=Function,me=TypeError,bt=function(t){try{return $r('"use strict"; return ('+t+").constructor;")()}catch{}},ae=Object.getOwnPropertyDescriptor;if(ae)try{ae({},"")}catch{ae=null}var Rt=function(){throw new me},Xo=ae?function(){try{return arguments.callee,Rt}catch{try{return ae(arguments,"callee").get}catch{return Rt}}}():Rt,ye=$o(),Yo=Go(),D=Object.getPrototypeOf||(Yo?function(t){return t.__proto__}:null),ge={},Zo=typeof Uint8Array>"u"||!D?T:D(Uint8Array),ce={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":ye&&D?D([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":ge,"%AsyncGenerator%":ge,"%AsyncGeneratorFunction%":ge,"%AsyncIteratorPrototype%":ge,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?T:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?T:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":$r,"%GeneratorFunction%":ge,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ye&&D?D(D([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ye||!D?T:D(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ye||!D?T:D(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ye&&D?D(""[Symbol.iterator]()):T,"%Symbol%":ye?Symbol:T,"%SyntaxError%":he,"%ThrowTypeError%":Xo,"%TypedArray%":Zo,"%TypeError%":me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet};if(D)try{null.error}catch(t){var es=D(D(t));ce["%Error.prototype%"]=es}var ts=function t(e){var n;if(e==="%AsyncFunction%")n=bt("async function () {}");else if(e==="%GeneratorFunction%")n=bt("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=bt("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&D&&(n=D(i.prototype))}return ce[e]=n,n},Hr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},De=Ct,Ge=Qo,rs=De.call(Function.call,Array.prototype.concat),ns=De.call(Function.apply,Array.prototype.splice),Gr=De.call(Function.call,String.prototype.replace),Ve=De.call(Function.call,String.prototype.slice),is=De.call(Function.call,RegExp.prototype.exec),os=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ss=/\\(\\)?/g,as=function(e){var n=Ve(e,0,1),r=Ve(e,-1);if(n==="%"&&r!=="%")throw new he("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new he("invalid intrinsic syntax, expected opening `%`");var i=[];return Gr(e,os,function(o,s,a,l){i[i.length]=a?Gr(l,ss,"$1"):s||o}),i},cs=function(e,n){var r=e,i;if(Ge(Hr,r)&&(i=Hr[r],r="%"+i[0]+"%"),Ge(ce,r)){var o=ce[r];if(o===ge&&(o=ts(r)),typeof o>"u"&&!n)throw new me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new he("intrinsic "+e+" does not exist!")},Tt=function(e,n){if(typeof e!="string"||e.length===0)throw new me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new me('"allowMissing" argument must be a boolean');if(is(/^%?[^%]*%?$/,e)===null)throw new he("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=as(e),i=r.length>0?r[0]:"",o=cs("%"+i+"%",n),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],ns(r,rs([0,1],c)));for(var u=1,f=!0;u<r.length;u+=1){var d=r[u],m=Ve(d,0,1),h=Ve(d,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new he("property names with quotes must have matching quotes");if((d==="constructor"||!f)&&(l=!0),i+="."+d,s="%"+i+"%",Ge(ce,s))a=ce[s];else if(a!=null){if(!(d in a)){if(!n)throw new me("base intrinsic for "+e+" exists, but the property is not available.");return}if(ae&&u+1>=r.length){var y=ae(a,d);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[d]}else f=Ge(a,d),a=a[d];f&&!l&&(ce[s]=a)}}return a},Vr={exports:{}};(function(t){var e=Ct,n=Tt,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||e.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var d=o(e,i,arguments);if(s&&a){var m=s(d,"length");m.configurable&&a(d,"length",{value:1+l(0,f.length-(arguments.length-1))})}return d};var c=function(){return o(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(Vr);var ls=Vr.exports,zr=Tt,qr=ls,us=qr(zr("String.prototype.indexOf")),fs=function(e,n){var r=zr(e,!!n);return typeof r=="function"&&us(e,".prototype.")>-1?qr(r):r};const ps=wo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Et=typeof Map=="function"&&Map.prototype,Pt=Object.getOwnPropertyDescriptor&&Et?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ze=Et&&Pt&&typeof Pt.get=="function"?Pt.get:null,Jr=Et&&Map.prototype.forEach,Ot=typeof Set=="function"&&Set.prototype,At=Object.getOwnPropertyDescriptor&&Ot?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,qe=Ot&&At&&typeof At.get=="function"?At.get:null,Wr=Ot&&Set.prototype.forEach,ds=typeof WeakMap=="function"&&WeakMap.prototype,_e=ds?WeakMap.prototype.has:null,hs=typeof WeakSet=="function"&&WeakSet.prototype,Ie=hs?WeakSet.prototype.has:null,ms=typeof WeakRef=="function"&&WeakRef.prototype,Kr=ms?WeakRef.prototype.deref:null,ys=Boolean.prototype.valueOf,gs=Object.prototype.toString,Ss=Function.prototype.toString,vs=String.prototype.match,Dt=String.prototype.slice,ee=String.prototype.replace,Cs=String.prototype.toUpperCase,Qr=String.prototype.toLowerCase,Xr=RegExp.prototype.test,Yr=Array.prototype.concat,J=Array.prototype.join,bs=Array.prototype.slice,Zr=Math.floor,_t=typeof BigInt=="function"?BigInt.prototype.valueOf:null,It=Object.getOwnPropertySymbols,Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Se=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Se||!0)?Symbol.toStringTag:null,en=Object.prototype.propertyIsEnumerable,tn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function rn(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Xr.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Zr(-t):Zr(t);if(r!==t){var i=String(r),o=Dt.call(e,i.length+1);return ee.call(i,n,"$&_")+"."+ee.call(ee.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ee.call(e,n,"$&_")}var kt=ps,nn=kt.custom,on=cn(nn)?nn:null,Rs=function t(e,n,r,i){var o=n||{};if(te(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(te(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=te(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(te(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(te(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return un(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?rn(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?rn(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof e=="object")return xt(e)?"[Array]":"[Object]";var f=js(o,r);if(typeof i>"u")i=[];else if(ln(i,e)>=0)return"[Circular]";function d(Y,Re,nt){if(Re&&(i=bs.call(i),i.push(Re)),nt){var Te={depth:o.depth};return te(o,"quoteStyle")&&(Te.quoteStyle=o.quoteStyle),t(Y,Te,r+1,i)}return t(Y,o,r+1,i)}if(typeof e=="function"&&!an(e)){var m=Ls(e),h=Je(e,d);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+J.call(h,", ")+" }":"")}if(cn(e)){var y=Se?ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Lt.call(e);return typeof e=="object"&&!Se?Le(y):y}if(Us(e)){for(var g="<"+Qr.call(String(e.nodeName)),C=e.attributes||[],P=0;P<C.length;P++)g+=" "+C[P].name+"="+sn(Ts(C[P].value),"double",o);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+Qr.call(String(e.nodeName))+">",g}if(xt(e)){if(e.length===0)return"[]";var R=Je(e,d);return f&&!Bs(R)?"["+Ft(R,f)+"]":"[ "+J.call(R,", ")+" ]"}if(Ps(e)){var I=Je(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!en.call(e,"cause")?"{ ["+String(e)+"] "+J.call(Yr.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+J.call(I,", ")+" }"}if(typeof e=="object"&&s){if(on&&typeof e[on]=="function"&&kt)return kt(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ks(e)){var $=[];return Jr&&Jr.call(e,function(Y,Re){$.push(d(Re,e,!0)+" => "+d(Y,e))}),fn("Map",ze.call(e),$,f)}if(Fs(e)){var N=[];return Wr&&Wr.call(e,function(Y){N.push(d(Y,e))}),fn("Set",qe.call(e),N,f)}if(xs(e))return Mt("WeakMap");if(Ns(e))return Mt("WeakSet");if(Ms(e))return Mt("WeakRef");if(As(e))return Le(d(Number(e)));if(_s(e))return Le(d(_t.call(e)));if(Ds(e))return Le(ys.call(e));if(Os(e))return Le(d(String(e)));if(!Es(e)&&!an(e)){var L=Je(e,d),H=tn?tn(e)===Object.prototype:e instanceof Object||e.constructor===Object,z=e instanceof Object?"":"null prototype",X=!H&&k&&Object(e)===e&&k in e?Dt.call(re(e),8,-1):z?"Object":"",xe=H||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=xe+(X||z?"["+J.call(Yr.call([],X||[],z||[]),": ")+"] ":"");return L.length===0?q+"{}":f?q+"{"+Ft(L,f)+"}":q+"{ "+J.call(L,", ")+" }"}return String(e)};function sn(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function Ts(t){return ee.call(String(t),/"/g,"&quot;")}function xt(t){return re(t)==="[object Array]"&&(!k||!(typeof t=="object"&&k in t))}function Es(t){return re(t)==="[object Date]"&&(!k||!(typeof t=="object"&&k in t))}function an(t){return re(t)==="[object RegExp]"&&(!k||!(typeof t=="object"&&k in t))}function Ps(t){return re(t)==="[object Error]"&&(!k||!(typeof t=="object"&&k in t))}function Os(t){return re(t)==="[object String]"&&(!k||!(typeof t=="object"&&k in t))}function As(t){return re(t)==="[object Number]"&&(!k||!(typeof t=="object"&&k in t))}function Ds(t){return re(t)==="[object Boolean]"&&(!k||!(typeof t=="object"&&k in t))}function cn(t){if(Se)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Lt)return!1;try{return Lt.call(t),!0}catch{}return!1}function _s(t){if(!t||typeof t!="object"||!_t)return!1;try{return _t.call(t),!0}catch{}return!1}var Is=Object.prototype.hasOwnProperty||function(t){return t in this};function te(t,e){return Is.call(t,e)}function re(t){return gs.call(t)}function Ls(t){if(t.name)return t.name;var e=vs.call(Ss.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function ln(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function ks(t){if(!ze||!t||typeof t!="object")return!1;try{ze.call(t);try{qe.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function xs(t){if(!_e||!t||typeof t!="object")return!1;try{_e.call(t,_e);try{Ie.call(t,Ie)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Ms(t){if(!Kr||!t||typeof t!="object")return!1;try{return Kr.call(t),!0}catch{}return!1}function Fs(t){if(!qe||!t||typeof t!="object")return!1;try{qe.call(t);try{ze.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Ns(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t,Ie);try{_e.call(t,_e)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Us(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function un(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return un(Dt.call(t,0,e.maxStringLength),e)+r}var i=ee.call(ee.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ws);return sn(i,"single",e)}function ws(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Cs.call(e.toString(16))}function Le(t){return"Object("+t+")"}function Mt(t){return t+" { ? }"}function fn(t,e,n,r){var i=r?Ft(n,r):J.call(n,", ");return t+" ("+e+") {"+i+"}"}function Bs(t){for(var e=0;e<t.length;e++)if(ln(t[e],`
7
+ `)>=0)return!1;return!0}function js(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=J.call(Array(t.indent+1)," ");else return null;return{base:n,prev:J.call(Array(e+1),n)}}function Ft(t,e){if(t.length===0)return"";var n=`
8
+ `+e.prev+e.base;return n+J.call(t,","+n)+`
9
+ `+e.prev}function Je(t,e){var n=xt(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=te(t,i)?e(t[i],t):""}var o=typeof It=="function"?It(t):[],s;if(Se){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)te(t,l)&&(n&&String(Number(l))===l&&l<t.length||Se&&s["$"+l]instanceof Symbol||(Xr.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if(typeof It=="function")for(var c=0;c<o.length;c++)en.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var Nt=Tt,ve=fs,$s=Rs,Hs=Nt("%TypeError%"),We=Nt("%WeakMap%",!0),Ke=Nt("%Map%",!0),Gs=ve("WeakMap.prototype.get",!0),Vs=ve("WeakMap.prototype.set",!0),zs=ve("WeakMap.prototype.has",!0),qs=ve("Map.prototype.get",!0),Js=ve("Map.prototype.set",!0),Ws=ve("Map.prototype.has",!0),Ut=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},Ks=function(t,e){var n=Ut(t,e);return n&&n.value},Qs=function(t,e,n){var r=Ut(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},Xs=function(t,e){return!!Ut(t,e)},Ys=function(){var e,n,r,i={assert:function(o){if(!i.has(o))throw new Hs("Side channel does not contain "+$s(o))},get:function(o){if(We&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Gs(e,o)}else if(Ke){if(n)return qs(n,o)}else if(r)return Ks(r,o)},has:function(o){if(We&&o&&(typeof o=="object"||typeof o=="function")){if(e)return zs(e,o)}else if(Ke){if(n)return Ws(n,o)}else if(r)return Xs(r,o);return!1},set:function(o,s){We&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new We),Vs(e,o,s)):Ke?(n||(n=new Ke),Js(n,o,s)):(r||(r={key:{},next:null}),Qs(r,o,s))}};return i},Zs=String.prototype.replace,ea=/%20/g,wt={RFC1738:"RFC1738",RFC3986:"RFC3986"},Bt={default:wt.RFC3986,formatters:{RFC1738:function(t){return Zs.call(t,ea,"+")},RFC3986:function(t){return String(t)}},RFC1738:wt.RFC1738,RFC3986:wt.RFC3986},ta=Bt,jt=Object.prototype.hasOwnProperty,le=Array.isArray,W=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ra=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(le(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]<"u"&&i.push(r[o]);n.obj[n.prop]=i}}},pn=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},na=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(le(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!jt.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return le(e)&&!le(n)&&(i=pn(e,r)),le(e)&&le(n)?(n.forEach(function(o,s){if(jt.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,r):e.push(o)}else e[s]=o}),e):Object.keys(n).reduce(function(o,s){var a=n[s];return jt.call(o,s)?o[s]=t(o[s],a,r):o[s]=a,o},i)},ia=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},oa=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},sa=function(e,n,r,i,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;++l){var c=s.charCodeAt(l);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===ta.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+W[c];continue}if(c<2048){a=a+(W[192|c>>6]+W[128|c&63]);continue}if(c<55296||c>=57344){a=a+(W[224|c>>12]+W[128|c>>6&63]+W[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=W[240|c>>18]+W[128|c>>12&63]+W[128|c>>6&63]+W[128|c&63]}return a},aa=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:s,prop:c}),r.push(u))}return ra(n),e},ca=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},la=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ua=function(e,n){return[].concat(e,n)},fa=function(e,n){if(le(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},dn={arrayToObject:pn,assign:ia,combine:ua,compact:aa,decode:oa,encode:sa,isBuffer:la,isRegExp:ca,maybeMap:fa,merge:na},hn=Ys,Qe=dn,ke=Bt,pa=Object.prototype.hasOwnProperty,mn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},Q=Array.isArray,da=Array.prototype.push,yn=function(t,e){da.apply(t,Q(e)?e:[e])},ha=Date.prototype.toISOString,gn=ke.default,x={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Qe.encode,encodeValuesOnly:!1,format:gn,formatter:ke.formatters[gn],indices:!1,serializeDate:function(e){return ha.call(e)},skipNulls:!1,strictNullHandling:!1},ma=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},$t={},ya=function t(e,n,r,i,o,s,a,l,c,u,f,d,m,h,y,g){for(var C=e,P=g,R=0,I=!1;(P=P.get($t))!==void 0&&!I;){var $=P.get(e);if(R+=1,typeof $<"u"){if($===R)throw new RangeError("Cyclic object value");I=!0}typeof P.get($t)>"u"&&(R=0)}if(typeof l=="function"?C=l(n,C):C instanceof Date?C=f(C):r==="comma"&&Q(C)&&(C=Qe.maybeMap(C,function(Te){return Te instanceof Date?f(Te):Te})),C===null){if(o)return a&&!h?a(n,x.encoder,y,"key",d):n;C=""}if(ma(C)||Qe.isBuffer(C)){if(a){var N=h?n:a(n,x.encoder,y,"key",d);return[m(N)+"="+m(a(C,x.encoder,y,"value",d))]}return[m(n)+"="+m(String(C))]}var L=[];if(typeof C>"u")return L;var H;if(r==="comma"&&Q(C))h&&a&&(C=Qe.maybeMap(C,a)),H=[{value:C.length>0?C.join(",")||null:void 0}];else if(Q(l))H=l;else{var z=Object.keys(C);H=c?z.sort(c):z}for(var X=i&&Q(C)&&C.length===1?n+"[]":n,xe=0;xe<H.length;++xe){var q=H[xe],Y=typeof q=="object"&&typeof q.value<"u"?q.value:C[q];if(!(s&&Y===null)){var Re=Q(C)?typeof r=="function"?r(X,q):X:X+(u?"."+q:"["+q+"]");g.set(e,R);var nt=hn();nt.set($t,g),yn(L,t(Y,Re,r,i,o,s,r==="comma"&&h&&Q(C)?null:a,l,c,u,f,d,m,h,y,nt))}}return L},ga=function(e){if(!e)return x;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||x.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=ke.default;if(typeof e.format<"u"){if(!pa.call(ke.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=ke.formatters[r],o=x.filter;return(typeof e.filter=="function"||Q(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:x.addQueryPrefix,allowDots:typeof e.allowDots>"u"?x.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:x.charsetSentinel,delimiter:typeof e.delimiter>"u"?x.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:x.encode,encoder:typeof e.encoder=="function"?e.encoder:x.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:x.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:x.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:x.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:x.strictNullHandling}},Sa=function(t,e){var n=t,r=ga(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Q(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in mn?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=mn[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var u=hn(),f=0;f<i.length;++f){var d=i[f];r.skipNulls&&n[d]===null||yn(s,ya(n[d],d,l,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var m=s.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),m.length>0?h+m:""},Ce=dn,Ht=Object.prototype.hasOwnProperty,va=Array.isArray,_={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ce.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ca=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},Sn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ba="utf8=%26%2310003%3B",Ra="utf8=%E2%9C%93",Ta=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===Ra?c="utf-8":s[l]===ba&&(c="iso-8859-1"),a=l,l=s.length);for(l=0;l<s.length;++l)if(l!==a){var u=s[l],f=u.indexOf("]="),d=f===-1?u.indexOf("="):f+1,m,h;d===-1?(m=n.decoder(u,_.decoder,c,"key"),h=n.strictNullHandling?null:""):(m=n.decoder(u.slice(0,d),_.decoder,c,"key"),h=Ce.maybeMap(Sn(u.slice(d+1),n),function(y){return n.decoder(y,_.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=Ca(h)),u.indexOf("[]=")>-1&&(h=va(h)?[h]:h),Ht.call(r,m)?r[m]=Ce.combine(r[m],h):r[m]=h}return r},Ea=function(t,e,n,r){for(var i=r?e:Sn(e,n),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!n.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},Pa=function(e,n,r,i){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!r.plainObjects&&Ht.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var f=0;r.depth>0&&(l=a.exec(o))!==null&&f<r.depth;){if(f+=1,!r.plainObjects&&Ht.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),Ea(u,n,r,i)}},Oa=function(e){if(!e)return _;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?_.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?_.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:_.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:_.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:_.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:_.comma,decoder:typeof e.decoder=="function"?e.decoder:_.decoder,delimiter:typeof e.delimiter=="string"||Ce.isRegExp(e.delimiter)?e.delimiter:_.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:_.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:_.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:_.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:_.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_.strictNullHandling}},Aa=function(t,e){var n=Oa(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?Ta(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],l=Pa(a,r[a],n,typeof t=="string");i=Ce.merge(i,l,n)}return n.allowSparse===!0?i:Ce.compact(i)},Da=Sa,_a=Aa,Ia=Bt,La={formats:Ia,parse:_a,stringify:Da};const ka=wr(La);class vn{constructor(e){S(this,"axiosInstance");this.axiosInstance=O.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((n,r)=>{this.axiosInstance.request(e).then(i=>n(i)).catch(i=>r(i))})}Get(e,n,r){return new Promise((i,o)=>{n&&(r?r.params=n:r={params:n}),r&&(r.paramsSerializer={serialize:(s,a)=>ka.stringify(s,{indices:!1})}),this.axiosInstance.get(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Post(e,n,r){return new Promise((i,o)=>{this.axiosInstance.post(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Put(e,n,r){return new Promise((i,o)=>{this.axiosInstance.put(e,n,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Delete(e,n,r){return new Promise((i,o)=>{n&&(r?r.data=n:r={data:n}),this.axiosInstance.delete(e,r??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}}class xa{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}onDataChannelMessage(e){console.debug("onDataChannelMessage:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}var v=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO=1]="AUDIO",t[t.VIDEO=2]="VIDEO",t[t.RTSP_PULL=3]="RTSP_PULL",t[t.AUDIO_PUSH=4]="AUDIO_PUSH",t[t.VIDEO_PUSH=5]="VIDEO_PUSH",t[t.AUDIO_HALF=6]="AUDIO_HALF",t[t.VIDEO_HALF=7]="VIDEO_HALF",t))(v||{}),M=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(M||{});let Cn=!0,bn=!0;function Xe(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function ue(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const l=c=>{const u=n(c);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,l),i.apply(this,[s,l])};const o=r.removeEventListener;r.removeEventListener=function(s,a){if(s!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(a))return o.apply(this,arguments);const l=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[s,l])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function Ma(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Cn=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Fa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(bn=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Rn(){if(typeof window=="object"){if(Cn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Gt(t,e){bn&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Na(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=Xe(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=Xe(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=Xe(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Tn(t){return Object.prototype.toString.call(t)==="[object Object]"}function En(t){return Tn(t)?Object.keys(t).reduce(function(e,n){const r=Tn(t[n]),i=r?En(t[n]):t[n],o=r&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[n]:i})},{}):t}function Vt(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?Vt(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(i=>{Vt(t,t.get(i),n)})}))}function Pn(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const o=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&o.push(s)}),o.forEach(s=>{t.forEach(a=>{a.type===r&&a.trackId===s.id&&Vt(t,a,i)})}),i}const On=Rn;function An(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const l={};return Object.keys(a).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof a[c]=="object"?a[c]:{ideal:a[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const f=function(d,m){return d?d+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let d={};typeof u.ideal=="number"?(d[f("min",c)]=u.ideal,l.optional.push(d),d={},d[f("max",c)]=u.ideal,l.optional.push(d)):(d[f("",c)]=u.ideal,l.optional.push(d))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(d=>{u[d]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(d,c)]=u[d])})}),a.advanced&&(l.optional=(l.optional||[]).concat(a.advanced)),l},i=function(a,l){if(e.version>=61)return l(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const c=function(u,f,d){f in u&&!(d in u)&&(u[d]=u[f],delete u[f])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=r(a.audio)}if(a&&typeof a.video=="object"){let c=a.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete a.video.facingMode;let f;if(c.exact==="environment"||c.ideal==="environment"?f=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(f=["front"]),f)return n.mediaDevices.enumerateDevices().then(d=>{d=d.filter(h=>h.kind==="videoinput");let m=d.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&d.length&&f.includes("back")&&(m=d[d.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=r(a.video),On("chrome: "+JSON.stringify(a)),l(a)})}a.video=r(a.video)}return On("chrome: "+JSON.stringify(a)),l(a)},o=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(a,l,c){i(a,u=>{n.webkitGetUserMedia(u,l,f=>{c&&c(o(f))})})};if(n.getUserMedia=s.bind(n),n.mediaDevices.getUserMedia){const a=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(l){return i(l,c=>a(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(o(u))))}}}function Ua(t,e){if(!(t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices)&&t.navigator.mediaDevices){if(typeof e!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}t.navigator.mediaDevices.getDisplayMedia=function(r){return e(r).then(i=>{const o=r.video&&r.video.width,s=r.video&&r.video.height,a=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:a||3}},o&&(r.video.mandatory.maxWidth=o),s&&(r.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(r)})}}}function Dn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function _n(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.track.id):o={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let o;t.RTCPeerConnection.prototype.getReceivers?o=this.getReceivers().find(a=>a.track&&a.track.id===i.id):o={track:i};const s=new Event("track");s.track=i,s.receiver=o,s.transceiver={receiver:o},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else ue(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function In(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(a,l){let c=i.apply(this,arguments);return c||(c=e(this,a),this._senders.push(c)),c};const o=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(a){o.apply(this,arguments);const l=this._senders.indexOf(a);l!==-1&&this._senders.splice(l,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],n.apply(this,[o]),o.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(s=>{const a=this._senders.find(l=>l.track===s);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Ln(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,i,o]=arguments;if(arguments.length>0&&typeof r=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof r!="function"))return e.apply(this,[]);const s=function(l){const c={};return l.result().forEach(f=>{const d={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{d[m]=f.stat(m)}),c[d.id]=d}),c},a=function(l){return new Map(Object.keys(l).map(c=>[c,l[c]]))};if(arguments.length>=2){const l=function(c){i(a(s(c)))};return e.apply(this,[l,r])}return new Promise((l,c)=>{e.apply(this,[function(u){l(a(s(u)))},c])}).then(i,o)}}function kn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const n=t.RTCPeerConnection.prototype.getSenders;n&&(t.RTCPeerConnection.prototype.getSenders=function(){const o=n.apply(this,[]);return o.forEach(s=>s._pc=this),o});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const o=r.apply(this,arguments);return o._pc=this,o}),t.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(s=>Pn(s,o.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const n=t.RTCPeerConnection.prototype.getReceivers;n&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=n.apply(this,[]);return i.forEach(o=>o._pc=this),i}),ue(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>Pn(o,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const r=arguments[0];let i,o,s;return this.getSenders().forEach(a=>{a.track===r&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===r&&(o?s=!0:o=a),a.track===r)),s||i&&o?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():o?o.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function xn(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const l=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(l)===-1&&this._shimmedLocalStreams[a.id].push(l):this._shimmedLocalStreams[a.id]=[a,l],l};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(f=>f.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();n.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(l)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const l=this._shimmedLocalStreams[a].indexOf(s);l!==-1&&this._shimmedLocalStreams[a].splice(l,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),i.apply(this,arguments)}}function Mn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return xn(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=n.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(f=>{if(this.getSenders().find(m=>m.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const f=new t.MediaStream(u.getTracks());this._streams[u.id]=f,this._reverseStreams[f.id]=u,u=f}r.apply(this,[u])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},t.RTCPeerConnection.prototype.addTrack=function(u,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(y=>y===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(y=>y.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const h=this._streams[f.id];if(h)h.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const y=new t.MediaStream([u]);this._streams[f.id]=y,this._reverseStreams[y.id]=f,this.addStream(y)}return this.getSenders().find(y=>y.track===u)};function o(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const m=c._reverseStreams[d],h=c._streams[m.id];f=f.replace(new RegExp(h.id,"g"),m.id)}),new RTCSessionDescription({type:u.type,sdp:f})}function s(c,u){let f=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const m=c._reverseStreams[d],h=c._streams[m.id];f=f.replace(new RegExp(m.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:f})}["createOffer","createAnswer"].forEach(function(c){const u=t.RTCPeerConnection.prototype[c],f={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);d[0].apply(null,[y])},h=>{d[1]&&d[1].apply(null,h)},arguments[2]]):u.apply(this,arguments).then(h=>o(this,h))}};t.RTCPeerConnection.prototype[c]=f[c]});const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=s(this,arguments[0]),a.apply(this,arguments))};const l=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=l.get.apply(this);return c.type===""?c:o(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(d=this._streams[m])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function zt(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=t.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=i[n]})}function Fn(t,e){ue(t,"negotiationneeded",n=>{const r=n.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return n})}const Nn=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Fn,shimAddTrackRemoveTrack:Mn,shimAddTrackRemoveTrackWithNative:xn,shimGetDisplayMedia:Ua,shimGetSendersWithDtmf:In,shimGetStats:Ln,shimGetUserMedia:An,shimMediaStream:Dn,shimOnTrack:_n,shimPeerConnection:zt,shimSenderReceiverGetStats:kn},Symbol.toStringTag,{value:"Module"}));function Un(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(i,o,s){Gt("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(i).then(o,s)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const i=function(s,a,l){a in s&&!(l in s)&&(s[l]=s[a],delete s[a])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),o(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[a])}}}}function wa(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}function wn(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function qt(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[o,s,a]=arguments;return r.apply(this,[o||null]).then(l=>{if(e.version<53&&!s)try{l.forEach(c=>{c.type=n[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,f)=>{l.set(f,Object.assign({},u,{type:n[u.type]||u.type}))})}return l}).then(s,a)}}function Bn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(o=>o._pc=this),i});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=n.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function jn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),ue(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function $n(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){Gt("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&n.getTracks().includes(r.track)&&this.removeTrack(r)})})}function Hn(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function Gn(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const o=e.apply(this,arguments);if(i){const{sender:s}=o,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return o})}function Vn(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function zn(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function qn(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}const Jn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:Gn,shimCreateAnswer:qn,shimCreateOffer:zn,shimGetDisplayMedia:wa,shimGetParameters:Vn,shimGetUserMedia:Un,shimOnTrack:wn,shimPeerConnection:qt,shimRTCDataChannel:Hn,shimReceiverGetStats:jn,shimRemoveStream:$n,shimSenderGetStats:Bn},Symbol.toStringTag,{value:"Module"}));function Wn(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},t.RTCPeerConnection.prototype.addTrack=function(r,...i){return i&&i.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(n);if(r===-1)return;this._localStreams.splice(r,1);const i=n.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function Kn(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(o)>=0)return;r._remoteStreams.push(o);const s=new Event("addstream");s.stream=o,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Qn(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,o=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],d=n.apply(this,[f]);return u?(d.then(c,u),Promise.resolve()):d},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],d=r.apply(this,[f]);return u?(d.then(c,u),Promise.resolve()):d};let a=function(l,c,u){const f=i.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f};e.setLocalDescription=a,a=function(l,c,u){const f=o.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.setRemoteDescription=a,a=function(l,c,u){const f=s.apply(this,[l]);return u?(f.then(c,u),Promise.resolve()):f},e.addIceCandidate=a}function Xn(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=i=>r(Yn(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,o){e.mediaDevices.getUserMedia(r).then(i,o)}).bind(e))}function Yn(t){return t&&t.video!==void 0?Object.assign({},t,{video:En(t.video)}):t}function Zn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const o=[];for(let s=0;s<r.iceServers.length;s++){let a=r.iceServers[s];a.urls===void 0&&a.url?(Gt("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,o.push(a)):o.push(r.iceServers[s])}r.iceServers=o}return new e(r,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function ei(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ti(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const o=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function ri(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const ni=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:ri,shimCallbacksAPI:Qn,shimConstraints:Yn,shimCreateOfferLegacy:ti,shimGetUserMedia:Xn,shimLocalStreamsAPI:Wn,shimRTCIceServerUrls:Zn,shimRemoteStreamsAPI:Kn,shimTrackEventTransceiver:ei},Symbol.toStringTag,{value:"Module"}));var ii={exports:{}};(function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(n){return n.trim().split(`
10
+ `).map(r=>r.trim())},e.splitSections=function(n){return n.split(`
11
+ m=`).map((i,o)=>(o>0?"m="+i:i).trim()+`\r
12
+ `)},e.getDescription=function(n){const r=e.splitSections(n);return r&&r[0]},e.getMediaSections=function(n){const r=e.splitSections(n);return r.shift(),r},e.matchPrefix=function(n,r){return e.splitLines(n).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(n){let r;n.indexOf("a=candidate:")===0?r=n.substring(12).split(" "):r=n.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let o=8;o<r.length;o+=2)switch(r[o]){case"raddr":i.relatedAddress=r[o+1];break;case"rport":i.relatedPort=parseInt(r[o+1],10);break;case"tcptype":i.tcpType=r[o+1];break;case"ufrag":i.ufrag=r[o+1],i.usernameFragment=r[o+1];break;default:i[r[o]]===void 0&&(i[r[o]]=r[o+1]);break}return i},e.writeCandidate=function(n){const r=[];r.push(n.foundation);const i=n.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(n.protocol.toUpperCase()),r.push(n.priority),r.push(n.address||n.ip),r.push(n.port);const o=n.type;return r.push("typ"),r.push(o),o!=="host"&&n.relatedAddress&&n.relatedPort&&(r.push("raddr"),r.push(n.relatedAddress),r.push("rport"),r.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(r.push("ufrag"),r.push(n.usernameFragment||n.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(n){return n.substring(14).split(" ")},e.parseRtpMap=function(n){let r=n.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(n){let r=n.payloadType;n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType);const i=n.channels||n.numChannels||1;return"a=rtpmap:"+r+" "+n.name+"/"+n.clockRate+(i!==1?"/"+i:"")+`\r
13
+ `},e.parseExtmap=function(n){const r=n.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},e.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r
14
+ `},e.parseFmtp=function(n){const r={};let i;const o=n.substring(n.indexOf(" ")+1).split(";");for(let s=0;s<o.length;s++)i=o[s].trim().split("="),r[i[0].trim()]=i[1];return r},e.writeFmtp=function(n){let r="",i=n.payloadType;if(n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const o=[];Object.keys(n.parameters).forEach(s=>{n.parameters[s]!==void 0?o.push(s+"="+n.parameters[s]):o.push(s)}),r+="a=fmtp:"+i+" "+o.join(";")+`\r
15
+ `}return r},e.parseRtcpFb=function(n){const r=n.substring(n.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},e.writeRtcpFb=function(n){let r="",i=n.payloadType;return n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(o=>{r+="a=rtcp-fb:"+i+" "+o.type+(o.parameter&&o.parameter.length?" "+o.parameter:"")+`\r
16
+ `}),r},e.parseSsrcMedia=function(n){const r=n.indexOf(" "),i={ssrc:parseInt(n.substring(7,r),10)},o=n.indexOf(":",r);return o>-1?(i.attribute=n.substring(r+1,o),i.value=n.substring(o+1)):i.attribute=n.substring(r+1),i},e.parseSsrcGroup=function(n){const r=n.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(i=>parseInt(i,10))}},e.getMid=function(n){const r=e.matchPrefix(n,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(n){const r=n.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},e.getDtlsParameters=function(n,r){return{role:"auto",fingerprints:e.matchPrefix(n+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(n,r){let i="a=setup:"+r+`\r
17
+ `;return n.fingerprints.forEach(o=>{i+="a=fingerprint:"+o.algorithm+" "+o.value+`\r
18
+ `}),i},e.parseCryptoLine=function(n){const r=n.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},e.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?e.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r
19
+ `},e.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const r=n.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},e.getCryptoParameters=function(n,r){return e.matchPrefix(n+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(n,r){const i=e.matchPrefix(n+r,"a=ice-ufrag:")[0],o=e.matchPrefix(n+r,"a=ice-pwd:")[0];return i&&o?{usernameFragment:i.substring(12),password:o.substring(10)}:null},e.writeIceParameters=function(n){let r="a=ice-ufrag:"+n.usernameFragment+`\r
20
+ a=ice-pwd:`+n.password+`\r
21
+ `;return n.iceLite&&(r+=`a=ice-lite\r
22
+ `),r},e.parseRtpParameters=function(n){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},o=e.splitLines(n)[0].split(" ");r.profile=o[2];for(let a=3;a<o.length;a++){const l=o[a],c=e.matchPrefix(n,"a=rtpmap:"+l+" ")[0];if(c){const u=e.parseRtpMap(c),f=e.matchPrefix(n,"a=fmtp:"+l+" ");switch(u.parameters=f.length?e.parseFmtp(f[0]):{},u.rtcpFeedback=e.matchPrefix(n,"a=rtcp-fb:"+l+" ").map(e.parseRtcpFb),r.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(u.name.toUpperCase());break}}}e.matchPrefix(n,"a=extmap:").forEach(a=>{r.headerExtensions.push(e.parseExtmap(a))});const s=e.matchPrefix(n,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach(a=>{s.forEach(l=>{a.rtcpFeedback.find(u=>u.type===l.type&&u.parameter===l.parameter)||a.rtcpFeedback.push(l)})}),r},e.writeRtpDescription=function(n,r){let i="";i+="m="+n+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r
23
+ `,i+=`c=IN IP4 0.0.0.0\r
24
+ `,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
25
+ `,r.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let o=0;return r.codecs.forEach(s=>{s.maxptime>o&&(o=s.maxptime)}),o>0&&(i+="a=maxptime:"+o+`\r
26
+ `),r.headerExtensions&&r.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(n){const r=[],i=e.parseRtpParameters(n),o=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,a=e.matchPrefix(n,"a=ssrc:").map(d=>e.parseSsrcMedia(d)).filter(d=>d.attribute==="cname"),l=a.length>0&&a[0].ssrc;let c;const u=e.matchPrefix(n,"a=ssrc-group:FID").map(d=>d.substring(17).split(" ").map(h=>parseInt(h,10)));u.length>0&&u[0].length>1&&u[0][0]===l&&(c=u[0][1]),i.codecs.forEach(d=>{if(d.name.toUpperCase()==="RTX"&&d.parameters.apt){let m={ssrc:l,codecPayloadType:parseInt(d.parameters.apt,10)};l&&c&&(m.rtx={ssrc:c}),r.push(m),o&&(m=JSON.parse(JSON.stringify(m)),m.fec={ssrc:l,mechanism:s?"red+ulpfec":"red"},r.push(m))}}),r.length===0&&l&&r.push({ssrc:l});let f=e.matchPrefix(n,"b=");return f.length&&(f[0].indexOf("b=TIAS:")===0?f=parseInt(f[0].substring(7),10):f[0].indexOf("b=AS:")===0?f=parseInt(f[0].substring(5),10)*1e3*.95-50*40*8:f=void 0,r.forEach(d=>{d.maxBitrate=f})),r},e.parseRtcpParameters=function(n){const r={},i=e.matchPrefix(n,"a=ssrc:").map(a=>e.parseSsrcMedia(a)).filter(a=>a.attribute==="cname")[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const o=e.matchPrefix(n,"a=rtcp-rsize");r.reducedSize=o.length>0,r.compound=o.length===0;const s=e.matchPrefix(n,"a=rtcp-mux");return r.mux=s.length>0,r},e.writeRtcpParameters=function(n){let r="";return n.reducedSize&&(r+=`a=rtcp-rsize\r
27
+ `),n.mux&&(r+=`a=rtcp-mux\r
28
+ `),n.ssrc!==void 0&&n.cname&&(r+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r
29
+ `),r},e.parseMsid=function(n){let r;const i=e.matchPrefix(n,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const o=e.matchPrefix(n,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(o.length>0)return r=o[0].value.split(" "),{stream:r[0],track:r[1]}},e.parseSctpDescription=function(n){const r=e.parseMLine(n),i=e.matchPrefix(n,"a=max-message-size:");let o;i.length>0&&(o=parseInt(i[0].substring(19),10)),isNaN(o)&&(o=65536);const s=e.matchPrefix(n,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:o};const a=e.matchPrefix(n,"a=sctpmap:");if(a.length>0){const l=a[0].substring(10).split(" ");return{port:parseInt(l[0],10),protocol:l[1],maxMessageSize:o}}},e.writeSctpDescription=function(n,r){let i=[];return n.protocol!=="DTLS/SCTP"?i=["m="+n.kind+" 9 "+n.protocol+" "+r.protocol+`\r
30
+ `,`c=IN IP4 0.0.0.0\r
31
+ `,"a=sctp-port:"+r.port+`\r
32
+ `]:i=["m="+n.kind+" 9 "+n.protocol+" "+r.port+`\r
33
+ `,`c=IN IP4 0.0.0.0\r
34
+ `,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r
35
+ `],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r
36
+ `),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(n,r,i){let o;const s=r!==void 0?r:2;return n?o=n:o=e.generateSessionId(),`v=0\r
37
+ o=`+(i||"thisisadapterortc")+" "+o+" "+s+` IN IP4 127.0.0.1\r
38
+ s=-\r
39
+ t=0 0\r
40
+ `},e.getDirection=function(n,r){const i=e.splitLines(n);for(let o=0;o<i.length;o++)switch(i[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[o].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(n){return e.splitLines(n)[0].split(" ")[0].substring(2)},e.isRejected=function(n){return n.split(" ",2)[1]==="0"},e.parseMLine=function(n){const i=e.splitLines(n)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(n){const i=e.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const r=e.splitLines(n);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},t.exports=e})(ii);var oi=ii.exports;const be=wr(oi),Ba=w({__proto__:null,default:be},[oi]);function Ye(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),o=be.parseCandidate(r.candidate);for(const s in o)s in i||Object.defineProperty(i,s,{value:o[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},t.RTCIceCandidate.prototype=e.prototype,ue(t,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new t.RTCIceCandidate(n.candidate),writable:"false"}),n))}function Jt(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||ue(t,"icecandidate",e=>{if(e.candidate){const n=be.parseCandidate(e.candidate.candidate);n.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e})}function Ze(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(a){if(!a||!a.sdp)return!1;const l=be.splitSections(a.sdp);return l.shift(),l.some(c=>{const u=be.parseMLine(c);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},r=function(a){const l=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(l===null||l.length<2)return-1;const c=parseInt(l[1],10);return c!==c?-1:c},i=function(a){let l=65536;return e.browser==="firefox"&&(e.version<57?a===-1?l=16384:l=2147483637:e.version<60?l=e.version===57?65535:65536:l=2147483637),l},o=function(a,l){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const u=be.matchPrefix(a.sdp,"a=max-message-size:");return u.length>0?c=parseInt(u[0].substring(19),10):e.browser==="firefox"&&l!==-1&&(c=2147483637),c},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:l}=this.getConfiguration();l==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const l=r(arguments[0]),c=i(l),u=o(arguments[0],l);let f;c===0&&u===0?f=Number.POSITIVE_INFINITY:c===0||u===0?f=Math.max(c,u):f=Math.min(c,u);const d={};Object.defineProperty(d,"maxMessageSize",{get(){return f}}),this._sctp=d}return s.apply(this,arguments)}}function et(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(r,i){const o=r.send;r.send=function(){const a=arguments[0],l=a.length||a.size||a.byteLength;if(r.readyState==="open"&&i.sctp&&l>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return o.apply(r,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const i=n.apply(this,arguments);return e(i,this),i},ue(t,"datachannel",r=>(e(r.channel,r.target),r))}function Wt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const r=e[n];e[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const o=i.target;if(o._lastConnectionState!==o.connectionState){o._lastConnectionState=o.connectionState;const s=new Event("connectionstatechange",i);o.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function Kt(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
41
+ a=extmap-allow-mixed`)!==-1){const o=i.sdp.split(`
42
+ `).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
43
+ `);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:o}):i.sdp=o}return n.apply(this,arguments)}}function tt(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function rt(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return n.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?n.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>n.apply(this,[s]))})}const ja=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Kt,shimAddIceCandidateNullOrEmpty:tt,shimConnectionState:Wt,shimMaxMessageSize:Ze,shimParameterlessSetLocalDescription:rt,shimRTCIceCandidate:Ye,shimRTCIceCandidateRelayProtocol:Jt,shimSendThrowTypeError:et},Symbol.toStringTag,{value:"Module"}));function $a({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Rn,r=Na(t),i={browserDetails:r,commonShim:ja,extractVersion:Xe,disableLog:Ma,disableWarnings:Fa,sdp:Ba};switch(r.browser){case"chrome":if(!Nn||!zt||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=Nn,tt(t,r),rt(t),An(t,r),Dn(t),zt(t,r),_n(t),Mn(t,r),In(t),Ln(t),kn(t),Fn(t,r),Ye(t),Jt(t),Wt(t),Ze(t,r),et(t),Kt(t,r);break;case"firefox":if(!Jn||!qt||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=Jn,tt(t,r),rt(t),Un(t,r),qt(t,r),wn(t),$n(t),Bn(t),jn(t),Hn(t),Gn(t),Vn(t),zn(t),qn(t),Ye(t),Wt(t),Ze(t,r),et(t);break;case"safari":if(!ni||!e.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=ni,tt(t,r),rt(t),Zn(t),ti(t),Qn(t),Wn(t),Kn(t),ei(t),Xn(t),ri(t),Ye(t),Jt(t),Ze(t,r),et(t),Kt(t,r);break;default:n("Unsupported browser!");break}return i}const si=$a({window:typeof window>"u"?void 0:window});class Qt{constructor(e){S(this,"peerConnection");S(this,"sessionListener",new xa);S(this,"isCallOut",!1);S(this,"sessionType",v.UNKNOWN);S(this,"localStream");S(this,"remoteStream");S(this,"dataChannel");S(this,"hasSetRemoteSdp",!1);S(this,"facingMode",M.FRONT_FACING);S(this,"facingChanging",!1);S(this,"muted",!1);S(this,"openCamera",!1);S(this,"desktopSharing",!1);this.sessionType=e,console.debug(si.browserDetails.browser+" "+si.browserDetails.version)}setListener(e){this.sessionListener=e}start(e,n){if(!e&&!n){this.error(new Error("start failed, remoteSdp is null."));return}switch(this.isCallOut=e,this.hasSetRemoteSdp=!1,this.facingMode=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.desktopSharing=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:this.createDataChannel()}e?(console.debug("webrtc call out"),this.peerConnection.createOffer().then(r=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})):(console.debug("webrtc call in: ",n),this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:n})).then(()=>{console.debug("webrtc setRemoteDescription success"),this.peerConnection.createAnswer().then(r=>{console.debug("webrtc createAnswer success"),this.peerConnection.setLocalDescription(r).then(()=>{console.debug("webrtc setLocalDescription success")}).catch(i=>{this.error(i)})}).catch(r=>{this.error(r)})}).catch(r=>{this.error(r)}))},this.peerConnection.onicegatheringstatechange=()=>{var r;console.debug("webrtc onicegatheringstatechange",(r=this.peerConnection)==null?void 0:r.iceGatheringState),this.peerConnection&&this.peerConnection.iceGatheringState=="complete"&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.ontrack=r=>{console.debug("webrtc ontrack");for(let i=0;i<r.streams.length;i++)this.remoteStream?r.streams[i].getTracks().forEach(o=>{var s;(s=this.remoteStream)==null||s.addTrack(o)}):this.remoteStream=new MediaStream(r.streams[i]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=r=>{var i,o,s,a,l;console.debug("oniceconnectionstatechange",(i=this.peerConnection)==null?void 0:i.iceConnectionState),(((o=this.peerConnection)==null?void 0:o.iceConnectionState)=="completed"||((s=this.peerConnection)==null?void 0:s.iceConnectionState)=="disconnected"||((a=this.peerConnection)==null?void 0:a.iceConnectionState)=="failed"||((l=this.peerConnection)==null?void 0:l.iceConnectionState)=="closed")&&(this.dataChannel=void 0,this.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case v.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case v.AUDIO_PUSH:case v.VIDEO_PUSH:case v.AUDIO_HALF:case v.VIDEO_HALF:case v.VIDEO:case v.AUDIO:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){e&&e!==""&&this.peerConnection&&this.isCallOut&&!this.hasSetRemoteSdp&&(this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(n=>{this.error(n),this.hasSetRemoteSdp=!1}))}addRemoteCandidate(e){this.peerConnection&&e.forEach(n=>{this.peerConnection.addIceCandidate(n).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(r=>console.log(r))})}sendStringData(e){try{this.dataChannel&&this.dataChannel.send(e)}catch(n){console.debug("sendStringData failed",n)}}stop(){var e;if(console.debug("webrtc stop"),(this.sessionType==v.VIDEO_PUSH||this.sessionType==v.AUDIO_PUSH||this.sessionType==v.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.localStream)for(let n of this.localStream.getTracks())this.localStream.removeTrack(n),n.stop();this.desktopSharing&&(this.desktopSharing=!1,this.sessionListener.onStopDesktopShare()),this.peerConnection=void 0,this.dataChannel=void 0,this.localStream=void 0,this.remoteStream=void 0,this.isCallOut=!1,this.sessionType=v.UNKNOWN,this.hasSetRemoteSdp=!1,this.facingMode=M.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.openCamera=!1,this.desktopSharing=!1}changeFacing(){return new Promise((e,n)=>{if(this.sessionType!==v.VIDEO&&this.sessionType!==v.VIDEO_PUSH){n(new Error("not video call"));return}if(!this.localStream||this.localStream.getVideoTracks().length<=0){n(new Error("not in calling or not video call"));return}if(this.facingChanging){n(new Error("camera switching in progress"));return}this.changeCameraLocalMedia().then(()=>e(this.facingMode)).catch(r=>n(r))})}changeMuted(){return new Promise((e,n)=>{!this.localStream||this.localStream.getAudioTracks().length<=0?n(new Error("not in calling")):(this.localStream.getAudioTracks().forEach(r=>{r.enabled=!r.enabled,this.muted=!r.enabled}),e(this.muted))})}changeCameraOpened(){return new Promise((e,n)=>{!this.localStream||this.localStream.getVideoTracks().length<=0?n(new Error("not in video calling")):(this.localStream.getVideoTracks().forEach(r=>{r.enabled=!r.enabled,this.openCamera=!r.enabled}),e(this.openCamera))})}startDesktopShare(){return new Promise((e,n)=>{if(this.desktopSharing){n(new Error("desktop sharing has opened"));return}if(this.sessionType!=v.VIDEO&&this.sessionType!=v.VIDEO_PUSH){n(new Error("desktop sharing not in video calling"));return}if(!this.localStream){n(new Error("localStream undefined"));return}navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?(this.desktopSharing=!0,navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}).then(r=>{let i=this.changeVideoTrack(r,()=>{this.stopDesktopShare(),this.sessionListener.onStopDesktopShare()});i?(this.desktopSharing=!1,n(i)):e()}).catch(r=>{this.desktopSharing=!1,n(r)})):n(new Error("error: browsers unsupported DesktopShare"))})}stopDesktopShare(){if(!(!this.peerConnection||!this.localStream)&&this.desktopSharing){for(let e of this.localStream.getVideoTracks())this.localStream.removeTrack(e),e.stop();navigator.mediaDevices.getUserMedia({audio:!1,video:{height:{exact:720},width:{exact:1280}}}).then(e=>{this.changeVideoTrack(e),this.desktopSharing=!1}).catch(e=>{this.desktopSharing=!1,console.debug("stopDesktopShare getUserMedia failed: ",e)})}}changeVideoTrack(e,n){if(!this.localStream||!this.peerConnection){for(let r of e.getTracks())e.removeTrack(r),r.stop();return new Error("localStream undefined or peerConnection undefined")}for(let r of this.localStream.getVideoTracks())this.localStream.removeTrack(r),r.stop();for(let r of e.getTracks())e.removeTrack(r),r.kind=="video"?(this.localStream.addTrack(r),n&&(r.onended=i=>{n()})):r.stop();for(let r of this.peerConnection.getSenders())r.track&&r.track.kind==="video"&&r.replaceTrack(this.localStream.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.error(i)})}error(e){console.debug("webrtc error: ",e),this.stop(),this.sessionListener.onError(e)}addTransceivers(){this.peerConnection.addTransceiver("audio",{direction:"recvonly"}),this.peerConnection.addTransceiver("video",{direction:"recvonly"})}gotLocalMedia(){let e={audio:{echoCancellation:!0,noiseSuppression:!0}};switch(this.sessionType){case v.VIDEO:case v.VIDEO_PUSH:case v.VIDEO_HALF:e.video={height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING};break}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(n=>{this.getMediaSuccess(n)}).catch(n=>{this.getMediaFailed(n)}):this.error(new Error("Browser does not support WebRTC"))}getMediaSuccess(e){console.debug("webrtc getMediaSuccess"),this.localStream=e,(this.sessionType===v.VIDEO||this.sessionType===v.VIDEO_PUSH||this.sessionType===v.VIDEO_HALF)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(n=>{switch(this.sessionType){case v.AUDIO_PUSH:case v.VIDEO_PUSH:this.peerConnection.addTransceiver(n,{direction:"sendonly",streams:[e]});break;default:this.peerConnection.addTrack(n,e)}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===v.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_PUSH,this.gotLocalMedia();return}else if(this.sessionType===v.VIDEO_HALF){console.error("get video media failed. maybe not found camera.",e),this.sessionType=v.AUDIO_HALF,this.gotLocalMedia();return}this.error(e)}createDataChannel(){this.peerConnection&&(this.isCallOut?(this.dataChannel=this.peerConnection.createDataChannel("command_channel"),this.dataChannel.onmessage=e=>{this.onDataChannelReceive(e.data)}):this.peerConnection.ondatachannel=e=>{this.dataChannel=e.channel,this.dataChannel.onmessage=n=>{this.onDataChannelReceive(n.data)}})}onDataChannelReceive(e){if(e==="close"){console.debug("data channel receive from server: close"),this.dataChannel=void 0,this.stop();return}(this.sessionType==v.VIDEO_HALF||this.sessionType==v.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,n)=>{if(!this.localStream){n(new Error("local stream not found"));return}if(this.localStream.getVideoTracks().length==0){n(new Error("local stream not video track"));return}this.facingChanging=!0,this.localStream.getVideoTracks().forEach(o=>{this.localStream.removeTrack(o),o.stop()});let r,i=this.facingMode;if(this.facingMode===M.FRONT_FACING?(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}):(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(r).then(o=>{this.changeCameraSuccess(o,i),e()}).catch(o=>{console.error("change camera failed, use last camera: "+o,o),i=this.facingMode,this.facingMode===M.FRONT_FACING?(i=M.FRONT_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280},facingMode:M.FRONT_FACING}}):(i=M.BACK_FACING,r={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:1280},width:{exact:720},facingMode:M.BACK_FACING}}),navigator.mediaDevices.getUserMedia(r).then(s=>{this.changeCameraSuccess(s,i),e()}).catch(s=>{this.changeCameraFailed(s),n(s)})});else{let o=new Error("Browser does not support WebRTC");this.changeCameraFailed(o),n(new Error("Browser does not support WebRTC"))}})}changeCameraSuccess(e,n){if(!this.localStream){e.getTracks().forEach(r=>{r.stop()}),this.facingChanging=!1;return}e.getVideoTracks().forEach(r=>{this.localStream.addTrack(r)}),this.peerConnection.getSenders().forEach(r=>{r.track&&r.track.kind==="video"&&r.replaceTrack(e.getVideoTracks()[0]).then(()=>{}).catch(i=>{console.log(i)})}),this.facingMode=n,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class Ha{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class ai{constructor(e,n){S(this,"url");S(this,"offerSdp");this.url=e,this.offerSdp=n}}const Ga="/media-server/video-play/webrtc";class Va{constructor(e,n){S(this,"rtspUrl");S(this,"webrtcSession",new Qt(v.RTSP_PULL));S(this,"sessionListener",new Ha);S(this,"httpClient");this.rtspUrl=e,this.httpClient=n,this.webrtcSession.setListener(this)}setRtspPullSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("rtsp offer:",e.sdp),this.httpClient.Post(Ga,new ai(this.rtspUrl,e.sdp??"")).then(n=>{var r,i,o,s;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("rtsp answer",(r=n.data)==null?void 0:r.sdp),console.debug("rtsp answer",(i=n.data)==null?void 0:i.candidateList),this.webrtcSession.setRemoteSdp(((o=n.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=n.data)==null?void 0:s.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){}}var E=(t=>(t[t.OFFLINE=-1]="OFFLINE",t[t.IDLE=0]="IDLE",t[t.TRY=1]="TRY",t[t.RING=2]="RING",t[t.TALK=3]="TALK",t))(E||{}),F=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(F||{}),K=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(K||{}),fe=(t=>(t.IN="in",t.OUT="out",t))(fe||{}),j=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(j||{});let ci;function za(){ci="true"}function qa(){return ci}function li(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Ja(){return"browser-"+Wa()+Ka(6)}function Wa(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Ka(t){let e="",n=["0","1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let r=0;r<t;r++)e+=n[Math.floor(Math.random()*(n.length-1))];return e}class Qa{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"callMode");this.tel=e,this.callMode=r,this.mediaType=n}}class ui{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onAnswer(){console.debug("onAnswer")}onClose(e){console.debug("onClose:",e)}onError(e){console.debug("onError:",e)}onHangup(e){console.debug("onHangup:",e)}onNewCall(e){console.debug("onNewCall:",e)}onRing(){console.debug("onRing")}onInitResult(e){console.debug("onInitResult: ",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}class fi{constructor(e,n,r){S(this,"tel","");S(this,"status",E.OFFLINE);S(this,"mediaType",F.AUDIO);S(this,"callMode",K.FULL);S(this,"callDirect",fe.OUT);S(this,"called","");S(this,"callId");S(this,"remoteSdp");S(this,"candidate");S(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));S(this,"ringtone",new Audio("sound/ringtone.wav"));S(this,"dtmfAudio",new Audio("sound/dtmf.wav"));S(this,"ws");S(this,"wsConnected",!1);S(this,"closeBySelf",!1);S(this,"webrtcSession");S(this,"sessionListener",new ui);S(this,"wsUrl");S(this,"accountId");this.tel=n??"",this.wsUrl=e,this.accountId=r,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}audioCall(e){this.makeCall(e)}videoCall(e){this.makeCall(e,F.VIDEO)}answer(){var n;if(this.status!=E.RING){console.debug("session is not ring state");return}if(this.callDirect!=fe.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==K.HALF?e=F.VIDEO==this.mediaType?v.VIDEO_HALF:v.AUDIO_HALF:e=F.VIDEO==this.mediaType?v.VIDEO:v.AUDIO,this.webrtcCreate(e),(n=this.webrtcSession)==null||n.start(!1,this.remoteSdp)}hangup(){this.status<=E.IDLE||(this.status==E.TALK?this.sendHangup(this.callId??""):this.callDirect==fe.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==E.TALK?!1:(this.sendDtmf(e),!0)}changeCamera(){return new Promise((e,n)=>{var r;this.webrtcSession||n(new Error("webrtc session not start")),(r=this.webrtcSession)==null||r.changeFacing().then(i=>e(i)).catch(i=>n(i))})}changeMuted(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.changeMuted().then(r=>e(r)).catch(r=>n(r))})}changeCameraOpened(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.changeCameraOpened().then(r=>e(r)).catch(r=>n(r))})}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.status!=E.TALK&&n(new Error(`session status[${this.status}] not talk`)),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.status==E.TALK&&this.webrtcSession.stopDesktopShare()}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,n=F.AUDIO,r=K.FULL){var i;try{if(!li()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==E.OFFLINE){console.debug("The initialization has not been completed yet. Please try again later"),this.sessionListener.onError(new Error("The initialization has not been completed yet. Please try again later"));return}this.status>E.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=n,this.callMode=r,this.called=e,this.callDirect=fe.OUT,this.callId=Ja();let o;this.callMode==K.HALF?o=F.VIDEO==n?v.VIDEO_HALF:v.AUDIO_HALF:o=F.VIDEO==n?v.VIDEO:v.AUDIO,this.webrtcCreate(o),(i=this.webrtcSession)==null||i.start(!0),this.status=E.TRY}catch(o){this.status=E.IDLE,this.sessionListener.onError(new Error(""+o))}}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=E.IDLE}websocketInit(e){this.ws=new WebSocket(e),this.closeBySelf=!1,this.ws.onopen=()=>{console.debug("ws connect success"),this.wsConnected=!0,this.sendLogin()},this.ws.onclose=n=>{console.error("ws on close: ",n),this.wsConnected=!1,this.close(),this.status=E.OFFLINE,this.closeBySelf||this.sessionListener.onClose(new Error(n.reason)),this.ws=void 0},this.ws.onmessage=n=>{try{let r=JSON.parse(n.data);switch(console.debug("receive msg from server <<<<<<<<<<<<<<<",r),r.type){case j.Invite:this.inviteHandler(r);break;case j.ANSWER:this.answerHandler(r);break;case j.RING:this.ringHandler(r);break;case j.HANGUP:this.hangupHandler(r);break;case j.LOGIN:this.loginHandler(r);break}}catch(r){console.error("receive msg from server, but process error: ",r,n)}},this.ws.onerror=n=>{console.error("ws on error: ",n)}}sendTo(e){var n;try{this.wsConnected?(console.debug("send msg to server >>>>>>>>>>>>>>>>>> ",e),(n=this.ws)==null||n.send(JSON.stringify(e))):console.error("ws not connected.")}catch(r){console.debug("FullSession sendTo error: ",r)}}sendLogin(){this.sendTo({type:j.LOGIN,username:this.tel,allowEmpty:this.tel===""?qa():void 0,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:j.LOGOUT,username:this.tel}),this.status=E.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:j.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=E.TRY}sendRing(){this.sendTo({type:j.RING,callId:this.callId,code:180}),this.status=E.RING}sendAnswer(e){this.sendTo({type:j.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=E.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:j.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(n=>console.debug(n))}sendHangup(e,n=800){this.sendTo({type:j.HANGUP,callId:e,code:n}),e==this.callId&&(this.status=E.IDLE,this.callId=void 0)}loginHandler(e){var n;if(e.code!=200){(n=this.ws)==null||n.close(),this.wsConnected=!1,this.ws=void 0,this.status=E.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=E.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!li()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>E.IDLE){e.callId!=this.callId?(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486)):console.debug("receive re invite. not process");return}this.callId=e.callId,this.mediaType=e.mediaType??F.AUDIO,this.callMode=e.callMode??K.FULL,this.called=e.from??"",this.callDirect=fe.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new Qa(this.called,this.mediaType,this.callMode))}ringHandler(e){var n,r;!e.callId||e.callId!=this.callId||(e.code==183?(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[])):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=E.RING)}answerHandler(e){var n,r;!e.callId||e.callId!=this.callId||(this.ringBackTone.pause(),(n=this.webrtcSession)==null||n.setRemoteSdp(e.sdp??""),(r=this.webrtcSession)==null||r.addRemoteCandidate(e.candidate??[]),this.sessionListener.onAnswer(),this.status=E.TALK)}hangupHandler(e){!e.callId||e.callId!=this.callId||(this.close(),this.sessionListener.onHangup(e.code))}getUserAgent(){return navigator.platform.indexOf("Win")>=0?"windows":"phone"}webrtcCreate(e){this.webrtcClose(),this.webrtcSession=new Qt(e),this.webrtcSession.setListener(this)}webrtcClose(){var e;(e=this.webrtcSession)==null||e.stop(),this.webrtcSession=void 0}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){this.sessionListener.onAddRemoteStream(e)}onError(e){this.close(),this.callDirect==fe.OUT&&this.hangup(),this.sessionListener.onError(e)}onStartSuccess(e){var n;e.type=="answer"?(this.sendAnswer(e.sdp??""),(n=this.webrtcSession)==null||n.addRemoteCandidate(this.candidate??[])):e.type=="offer"&&this.sendInvite(e.sdp??"")}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}class Xa{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onStopDesktopShare(){console.debug("onStopDesktopShare")}}const Ya="/media-server/broadcast/webrtc";class Za{constructor(e,n,r){S(this,"tel");S(this,"mediaType");S(this,"webrtcSession");S(this,"sessionListener",new Xa);S(this,"httpClient");this.tel=e,this.httpClient=n,this.mediaType=r===F.VIDEO?F.VIDEO:F.AUDIO,this.webrtcSession=new Qt(r==F.VIDEO?v.VIDEO_PUSH:v.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}startDesktopShare(){return new Promise((e,n)=>{this.webrtcSession||n(new Error("webrtc session not start")),this.webrtcSession.startDesktopShare().then(()=>e()).catch(r=>n(r))})}stopDesktopShare(){this.webrtcSession&&this.webrtcSession.stopDesktopShare()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(Ya,new ai(this.tel,e.sdp??"")).then(n=>{var r,i,o;if(n.code!=200){this.stop(),this.sessionListener.onError(new Error(n.message));return}console.debug("answer",(r=n.data)==null?void 0:r.sdp),this.webrtcSession.setRemoteSdp(((i=n.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((o=n.data)==null?void 0:o.candidateList)??[])}).catch(n=>{this.stop(),this.sessionListener.onError(n)})}onDataChannelMessage(e){}onStopDesktopShare(){this.sessionListener.onStopDesktopShare()}}var Xt=(t=>(t.TB_REQUEST="tb_request",t.TB_GRANTED="tb_granted",t.TB_TAKEN="tb_taken",t.TB_DENY="tb_deny",t.TB_RELEASE="tb_release",t.TB_IDLE="tb_idle",t.TB_REVOKE="tb_revoke",t))(Xt||{});class ec extends ui{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class tc extends fi{constructor(n,r,i){super(n,r,i);S(this,"sessionListener",new ec)}setCallSessionListener(n){this.sessionListener=n}audioHalfCall(n){this.makeCall(n,F.AUDIO,K.HALF)}videoHalfCall(n){this.makeCall(n,F.VIDEO,K.HALF)}tbcpRequest(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_REQUEST})))}tbcpRelease(){var n;this.callMode==K.HALF&&this.status==E.TALK&&((n=this.webrtcSession)==null||n.sendStringData(JSON.stringify({type:Xt.TB_RELEASE})))}onDataChannelMessage(n){try{this.sessionListener.onTbcpMessage(JSON.parse(n))}catch(r){console.debug("onDataChannelMessage err: ",r,n)}}}let Yt=new vn("/"),pi="/media-server/ws/voip",di="/media-server/ws/b-trun-c",Zt=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+pi),er=new URL((window.location.protocol=="https:"?"wss://":"ws://")+window.location.host+di);function rc(t){Yt=new vn(t)}function nc(t){return new Va(t,Yt)}function ic(t,e){return new Za(t,Yt,e)}function oc(t){Zt=new URL(t),Zt.pathname=pi,er=new URL(t),er.pathname=di}function sc(t){return new fi(Zt.toString(),t)}function ac(t,e){return new tc(er.toString(),t,e)}A.createAppCallSession=ac,A.createBroadcastSession=ic,A.createCallSession=sc,A.createRtspPullSession=nc,A.setAllowEmpty=za,A.videoModuleInit=rc,A.voipModuleInit=oc,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});