media-av 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +14 -10
- package/dist/mediaAV.js +1041 -993
- package/dist/mediaAV.umd.cjs +8 -8
- package/index.d.ts +353 -271
- package/package.json +1 -1
package/dist/mediaAV.umd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(A,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(A=typeof globalThis<"u"?globalThis:A||self,D(A.mediaAV={}))})(this,function(A){"use strict";var La=Object.defineProperty;var ka=(A,D,z)=>D in A?La(A,D,{enumerable:!0,configurable:!0,writable:!0,value:z}):A[D]=z;var g=(A,D,z)=>(ka(A,typeof D!="symbol"?D+"":D,z),z);function D(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function z(t,e){return function(){return t.apply(e,arguments)}}const{toString:Qn}=Object.prototype,{getPrototypeOf:nt}=Object,_e=(t=>e=>{const r=Qn.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>_e(e)===t),xe=t=>e=>typeof e===t,{isArray:ie}=Array,Se=xe("undefined");function Yn(t){return t!==null&&!Se(t)&&t.constructor!==null&&!Se(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Qt=N("ArrayBuffer");function Xn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Qt(t.buffer),e}const Zn=xe("string"),M=xe("function"),Yt=xe("number"),De=t=>t!==null&&typeof t=="object",ei=t=>t===!0||t===!1,Le=t=>{if(_e(t)!=="object")return!1;const e=nt(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ti=N("Date"),ri=N("File"),ni=N("Blob"),ii=N("FileList"),oi=t=>De(t)&&M(t.pipe),si=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=_e(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},ai=N("URLSearchParams"),ci=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ve(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),ie(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(n=0;n<s;n++)a=o[n],e.call(null,t[a],a,t)}}function Xt(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}const Zt=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),er=t=>!Se(t)&&t!==Zt;function it(){const{caseless:t}=er(this)&&this||{},e={},r=(n,i)=>{const o=t&&Xt(e,i)||i;Le(e[o])&&Le(n)?e[o]=it(e[o],n):Le(n)?e[o]=it({},n):ie(n)?e[o]=n.slice():e[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ve(arguments[n],r);return e}const li=(t,e,r,{allOwnKeys:n}={})=>(ve(e,(i,o)=>{r&&M(i)?t[o]=z(i,r):t[o]=i},{allOwnKeys:n}),t),ui=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),fi=(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)},pi=(t,e,r,n)=>{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],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&nt(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},di=(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},hi=t=>{if(!t)return null;if(ie(t))return t;let e=t.length;if(!Yt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},mi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&nt(Uint8Array)),yi=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},gi=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Si=N("HTMLFormElement"),vi=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),tr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ci=N("RegExp"),rr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};ve(r,(i,o)=>{e(i,o,t)!==!1&&(n[o]=i)}),Object.defineProperties(t,n)},bi=t=>{rr(t,(e,r)=>{if(M(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(M(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+"'")})}})},Ri=(t,e)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return ie(t)?n(t):n(String(t).split(e)),r},Ti=()=>{},Ei=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ot="abcdefghijklmnopqrstuvwxyz",nr="0123456789",ir={DIGIT:nr,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+nr},Pi=(t=16,e=ir.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Oi(t){return!!(t&&M(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ai=t=>{const e=new Array(10),r=(n,i)=>{if(De(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const o=ie(n)?[]:{};return ve(n,(s,a)=>{const l=r(s,i+1);!Se(l)&&(o[a]=l)}),e[i]=void 0,o}}return n};return r(t,0)},Ii=N("AsyncFunction"),d={isArray:ie,isArrayBuffer:Qt,isBuffer:Yn,isFormData:si,isArrayBufferView:Xn,isString:Zn,isNumber:Yt,isBoolean:ei,isObject:De,isPlainObject:Le,isUndefined:Se,isDate:ti,isFile:ri,isBlob:ni,isRegExp:Ci,isFunction:M,isStream:oi,isURLSearchParams:ai,isTypedArray:mi,isFileList:ii,forEach:ve,merge:it,extend:li,trim:ci,stripBOM:ui,inherits:fi,toFlatObject:pi,kindOf:_e,kindOfTest:N,endsWith:di,toArray:hi,forEachEntry:yi,matchAll:gi,isHTMLForm:Si,hasOwnProperty:tr,hasOwnProp:tr,reduceDescriptors:rr,freezeMethods:bi,toObjectSet:Ri,toCamelCase:vi,noop:Ti,toFiniteNumber:Ei,findKey:Xt,global:Zt,isContextDefined:er,ALPHABET:ir,generateString:Pi,isSpecCompliantForm:Oi,toJSONObject:Ai,isAsyncFn:Ii,isThenable:t=>t&&(De(t)||M(t))&&M(t.then)&&M(t.catch)};function C(t,e,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}d.inherits(C,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:d.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const or=C.prototype,sr={};["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=>{sr[t]={value:t}}),Object.defineProperties(C,sr),Object.defineProperty(or,"isAxiosError",{value:!0}),C.from=(t,e,r,n,i,o)=>{const s=Object.create(or);return d.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),C.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const _i=null;function st(t){return d.isPlainObject(t)||d.isArray(t)}function ar(t){return d.endsWith(t,"[]")?t.slice(0,-2):t}function cr(t,e,r){return t?t.concat(e).map(function(i,o){return i=ar(i),!r&&o?"["+i+"]":i}).join(r?".":""):e}function xi(t){return d.isArray(t)&&!t.some(st)}const Di=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(t,e,r){if(!d.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=d.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,E){return!d.isUndefined(E[y])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(e);if(!d.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(d.isDate(h))return h.toISOString();if(!l&&d.isBlob(h))throw new C("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(h)||d.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,E){let S=h;if(h&&!E&&typeof h=="object"){if(d.endsWith(y,"{}"))y=n?y:y.slice(0,-2),h=JSON.stringify(h);else if(d.isArray(h)&&xi(h)||(d.isFileList(h)||d.endsWith(y,"[]"))&&(S=d.toArray(h)))return y=ar(y),S.forEach(function(k,K){!(d.isUndefined(k)||k===null)&&e.append(s===!0?cr([y],K,o):s===null?y:y+"[]",c(k))}),!1}return st(h)?!0:(e.append(cr(E,y,o),c(h)),!1)}const f=[],p=Object.assign(Di,{defaultVisitor:u,convertValue:c,isVisitable:st});function m(h,y){if(!d.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),d.forEach(h,function(S,x){(!(d.isUndefined(S)||S===null)&&i.call(e,S,d.isString(x)?x.trim():x,y,p))===!0&&m(S,y?y.concat(x):[x])}),f.pop()}}if(!d.isObject(t))throw new TypeError("data must be an object");return m(t),e}function lr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function at(t,e){this._pairs=[],t&&ke(t,this,e)}const ur=at.prototype;ur.append=function(e,r){this._pairs.push([e,r])},ur.toString=function(e){const r=e?function(n){return e.call(this,n,lr)}:lr;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Li(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fr(t,e,r){if(!e)return t;const n=r&&r.encode||Li,i=r&&r.serialize;let o;if(i?o=i(e,r):o=d.isURLSearchParams(e)?e.toString():new at(e,r).toString(n),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class ki{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){d.forEach(this.handlers,function(n){n!==null&&e(n)})}}const pr=ki,dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mi=typeof URLSearchParams<"u"?URLSearchParams:at,Fi=typeof FormData<"u"?FormData:null,Ni=typeof Blob<"u"?Blob:null,Ui=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Bi=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),U={isBrowser:!0,classes:{URLSearchParams:Mi,FormData:Fi,Blob:Ni},isStandardBrowserEnv:Ui,isStandardBrowserWebWorkerEnv:Bi,protocols:["http","https","file","blob","url","data"]};function ji(t,e){return ke(t,new U.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return U.isNode&&d.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function $i(t){return d.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wi(t){const e={},r=Object.keys(t);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],e[o]=t[o];return e}function hr(t){function e(r,n,i,o){let s=r[o++];const a=Number.isFinite(+s),l=o>=r.length;return s=!s&&d.isArray(i)?i.length:s,l?(d.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!d.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],o)&&d.isArray(i[s])&&(i[s]=wi(i[s])),!a)}if(d.isFormData(t)&&d.isFunction(t.entries)){const r={};return d.forEachEntry(t,(n,i)=>{e($i(n),i,r,0)}),r}return null}const Hi={"Content-Type":void 0};function Gi(t,e,r){if(d.isString(t))try{return(e||JSON.parse)(t),d.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Me={transitional:dr,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=d.isObject(e);if(o&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return i&&i?JSON.stringify(hr(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ji(e,this.formSerializer).toString();if((a=d.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ke(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),Gi(e)):e}],transformResponse:[function(e){const r=this.transitional||Me.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&d.isString(e)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?C.from(a,C.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:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};d.forEach(["delete","get","head"],function(e){Me.headers[e]={}}),d.forEach(["post","put","patch"],function(e){Me.headers[e]=d.merge(Hi)});const ct=Me,zi=d.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"]),Vi=t=>{const e={};let r,n,i;return t&&t.split(`
|
|
2
|
-
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&
|
|
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(i=>n.set(i)),n}static accessor(e){const n=(this[mr]=this[mr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Ce(s);n[a]||(Ki(i,s),n[a]=!0)}return d.isArray(e)?e.forEach(o):o(e),this}}Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),d.freezeMethods(Ne.prototype),d.freezeMethods(Ne);const w=Ne;function ut(t,e){const r=this||ct,n=e||r,i=w.from(n.headers);let o=n.data;return d.forEach(t,function(a){o=a.call(r,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function yr(t){return!!(t&&t.__CANCEL__)}function be(t,e,r){C.call(this,t??"canceled",C.ERR_CANCELED,e,r),this.name="CanceledError"}d.inherits(be,C,{__CANCEL__:!0});function Qi(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new C("Request failed with status code "+r.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Yi=U.isStandardBrowserEnv?function(){return{write:function(r,n,i,o,s,a){const l=[];l.push(r+"="+encodeURIComponent(n)),d.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),d.isString(o)&&l.push("path="+o),d.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Xi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zi(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function gr(t,e){return t&&!Xi(e)?Zi(t,e):e}const eo=U.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(o){let s=o;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=i(window.location.href),function(s){const a=d.isString(s)?i(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 i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=n[o];s||(s=c),r[i]=l,n[i]=c;let f=o,p=0;for(;f!==i;)p+=r[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(p*1e3/m):void 0}}function Sr(t,e){let r=0;const n=ro(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-r,l=n(a),c=o<=s;r=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const Ue={http:_i,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){let i=t.data;const o=w.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}d.isFormData(i)&&(U.isStandardBrowserEnv||U.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+h))}const u=gr(t.baseURL,t.url);c.open(t.method.toUpperCase(),fr(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function f(){if(!c)return;const m=w.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:m,config:t,request:c};Qi(function(S){r(S),l()},function(S){n(S),l()},y),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(n(new C("Request aborted",C.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new C("Network Error",C.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||dr;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),n(new C(h,y.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,c)),c=null},U.isStandardBrowserEnv){const m=(t.withCredentials||eo(u))&&t.xsrfCookieName&&Yi.read(t.xsrfCookieName);m&&o.set(t.xsrfHeaderName,m)}i===void 0&&o.setContentType(null),"setRequestHeader"in c&&d.forEach(o.toJSON(),function(h,y){c.setRequestHeader(y,h)}),d.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",Sr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Sr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=m=>{c&&(n(!m||m.type?new be(null,t,c):m),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=to(u);if(p&&U.protocols.indexOf(p)===-1){n(new C("Unsupported protocol "+p+":",C.ERR_BAD_REQUEST,t));return}c.send(i||null)})}};d.forEach(Ue,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const no={getAdapter:t=>{t=d.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let i=0;i<e&&(r=t[i],!(n=d.isString(r)?Ue[r.toLowerCase()]:r));i++);if(!n)throw n===!1?new C(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(d.hasOwnProp(Ue,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!d.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:Ue};function ft(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new be(null,t)}function vr(t){return ft(t),t.headers=w.from(t.headers),t.data=ut.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),no.getAdapter(t.adapter||ct.adapter)(t).then(function(n){return ft(t),n.data=ut.call(t,t.transformResponse,n),n.headers=w.from(n.headers),n},function(n){return yr(n)||(ft(t),n&&n.response&&(n.response.data=ut.call(t,t.transformResponse,n.response),n.response.headers=w.from(n.response.headers))),Promise.reject(n)})}const Cr=t=>t instanceof w?t.toJSON():t;function oe(t,e){e=e||{};const r={};function n(c,u,f){return d.isPlainObject(c)&&d.isPlainObject(u)?d.merge.call({caseless:f},c,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function i(c,u,f){if(d.isUndefined(u)){if(!d.isUndefined(c))return n(void 0,c,f)}else return n(c,u,f)}function o(c,u){if(!d.isUndefined(u))return n(void 0,u)}function s(c,u){if(d.isUndefined(u)){if(!d.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,f){if(f in e)return n(c,u);if(f in t)return n(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,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(Cr(c),Cr(u),!0)};return d.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,p=f(t[u],e[u],u);d.isUndefined(p)&&f!==a||(r[u]=p)}),r}const br="1.4.0",pt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Rr={};pt.transitional=function(e,r,n){function i(o,s){return"[Axios v"+br+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(e===!1)throw new C(i(s," has been removed"+(r?" in "+r:"")),C.ERR_DEPRECATED);return r&&!Rr[s]&&(Rr[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,s,a):!0}};function io(t,e,r){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const o=n[i],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new C("option "+o+" must be "+l,C.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new C("Unknown option "+o,C.ERR_BAD_OPTION)}}const dt={assertOptions:io,validators:pt},V=dt.validators;class Be{constructor(e){this.defaults=e,this.interceptors={request:new pr,response:new pr}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=oe(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&dt.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),i!=null&&(d.isFunction(i)?r.paramsSerializer={serialize:i}:dt.assertOptions(i,{encode:V.function,serialize:V.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s;s=o&&d.merge(o.common,o[r.method]),s&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),r.headers=w.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!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,p;if(!l){const h=[vr.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,u=Promise.resolve(r);f<p;)u=u.then(h[f++],h[f++]);return u}p=a.length;let m=r;for(f=0;f<p;){const h=a[f++],y=a[f++];try{m=h(m)}catch(E){y.call(this,E);break}}try{u=vr.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=oe(this.defaults,e);const r=gr(e.baseURL,e.url);return fr(r,e.params,e.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(e){Be.prototype[e]=function(r,n){return this.request(oe(n||{},{method:e,url:r,data:(n||{}).data}))}}),d.forEach(["post","put","patch"],function(e){function r(n){return function(o,s,a){return this.request(oe(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Be.prototype[e]=r(),Be.prototype[e+"Form"]=r(!0)});const je=Be;class ht{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},e(function(o,s,a){n.reason||(n.reason=new be(o,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 ht(function(i){e=i}),cancel:e}}}const oo=ht;function so(t){return function(r){return t.apply(null,r)}}function ao(t){return d.isObject(t)&&t.isAxiosError===!0}const mt={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(mt).forEach(([t,e])=>{mt[e]=t});const co=mt;function Tr(t){const e=new je(t),r=z(je.prototype.request,e);return d.extend(r,je.prototype,e,{allOwnKeys:!0}),d.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Tr(oe(t,i))},r}const T=Tr(ct);T.Axios=je,T.CanceledError=be,T.CancelToken=oo,T.isCancel=yr,T.VERSION=br,T.toFormData=ke,T.AxiosError=C,T.Cancel=T.CanceledError,T.all=function(e){return Promise.all(e)},T.spread=so,T.isAxiosError=ao,T.mergeConfig=oe,T.AxiosHeaders=w,T.formToJSON=t=>hr(d.isHTMLForm(t)?new FormData(t):t),T.HttpStatusCode=co,T.default=T;const lo=T;function Er(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 i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{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 i=42;e[r]=i;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 o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0},Pr=typeof Symbol<"u"&&Symbol,po=fo,ho=function(){return typeof Pr!="function"||typeof Symbol!="function"||typeof Pr("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:po()},Or={foo:{}},mo=Object,yo=function(){return{__proto__:Or}.foo===Or.foo&&!({__proto__:null}instanceof mo)},go="Function.prototype.bind called on incompatible ",yt=Array.prototype.slice,So=Object.prototype.toString,vo="[object Function]",Co=function(e){var r=this;if(typeof r!="function"||So.call(r)!==vo)throw new TypeError(go+r);for(var n=yt.call(arguments,1),i,o=function(){if(this instanceof i){var u=r.apply(this,n.concat(yt.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(yt.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,i.prototype=new c,c.prototype=null}return i},bo=Co,gt=Function.prototype.bind||bo,Ro=gt,To=Ro.call(Function.call,Object.prototype.hasOwnProperty),v,se=SyntaxError,Ar=Function,ae=TypeError,St=function(t){try{return Ar('"use strict"; return ('+t+").constructor;")()}catch{}},Y=Object.getOwnPropertyDescriptor;if(Y)try{Y({},"")}catch{Y=null}var vt=function(){throw new ae},Eo=Y?function(){try{return arguments.callee,vt}catch{try{return Y(arguments,"callee").get}catch{return vt}}}():vt,ce=ho(),Po=yo(),P=Object.getPrototypeOf||(Po?function(t){return t.__proto__}:null),le={},Oo=typeof Uint8Array>"u"||!P?v:P(Uint8Array),X={"%AggregateError%":typeof AggregateError>"u"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?v:ArrayBuffer,"%ArrayIteratorPrototype%":ce&&P?P([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":le,"%AsyncGenerator%":le,"%AsyncGeneratorFunction%":le,"%AsyncIteratorPrototype%":le,"%Atomics%":typeof Atomics>"u"?v:Atomics,"%BigInt%":typeof BigInt>"u"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?v:Float32Array,"%Float64Array%":typeof Float64Array>"u"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?v:FinalizationRegistry,"%Function%":Ar,"%GeneratorFunction%":le,"%Int8Array%":typeof Int8Array>"u"?v:Int8Array,"%Int16Array%":typeof Int16Array>"u"?v:Int16Array,"%Int32Array%":typeof Int32Array>"u"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ce&&P?P(P([][Symbol.iterator]())):v,"%JSON%":typeof JSON=="object"?JSON:v,"%Map%":typeof Map>"u"?v:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ce||!P?v:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?v:Promise,"%Proxy%":typeof Proxy>"u"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?v:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ce||!P?v:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ce&&P?P(""[Symbol.iterator]()):v,"%Symbol%":ce?Symbol:v,"%SyntaxError%":se,"%ThrowTypeError%":Eo,"%TypedArray%":Oo,"%TypeError%":ae,"%Uint8Array%":typeof Uint8Array>"u"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?v:WeakMap,"%WeakRef%":typeof WeakRef>"u"?v:WeakRef,"%WeakSet%":typeof WeakSet>"u"?v:WeakSet};if(P)try{null.error}catch(t){var Ao=P(P(t));X["%Error.prototype%"]=Ao}var Io=function t(e){var r;if(e==="%AsyncFunction%")r=St("async function () {}");else if(e==="%GeneratorFunction%")r=St("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=St("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return X[e]=r,r},Ir={"%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"]},Re=gt,$e=To,_o=Re.call(Function.call,Array.prototype.concat),xo=Re.call(Function.apply,Array.prototype.splice),_r=Re.call(Function.call,String.prototype.replace),we=Re.call(Function.call,String.prototype.slice),Do=Re.call(Function.call,RegExp.prototype.exec),Lo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ko=/\\(\\)?/g,Mo=function(e){var r=we(e,0,1),n=we(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 i=[];return _r(e,Lo,function(o,s,a,l){i[i.length]=a?_r(l,ko,"$1"):s||o}),i},Fo=function(e,r){var n=e,i;if($e(Ir,n)&&(i=Ir[n],n="%"+i[0]+"%"),$e(X,n)){var o=X[n];if(o===le&&(o=Io(n)),typeof o>"u"&&!r)throw new ae("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new se("intrinsic "+e+" does not exist!")},Ct=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(Do(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Mo(e),i=n.length>0?n[0]:"",o=Fo("%"+i+"%",r),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],xo(n,_o([0,1],c)));for(var u=1,f=!0;u<n.length;u+=1){var p=n[u],m=we(p,0,1),h=we(p,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new se("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),i+="."+p,s="%"+i+"%",$e(X,s))a=X[s];else if(a!=null){if(!(p in a)){if(!r)throw new ae("base intrinsic for "+e+" exists, but the property is not available.");return}if(Y&&u+1>=n.length){var y=Y(a,p);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[p]}else f=$e(a,p),a=a[p];f&&!l&&(X[s]=a)}}return a},xr={exports:{}};(function(t){var e=gt,r=Ct,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var p=o(e,i,arguments);if(s&&a){var m=s(p,"length");m.configurable&&a(p,"length",{value:1+l(0,f.length-(arguments.length-1))})}return p};var c=function(){return o(e,n,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(xr);var No=xr.exports,Dr=Ct,Lr=No,Uo=Lr(Dr("String.prototype.indexOf")),Bo=function(e,r){var n=Dr(e,!!r);return typeof n=="function"&&Uo(e,".prototype.")>-1?Lr(n):n};const jo=uo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var bt=typeof Map=="function"&&Map.prototype,Rt=Object.getOwnPropertyDescriptor&&bt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,He=bt&&Rt&&typeof Rt.get=="function"?Rt.get:null,kr=bt&&Map.prototype.forEach,Tt=typeof Set=="function"&&Set.prototype,Et=Object.getOwnPropertyDescriptor&&Tt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ge=Tt&&Et&&typeof Et.get=="function"?Et.get:null,Mr=Tt&&Set.prototype.forEach,$o=typeof WeakMap=="function"&&WeakMap.prototype,Te=$o?WeakMap.prototype.has:null,wo=typeof WeakSet=="function"&&WeakSet.prototype,Ee=wo?WeakSet.prototype.has:null,Ho=typeof WeakRef=="function"&&WeakRef.prototype,Fr=Ho?WeakRef.prototype.deref:null,Go=Boolean.prototype.valueOf,zo=Object.prototype.toString,Vo=Function.prototype.toString,Wo=String.prototype.match,Pt=String.prototype.slice,W=String.prototype.replace,Jo=String.prototype.toUpperCase,Nr=String.prototype.toLowerCase,Ur=RegExp.prototype.test,Br=Array.prototype.concat,B=Array.prototype.join,qo=Array.prototype.slice,jr=Math.floor,Ot=typeof BigInt=="function"?BigInt.prototype.valueOf:null,At=Object.getOwnPropertySymbols,It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ue=typeof Symbol=="function"&&typeof Symbol.iterator=="object",I=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ue||"symbol")?Symbol.toStringTag:null,$r=Object.prototype.propertyIsEnumerable,wr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Hr(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ur.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-jr(-t):jr(t);if(n!==t){var i=String(n),o=Pt.call(e,i.length+1);return W.call(i,r,"$&_")+"."+W.call(W.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return W.call(e,r,"$&_")}var _t=jo,Gr=_t.custom,zr=Jr(Gr)?Gr:null,Ko=function t(e,r,n,i){var o=r||{};if(J(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(J(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=J(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(J(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(J(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 Kr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Hr(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?Hr(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return xt(e)?"[Array]":"[Object]";var f=ds(o,n);if(typeof i>"u")i=[];else if(qr(i,e)>=0)return"[Circular]";function p(G,ye,rt){if(ye&&(i=qo.call(i),i.push(ye)),rt){var ge={depth:o.depth};return J(o,"quoteStyle")&&(ge.quoteStyle=o.quoteStyle),t(G,ge,n+1,i)}return t(G,o,n+1,i)}if(typeof e=="function"&&!Wr(e)){var m=is(e),h=ze(e,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+B.call(h,", ")+" }":"")}if(Jr(e)){var y=ue?W.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):It.call(e);return typeof e=="object"&&!ue?Pe(y):y}if(us(e)){for(var E="<"+Nr.call(String(e.nodeName)),S=e.attributes||[],x=0;x<S.length;x++)E+=" "+S[x].name+"="+Vr(Qo(S[x].value),"double",o);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Nr.call(String(e.nodeName))+">",E}if(xt(e)){if(e.length===0)return"[]";var k=ze(e,p);return f&&!ps(k)?"["+Lt(k,f)+"]":"[ "+B.call(k,", ")+" ]"}if(Xo(e)){var K=ze(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!$r.call(e,"cause")?"{ ["+String(e)+"] "+B.call(Br.call("[cause]: "+p(e.cause),K),", ")+" }":K.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+B.call(K,", ")+" }"}if(typeof e=="object"&&s){if(zr&&typeof e[zr]=="function"&&_t)return _t(e,{depth:u-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(os(e)){var Ae=[];return kr&&kr.call(e,function(G,ye){Ae.push(p(ye,e,!0)+" => "+p(G,e))}),Qr("Map",He.call(e),Ae,f)}if(cs(e)){var tt=[];return Mr&&Mr.call(e,function(G){tt.push(p(G,e))}),Qr("Set",Ge.call(e),tt,f)}if(ss(e))return Dt("WeakMap");if(ls(e))return Dt("WeakSet");if(as(e))return Dt("WeakRef");if(es(e))return Pe(p(Number(e)));if(rs(e))return Pe(p(Ot.call(e)));if(ts(e))return Pe(Go.call(e));if(Zo(e))return Pe(p(String(e)));if(!Yo(e)&&!Wr(e)){var ne=ze(e,p),Q=wr?wr(e)===Object.prototype:e instanceof Object||e.constructor===Object,he=e instanceof Object?"":"null prototype",me=!Q&&I&&Object(e)===e&&I in e?Pt.call(q(e),8,-1):he?"Object":"",Ie=Q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",F=Ie+(me||he?"["+B.call(Br.call([],me||[],he||[]),": ")+"] ":"");return ne.length===0?F+"{}":f?F+"{"+Lt(ne,f)+"}":F+"{ "+B.call(ne,", ")+" }"}return String(e)};function Vr(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qo(t){return W.call(String(t),/"/g,""")}function xt(t){return q(t)==="[object Array]"&&(!I||!(typeof t=="object"&&I in t))}function Yo(t){return q(t)==="[object Date]"&&(!I||!(typeof t=="object"&&I in t))}function Wr(t){return q(t)==="[object RegExp]"&&(!I||!(typeof t=="object"&&I in t))}function Xo(t){return q(t)==="[object Error]"&&(!I||!(typeof t=="object"&&I in t))}function Zo(t){return q(t)==="[object String]"&&(!I||!(typeof t=="object"&&I in t))}function es(t){return q(t)==="[object Number]"&&(!I||!(typeof t=="object"&&I in t))}function ts(t){return q(t)==="[object Boolean]"&&(!I||!(typeof t=="object"&&I in t))}function Jr(t){if(ue)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!It)return!1;try{return It.call(t),!0}catch{}return!1}function rs(t){if(!t||typeof t!="object"||!Ot)return!1;try{return Ot.call(t),!0}catch{}return!1}var ns=Object.prototype.hasOwnProperty||function(t){return t in this};function J(t,e){return ns.call(t,e)}function q(t){return zo.call(t)}function is(t){if(t.name)return t.name;var e=Wo.call(Vo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function qr(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 os(t){if(!He||!t||typeof t!="object")return!1;try{He.call(t);try{Ge.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function ss(t){if(!Te||!t||typeof t!="object")return!1;try{Te.call(t,Te);try{Ee.call(t,Ee)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function as(t){if(!Fr||!t||typeof t!="object")return!1;try{return Fr.call(t),!0}catch{}return!1}function cs(t){if(!Ge||!t||typeof t!="object")return!1;try{Ge.call(t);try{He.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function ls(t){if(!Ee||!t||typeof t!="object")return!1;try{Ee.call(t,Ee);try{Te.call(t,Te)}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 Kr(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Kr(Pt.call(t,0,e.maxStringLength),e)+n}var i=W.call(W.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fs);return Vr(i,"single",e)}function fs(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":"")+Jo.call(e.toString(16))}function Pe(t){return"Object("+t+")"}function Dt(t){return t+" { ? }"}function Qr(t,e,r,n){var i=n?Lt(r,n):B.call(r,", ");return t+" ("+e+") {"+i+"}"}function ps(t){for(var e=0;e<t.length;e++)if(qr(t[e],`
|
|
4
|
-
`)>=0)return!1;return!0}function
|
|
5
|
-
`+e.prev+e.base;return r+
|
|
6
|
-
`+e.prev}function ze(t,e){var r=xt(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=J(t,i)?e(t[i],t):""}var o=typeof At=="function"?At(t):[],s;if(ue){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)J(t,l)&&(r&&String(Number(l))===l&&l<t.length||ue&&s["$"+l]instanceof Symbol||(Ur.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof At=="function")for(var c=0;c<o.length;c++)$r.call(t,o[c])&&n.push("["+e(o[c])+"]: "+e(t[o[c]],t));return n}var kt=Ct,fe=Bo,hs=Ko,ms=kt("%TypeError%"),Ve=kt("%WeakMap%",!0),We=kt("%Map%",!0),ys=fe("WeakMap.prototype.get",!0),gs=fe("WeakMap.prototype.set",!0),Ss=fe("WeakMap.prototype.has",!0),vs=fe("Map.prototype.get",!0),Cs=fe("Map.prototype.set",!0),bs=fe("Map.prototype.has",!0),Mt=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},Rs=function(t,e){var r=Mt(t,e);return r&&r.value},Ts=function(t,e,r){var n=Mt(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Es=function(t,e){return!!Mt(t,e)},Ps=function(){var e,r,n,i={assert:function(o){if(!i.has(o))throw new ms("Side channel does not contain "+hs(o))},get:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return ys(e,o)}else if(We){if(r)return vs(r,o)}else if(n)return Rs(n,o)},has:function(o){if(Ve&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Ss(e,o)}else if(We){if(r)return bs(r,o)}else if(n)return Es(n,o);return!1},set:function(o,s){Ve&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ve),gs(e,o,s)):We?(r||(r=new We),Cs(r,o,s)):(n||(n={key:{},next:null}),Ts(n,o,s))}};return i},Os=String.prototype.replace,As=/%20/g,Ft={RFC1738:"RFC1738",RFC3986:"RFC3986"},Nt={default:Ft.RFC3986,formatters:{RFC1738:function(t){return Os.call(t,As,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ft.RFC1738,RFC3986:Ft.RFC3986},Is=Nt,Ut=Object.prototype.hasOwnProperty,Z=Array.isArray,j=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),_s=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Z(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);r.obj[r.prop]=i}}},Yr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},xs=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Z(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Ut.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return Z(e)&&!Z(r)&&(i=Yr(e,n)),Z(e)&&Z(r)?(r.forEach(function(o,s){if(Ut.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var a=r[s];return Ut.call(o,s)?o[s]=t(o[s],a,n):o[s]=a,o},i)},Ds=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Ls=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}},ks=function(e,r,n,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)),n==="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===Is.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+j[c];continue}if(c<2048){a=a+(j[192|c>>6]+j[128|c&63]);continue}if(c<55296||c>=57344){a=a+(j[224|c>>12]+j[128|c>>6&63]+j[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=j[240|c>>18]+j[128|c>>12&63]+j[128|c>>6&63]+j[128|c&63]}return a},Ms=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[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&&n.indexOf(u)===-1&&(r.push({obj:s,prop:c}),n.push(u))}return _s(r),e},Fs=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ns=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Us=function(e,r){return[].concat(e,r)},Bs=function(e,r){if(Z(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},Xr={arrayToObject:Yr,assign:Ds,combine:Us,compact:Ms,decode:Ls,encode:ks,isBuffer:Ns,isRegExp:Fs,maybeMap:Bs,merge:xs},Zr=Ps,Je=Xr,Oe=Nt,js=Object.prototype.hasOwnProperty,en={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},H=Array.isArray,$s=Array.prototype.push,tn=function(t,e){$s.apply(t,H(e)?e:[e])},ws=Date.prototype.toISOString,rn=Oe.default,_={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Je.encode,encodeValuesOnly:!1,format:rn,formatter:Oe.formatters[rn],indices:!1,serializeDate:function(e){return ws.call(e)},skipNulls:!1,strictNullHandling:!1},Hs=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Bt={},Gs=function t(e,r,n,i,o,s,a,l,c,u,f,p,m,h,y,E){for(var S=e,x=E,k=0,K=!1;(x=x.get(Bt))!==void 0&&!K;){var Ae=x.get(e);if(k+=1,typeof Ae<"u"){if(Ae===k)throw new RangeError("Cyclic object value");K=!0}typeof x.get(Bt)>"u"&&(k=0)}if(typeof l=="function"?S=l(r,S):S instanceof Date?S=f(S):n==="comma"&&H(S)&&(S=Je.maybeMap(S,function(ge){return ge instanceof Date?f(ge):ge})),S===null){if(o)return a&&!h?a(r,_.encoder,y,"key",p):r;S=""}if(Hs(S)||Je.isBuffer(S)){if(a){var tt=h?r:a(r,_.encoder,y,"key",p);return[m(tt)+"="+m(a(S,_.encoder,y,"value",p))]}return[m(r)+"="+m(String(S))]}var ne=[];if(typeof S>"u")return ne;var Q;if(n==="comma"&&H(S))h&&a&&(S=Je.maybeMap(S,a)),Q=[{value:S.length>0?S.join(",")||null:void 0}];else if(H(l))Q=l;else{var he=Object.keys(S);Q=c?he.sort(c):he}for(var me=i&&H(S)&&S.length===1?r+"[]":r,Ie=0;Ie<Q.length;++Ie){var F=Q[Ie],G=typeof F=="object"&&typeof F.value<"u"?F.value:S[F];if(!(s&&G===null)){var ye=H(S)?typeof n=="function"?n(me,F):me:me+(u?"."+F:"["+F+"]");E.set(e,k);var rt=Zr();rt.set(Bt,E),tn(ne,t(G,ye,n,i,o,s,n==="comma"&&h&&H(S)?null:a,l,c,u,f,p,m,h,y,rt))}}return ne},zs=function(e){if(!e)return _;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||_.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=Oe.default;if(typeof e.format<"u"){if(!js.call(Oe.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Oe.formatters[n],o=_.filter;return(typeof e.filter=="function"||H(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_.addQueryPrefix,allowDots:typeof e.allowDots>"u"?_.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_.charsetSentinel,delimiter:typeof e.delimiter>"u"?_.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_.encode,encoder:typeof e.encoder=="function"?e.encoder:_.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_.strictNullHandling}},Vs=function(t,e){var r=t,n=zs(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):H(n.filter)&&(o=n.filter,i=o);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in en?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=en[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(r)),n.sort&&i.sort(n.sort);for(var u=Zr(),f=0;f<i.length;++f){var p=i[f];n.skipNulls&&r[p]===null||tn(s,Gs(r[p],p,l,c,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,u))}var m=s.join(n.delimiter),h=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),m.length>0?h+m:""},pe=Xr,jt=Object.prototype.hasOwnProperty,Ws=Array.isArray,O={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:pe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Js=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},nn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},qs="utf8=%26%2310003%3B",Ks="utf8=%E2%9C%93",Qs=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,o),a=-1,l,c=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===Ks?c="utf-8":s[l]===qs&&(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("]="),p=f===-1?u.indexOf("="):f+1,m,h;p===-1?(m=r.decoder(u,O.decoder,c,"key"),h=r.strictNullHandling?null:""):(m=r.decoder(u.slice(0,p),O.decoder,c,"key"),h=pe.maybeMap(nn(u.slice(p+1),r),function(y){return r.decoder(y,O.decoder,c,"value")})),h&&r.interpretNumericEntities&&c==="iso-8859-1"&&(h=Js(h)),u.indexOf("[]=")>-1&&(h=Ws(h)?[h]:h),jt.call(n,m)?n[m]=pe.combine(n[m],h):n[m]=h}return n},Ys=function(t,e,r,n){for(var i=n?e:nn(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!r.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},Xs=function(e,r,n,i){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!n.plainObjects&&jt.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var f=0;n.depth>0&&(l=a.exec(o))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&jt.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),Ys(u,r,n,i)}},Zs=function(e){if(!e)return O;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"?O.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?O.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:O.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:O.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:O.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:O.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:O.comma,decoder:typeof e.decoder=="function"?e.decoder:O.decoder,delimiter:typeof e.delimiter=="string"||pe.isRegExp(e.delimiter)?e.delimiter:O.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:O.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:O.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:O.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:O.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:O.strictNullHandling}},ea=function(t,e){var r=Zs(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Qs(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],l=Xs(a,n[a],r,typeof t=="string");i=pe.merge(i,l,r)}return r.allowSparse===!0?i:pe.compact(i)},ta=Vs,ra=ea,na=Nt,ia={formats:na,parse:ra,stringify:ta};const oa=Er(ia);class on{constructor(e){g(this,"axiosInstance");this.axiosInstance=lo.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((r,n)=>{this.axiosInstance.request(e).then(i=>r(i)).catch(i=>n(i))})}Get(e,r,n){return new Promise((i,o)=>{r&&(n?n.params=r:n={params:r}),n&&(n.paramsSerializer={serialize:(s,a)=>oa.stringify(s,{indices:!1})}),this.axiosInstance.get(e,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Post(e,r,n){return new Promise((i,o)=>{this.axiosInstance.post(e,r,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Put(e,r,n){return new Promise((i,o)=>{this.axiosInstance.put(e,r,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Delete(e,r,n){return new Promise((i,o)=>{r&&(n?n.data=r:n={data:r}),this.axiosInstance.delete(e,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}}class sa{onAddLocalStream(e){console.debug("onAddLocalStream:",e)}onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}onStartSuccess(e){console.debug("onStartSuccess:",e)}}var b=(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))(b||{}),ee=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(ee||{});let sn=!0,an=!0;function qe(t,e,r){const n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function te(t,e,r){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const l=c=>{const u=r(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=n.removeEventListener;n.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(n,"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 aa(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(sn=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function ca(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(an=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function cn(){if(typeof window=="object"){if(sn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $t(t,e){an&&console.warn(t+" is deprecated, please use "+e+" instead.")}function la(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:r}=t;if(r.mozGetUserMedia)e.browser="firefox",e.version=qe(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=qe(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=qe(r.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 ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function un(t){return ln(t)?Object.keys(t).reduce(function(e,r){const n=ln(t[r]),i=n?un(t[r]):t[r],o=n&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[r]:i})},{}):t}function wt(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?wt(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(i=>{wt(t,t.get(i),r)})}))}function fn(t,e,r){const n=r?"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===n&&a.trackId===s.id&&wt(t,a,i)})}),i}const pn=cn;function dn(t,e){const r=t&&t.navigator;if(!r.mediaDevices)return;const n=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(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",c)]=u.ideal,l.optional.push(p),p={},p[f("max",c)]=u.ideal,l.optional.push(p)):(p[f("",c)]=u.ideal,l.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(p,c)]=u[p])})}),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,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=n(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")&&!(r.mediaDevices.getSupportedConstraints&&r.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 r.mediaDevices.enumerateDevices().then(p=>{p=p.filter(h=>h.kind==="videoinput");let m=p.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=n(a.video),pn("chrome: "+JSON.stringify(a)),l(a)})}a.video=n(a.video)}return pn("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=>{r.webkitGetUserMedia(u,l,f=>{c&&c(o(f))})})};if(r.getUserMedia=s.bind(r),r.mediaDevices.getUserMedia){const a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.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(n){return e(n).then(i=>{const o=n.video&&n.video.width,s=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:a||3}},o&&(n.video.mandatory.maxWidth=o),s&&(n.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(n)})}}}function hn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function mn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(r){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=r)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.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=[n.stream],this.dispatchEvent(s)}),n.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=[n.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else te(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function yn(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 r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],n.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 n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},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 gn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[n,i,o]=arguments;if(arguments.length>0&&typeof n=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof n!="function"))return e.apply(this,[]);const s=function(l){const c={};return l.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),c[p.id]=p}),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,n])}return new Promise((l,c)=>{e.apply(this,[function(u){l(a(s(u)))},c])}).then(i,o)}}function Sn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const r=t.RTCPeerConnection.prototype.getSenders;r&&(t.RTCPeerConnection.prototype.getSenders=function(){const o=r.apply(this,[]);return o.forEach(s=>s._pc=this),o});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const o=n.apply(this,arguments);return o._pc=this,o}),t.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(s=>fn(s,o.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const r=t.RTCPeerConnection.prototype.getReceivers;r&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=r.apply(this,[]);return i.forEach(o=>o._pc=this),i}),te(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>fn(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 n=arguments[0];let i,o,s;return this.getSenders().forEach(a=>{a.track===n&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===n&&(o?s=!0:o=a),a.track===n)),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 vn(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 r=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();r.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(l)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.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 Cn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return vn(t);const r=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=r.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const n=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}n.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 p=[].slice.call(arguments,1);if(p.length!==1||!p[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(p=>{const m=c._reverseStreams[p],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(p=>{const m=c._reverseStreams[p],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 p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);p[0].apply(null,[y])},h=>{p[1]&&p[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 p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Ht(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(r){const n=t.RTCPeerConnection.prototype[r],i={[r](){return arguments[0]=new(r==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[r]=i[r]})}function bn(t,e){te(t,"negotiationneeded",r=>{const n=r.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return r})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:bn,shimAddTrackRemoveTrack:Cn,shimAddTrackRemoveTrackWithNative:vn,shimGetDisplayMedia:ua,shimGetSendersWithDtmf:yn,shimGetStats:gn,shimGetUserMedia:dn,shimMediaStream:hn,shimOnTrack:mn,shimPeerConnection:Ht,shimSenderReceiverGetStats:Sn},Symbol.toStringTag,{value:"Module"}));function Tn(t,e){const r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(i,o,s){$t("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(i).then(o,s)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const i=function(s,a,l){a in s&&!(l in s)&&(s[l]=s[a],delete s[a])},o=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.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)},n&&n.prototype.getSettings){const s=n.prototype.getSettings;n.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(n&&n.prototype.applyConstraints){const s=n.prototype.applyConstraints;n.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 fa(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function En(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 Gt(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 r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[o,s,a]=arguments;return n.apply(this,[o||null]).then(l=>{if(e.version<53&&!s)try{l.forEach(c=>{c.type=r[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,f)=>{l.set(f,Object.assign({},u,{type:r[u.type]||u.type}))})}return l}).then(s,a)}}function Pn(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 r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=r.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 On(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 n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n}),te(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function An(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){$t("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&r.getTracks().includes(n.track)&&this.removeTrack(n)})})}function In(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function _n(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.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=n,s.sendEncodings=n,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return o})}function xn(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const n=e.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function Dn(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 Ln(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 kn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:_n,shimCreateAnswer:Ln,shimCreateOffer:Dn,shimGetDisplayMedia:fa,shimGetParameters:xn,shimGetUserMedia:Tn,shimOnTrack:En,shimPeerConnection:Gt,shimRTCDataChannel:In,shimReceiverGetStats:On,shimRemoveStream:An,shimSenderGetStats:Pn},Symbol.toStringTag,{value:"Module"}));function Mn(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(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>e.call(this,i,n)),n.getVideoTracks().forEach(i=>e.call(this,i,n))},t.RTCPeerConnection.prototype.addTrack=function(n,...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(r){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(r);if(n===-1)return;this._localStreams.splice(n,1);const i=r.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function Fn(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(r){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=n=>{n.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 n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(o)>=0)return;n._remoteStreams.push(o);const s=new Event("addstream");s.stream=o,n.dispatchEvent(s)})}),e.apply(n,arguments)}}}function Nn(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,r=e.createOffer,n=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],p=r.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p};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 Un(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=i=>n(Bn(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(n,i,o){e.mediaDevices.getUserMedia(n).then(i,o)}).bind(e))}function Bn(t){return t&&t.video!==void 0?Object.assign({},t,{video:un(t.video)}):t}function jn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const o=[];for(let s=0;s<n.iceServers.length;s++){let a=n.iceServers[s];a.urls===void 0&&a.url?($t("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,o.push(a)):o.push(n.iceServers[s])}n.iceServers=o}return new e(n,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function $n(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 wn(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio<"u"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");n.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"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo<"u"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const o=this.getTransceivers().find(s=>s.receiver.track.kind==="video");n.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"):n.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Hn(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const Gn=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Hn,shimCallbacksAPI:Nn,shimConstraints:Bn,shimCreateOfferLegacy:wn,shimGetUserMedia:Un,shimLocalStreamsAPI:Mn,shimRTCIceServerUrls:jn,shimRemoteStreamsAPI:Fn,shimTrackEventTransceiver:$n},Symbol.toStringTag,{value:"Module"}));var zn={exports:{}};(function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(r){return r.trim().split(`
|
|
1
|
+
(function(A,x){typeof exports=="object"&&typeof module<"u"?x(exports):typeof define=="function"&&define.amd?define(["exports"],x):(A=typeof globalThis<"u"?globalThis:A||self,x(A.mediaAV={}))})(this,function(A){"use strict";var Ba=Object.defineProperty;var ja=(A,x,z)=>x in A?Ba(A,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):A[x]=z;var g=(A,x,z)=>(ja(A,typeof x!="symbol"?x+"":x,z),z);function x(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function z(t,e){return function(){return t.apply(e,arguments)}}const{toString:ti}=Object.prototype,{getPrototypeOf:nt}=Object,De=(t=>e=>{const r=ti.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),U=t=>(t=t.toLowerCase(),e=>De(e)===t),Le=t=>e=>typeof e===t,{isArray:oe}=Array,ve=Le("undefined");function ri(t){return t!==null&&!ve(t)&&t.constructor!==null&&!ve(t.constructor)&&F(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Xt=U("ArrayBuffer");function ni(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Xt(t.buffer),e}const ii=Le("string"),F=Le("function"),Zt=Le("number"),xe=t=>t!==null&&typeof t=="object",oi=t=>t===!0||t===!1,Me=t=>{if(De(t)!=="object")return!1;const e=nt(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},si=U("Date"),ai=U("File"),ci=U("Blob"),li=U("FileList"),ui=t=>xe(t)&&F(t.pipe),fi=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||F(t.append)&&((e=De(t))==="formdata"||e==="object"&&F(t.toString)&&t.toString()==="[object FormData]"))},pi=U("URLSearchParams"),di=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ce(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),oe(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let a;for(n=0;n<s;n++)a=o[n],e.call(null,t[a],a,t)}}function er(t,e){e=e.toLowerCase();const r=Object.keys(t);let n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}const tr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),rr=t=>!ve(t)&&t!==tr;function it(){const{caseless:t}=rr(this)&&this||{},e={},r=(n,i)=>{const o=t&&er(e,i)||i;Me(e[o])&&Me(n)?e[o]=it(e[o],n):Me(n)?e[o]=it({},n):oe(n)?e[o]=n.slice():e[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Ce(arguments[n],r);return e}const hi=(t,e,r,{allOwnKeys:n}={})=>(Ce(e,(i,o)=>{r&&F(i)?t[o]=z(i,r):t[o]=i},{allOwnKeys:n}),t),mi=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yi=(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)},gi=(t,e,r,n)=>{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],(!n||n(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=r!==!1&&nt(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Si=(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},vi=t=>{if(!t)return null;if(oe(t))return t;let e=t.length;if(!Zt(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Ci=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&nt(Uint8Array)),bi=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=n.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},Ri=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ti=U("HTMLFormElement"),Ei=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),nr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Pi=U("RegExp"),ir=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};Ce(r,(i,o)=>{e(i,o,t)!==!1&&(n[o]=i)}),Object.defineProperties(t,n)},Oi=t=>{ir(t,(e,r)=>{if(F(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(F(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+"'")})}})},Ai=(t,e)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return oe(t)?n(t):n(String(t).split(e)),r},_i=()=>{},Ii=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ot="abcdefghijklmnopqrstuvwxyz",or="0123456789",sr={DIGIT:or,ALPHA:ot,ALPHA_DIGIT:ot+ot.toUpperCase()+or},Di=(t=16,e=sr.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Li(t){return!!(t&&F(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const xi=t=>{const e=new Array(10),r=(n,i)=>{if(xe(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const o=oe(n)?[]:{};return Ce(n,(s,a)=>{const l=r(s,i+1);!ve(l)&&(o[a]=l)}),e[i]=void 0,o}}return n};return r(t,0)},Mi=U("AsyncFunction"),d={isArray:oe,isArrayBuffer:Xt,isBuffer:ri,isFormData:fi,isArrayBufferView:ni,isString:ii,isNumber:Zt,isBoolean:oi,isObject:xe,isPlainObject:Me,isUndefined:ve,isDate:si,isFile:ai,isBlob:ci,isRegExp:Pi,isFunction:F,isStream:ui,isURLSearchParams:pi,isTypedArray:Ci,isFileList:li,forEach:Ce,merge:it,extend:hi,trim:di,stripBOM:mi,inherits:yi,toFlatObject:gi,kindOf:De,kindOfTest:U,endsWith:Si,toArray:vi,forEachEntry:bi,matchAll:Ri,isHTMLForm:Ti,hasOwnProperty:nr,hasOwnProp:nr,reduceDescriptors:ir,freezeMethods:Oi,toObjectSet:Ai,toCamelCase:Ei,noop:_i,toFiniteNumber:Ii,findKey:er,global:tr,isContextDefined:rr,ALPHABET:sr,generateString:Di,isSpecCompliantForm:Li,toJSONObject:xi,isAsyncFn:Mi,isThenable:t=>t&&(xe(t)||F(t))&&F(t.then)&&F(t.catch)};function b(t,e,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}d.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:d.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ar=b.prototype,cr={};["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=>{cr[t]={value:t}}),Object.defineProperties(b,cr),Object.defineProperty(ar,"isAxiosError",{value:!0}),b.from=(t,e,r,n,i,o)=>{const s=Object.create(ar);return d.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),b.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const ki=null;function st(t){return d.isPlainObject(t)||d.isArray(t)}function lr(t){return d.endsWith(t,"[]")?t.slice(0,-2):t}function ur(t,e,r){return t?t.concat(e).map(function(i,o){return i=lr(i),!r&&o?"["+i+"]":i}).join(r?".":""):e}function Fi(t){return d.isArray(t)&&!t.some(st)}const Ni=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(t,e,r){if(!d.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=d.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,E){return!d.isUndefined(E[y])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(e);if(!d.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(d.isDate(h))return h.toISOString();if(!l&&d.isBlob(h))throw new b("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(h)||d.isTypedArray(h)?l&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,E){let v=h;if(h&&!E&&typeof h=="object"){if(d.endsWith(y,"{}"))y=n?y:y.slice(0,-2),h=JSON.stringify(h);else if(d.isArray(h)&&Fi(h)||(d.isFileList(h)||d.endsWith(y,"[]"))&&(v=d.toArray(h)))return y=lr(y),v.forEach(function(k,Q){!(d.isUndefined(k)||k===null)&&e.append(s===!0?ur([y],Q,o):s===null?y:y+"[]",c(k))}),!1}return st(h)?!0:(e.append(ur(E,y,o),c(h)),!1)}const f=[],p=Object.assign(Ni,{defaultVisitor:u,convertValue:c,isVisitable:st});function m(h,y){if(!d.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),d.forEach(h,function(v,D){(!(d.isUndefined(v)||v===null)&&i.call(e,v,d.isString(D)?D.trim():D,y,p))===!0&&m(v,y?y.concat(D):[D])}),f.pop()}}if(!d.isObject(t))throw new TypeError("data must be an object");return m(t),e}function fr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function at(t,e){this._pairs=[],t&&ke(t,this,e)}const pr=at.prototype;pr.append=function(e,r){this._pairs.push([e,r])},pr.toString=function(e){const r=e?function(n){return e.call(this,n,fr)}:fr;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Ui(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dr(t,e,r){if(!e)return t;const n=r&&r.encode||Ui,i=r&&r.serialize;let o;if(i?o=i(e,r):o=d.isURLSearchParams(e)?e.toString():new at(e,r).toString(n),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Bi{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){d.forEach(this.handlers,function(n){n!==null&&e(n)})}}const hr=Bi,mr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ji=typeof URLSearchParams<"u"?URLSearchParams:at,$i=typeof FormData<"u"?FormData:null,Hi=typeof Blob<"u"?Blob:null,wi=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Gi=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),B={isBrowser:!0,classes:{URLSearchParams:ji,FormData:$i,Blob:Hi},isStandardBrowserEnv:wi,isStandardBrowserWebWorkerEnv:Gi,protocols:["http","https","file","blob","url","data"]};function Vi(t,e){return ke(t,new B.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return B.isNode&&d.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function zi(t){return d.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ji(t){const e={},r=Object.keys(t);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],e[o]=t[o];return e}function yr(t){function e(r,n,i,o){let s=r[o++];const a=Number.isFinite(+s),l=o>=r.length;return s=!s&&d.isArray(i)?i.length:s,l?(d.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!d.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],o)&&d.isArray(i[s])&&(i[s]=Ji(i[s])),!a)}if(d.isFormData(t)&&d.isFunction(t.entries)){const r={};return d.forEachEntry(t,(n,i)=>{e(zi(n),i,r,0)}),r}return null}const Wi={"Content-Type":void 0};function qi(t,e,r){if(d.isString(t))try{return(e||JSON.parse)(t),d.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const Fe={transitional:mr,adapter:["xhr","http"],transformRequest:[function(e,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=d.isObject(e);if(o&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return i&&i?JSON.stringify(yr(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vi(e,this.formSerializer).toString();if((a=d.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ke(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),qi(e)):e}],transformResponse:[function(e){const r=this.transitional||Fe.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&d.isString(e)&&(n&&!this.responseType||i)){const s=!(r&&r.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:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};d.forEach(["delete","get","head"],function(e){Fe.headers[e]={}}),d.forEach(["post","put","patch"],function(e){Fe.headers[e]=d.merge(Wi)});const ct=Fe,Ki=d.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"]),Qi=t=>{const e={};let r,n,i;return t&&t.split(`
|
|
2
|
+
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&Ki[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},gr=Symbol("internals");function be(t){return t&&String(t).trim().toLowerCase()}function Ne(t){return t===!1||t==null?t:d.isArray(t)?t.map(Ne):String(t)}function Yi(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 Xi=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function lt(t,e,r,n,i){if(d.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!d.isString(e)){if(d.isString(n))return e.indexOf(n)!==-1;if(d.isRegExp(n))return n.test(e)}}function Zi(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function eo(t,e){const r=d.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,o,s){return this[n].call(this,e,i,o,s)},configurable:!0})})}class Ue{constructor(e){e&&this.set(e)}set(e,r,n){const i=this;function o(a,l,c){const u=be(l);if(!u)throw new Error("header name must be a non-empty string");const f=d.findKey(i,u);(!f||i[f]===void 0||c===!0||c===void 0&&i[f]!==!1)&&(i[f||l]=Ne(a))}const s=(a,l)=>d.forEach(a,(c,u)=>o(c,u,l));return d.isPlainObject(e)||e instanceof this.constructor?s(e,r):d.isString(e)&&(e=e.trim())&&!Xi(e)?s(Qi(e),r):e!=null&&o(r,e,n),this}get(e,r){if(e=be(e),e){const n=d.findKey(this,e);if(n){const i=this[n];if(!r)return i;if(r===!0)return Yi(i);if(d.isFunction(r))return r.call(this,i,n);if(d.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=be(e),e){const n=d.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||lt(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let i=!1;function o(s){if(s=be(s),s){const a=d.findKey(n,s);a&&(!r||lt(n,n[a],a,r))&&(delete n[a],i=!0)}}return d.isArray(e)?e.forEach(o):o(e),i}clear(e){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!e||lt(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const r=this,n={};return d.forEach(this,(i,o)=>{const s=d.findKey(n,o);if(s){r[s]=Ne(i),delete r[o];return}const a=e?Zi(o):String(o).trim();a!==o&&delete r[o],r[a]=Ne(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return d.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&d.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(i=>n.set(i)),n}static accessor(e){const n=(this[gr]=this[gr]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=be(s);n[a]||(eo(i,s),n[a]=!0)}return d.isArray(e)?e.forEach(o):o(e),this}}Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),d.freezeMethods(Ue.prototype),d.freezeMethods(Ue);const w=Ue;function ut(t,e){const r=this||ct,n=e||r,i=w.from(n.headers);let o=n.data;return d.forEach(t,function(a){o=a.call(r,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function Sr(t){return!!(t&&t.__CANCEL__)}function Re(t,e,r){b.call(this,t??"canceled",b.ERR_CANCELED,e,r),this.name="CanceledError"}d.inherits(Re,b,{__CANCEL__:!0});function to(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new b("Request failed with status code "+r.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const ro=B.isStandardBrowserEnv?function(){return{write:function(r,n,i,o,s,a){const l=[];l.push(r+"="+encodeURIComponent(n)),d.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),d.isString(o)&&l.push("path="+o),d.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){const n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function no(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function io(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function vr(t,e){return t&&!no(e)?io(t,e):e}const oo=B.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(o){let s=o;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=i(window.location.href),function(s){const a=d.isString(s)?i(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function so(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ao(t,e){t=t||10;const r=new Array(t),n=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=n[o];s||(s=c),r[i]=l,n[i]=c;let f=o,p=0;for(;f!==i;)p+=r[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(p*1e3/m):void 0}}function Cr(t,e){let r=0;const n=ao(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-r,l=n(a),c=o<=s;r=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const Be={http:ki,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){let i=t.data;const o=w.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}d.isFormData(i)&&(B.isStandardBrowserEnv||B.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const m=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+h))}const u=vr(t.baseURL,t.url);c.open(t.method.toUpperCase(),dr(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function f(){if(!c)return;const m=w.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:m,config:t,request:c};to(function(v){r(v),l()},function(v){n(v),l()},y),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(n(new b("Request aborted",b.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new b("Network Error",b.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||mr;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),n(new b(h,y.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,t,c)),c=null},B.isStandardBrowserEnv){const m=(t.withCredentials||oo(u))&&t.xsrfCookieName&&ro.read(t.xsrfCookieName);m&&o.set(t.xsrfHeaderName,m)}i===void 0&&o.setContentType(null),"setRequestHeader"in c&&d.forEach(o.toJSON(),function(h,y){c.setRequestHeader(y,h)}),d.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",Cr(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Cr(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=m=>{c&&(n(!m||m.type?new Re(null,t,c):m),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=so(u);if(p&&B.protocols.indexOf(p)===-1){n(new b("Unsupported protocol "+p+":",b.ERR_BAD_REQUEST,t));return}c.send(i||null)})}};d.forEach(Be,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const co={getAdapter:t=>{t=d.isArray(t)?t:[t];const{length:e}=t;let r,n;for(let i=0;i<e&&(r=t[i],!(n=d.isString(r)?Be[r.toLowerCase()]:r));i++);if(!n)throw n===!1?new b(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(d.hasOwnProp(Be,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`);if(!d.isFunction(n))throw new TypeError("adapter is not a function");return n},adapters:Be};function ft(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Re(null,t)}function br(t){return ft(t),t.headers=w.from(t.headers),t.data=ut.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),co.getAdapter(t.adapter||ct.adapter)(t).then(function(n){return ft(t),n.data=ut.call(t,t.transformResponse,n),n.headers=w.from(n.headers),n},function(n){return Sr(n)||(ft(t),n&&n.response&&(n.response.data=ut.call(t,t.transformResponse,n.response),n.response.headers=w.from(n.response.headers))),Promise.reject(n)})}const Rr=t=>t instanceof w?t.toJSON():t;function se(t,e){e=e||{};const r={};function n(c,u,f){return d.isPlainObject(c)&&d.isPlainObject(u)?d.merge.call({caseless:f},c,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function i(c,u,f){if(d.isUndefined(u)){if(!d.isUndefined(c))return n(void 0,c,f)}else return n(c,u,f)}function o(c,u){if(!d.isUndefined(u))return n(void 0,u)}function s(c,u){if(d.isUndefined(u)){if(!d.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,f){if(f in e)return n(c,u);if(f in t)return n(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,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(Rr(c),Rr(u),!0)};return d.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,p=f(t[u],e[u],u);d.isUndefined(p)&&f!==a||(r[u]=p)}),r}const Tr="1.4.0",pt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Er={};pt.transitional=function(e,r,n){function i(o,s){return"[Axios v"+Tr+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(e===!1)throw new b(i(s," has been removed"+(r?" in "+r:"")),b.ERR_DEPRECATED);return r&&!Er[s]&&(Er[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(o,s,a):!0}};function lo(t,e,r){if(typeof t!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let i=n.length;for(;i-- >0;){const o=n[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(r!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const dt={assertOptions:lo,validators:pt},J=dt.validators;class je{constructor(e){this.defaults=e,this.interceptors={request:new hr,response:new hr}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=se(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&dt.assertOptions(n,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),i!=null&&(d.isFunction(i)?r.paramsSerializer={serialize:i}:dt.assertOptions(i,{encode:J.function,serialize:J.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s;s=o&&d.merge(o.common,o[r.method]),s&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),r.headers=w.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!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,p;if(!l){const h=[br.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,u=Promise.resolve(r);f<p;)u=u.then(h[f++],h[f++]);return u}p=a.length;let m=r;for(f=0;f<p;){const h=a[f++],y=a[f++];try{m=h(m)}catch(E){y.call(this,E);break}}try{u=br.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=se(this.defaults,e);const r=vr(e.baseURL,e.url);return dr(r,e.params,e.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(e){je.prototype[e]=function(r,n){return this.request(se(n||{},{method:e,url:r,data:(n||{}).data}))}}),d.forEach(["post","put","patch"],function(e){function r(n){return function(o,s,a){return this.request(se(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}je.prototype[e]=r(),je.prototype[e+"Form"]=r(!0)});const $e=je;class ht{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},e(function(o,s,a){n.reason||(n.reason=new Re(o,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 ht(function(i){e=i}),cancel:e}}}const uo=ht;function fo(t){return function(r){return t.apply(null,r)}}function po(t){return d.isObject(t)&&t.isAxiosError===!0}const mt={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(mt).forEach(([t,e])=>{mt[e]=t});const ho=mt;function Pr(t){const e=new $e(t),r=z($e.prototype.request,e);return d.extend(r,$e.prototype,e,{allOwnKeys:!0}),d.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return Pr(se(t,i))},r}const T=Pr(ct);T.Axios=$e,T.CanceledError=Re,T.CancelToken=uo,T.isCancel=Sr,T.VERSION=Tr,T.toFormData=ke,T.AxiosError=b,T.Cancel=T.CanceledError,T.all=function(e){return Promise.all(e)},T.spread=fo,T.isAxiosError=po,T.mergeConfig=se,T.AxiosHeaders=w,T.formToJSON=t=>yr(d.isHTMLForm(t)?new FormData(t):t),T.HttpStatusCode=ho,T.default=T;const mo=T;function Or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yo(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 i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var go=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 i=42;e[r]=i;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 o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0},Ar=typeof Symbol<"u"&&Symbol,So=go,vo=function(){return typeof Ar!="function"||typeof Symbol!="function"||typeof Ar("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:So()},_r={foo:{}},Co=Object,bo=function(){return{__proto__:_r}.foo===_r.foo&&!({__proto__:null}instanceof Co)},Ro="Function.prototype.bind called on incompatible ",yt=Array.prototype.slice,To=Object.prototype.toString,Eo="[object Function]",Po=function(e){var r=this;if(typeof r!="function"||To.call(r)!==Eo)throw new TypeError(Ro+r);for(var n=yt.call(arguments,1),i,o=function(){if(this instanceof i){var u=r.apply(this,n.concat(yt.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(yt.call(arguments)))},s=Math.max(0,r.length-n.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,i.prototype=new c,c.prototype=null}return i},Oo=Po,gt=Function.prototype.bind||Oo,Ao=gt,_o=Ao.call(Function.call,Object.prototype.hasOwnProperty),C,ae=SyntaxError,Ir=Function,ce=TypeError,St=function(t){try{return Ir('"use strict"; return ('+t+").constructor;")()}catch{}},X=Object.getOwnPropertyDescriptor;if(X)try{X({},"")}catch{X=null}var vt=function(){throw new ce},Io=X?function(){try{return arguments.callee,vt}catch{try{return X(arguments,"callee").get}catch{return vt}}}():vt,le=vo(),Do=bo(),P=Object.getPrototypeOf||(Do?function(t){return t.__proto__}:null),ue={},Lo=typeof Uint8Array>"u"||!P?C:P(Uint8Array),Z={"%AggregateError%":typeof AggregateError>"u"?C:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?C:ArrayBuffer,"%ArrayIteratorPrototype%":le&&P?P([][Symbol.iterator]()):C,"%AsyncFromSyncIteratorPrototype%":C,"%AsyncFunction%":ue,"%AsyncGenerator%":ue,"%AsyncGeneratorFunction%":ue,"%AsyncIteratorPrototype%":ue,"%Atomics%":typeof Atomics>"u"?C:Atomics,"%BigInt%":typeof BigInt>"u"?C:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?C:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?C:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?C:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?C:Float32Array,"%Float64Array%":typeof Float64Array>"u"?C:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?C:FinalizationRegistry,"%Function%":Ir,"%GeneratorFunction%":ue,"%Int8Array%":typeof Int8Array>"u"?C:Int8Array,"%Int16Array%":typeof Int16Array>"u"?C:Int16Array,"%Int32Array%":typeof Int32Array>"u"?C:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":le&&P?P(P([][Symbol.iterator]())):C,"%JSON%":typeof JSON=="object"?JSON:C,"%Map%":typeof Map>"u"?C:Map,"%MapIteratorPrototype%":typeof Map>"u"||!le||!P?C:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?C:Promise,"%Proxy%":typeof Proxy>"u"?C:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?C:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?C:Set,"%SetIteratorPrototype%":typeof Set>"u"||!le||!P?C:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?C:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":le&&P?P(""[Symbol.iterator]()):C,"%Symbol%":le?Symbol:C,"%SyntaxError%":ae,"%ThrowTypeError%":Io,"%TypedArray%":Lo,"%TypeError%":ce,"%Uint8Array%":typeof Uint8Array>"u"?C:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?C:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?C:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?C:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?C:WeakMap,"%WeakRef%":typeof WeakRef>"u"?C:WeakRef,"%WeakSet%":typeof WeakSet>"u"?C:WeakSet};if(P)try{null.error}catch(t){var xo=P(P(t));Z["%Error.prototype%"]=xo}var Mo=function t(e){var r;if(e==="%AsyncFunction%")r=St("async function () {}");else if(e==="%GeneratorFunction%")r=St("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=St("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return Z[e]=r,r},Dr={"%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"]},Te=gt,He=_o,ko=Te.call(Function.call,Array.prototype.concat),Fo=Te.call(Function.apply,Array.prototype.splice),Lr=Te.call(Function.call,String.prototype.replace),we=Te.call(Function.call,String.prototype.slice),No=Te.call(Function.call,RegExp.prototype.exec),Uo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bo=/\\(\\)?/g,jo=function(e){var r=we(e,0,1),n=we(e,-1);if(r==="%"&&n!=="%")throw new ae("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ae("invalid intrinsic syntax, expected opening `%`");var i=[];return Lr(e,Uo,function(o,s,a,l){i[i.length]=a?Lr(l,Bo,"$1"):s||o}),i},$o=function(e,r){var n=e,i;if(He(Dr,n)&&(i=Dr[n],n="%"+i[0]+"%"),He(Z,n)){var o=Z[n];if(o===ue&&(o=Mo(n)),typeof o>"u"&&!r)throw new ce("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new ae("intrinsic "+e+" does not exist!")},Ct=function(e,r){if(typeof e!="string"||e.length===0)throw new ce("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ce('"allowMissing" argument must be a boolean');if(No(/^%?[^%]*%?$/,e)===null)throw new ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=jo(e),i=n.length>0?n[0]:"",o=$o("%"+i+"%",r),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],Fo(n,ko([0,1],c)));for(var u=1,f=!0;u<n.length;u+=1){var p=n[u],m=we(p,0,1),h=we(p,-1);if((m==='"'||m==="'"||m==="`"||h==='"'||h==="'"||h==="`")&&m!==h)throw new ae("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),i+="."+p,s="%"+i+"%",He(Z,s))a=Z[s];else if(a!=null){if(!(p in a)){if(!r)throw new ce("base intrinsic for "+e+" exists, but the property is not available.");return}if(X&&u+1>=n.length){var y=X(a,p);f=!!y,f&&"get"in y&&!("originalValue"in y.get)?a=y.get:a=a[p]}else f=He(a,p),a=a[p];f&&!l&&(Z[s]=a)}}return a},xr={exports:{}};(function(t){var e=gt,r=Ct,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(f){var p=o(e,i,arguments);if(s&&a){var m=s(p,"length");m.configurable&&a(p,"length",{value:1+l(0,f.length-(arguments.length-1))})}return p};var c=function(){return o(e,n,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(xr);var Ho=xr.exports,Mr=Ct,kr=Ho,wo=kr(Mr("String.prototype.indexOf")),Go=function(e,r){var n=Mr(e,!!r);return typeof n=="function"&&wo(e,".prototype.")>-1?kr(n):n};const Vo=yo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var bt=typeof Map=="function"&&Map.prototype,Rt=Object.getOwnPropertyDescriptor&&bt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ge=bt&&Rt&&typeof Rt.get=="function"?Rt.get:null,Fr=bt&&Map.prototype.forEach,Tt=typeof Set=="function"&&Set.prototype,Et=Object.getOwnPropertyDescriptor&&Tt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ve=Tt&&Et&&typeof Et.get=="function"?Et.get:null,Nr=Tt&&Set.prototype.forEach,zo=typeof WeakMap=="function"&&WeakMap.prototype,Ee=zo?WeakMap.prototype.has:null,Jo=typeof WeakSet=="function"&&WeakSet.prototype,Pe=Jo?WeakSet.prototype.has:null,Wo=typeof WeakRef=="function"&&WeakRef.prototype,Ur=Wo?WeakRef.prototype.deref:null,qo=Boolean.prototype.valueOf,Ko=Object.prototype.toString,Qo=Function.prototype.toString,Yo=String.prototype.match,Pt=String.prototype.slice,W=String.prototype.replace,Xo=String.prototype.toUpperCase,Br=String.prototype.toLowerCase,jr=RegExp.prototype.test,$r=Array.prototype.concat,j=Array.prototype.join,Zo=Array.prototype.slice,Hr=Math.floor,Ot=typeof BigInt=="function"?BigInt.prototype.valueOf:null,At=Object.getOwnPropertySymbols,_t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",_=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fe||"symbol")?Symbol.toStringTag:null,wr=Object.prototype.propertyIsEnumerable,Gr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Vr(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||jr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Hr(-t):Hr(t);if(n!==t){var i=String(n),o=Pt.call(e,i.length+1);return W.call(i,r,"$&_")+"."+W.call(W.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return W.call(e,r,"$&_")}var It=Vo,zr=It.custom,Jr=Kr(zr)?zr:null,es=function t(e,r,n,i){var o=r||{};if(q(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(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=q(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(q(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(q(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 Yr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Vr(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?Vr(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Dt(e)?"[Array]":"[Object]";var f=Ss(o,n);if(typeof i>"u")i=[];else if(Qr(i,e)>=0)return"[Circular]";function p(V,ge,rt){if(ge&&(i=Zo.call(i),i.push(ge)),rt){var Se={depth:o.depth};return q(o,"quoteStyle")&&(Se.quoteStyle=o.quoteStyle),t(V,Se,n+1,i)}return t(V,o,n+1,i)}if(typeof e=="function"&&!qr(e)){var m=ls(e),h=ze(e,p);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(h.length>0?" { "+j.call(h,", ")+" }":"")}if(Kr(e)){var y=fe?W.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):_t.call(e);return typeof e=="object"&&!fe?Oe(y):y}if(ms(e)){for(var E="<"+Br.call(String(e.nodeName)),v=e.attributes||[],D=0;D<v.length;D++)E+=" "+v[D].name+"="+Wr(ts(v[D].value),"double",o);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Br.call(String(e.nodeName))+">",E}if(Dt(e)){if(e.length===0)return"[]";var k=ze(e,p);return f&&!gs(k)?"["+xt(k,f)+"]":"[ "+j.call(k,", ")+" ]"}if(ns(e)){var Q=ze(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!wr.call(e,"cause")?"{ ["+String(e)+"] "+j.call($r.call("[cause]: "+p(e.cause),Q),", ")+" }":Q.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(Q,", ")+" }"}if(typeof e=="object"&&s){if(Jr&&typeof e[Jr]=="function"&&It)return It(e,{depth:u-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(us(e)){var _e=[];return Fr&&Fr.call(e,function(V,ge){_e.push(p(ge,e,!0)+" => "+p(V,e))}),Xr("Map",Ge.call(e),_e,f)}if(ds(e)){var tt=[];return Nr&&Nr.call(e,function(V){tt.push(p(V,e))}),Xr("Set",Ve.call(e),tt,f)}if(fs(e))return Lt("WeakMap");if(hs(e))return Lt("WeakSet");if(ps(e))return Lt("WeakRef");if(os(e))return Oe(p(Number(e)));if(as(e))return Oe(p(Ot.call(e)));if(ss(e))return Oe(qo.call(e));if(is(e))return Oe(p(String(e)));if(!rs(e)&&!qr(e)){var ie=ze(e,p),Y=Gr?Gr(e)===Object.prototype:e instanceof Object||e.constructor===Object,me=e instanceof Object?"":"null prototype",ye=!Y&&_&&Object(e)===e&&_ in e?Pt.call(K(e),8,-1):me?"Object":"",Ie=Y||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",N=Ie+(ye||me?"["+j.call($r.call([],ye||[],me||[]),": ")+"] ":"");return ie.length===0?N+"{}":f?N+"{"+xt(ie,f)+"}":N+"{ "+j.call(ie,", ")+" }"}return String(e)};function Wr(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function ts(t){return W.call(String(t),/"/g,""")}function Dt(t){return K(t)==="[object Array]"&&(!_||!(typeof t=="object"&&_ in t))}function rs(t){return K(t)==="[object Date]"&&(!_||!(typeof t=="object"&&_ in t))}function qr(t){return K(t)==="[object RegExp]"&&(!_||!(typeof t=="object"&&_ in t))}function ns(t){return K(t)==="[object Error]"&&(!_||!(typeof t=="object"&&_ in t))}function is(t){return K(t)==="[object String]"&&(!_||!(typeof t=="object"&&_ in t))}function os(t){return K(t)==="[object Number]"&&(!_||!(typeof t=="object"&&_ in t))}function ss(t){return K(t)==="[object Boolean]"&&(!_||!(typeof t=="object"&&_ in t))}function Kr(t){if(fe)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!_t)return!1;try{return _t.call(t),!0}catch{}return!1}function as(t){if(!t||typeof t!="object"||!Ot)return!1;try{return Ot.call(t),!0}catch{}return!1}var cs=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return cs.call(t,e)}function K(t){return Ko.call(t)}function ls(t){if(t.name)return t.name;var e=Yo.call(Qo.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Qr(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 us(t){if(!Ge||!t||typeof t!="object")return!1;try{Ge.call(t);try{Ve.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function fs(t){if(!Ee||!t||typeof t!="object")return!1;try{Ee.call(t,Ee);try{Pe.call(t,Pe)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function ps(t){if(!Ur||!t||typeof t!="object")return!1;try{return Ur.call(t),!0}catch{}return!1}function ds(t){if(!Ve||!t||typeof t!="object")return!1;try{Ve.call(t);try{Ge.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function hs(t){if(!Pe||!t||typeof t!="object")return!1;try{Pe.call(t,Pe);try{Ee.call(t,Ee)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function ms(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Yr(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Yr(Pt.call(t,0,e.maxStringLength),e)+n}var i=W.call(W.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ys);return Wr(i,"single",e)}function ys(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":"")+Xo.call(e.toString(16))}function Oe(t){return"Object("+t+")"}function Lt(t){return t+" { ? }"}function Xr(t,e,r,n){var i=n?xt(r,n):j.call(r,", ");return t+" ("+e+") {"+i+"}"}function gs(t){for(var e=0;e<t.length;e++)if(Qr(t[e],`
|
|
4
|
+
`)>=0)return!1;return!0}function Ss(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=j.call(Array(t.indent+1)," ");else return null;return{base:r,prev:j.call(Array(e+1),r)}}function xt(t,e){if(t.length===0)return"";var r=`
|
|
5
|
+
`+e.prev+e.base;return r+j.call(t,","+r)+`
|
|
6
|
+
`+e.prev}function ze(t,e){var r=Dt(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=q(t,i)?e(t[i],t):""}var o=typeof At=="function"?At(t):[],s;if(fe){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var l in t)q(t,l)&&(r&&String(Number(l))===l&&l<t.length||fe&&s["$"+l]instanceof Symbol||(jr.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof At=="function")for(var c=0;c<o.length;c++)wr.call(t,o[c])&&n.push("["+e(o[c])+"]: "+e(t[o[c]],t));return n}var Mt=Ct,pe=Go,vs=es,Cs=Mt("%TypeError%"),Je=Mt("%WeakMap%",!0),We=Mt("%Map%",!0),bs=pe("WeakMap.prototype.get",!0),Rs=pe("WeakMap.prototype.set",!0),Ts=pe("WeakMap.prototype.has",!0),Es=pe("Map.prototype.get",!0),Ps=pe("Map.prototype.set",!0),Os=pe("Map.prototype.has",!0),kt=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},As=function(t,e){var r=kt(t,e);return r&&r.value},_s=function(t,e,r){var n=kt(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Is=function(t,e){return!!kt(t,e)},Ds=function(){var e,r,n,i={assert:function(o){if(!i.has(o))throw new Cs("Side channel does not contain "+vs(o))},get:function(o){if(Je&&o&&(typeof o=="object"||typeof o=="function")){if(e)return bs(e,o)}else if(We){if(r)return Es(r,o)}else if(n)return As(n,o)},has:function(o){if(Je&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Ts(e,o)}else if(We){if(r)return Os(r,o)}else if(n)return Is(n,o);return!1},set:function(o,s){Je&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Je),Rs(e,o,s)):We?(r||(r=new We),Ps(r,o,s)):(n||(n={key:{},next:null}),_s(n,o,s))}};return i},Ls=String.prototype.replace,xs=/%20/g,Ft={RFC1738:"RFC1738",RFC3986:"RFC3986"},Nt={default:Ft.RFC3986,formatters:{RFC1738:function(t){return Ls.call(t,xs,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ft.RFC1738,RFC3986:Ft.RFC3986},Ms=Nt,Ut=Object.prototype.hasOwnProperty,ee=Array.isArray,$=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ks=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(ee(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);r.obj[r.prop]=i}}},Zr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Fs=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(ee(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Ut.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return ee(e)&&!ee(r)&&(i=Zr(e,n)),ee(e)&&ee(r)?(r.forEach(function(o,s){if(Ut.call(e,s)){var a=e[s];a&&typeof a=="object"&&o&&typeof o=="object"?e[s]=t(a,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var a=r[s];return Ut.call(o,s)?o[s]=t(o[s],a,n):o[s]=a,o},i)},Ns=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Us=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}},Bs=function(e,r,n,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)),n==="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===Ms.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+$[c];continue}if(c<2048){a=a+($[192|c>>6]+$[128|c&63]);continue}if(c<55296||c>=57344){a=a+($[224|c>>12]+$[128|c>>6&63]+$[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=$[240|c>>18]+$[128|c>>12&63]+$[128|c>>6&63]+$[128|c&63]}return a},js=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[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&&n.indexOf(u)===-1&&(r.push({obj:s,prop:c}),n.push(u))}return ks(r),e},$s=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Hs=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ws=function(e,r){return[].concat(e,r)},Gs=function(e,r){if(ee(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},en={arrayToObject:Zr,assign:Ns,combine:ws,compact:js,decode:Us,encode:Bs,isBuffer:Hs,isRegExp:$s,maybeMap:Gs,merge:Fs},tn=Ds,qe=en,Ae=Nt,Vs=Object.prototype.hasOwnProperty,rn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,zs=Array.prototype.push,nn=function(t,e){zs.apply(t,G(e)?e:[e])},Js=Date.prototype.toISOString,on=Ae.default,I={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:qe.encode,encodeValuesOnly:!1,format:on,formatter:Ae.formatters[on],indices:!1,serializeDate:function(e){return Js.call(e)},skipNulls:!1,strictNullHandling:!1},Ws=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Bt={},qs=function t(e,r,n,i,o,s,a,l,c,u,f,p,m,h,y,E){for(var v=e,D=E,k=0,Q=!1;(D=D.get(Bt))!==void 0&&!Q;){var _e=D.get(e);if(k+=1,typeof _e<"u"){if(_e===k)throw new RangeError("Cyclic object value");Q=!0}typeof D.get(Bt)>"u"&&(k=0)}if(typeof l=="function"?v=l(r,v):v instanceof Date?v=f(v):n==="comma"&&G(v)&&(v=qe.maybeMap(v,function(Se){return Se instanceof Date?f(Se):Se})),v===null){if(o)return a&&!h?a(r,I.encoder,y,"key",p):r;v=""}if(Ws(v)||qe.isBuffer(v)){if(a){var tt=h?r:a(r,I.encoder,y,"key",p);return[m(tt)+"="+m(a(v,I.encoder,y,"value",p))]}return[m(r)+"="+m(String(v))]}var ie=[];if(typeof v>"u")return ie;var Y;if(n==="comma"&&G(v))h&&a&&(v=qe.maybeMap(v,a)),Y=[{value:v.length>0?v.join(",")||null:void 0}];else if(G(l))Y=l;else{var me=Object.keys(v);Y=c?me.sort(c):me}for(var ye=i&&G(v)&&v.length===1?r+"[]":r,Ie=0;Ie<Y.length;++Ie){var N=Y[Ie],V=typeof N=="object"&&typeof N.value<"u"?N.value:v[N];if(!(s&&V===null)){var ge=G(v)?typeof n=="function"?n(ye,N):ye:ye+(u?"."+N:"["+N+"]");E.set(e,k);var rt=tn();rt.set(Bt,E),nn(ie,t(V,ge,n,i,o,s,n==="comma"&&h&&G(v)?null:a,l,c,u,f,p,m,h,y,rt))}}return ie},Ks=function(e){if(!e)return I;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||I.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=Ae.default;if(typeof e.format<"u"){if(!Vs.call(Ae.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ae.formatters[n],o=I.filter;return(typeof e.filter=="function"||G(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:I.addQueryPrefix,allowDots:typeof e.allowDots>"u"?I.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:I.charsetSentinel,delimiter:typeof e.delimiter>"u"?I.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:I.encode,encoder:typeof e.encoder=="function"?e.encoder:I.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:I.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:I.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:I.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:I.strictNullHandling}},Qs=function(t,e){var r=t,n=Ks(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):G(n.filter)&&(o=n.filter,i=o);var s=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in rn?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=rn[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(r)),n.sort&&i.sort(n.sort);for(var u=tn(),f=0;f<i.length;++f){var p=i[f];n.skipNulls&&r[p]===null||nn(s,qs(r[p],p,l,c,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,u))}var m=s.join(n.delimiter),h=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),m.length>0?h+m:""},de=en,jt=Object.prototype.hasOwnProperty,Ys=Array.isArray,O={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},Xs=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},sn=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Zs="utf8=%26%2310003%3B",ea="utf8=%E2%9C%93",ta=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,o),a=-1,l,c=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===ea?c="utf-8":s[l]===Zs&&(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("]="),p=f===-1?u.indexOf("="):f+1,m,h;p===-1?(m=r.decoder(u,O.decoder,c,"key"),h=r.strictNullHandling?null:""):(m=r.decoder(u.slice(0,p),O.decoder,c,"key"),h=de.maybeMap(sn(u.slice(p+1),r),function(y){return r.decoder(y,O.decoder,c,"value")})),h&&r.interpretNumericEntities&&c==="iso-8859-1"&&(h=Xs(h)),u.indexOf("[]=")>-1&&(h=Ys(h)?[h]:h),jt.call(n,m)?n[m]=de.combine(n[m],h):n[m]=h}return n},ra=function(t,e,r,n){for(var i=n?e:sn(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if(a==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!r.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},na=function(e,r,n,i){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!n.plainObjects&&jt.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var f=0;n.depth>0&&(l=a.exec(o))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&jt.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+o.slice(l.index)+"]"),ra(u,r,n,i)}},ia=function(e){if(!e)return O;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"?O.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?O.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:O.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:O.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:O.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:O.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:O.comma,decoder:typeof e.decoder=="function"?e.decoder:O.decoder,delimiter:typeof e.delimiter=="string"||de.isRegExp(e.delimiter)?e.delimiter:O.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:O.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:O.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:O.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:O.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:O.strictNullHandling}},oa=function(t,e){var r=ia(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?ta(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],l=na(a,n[a],r,typeof t=="string");i=de.merge(i,l,r)}return r.allowSparse===!0?i:de.compact(i)},sa=Qs,aa=oa,ca=Nt,la={formats:ca,parse:aa,stringify:sa};const ua=Or(la);class an{constructor(e){g(this,"axiosInstance");this.axiosInstance=mo.create({baseURL:e,timeout:12e4})}Request(e){return new Promise((r,n)=>{this.axiosInstance.request(e).then(i=>r(i)).catch(i=>n(i))})}Get(e,r,n){return new Promise((i,o)=>{r&&(n?n.params=r:n={params:r}),n&&(n.paramsSerializer={serialize:(s,a)=>ua.stringify(s,{indices:!1})}),this.axiosInstance.get(e,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Post(e,r,n){return new Promise((i,o)=>{this.axiosInstance.post(e,r,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Put(e,r,n){return new Promise((i,o)=>{this.axiosInstance.put(e,r,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}Delete(e,r,n){return new Promise((i,o)=>{r&&(n?n.data=r:n={data:r}),this.axiosInstance.delete(e,n??{}).then(({data:s})=>i(s)).catch(s=>o(s))})}}class fa{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)}}var S=(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))(S||{}),te=(t=>(t.FRONT_FACING="user",t.BACK_FACING="environment",t))(te||{});let cn=!0,ln=!0;function Ke(t,e,r){const n=t.match(e);return n&&n.length>=r&&parseInt(n[r],10)}function re(t,e,r){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const l=c=>{const u=r(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=n.removeEventListener;n.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(n,"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 pa(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 da(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(ln=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function un(){if(typeof window=="object"){if(cn)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function $t(t,e){ln&&console.warn(t+" is deprecated, please use "+e+" instead.")}function ha(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:r}=t;if(r.mozGetUserMedia)e.browser="firefox",e.version=Ke(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=Ke(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&r.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=Ke(r.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 fn(t){return Object.prototype.toString.call(t)==="[object Object]"}function pn(t){return fn(t)?Object.keys(t).reduce(function(e,r){const n=fn(t[r]),i=n?pn(t[r]):t[r],o=n&&!Object.keys(i).length;return i===void 0||o?e:Object.assign(e,{[r]:i})},{}):t}function Ht(t,e,r){!e||r.has(e.id)||(r.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?Ht(t,t.get(e[n]),r):n.endsWith("Ids")&&e[n].forEach(i=>{Ht(t,t.get(i),r)})}))}function dn(t,e,r){const n=r?"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===n&&a.trackId===s.id&&Ht(t,a,i)})}),i}const hn=un;function mn(t,e){const r=t&&t.navigator;if(!r.mediaDevices)return;const n=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(p,m){return p?p+m.charAt(0).toUpperCase()+m.slice(1):m==="deviceId"?"sourceId":m};if(u.ideal!==void 0){l.optional=l.optional||[];let p={};typeof u.ideal=="number"?(p[f("min",c)]=u.ideal,l.optional.push(p),p={},p[f("max",c)]=u.ideal,l.optional.push(p)):(p[f("",c)]=u.ideal,l.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[f("",c)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[f(p,c)]=u[p])})}),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,p){f in u&&!(p in u)&&(u[p]=u[f],delete u[f])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=n(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")&&!(r.mediaDevices.getSupportedConstraints&&r.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 r.mediaDevices.enumerateDevices().then(p=>{p=p.filter(h=>h.kind==="videoinput");let m=p.find(h=>f.some(y=>h.label.toLowerCase().includes(y)));return!m&&p.length&&f.includes("back")&&(m=p[p.length-1]),m&&(a.video.deviceId=c.exact?{exact:m.deviceId}:{ideal:m.deviceId}),a.video=n(a.video),hn("chrome: "+JSON.stringify(a)),l(a)})}a.video=n(a.video)}return hn("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=>{r.webkitGetUserMedia(u,l,f=>{c&&c(o(f))})})};if(r.getUserMedia=s.bind(r),r.mediaDevices.getUserMedia){const a=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.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 ma(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(n){return e(n).then(i=>{const o=n.video&&n.video.width,s=n.video&&n.video.height,a=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:a||3}},o&&(n.video.mandatory.maxWidth=o),s&&(n.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(n)})}}}function yn(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function gn(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(r){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=r)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.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=[n.stream],this.dispatchEvent(s)}),n.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=[n.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else re(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function Sn(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 r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){this._senders=this._senders||[],n.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 n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},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 vn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[n,i,o]=arguments;if(arguments.length>0&&typeof n=="function")return e.apply(this,arguments);if(e.length===0&&(arguments.length===0||typeof n!="function"))return e.apply(this,[]);const s=function(l){const c={};return l.result().forEach(f=>{const p={id:f.id,timestamp:f.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[f.type]||f.type};f.names().forEach(m=>{p[m]=f.stat(m)}),c[p.id]=p}),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,n])}return new Promise((l,c)=>{e.apply(this,[function(u){l(a(s(u)))},c])}).then(i,o)}}function Cn(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const r=t.RTCPeerConnection.prototype.getSenders;r&&(t.RTCPeerConnection.prototype.getSenders=function(){const o=r.apply(this,[]);return o.forEach(s=>s._pc=this),o});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const o=n.apply(this,arguments);return o._pc=this,o}),t.RTCRtpSender.prototype.getStats=function(){const o=this;return this._pc.getStats().then(s=>dn(s,o.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const r=t.RTCPeerConnection.prototype.getReceivers;r&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=r.apply(this,[]);return i.forEach(o=>o._pc=this),i}),re(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>dn(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 n=arguments[0];let i,o,s;return this.getSenders().forEach(a=>{a.track===n&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===n&&(o?s=!0:o=a),a.track===n)),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 bn(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 r=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();r.apply(this,arguments);const l=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(l)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.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 Rn(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return bn(t);const r=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=r.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(f=>this._reverseStreams[f.id])};const n=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}n.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 p=[].slice.call(arguments,1);if(p.length!==1||!p[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(p=>{const m=c._reverseStreams[p],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(p=>{const m=c._reverseStreams[p],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 p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[h=>{const y=o(this,h);p[0].apply(null,[y])},h=>{p[1]&&p[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 p;Object.keys(this._streams).forEach(m=>{this._streams[m].getTracks().find(y=>u.track===y)&&(p=this._streams[m])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function wt(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(r){const n=t.RTCPeerConnection.prototype[r],i={[r](){return arguments[0]=new(r==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[r]=i[r]})}function Tn(t,e){re(t,"negotiationneeded",r=>{const n=r.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return r})}const En=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Tn,shimAddTrackRemoveTrack:Rn,shimAddTrackRemoveTrackWithNative:bn,shimGetDisplayMedia:ma,shimGetSendersWithDtmf:Sn,shimGetStats:vn,shimGetUserMedia:mn,shimMediaStream:yn,shimOnTrack:gn,shimPeerConnection:wt,shimSenderReceiverGetStats:Cn},Symbol.toStringTag,{value:"Module"}));function Pn(t,e){const r=t&&t.navigator,n=t&&t.MediaStreamTrack;if(r.getUserMedia=function(i,o,s){$t("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(i).then(o,s)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const i=function(s,a,l){a in s&&!(l in s)&&(s[l]=s[a],delete s[a])},o=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.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)},n&&n.prototype.getSettings){const s=n.prototype.getSettings;n.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(n&&n.prototype.applyConstraints){const s=n.prototype.applyConstraints;n.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 ya(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function On(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 Gt(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 r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[o,s,a]=arguments;return n.apply(this,[o||null]).then(l=>{if(e.version<53&&!s)try{l.forEach(c=>{c.type=r[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;l.forEach((u,f)=>{l.set(f,Object.assign({},u,{type:r[u.type]||u.type}))})}return l}).then(s,a)}}function An(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 r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=r.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 _n(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 n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n}),re(t,"track",r=>(r.receiver._pc=r.srcElement,r)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function In(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){$t("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&r.getTracks().includes(n.track)&&this.removeTrack(n)})})}function Dn(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function Ln(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.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=n,s.sendEncodings=n,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return o})}function xn(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const n=e.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function Mn(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 kn(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 Fn=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:Ln,shimCreateAnswer:kn,shimCreateOffer:Mn,shimGetDisplayMedia:ya,shimGetParameters:xn,shimGetUserMedia:Pn,shimOnTrack:On,shimPeerConnection:Gt,shimRTCDataChannel:Dn,shimReceiverGetStats:_n,shimRemoveStream:In,shimSenderGetStats:An},Symbol.toStringTag,{value:"Module"}));function Nn(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(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>e.call(this,i,n)),n.getVideoTracks().forEach(i=>e.call(this,i,n))},t.RTCPeerConnection.prototype.addTrack=function(n,...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(r){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(r);if(n===-1)return;this._localStreams.splice(n,1);const i=r.getTracks();this.getSenders().forEach(o=>{i.includes(o.track)&&this.removeTrack(o)})})}}function Un(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(r){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=n=>{n.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 n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(o=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(o)>=0)return;n._remoteStreams.push(o);const s=new Event("addstream");s.stream=o,n.dispatchEvent(s)})}),e.apply(n,arguments)}}}function Bn(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,r=e.createOffer,n=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],p=r.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p},e.createAnswer=function(c,u){const f=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[f]);return u?(p.then(c,u),Promise.resolve()):p};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 jn(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const r=e.mediaDevices,n=r.getUserMedia.bind(r);e.mediaDevices.getUserMedia=i=>n($n(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(n,i,o){e.mediaDevices.getUserMedia(n).then(i,o)}).bind(e))}function $n(t){return t&&t.video!==void 0?Object.assign({},t,{video:pn(t.video)}):t}function Hn(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const o=[];for(let s=0;s<n.iceServers.length;s++){let a=n.iceServers[s];a.urls===void 0&&a.url?($t("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,o.push(a)):o.push(n.iceServers[s])}n.iceServers=o}return new e(n,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}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 Gn(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio<"u"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");n.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"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo<"u"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const o=this.getTransceivers().find(s=>s.receiver.track.kind==="video");n.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"):n.offerToReceiveVideo===!0&&!o&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Vn(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}const zn=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Vn,shimCallbacksAPI:Bn,shimConstraints:$n,shimCreateOfferLegacy:Gn,shimGetUserMedia:jn,shimLocalStreamsAPI:Nn,shimRTCIceServerUrls:Hn,shimRemoteStreamsAPI:Un,shimTrackEventTransceiver:wn},Symbol.toStringTag,{value:"Module"}));var Jn={exports:{}};(function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(r){return r.trim().split(`
|
|
7
7
|
`).map(n=>n.trim())},e.splitSections=function(r){return r.split(`
|
|
8
8
|
m=`).map((i,o)=>(o>0?"m="+i:i).trim()+`\r
|
|
9
9
|
`)},e.getDescription=function(r){const n=e.splitSections(r);return n&&n[0]},e.getMediaSections=function(r){const n=e.splitSections(r);return n.shift(),n},e.matchPrefix=function(r,n){return e.splitLines(r).filter(i=>i.indexOf(n)===0)},e.parseCandidate=function(r){let n;r.indexOf("a=candidate:")===0?n=r.substring(12).split(" "):n=r.substring(10).split(" ");const i={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let o=8;o<n.length;o+=2)switch(n[o]){case"raddr":i.relatedAddress=n[o+1];break;case"rport":i.relatedPort=parseInt(n[o+1],10);break;case"tcptype":i.tcpType=n[o+1];break;case"ufrag":i.ufrag=n[o+1],i.usernameFragment=n[o+1];break;default:i[n[o]]===void 0&&(i[n[o]]=n[o+1]);break}return i},e.writeCandidate=function(r){const n=[];n.push(r.foundation);const i=r.component;i==="rtp"?n.push(1):i==="rtcp"?n.push(2):n.push(i),n.push(r.protocol.toUpperCase()),n.push(r.priority),n.push(r.address||r.ip),n.push(r.port);const o=r.type;return n.push("typ"),n.push(o),o!=="host"&&r.relatedAddress&&r.relatedPort&&(n.push("raddr"),n.push(r.relatedAddress),n.push("rport"),n.push(r.relatedPort)),r.tcpType&&r.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(r.tcpType)),(r.usernameFragment||r.ufrag)&&(n.push("ufrag"),n.push(r.usernameFragment||r.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(r){return r.substring(14).split(" ")},e.parseRtpMap=function(r){let n=r.substring(9).split(" ");const i={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),i.name=n[0],i.clockRate=parseInt(n[1],10),i.channels=n.length===3?parseInt(n[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(r){let n=r.payloadType;r.preferredPayloadType!==void 0&&(n=r.preferredPayloadType);const i=r.channels||r.numChannels||1;return"a=rtpmap:"+n+" "+r.name+"/"+r.clockRate+(i!==1?"/"+i:"")+`\r
|
|
@@ -34,7 +34,7 @@ a=ice-pwd:`+r.password+`\r
|
|
|
34
34
|
o=`+(i||"thisisadapterortc")+" "+o+" "+s+` IN IP4 127.0.0.1\r
|
|
35
35
|
s=-\r
|
|
36
36
|
t=0 0\r
|
|
37
|
-
`},e.getDirection=function(r,n){const i=e.splitLines(r);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 n?e.getDirection(n):"sendrecv"},e.getKind=function(r){return e.splitLines(r)[0].split(" ")[0].substring(2)},e.isRejected=function(r){return r.split(" ",2)[1]==="0"},e.parseMLine=function(r){const i=e.splitLines(r)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(r){const i=e.matchPrefix(r,"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(r){if(typeof r!="string"||r.length===0)return!1;const n=e.splitLines(r);for(let i=0;i<n.length;i++)if(n[i].length<2||n[i].charAt(1)!=="=")return!1;return!0},t.exports=e})(
|
|
37
|
+
`},e.getDirection=function(r,n){const i=e.splitLines(r);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 n?e.getDirection(n):"sendrecv"},e.getKind=function(r){return e.splitLines(r)[0].split(" ")[0].substring(2)},e.isRejected=function(r){return r.split(" ",2)[1]==="0"},e.parseMLine=function(r){const i=e.splitLines(r)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(r){const i=e.matchPrefix(r,"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(r){if(typeof r!="string"||r.length===0)return!1;const n=e.splitLines(r);for(let i=0;i<n.length;i++)if(n[i].length<2||n[i].charAt(1)!=="=")return!1;return!0},t.exports=e})(Jn);var Wn=Jn.exports;const he=Or(Wn),ga=x({__proto__:null,default:he},[Wn]);function Qe(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&(n=JSON.parse(JSON.stringify(n)),n.candidate=n.candidate.substring(2)),n.candidate&&n.candidate.length){const i=new e(n),o=he.parseCandidate(n.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(n)},t.RTCIceCandidate.prototype=e.prototype,re(t,"icecandidate",r=>(r.candidate&&Object.defineProperty(r,"candidate",{value:new t.RTCIceCandidate(r.candidate),writable:"false"}),r))}function Vt(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||re(t,"icecandidate",e=>{if(e.candidate){const r=he.parseCandidate(e.candidate.candidate);r.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[r.priority>>24])}return e})}function Ye(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 r=function(a){if(!a||!a.sdp)return!1;const l=he.splitSections(a.sdp);return l.shift(),l.some(c=>{const u=he.parseMLine(c);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},n=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=he.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(r(arguments[0])){const l=n(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 p={};Object.defineProperty(p,"maxMessageSize",{get(){return f}}),this._sctp=p}return s.apply(this,arguments)}}function Xe(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(n,i){const o=n.send;n.send=function(){const a=arguments[0],l=a.length||a.size||a.byteLength;if(n.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(n,arguments)}}const r=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const i=r.apply(this,arguments);return e(i,this),i},re(t,"datachannel",n=>(e(n.channel,n.target),n))}function zt(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(r){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),r&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=r)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(r=>{const n=e[r];e[r]=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)),n.apply(this,arguments)}})}function Jt(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const r=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
|
|
38
38
|
a=extmap-allow-mixed`)!==-1){const o=i.sdp.split(`
|
|
39
39
|
`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
|
|
40
|
-
`);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:o}):i.sdp=o}return r.apply(this,arguments)}}function Xe(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const r=t.RTCPeerConnection.prototype.addIceCandidate;!r||r.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():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Ze(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const r=t.RTCPeerConnection.prototype.setLocalDescription;!r||r.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return r.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"?r.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>r.apply(this,[s]))})}const da=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Wt,shimAddIceCandidateNullOrEmpty:Xe,shimConnectionState:Vt,shimMaxMessageSize:Qe,shimParameterlessSetLocalDescription:Ze,shimRTCIceCandidate:Ke,shimRTCIceCandidateRelayProtocol:zt,shimSendThrowTypeError:Ye},Symbol.toStringTag,{value:"Module"}));function ha({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=cn,n=la(t),i={browserDetails:n,commonShim:da,extractVersion:qe,disableLog:aa,disableWarnings:ca,sdp:pa};switch(n.browser){case"chrome":if(!Rn||!Ht||!e.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(n.version===null)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=Rn,Xe(t,n),Ze(t),dn(t,n),hn(t),Ht(t,n),mn(t),Cn(t,n),yn(t),gn(t),Sn(t),bn(t,n),Ke(t),zt(t),Vt(t),Qe(t,n),Ye(t),Wt(t,n);break;case"firefox":if(!kn||!Gt||!e.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=kn,Xe(t,n),Ze(t),Tn(t,n),Gt(t,n),En(t),An(t),Pn(t),On(t),In(t),_n(t),xn(t),Dn(t),Ln(t),Ke(t),Vt(t),Qe(t,n),Ye(t);break;case"safari":if(!Gn||!e.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=Gn,Xe(t,n),Ze(t),jn(t),wn(t),Nn(t),Mn(t),Fn(t),$n(t),Un(t),Hn(t),Ke(t),zt(t),Qe(t,n),Ye(t),Wt(t,n);break;default:r("Unsupported browser!");break}return i}const Wn=ha({window:typeof window>"u"?void 0:window});class Jt{constructor(e){g(this,"peerConnection");g(this,"sessionListener",new sa);g(this,"isCallOut",!1);g(this,"sessionType",b.UNKNOWN);g(this,"localStream");g(this,"remoteStream");g(this,"hasSetRemoteSdp",!1);g(this,"facingMode",ee.FRONT_FACING);g(this,"facingChanging",!1);g(this,"muted",!1);g(this,"openCamera",!1);this.sessionType=e,console.debug(Wn.browserDetails.browser+" "+Wn.browserDetails.version)}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=ee.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{e?this.peerConnection.createOffer().then(n=>{console.debug("webrtc createOffer success"),this.peerConnection.setLocalDescription(n).then(()=>{}).catch(i=>{this.error(i)})}).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(()=>{}).catch(i=>{this.error(i)})}).catch(n=>{this.error(n)})}).catch(n=>{this.error(n)}))},this.peerConnection.onicecandidate=n=>{console.debug(n.candidate),!n.candidate&&this.peerConnection&&this.peerConnection.localDescription&&this.sessionListener.onStartSuccess(this.peerConnection.localDescription)},this.peerConnection.onicegatheringstatechange=()=>{var n;console.debug("webrtc onicegatheringstatechange",(n=this.peerConnection)==null?void 0:n.iceGatheringState)},this.peerConnection.ontrack=n=>{console.debug("webrtc ontrack");for(let i=0;i<n.streams.length;i++)this.remoteStream?n.streams[i].getTracks().forEach(o=>{var s;(s=this.remoteStream)==null||s.addTrack(o)}):this.remoteStream=new MediaStream(n.streams[i]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=n=>{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.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case b.RTSP_PULL:this.addTransceivers();break;case b.VIDEO:case b.AUDIO:case b.AUDIO_PUSH:case b.VIDEO_PUSH:this.gotLocalMedia();break;default:this.error(new Error("session type unknown: "+this.sessionType));break}}setRemoteSdp(e){if(this.peerConnection&&this.isCallOut){if(this.hasSetRemoteSdp)return;this.hasSetRemoteSdp=!0,this.peerConnection.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then(()=>{console.debug("webrtc setRemoteDescription success")}).catch(r=>{this.error(r)})}}addRemoteCandidate(e){this.peerConnection&&e.forEach(r=>{this.peerConnection.addIceCandidate(r).then(()=>{console.debug("webrtc addIceCandidate success")}).catch(n=>console.log(n))})}stop(){console.debug("webrtc stop"),this.peerConnection&&(this.peerConnection.close(),this.peerConnection=void 0),this.localStream&&(this.localStream.getTracks().forEach(e=>{this.localStream.removeTrack(e),e.stop()}),this.localStream=void 0),this.remoteStream=void 0}changeFacing(){return new Promise((e,r)=>{if(this.sessionType!==b.VIDEO&&this.sessionType!==b.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))})}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;switch(this.sessionType){case b.AUDIO:case b.AUDIO_PUSH:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:!1};break;case b.VIDEO:case b.VIDEO_PUSH:e={audio:{echoCancellation:!0,noiseSuppression:!0},video:{height:{exact:720},width:{exact:1280}}};break;default:this.error(new Error("session type unknown."));return}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===b.VIDEO||this.sessionType===b.VIDEO_PUSH)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(r=>{switch(this.sessionType){case b.VIDEO:case b.AUDIO:this.peerConnection.addTrack(r,e);break;case b.AUDIO_PUSH:case b.VIDEO_PUSH:this.peerConnection.addTransceiver(r,{direction:"sendonly",streams:[e]});break}}),this.muted=!1}getMediaFailed(e){if(console.debug("webrtc getMediaFailed failed"),this.sessionType===b.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=b.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===b.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=b.AUDIO_PUSH,this.gotLocalMedia();return}this.error(e)}changeCameraLocalMedia(){return new Promise((e,r)=>{let n;if(this.facingMode===ee.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(i=>{this.changeCameraSuccess(i),e()}).catch(i=>{this.changeCameraFailed(i),r(i)});else{let i=new Error("Browser does not support WebRTC");this.changeCameraFailed(i),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===ee.FRONT_FACING?this.facingMode=ee.BACK_FACING:this.facingMode=ee.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class ma{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class Jn{constructor(e,r){g(this,"url");g(this,"offerSdp");this.url=e,this.offerSdp=r}}const ya="/media-server/video-play/webrtc";class ga{constructor(e,r){g(this,"rtspUrl");g(this,"webrtcSession",new Jt(b.RTSP_PULL));g(this,"sessionListener",new ma);g(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(ya,new Jn(this.rtspUrl,e.sdp??"")).then(r=>{var n,i,o,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",(i=r.data)==null?void 0:i.candidateList),this.webrtcSession.setRemoteSdp(((o=r.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=r.data)==null?void 0:s.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}}var R=(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))(R||{}),$=(t=>(t.VIDEO="video",t.AUDIO="audio",t))($||{}),et=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(et||{}),re=(t=>(t.IN="in",t.OUT="out",t))(re||{}),L=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(L||{});function qn(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Sa(){return"browser-"+va()+Ca(6)}function va(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Ca(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 ba{constructor(e,r,n){g(this,"tel");g(this,"mediaType");g(this,"callMode");this.tel=e,this.callMode=n,this.mediaType=r}}class Ra{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)}}class Ta{constructor(e,r){g(this,"tel","");g(this,"status",R.OFFLINE);g(this,"mediaType",$.AUDIO);g(this,"callMode",et.FULL);g(this,"callDirect",re.OUT);g(this,"called","");g(this,"callId");g(this,"remoteSdp");g(this,"candidate");g(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));g(this,"ringtone",new Audio("sound/ringtone.wav"));g(this,"dtmfAudio",new Audio("sound/dtmf.wav"));g(this,"ws");g(this,"wsConnected",!1);g(this,"closeBySelf",!1);g(this,"webrtcSession");g(this,"sessionListener",new Ra);g(this,"wsUrl");this.tel=r??"",this.wsUrl=e,this.ringBackTone.loop=!0,this.ringtone.loop=!0}setCallSessionListener(e){this.sessionListener=e}init(){this.websocketInit(this.wsUrl)}makeCall(e,r=$.AUDIO,n=et.FULL){var i;try{if(this.status==R.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}if(this.status>R.IDLE){console.debug("Another call is currently in progress"),this.sessionListener.onError(new Error("Another call is currently in progress"));return}if(!qn()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}this.mediaType=r,this.callMode=n,this.called=e,this.callDirect=re.OUT,this.callId=Sa(),this.webrtcCreate($.VIDEO==r?b.VIDEO:b.AUDIO),(i=this.webrtcSession)==null||i.start(!0),this.status=R.TRY}catch(o){this.status=R.IDLE,this.sessionListener.onError(new Error(""+o))}}answer(){var e;if(this.status!=R.RING){console.debug("session is not ring state");return}if(this.callDirect!=re.IN){console.debug("session is call out, not allow answer");return}this.webrtcCreate($.VIDEO==this.mediaType?b.VIDEO:b.AUDIO),(e=this.webrtcSession)==null||e.start(!1,this.remoteSdp)}hangup(){this.status<=R.IDLE||(this.status==R.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!==R.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(i=>e(i)).catch(i=>r(i))})}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))})}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}close(){this.webrtcClose();try{this.ringtone.pause(),this.ringBackTone.pause()}catch(e){console.debug("FullSession.close: ",e)}this.status=R.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=R.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 L.Invite:this.inviteHandler(n);break;case L.ANSWER:this.answerHandler(n);break;case L.RING:this.ringHandler(n);break;case L.HANGUP:this.hangupHandler(n);break;case L.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:L.LOGIN,username:this.tel,userAgent:this.getUserAgent()})}sendLogout(){this.sendTo({type:L.LOGOUT,username:this.tel}),this.status=R.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:L.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=R.TRY}sendRing(){this.sendTo({type:L.RING,callId:this.callId,code:180}),this.status=R.RING}sendAnswer(e){this.sendTo({type:L.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=R.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:L.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(r=>console.debug(r))}sendHangup(e,r=800){this.sendTo({type:L.HANGUP,callId:e,code:r}),e==this.callId&&(this.status=R.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=R.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=R.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!qn()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>R.IDLE){e.callId!=this.callId&&(console.debug("receive invite, but busy."),this.sendHangup(e.callId,486));return}this.callId=e.callId,this.mediaType=e.mediaType??$.AUDIO,this.callMode=e.callMode??et.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 ba(this.called,this.mediaType,this.callMode))}ringHandler(e){var r;!e.callId||e.callId!=this.callId||(e.code==183?((r=this.webrtcSession)==null||r.setRemoteSdp(e.sdp??""),this.ringBackTone.pause()):(this.ringBackTone.currentTime=0,this.ringBackTone.play().then(()=>{}).catch(()=>{})),this.sessionListener.onRing(),this.status=R.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=R.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 Jt(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??"")}}class Ea{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}}const Pa="/media-server/broadcast/webrtc";class Oa{constructor(e,r,n){g(this,"tel");g(this,"mediaType");g(this,"webrtcSession");g(this,"sessionListener",new Ea);g(this,"httpClient");this.tel=e,this.httpClient=r,this.mediaType=n===$.VIDEO?$.VIDEO:$.AUDIO,this.webrtcSession=new Jt(n==$.VIDEO?b.VIDEO_PUSH:b.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(Pa,new Jn(this.tel,e.sdp??"")).then(r=>{var n,i,o;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(((i=r.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((o=r.data)==null?void 0:o.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}}let qt=new on("/"),Kn="/media-server/ws/voip",Kt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Kn);function Aa(t){qt=new on(t)}function Ia(t){return new ga(t,qt)}function _a(t,e){return new Oa(t,qt,e)}function xa(t){Kt=new URL(t),Kt.pathname=Kn}function Da(t){return new Ta(Kt.toString(),t)}A.createBroadcastSession=_a,A.createCallSession=Da,A.createRtspPullSession=Ia,A.videoModuleInit=Aa,A.voipModuleInit=xa,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
40
|
+
`);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:o}):i.sdp=o}return r.apply(this,arguments)}}function Ze(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const r=t.RTCPeerConnection.prototype.addIceCandidate;!r||r.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():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function et(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const r=t.RTCPeerConnection.prototype.setLocalDescription;!r||r.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return r.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"?r.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>r.apply(this,[s]))})}const Sa=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Jt,shimAddIceCandidateNullOrEmpty:Ze,shimConnectionState:zt,shimMaxMessageSize:Ye,shimParameterlessSetLocalDescription:et,shimRTCIceCandidate:Qe,shimRTCIceCandidateRelayProtocol:Vt,shimSendThrowTypeError:Xe},Symbol.toStringTag,{value:"Module"}));function va({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=un,n=ha(t),i={browserDetails:n,commonShim:Sa,extractVersion:Ke,disableLog:pa,disableWarnings:da,sdp:ga};switch(n.browser){case"chrome":if(!En||!wt||!e.shimChrome)return r("Chrome shim is not included in this adapter release."),i;if(n.version===null)return r("Chrome shim can not determine version, not shimming."),i;r("adapter.js shimming chrome."),i.browserShim=En,Ze(t,n),et(t),mn(t,n),yn(t),wt(t,n),gn(t),Rn(t,n),Sn(t),vn(t),Cn(t),Tn(t,n),Qe(t),Vt(t),zt(t),Ye(t,n),Xe(t),Jt(t,n);break;case"firefox":if(!Fn||!Gt||!e.shimFirefox)return r("Firefox shim is not included in this adapter release."),i;r("adapter.js shimming firefox."),i.browserShim=Fn,Ze(t,n),et(t),Pn(t,n),Gt(t,n),On(t),In(t),An(t),_n(t),Dn(t),Ln(t),xn(t),Mn(t),kn(t),Qe(t),zt(t),Ye(t,n),Xe(t);break;case"safari":if(!zn||!e.shimSafari)return r("Safari shim is not included in this adapter release."),i;r("adapter.js shimming safari."),i.browserShim=zn,Ze(t,n),et(t),Hn(t),Gn(t),Bn(t),Nn(t),Un(t),wn(t),jn(t),Vn(t),Qe(t),Vt(t),Ye(t,n),Xe(t),Jt(t,n);break;default:r("Unsupported browser!");break}return i}const qn=va({window:typeof window>"u"?void 0:window});class Wt{constructor(e){g(this,"peerConnection");g(this,"sessionListener",new fa);g(this,"isCallOut",!1);g(this,"sessionType",S.UNKNOWN);g(this,"localStream");g(this,"remoteStream");g(this,"dataChannel");g(this,"hasSetRemoteSdp",!1);g(this,"facingMode",te.FRONT_FACING);g(this,"facingChanging",!1);g(this,"muted",!1);g(this,"openCamera",!1);this.sessionType=e,console.debug(qn.browserDetails.browser+" "+qn.browserDetails.version)}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=te.FRONT_FACING,this.facingChanging=!1,this.muted=!1,this.peerConnection=new RTCPeerConnection({iceServers:[]}),this.peerConnection.onnegotiationneeded=()=>{switch(this.sessionType){case S.AUDIO_PUSH:case S.VIDEO_PUSH:case S.AUDIO_HALF:case S.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(i=>{this.error(i)})}).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(i=>{this.error(i)})}).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 i=0;i<n.streams.length;i++)this.remoteStream?n.streams[i].getTracks().forEach(o=>{var s;(s=this.remoteStream)==null||s.addTrack(o)}):this.remoteStream=new MediaStream(n.streams[i]);this.sessionListener.onAddRemoteStream(this.remoteStream)},this.peerConnection.oniceconnectionstatechange=n=>{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.stop(),this.sessionListener.onError(new Error("session closed.")))},this.sessionType){case S.RTSP_PULL:this.addTransceivers(),this.createDataChannel();break;case S.AUDIO_PUSH:case S.VIDEO_PUSH:case S.AUDIO_HALF:case S.VIDEO_HALF:case S.VIDEO:case S.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){this.dataChannel&&this.dataChannel.send(e)}stop(){var e;console.debug("webrtc stop"),(this.sessionType==S.VIDEO_PUSH||this.sessionType==S.AUDIO_PUSH||this.sessionType==S.RTSP_PULL)&&this.sendStringData("close"),(e=this.peerConnection)==null||e.close(),this.peerConnection=void 0,this.localStream&&(this.localStream.getTracks().forEach(r=>{this.localStream.removeTrack(r),r.stop()}),this.localStream=void 0),this.remoteStream=void 0}changeFacing(){return new Promise((e,r)=>{if(this.sessionType!==S.VIDEO&&this.sessionType!==S.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))})}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 S.VIDEO:case S.VIDEO_PUSH:case S.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===S.VIDEO||this.sessionType===S.VIDEO_PUSH)&&this.sessionListener.onAddLocalStream(e),e.getTracks().forEach(r=>{switch(this.sessionType){case S.AUDIO_PUSH:case S.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===S.VIDEO){console.error("get video media failed. maybe not found camera.",e),this.sessionType=S.AUDIO,this.gotLocalMedia();return}else if(this.sessionType===S.VIDEO_PUSH){console.error("get video media failed. maybe not found camera.",e),this.sessionType=S.AUDIO_PUSH,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==S.VIDEO_HALF||this.sessionType==S.AUDIO_HALF)&&this.sessionListener.onDataChannelMessage(e)}changeCameraLocalMedia(){return new Promise((e,r)=>{let n;if(this.facingMode===te.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(i=>{this.changeCameraSuccess(i),e()}).catch(i=>{this.changeCameraFailed(i),r(i)});else{let i=new Error("Browser does not support WebRTC");this.changeCameraFailed(i),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===te.FRONT_FACING?this.facingMode=te.BACK_FACING:this.facingMode=te.FRONT_FACING,this.facingChanging=!1}changeCameraFailed(e){console.log(e),this.facingChanging=!1}}class Ca{onAddRemoteStream(e){console.debug("onAddRemoteStream:",e)}onError(e){console.debug("onError:",e)}}class Kn{constructor(e,r){g(this,"url");g(this,"offerSdp");this.url=e,this.offerSdp=r}}const ba="/media-server/video-play/webrtc";class Ra{constructor(e,r){g(this,"rtspUrl");g(this,"webrtcSession",new Wt(S.RTSP_PULL));g(this,"sessionListener",new Ca);g(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(ba,new Kn(this.rtspUrl,e.sdp??"")).then(r=>{var n,i,o,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",(i=r.data)==null?void 0:i.candidateList),this.webrtcSession.setRemoteSdp(((o=r.data)==null?void 0:o.sdp)??""),this.webrtcSession.addRemoteCandidate(((s=r.data)==null?void 0:s.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}}var R=(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))(R||{}),L=(t=>(t.VIDEO="video",t.AUDIO="audio",t))(L||{}),H=(t=>(t.FULL="full-duplex",t.HALF="half-duplex",t))(H||{}),ne=(t=>(t.IN="in",t.OUT="out",t))(ne||{}),M=(t=>(t.LOGIN="login",t.LOGOUT="logout",t.Invite="invite",t.RING="ring",t.ANSWER="answer",t.HANGUP="hangup",t.DTMF="dtmf",t))(M||{});function Qn(){try{return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}catch{return!1}}function Ta(){return"browser-"+Ea()+Pa(6)}function Ea(){let t=new Date;return`${t.getFullYear()}${t.getMonth()}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`}function Pa(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 Oa{constructor(e,r,n){g(this,"tel");g(this,"mediaType");g(this,"callMode");this.tel=e,this.callMode=n,this.mediaType=r}}class Yn{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)}}class Xn{constructor(e,r,n){g(this,"tel","");g(this,"status",R.OFFLINE);g(this,"mediaType",L.AUDIO);g(this,"callMode",H.FULL);g(this,"callDirect",ne.OUT);g(this,"called","");g(this,"callId");g(this,"remoteSdp");g(this,"candidate");g(this,"ringBackTone",new Audio("sound/ringbacktone.wav"));g(this,"ringtone",new Audio("sound/ringtone.wav"));g(this,"dtmfAudio",new Audio("sound/dtmf.wav"));g(this,"ws");g(this,"wsConnected",!1);g(this,"closeBySelf",!1);g(this,"webrtcSession");g(this,"sessionListener",new Yn);g(this,"wsUrl");g(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,L.VIDEO)}answer(){var r;if(this.status!=R.RING){console.debug("session is not ring state");return}if(this.callDirect!=ne.IN){console.debug("session is call out, not allow answer");return}let e;this.callMode==H.HALF?e=L.VIDEO==this.mediaType?S.VIDEO_HALF:S.AUDIO_HALF:e=L.VIDEO==this.mediaType?S.VIDEO:S.AUDIO,this.webrtcCreate(e),(r=this.webrtcSession)==null||r.start(!1,this.remoteSdp)}hangup(){this.status<=R.IDLE||(this.status==R.TALK?this.sendHangup(this.callId??""):this.callDirect==ne.IN?this.sendHangup(this.callId??"",488):this.sendHangup(this.callId??"",801),this.close())}dtmf(e){return this.status!==R.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(i=>e(i)).catch(i=>r(i))})}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))})}destroy(){var e;this.closeBySelf=!0,this.hangup(),this.close(),(e=this.ws)==null||e.close()}makeCall(e,r=L.AUDIO,n=H.FULL){var i;try{if(!Qn()){console.debug("Browser does not support WEBRTC"),this.sessionListener.onError(new Error("Browser does not support WEBRTC"));return}if(this.status==R.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>R.IDLE&&(console.debug("Another call is currently in progress, hangup it"),this.hangup()),this.mediaType=r,this.callMode=n,this.called=e,this.callDirect=ne.OUT,this.callId=Ta();let o;this.callMode==H.HALF?o=L.VIDEO==r?S.VIDEO_HALF:S.AUDIO_HALF:o=L.VIDEO==r?S.VIDEO:S.AUDIO,this.webrtcCreate(o),(i=this.webrtcSession)==null||i.start(!0),this.status=R.TRY}catch(o){this.status=R.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=R.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=R.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 M.Invite:this.inviteHandler(n);break;case M.ANSWER:this.answerHandler(n);break;case M.RING:this.ringHandler(n);break;case M.HANGUP:this.hangupHandler(n);break;case M.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:M.LOGIN,username:this.tel,userAgent:this.getUserAgent(),accountId:this.accountId})}sendLogout(){this.sendTo({type:M.LOGOUT,username:this.tel}),this.status=R.OFFLINE}sendInvite(e){this.sendTo({callId:this.callId,type:M.Invite,from:this.tel,to:this.called,callMode:this.callMode,mediaType:this.mediaType,sdp:e}),this.status=R.TRY}sendRing(){this.sendTo({type:M.RING,callId:this.callId,code:180}),this.status=R.RING}sendAnswer(e){this.sendTo({type:M.ANSWER,callId:this.callId,mediaType:this.mediaType,sdp:e}),this.status=R.TALK,this.ringtone.pause(),this.ringBackTone.pause()}sendDtmf(e){this.sendTo({type:M.DTMF,callId:this.callId,callInfo:"dtmf="+e}),this.dtmfAudio.play().then(()=>{}).catch(r=>console.debug(r))}sendHangup(e,r=800){this.sendTo({type:M.HANGUP,callId:e,code:r}),e==this.callId&&(this.status=R.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=R.OFFLINE,this.sessionListener.onInitResult(!1);return}this.tel=e.username??"",this.status=R.IDLE,this.sessionListener.onInitResult(!0)}inviteHandler(e){if(!e.callId){console.debug("receive invite, but callId is null.");return}if(!Qn()){console.debug("receive invite, but unsupported webrtc."),this.sendHangup(e.callId,803);return}if(this.status>R.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??L.AUDIO,this.callMode=e.callMode??H.FULL,this.called=e.from??"",this.callDirect=ne.IN,this.remoteSdp=e.sdp,this.candidate=e.candidate,this.sendRing(),this.ringtone.currentTime=0,this.ringtone.play().then(()=>{}).catch(()=>{}),this.sessionListener.onNewCall(new Oa(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=R.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=R.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 Wt(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==ne.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){}}class Aa{onError(e){console.debug("onError:",e)}onAddLocalStream(e){console.debug("onAddLocalStream:",e)}}const _a="/media-server/broadcast/webrtc";class Ia{constructor(e,r,n){g(this,"tel");g(this,"mediaType");g(this,"webrtcSession");g(this,"sessionListener",new Aa);g(this,"httpClient");this.tel=e,this.httpClient=r,this.mediaType=n===L.VIDEO?L.VIDEO:L.AUDIO,this.webrtcSession=new Wt(n==L.VIDEO?S.VIDEO_PUSH:S.AUDIO_PUSH),this.webrtcSession.setListener(this)}setBroadcastSessionListener(e){this.sessionListener=e}start(){this.webrtcSession.start(!0)}stop(){this.webrtcSession.stop()}onAddLocalStream(e){this.sessionListener.onAddLocalStream(e)}onAddRemoteStream(e){}onError(e){this.sessionListener.onError(e)}onStartSuccess(e){console.debug("offer:",e.sdp),this.httpClient.Post(_a,new Kn(this.tel,e.sdp??"")).then(r=>{var n,i,o;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(((i=r.data)==null?void 0:i.sdp)??""),this.webrtcSession.addRemoteCandidate(((o=r.data)==null?void 0:o.candidateList)??[])}).catch(r=>{this.stop(),this.sessionListener.onError(r)})}onDataChannelMessage(e){}}var qt=(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))(qt||{});class Da extends Yn{onTbcpMessage(e){console.debug("onTbcpMessage:",e)}}class La extends Xn{constructor(r,n,i){super(r,n,i);g(this,"sessionListener",new Da)}setCallSessionListener(r){this.sessionListener=r}audioHalfCall(r){this.makeCall(r,L.AUDIO,H.HALF)}videoHalfCall(r){this.makeCall(r,L.VIDEO,H.HALF)}tbcpRequest(){var r;this.callMode==H.HALF&&this.status==R.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:qt.TB_REQUEST})))}tbcpRelease(){var r;this.callMode==H.HALF&&this.status==R.TALK&&((r=this.webrtcSession)==null||r.sendStringData(JSON.stringify({type:qt.TB_RELEASE})))}onDataChannelMessage(r){try{this.sessionListener.onTbcpMessage(JSON.parse(r))}catch(n){console.debug("onDataChannelMessage err: ",n,r)}}}let Kt=new an("/"),Zn="/media-server/ws/voip",ei="/media-server/ws/b-trun-c",Qt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+Zn),Yt=new URL((location.protocol=="https:"?"wss://":"ws://")+location.host+ei);function xa(t){Kt=new an(t)}function Ma(t){return new Ra(t,Kt)}function ka(t,e){return new Ia(t,Kt,e)}function Fa(t){Qt=new URL(t),Qt.pathname=Zn,Yt=new URL(t),Yt.pathname=ei}function Na(t){return new Xn(Qt.toString(),t)}function Ua(t,e){return new La(Yt.toString(),t,e)}A.createAppCallSession=Ua,A.createBroadcastSession=ka,A.createCallSession=Na,A.createRtspPullSession=Ma,A.videoModuleInit=xa,A.voipModuleInit=Fa,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|