Support file uploads and the device details page for Elegoo Centauri Carbon 2 (#13212)

* Support file uploads and the device details page for CC2 printers.

* Resolved build issues for Linux and macOS.

* 1. Added `ElegooPrinterWebViewHandler` to handle WebUI messages for Elegoo printers. Other printers will keep the current behavior.
2. Added a static `get_print_host_webui` method in `PrintHost` to retrieve the printer WebUI URL.

* Improved timeout handling for CC2 file upload and SN info APIs.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
anjisandSoftFever authored and GitHub committed 2026-05-16 15:22:31 +08:00
1 parent 5a136a25d1
commit 427d0f7a9f
16 files changed
+1248 -56

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

@@ -0,0 +1,265 @@
<!doctype html><html lang=""><head><meta charset="UTF-8"><link rel="icon" href="./favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ELEGOO-Create The Future</title><script type="module" crossorigin>var Dte=Object.defineProperty;var ZI=e=>{throw TypeError(e)};var Lte=(e,t,n)=>t in e?Dte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Nte=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var et=(e,t,n)=>Lte(e,typeof t!="symbol"?t+"":t,n),C6=(e,t,n)=>t.has(e)||ZI("Cannot "+n);var ke=(e,t,n)=>(C6(e,t,"read from private field"),n?n.call(e):t.get(e)),lr=(e,t,n)=>t.has(e)?ZI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sn=(e,t,n,r)=>(C6(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Wt=(e,t,n)=>(C6(e,t,"access private method"),n);var d2=(e,t,n,r)=>({set _(i){sn(e,t,i,n)},get _(){return ke(e,t,r)}});var nZe=Nte((sa,aa)=>{/**
* @vue/shared v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function vC(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Sr={},kh=[],$i=()=>{},_H=()=>!1,U4=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),yC=e=>e.startsWith("onUpdate:"),lo=Object.assign,EC=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Mte=Object.prototype.hasOwnProperty,zn=(e,t)=>Mte.call(e,t),At=Array.isArray,xh=e=>Pg(e)==="[object Map]",j4=e=>Pg(e)==="[object Set]",YI=e=>Pg(e)==="[object Date]",kt=e=>typeof e=="function",Yt=e=>typeof e=="string",hc=e=>typeof e=="symbol",cn=e=>e!==null&&typeof e=="object",D3=e=>(cn(e)||kt(e))&&kt(e.then)&&kt(e.catch),RH=Object.prototype.toString,Pg=e=>RH.call(e),Bte=e=>Pg(e).slice(8,-1),bC=e=>Pg(e)==="[object Object]",SC=e=>Yt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,X1=vC(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H4=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Fte=/-(\w)/g,Us=H4(e=>e.replace(Fte,(t,n)=>n?n.toUpperCase():"")),Ute=/\B([A-Z])/g,gl=H4(e=>e.replace(Ute,"-$1").toLowerCase()),z4=H4(e=>e.charAt(0).toUpperCase()+e.slice(1)),Q1=H4(e=>e?`on${z4(e)}`:""),Is=(e,t)=>!Object.is(e,t),N5=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},kH=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},JE=e=>{const t=parseFloat(e);return isNaN(t)?e:t},jte=e=>{const t=Yt(e)?Number(e):NaN;return isNaN(t)?e:t};let XI;const W4=()=>XI||(XI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ut(e){if(At(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=Yt(r)?Vte(r):Ut(r);if(i)for(const o in i)t[o]=i[o]}return t}else if(Yt(e)||cn(e))return e}const Hte=/;(?![^(]*\))/g,zte=/:([^]+)/,Wte=/\/\*[^]*?\*\//g;function Vte(e){const t={};return e.replace(Wte,"").split(Hte).forEach(n=>{if(n){const r=n.split(zte);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function je(e){let t="";if(Yt(e))t=e;else if(At(e))for(let n=0;n<e.length;n++){const r=je(e[n]);r&&(t+=r+" ")}else if(cn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function ZE(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Yt(t)&&(e.class=je(t)),n&&(e.style=Ut(n)),e}const Gte="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Jte=vC(Gte);function xH(e){return!!e||e===""}function Zte(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Qh(e[r],t[r]);return n}function Qh(e,t){if(e===t)return!0;let n=YI(e),r=YI(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=hc(e),r=hc(t),n||r)return e===t;if(n=At(e),r=At(t),n||r)return n&&r?Zte(e,t):!1;if(n=cn(e),r=cn(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const s in e){const a=e.hasOwnProperty(s),c=t.hasOwnProperty(s);if(a&&!c||!a&&c||!Qh(e[s],t[s]))return!1}}return String(e)===String(t)}function DH(e,t){return e.findIndex(n=>Qh(n,t))}const LH=e=>!!(e&&e.__v_isRef===!0),Ue=e=>Yt(e)?e:e==null?"":At(e)||cn(e)&&(e.toString===RH||!kt(e.toString))?LH(e)?Ue(e.value):JSON.stringify(e,NH,2):String(e),NH=(e,t)=>LH(t)?NH(e,t.value):xh(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],o)=>(n[w6(r,o)+" =>"]=i,n),{})}:j4(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>w6(n))}:hc(t)?w6(t):cn(t)&&!At(t)&&!bC(t)?String(t):t,w6=(e,t="")=>{var n;return hc(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function Yte(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
* @vue/reactivity v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Vo;class MH{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Vo,!t&&Vo&&(this.index=(Vo.scopes||(Vo.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Vo;try{return Vo=this,t()}finally{Vo=n}}}on(){++this._on===1&&(this.prevScope=Vo,Vo=this)}off(){this._on>0&&--this._on===0&&(Vo=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function V4(e){return new MH(e)}function G4(){return Vo}function J4(e,t=!1){Vo&&Vo.cleanups.push(e)}let Qr;const T6=new WeakSet;class BH{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Vo&&Vo.active&&Vo.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,T6.has(this)&&(T6.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||UH(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,QI(this),jH(this);const t=Qr,n=lc;Qr=this,lc=!0;try{return this.fn()}finally{HH(this),Qr=t,lc=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)wC(t);this.deps=this.depsTail=void 0,QI(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?T6.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){YE(this)&&this.run()}get dirty(){return YE(this)}}let FH=0,K1,q1;function UH(e,t=!1){if(e.flags|=8,t){e.next=q1,q1=e;return}e.next=K1,K1=e}function AC(){FH++}function CC(){if(--FH>0)return;if(q1){let t=q1;for(q1=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;K1;){let t=K1;for(K1=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function jH(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function HH(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),wC(r),Xte(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function YE(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(zH(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function zH(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Om)||(e.globalVersion=Om,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!YE(e))))return;e.flags|=2;const t=e.dep,n=Qr,r=lc;Qr=e,lc=!0;try{jH(e);const i=e.fn(e._value);(t.version===0||Is(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{Qr=n,lc=r,HH(e),e.flags&=-3}}function wC(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)wC(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Xte(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let lc=!0;const WH=[];function mu(){WH.push(lc),lc=!1}function gu(){const e=WH.pop();lc=e===void 0?!0:e}function QI(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Qr;Qr=void 0;try{t()}finally{Qr=n}}}let Om=0;class Qte{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Z4{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Qr||!lc||Qr===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Qr)n=this.activeLink=new Qte(Qr,this),Qr.deps?(n.prevDep=Qr.depsTail,Qr.depsTail.nextDep=n,Qr.depsTail=n):Qr.deps=Qr.depsTail=n,VH(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Qr.depsTail,n.nextDep=void 0,Qr.depsTail.nextDep=n,Qr.depsTail=n,Qr.deps===n&&(Qr.deps=r)}return n}trigger(t){this.version++,Om++,this.notify(t)}notify(t){AC();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{CC()}}}fuLine truncated
* @vue/runtime-core v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Og(e,t,n,r){try{return r?e(...r):e()}catch(i){Q4(i,t,n)}}function pc(e,t,n,r){if(kt(e)){const i=Og(e,t,n,r);return i&&D3(i)&&i.catch(o=>{Q4(o,t,n)}),i}if(At(e)){const i=[];for(let o=0;o<e.length;o++)i.push(pc(e[o],t,n,r));return i}}function Q4(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Sr;if(t){let a=t.parent;const c=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,c,l)===!1)return}a=a.parent}if(o){mu(),Og(o,null,10,[e,c,l]),gu();return}}Cne(e,n,i,r,s)}function Cne(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const us=[];let Uc=-1;const Dh=[];let cd=null,sh=0;const tz=Promise.resolve();let B3=null;function Cn(e){const t=B3||tz;return e?t.then(this?e.bind(this):e):t}function wne(e){let t=Uc+1,n=us.length;for(;t<n;){const r=t+n>>>1,i=us[r],o=km(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function OC(e){if(!(e.flags&1)){const t=km(e),n=us[us.length-1];!n||!(e.flags&2)&&t>=km(n)?us.push(e):us.splice(wne(t),0,e),e.flags|=1,nz()}}function nz(){B3||(B3=tz.then(oz))}function rz(e){At(e)?Dh.push(...e):cd&&e.id===-1?cd.splice(sh+1,0,e):e.flags&1||(Dh.push(e),e.flags|=1),nz()}function qI(e,t,n=Uc+1){for(;n<us.length;n++){const r=us[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;us.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function iz(e){if(Dh.length){const t=[...new Set(Dh)].sort((n,r)=>km(n)-km(r));if(Dh.length=0,cd){cd.push(...t);return}for(cd=t,sh=0;sh<cd.length;sh++){const n=cd[sh];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}cd=null,sh=0}}const km=e=>e.id==null?e.flags&2?-1:1/0:e.id;function oz(e){try{for(Uc=0;Uc<us.length;Uc++){const t=us[Uc];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Og(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Uc<us.length;Uc++){const t=us[Uc];t&&(t.flags&=-2)}Uc=-1,us.length=0,iz(),B3=null,(us.length||Dh.length)&&oz()}}let ko=null,sz=null;function F3(e){const t=ko;return ko=e,sz=e&&e.type.__scopeId||null,t}function Re(e,t=ko,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&dP(-1);const o=F3(t);let s;try{s=e(...i)}finally{F3(o),r._d&&dP(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function vn(e,t){if(ko===null)return e;const n=ry(ko),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,a,c=Sr]=t[i];o&&(kt(o)&&(o={mounted:o,updated:o}),o.deep&&tu(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}function a0(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let s=0;s<i.length;s++){const a=i[s];o&&(a.oldValue=o[s].value);let c=a.dir[r];c&&(mu(),pc(c,n,8,[e.el,a,e,t]),gu())}}const az=Symbol("_vte"),cz=e=>e.__isTeleport,$1=e=>e&&(e.disabled||e.disabled===""),$I=e=>e&&(e.defer||e.defer===""),eP=e=>typeof SVGElement<"u"&&e instanceof SVGElement,tP=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,KE=(e,t)=>{const n=e&&e.to;return Yt(n)?t?t(n):null:n},lz={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,s,a,c,l){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:m}}=l,y=$1(t.props);let{shapeFlag:v,children:E,dynamicChildren:b}=t;if(e==null){const S=t.el=g(""),w=t.anchor=g("");h(S,n,r),h(w,n,r);const C=(I,O)=>{v&16&&(i&&i.isCE&&(i.ce._teleportTarget=I),u(E,I,O,i,o,s,a,c))},_=()=>{const I=t.target=KE(t.props,p),O=uz(I,t,g,h);I&&(s!=="svg"&&eP(I)?s="svg":s!=="mathml"&&tP(I)&&(s="mathml"),y||(C(I,O),M5(t,!1)))};y&&(C(n,w),M5(t,!0)),$I(t.props)?(t.el.__isMounted=!1,os(()=>{_(),delete t.el.__isMounted},o)):_()}else{if($I(t.props)&&e.el.__isMounted===!1){os(()=>{lz.process(e,t,n,r,i,o,s,a,c,l)},o);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,w=t.target=e.target,C=t.targetAnchor=e.targetAnchor,_=$1(e.props),I=_?n:w,O=_?S:C;if(s==="svg"||eP(w)?s="svg":(s==="mathml"||tP(w))&&(s="mathml"),b?(f(e.dynamicChildren,b,I,i,o,s,a),MC(e,t,!0)):c||d(e,t,I,O,i,o,s,a,!1),y)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):m2(t,n,S,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const L=t.target=KE(t.props,p);L&&m2(t,L,null,l,0)}else _&&m2(t,w,C,l,1);M5(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:s,children:a,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e;if(d&&(i(l),i(u)),o&&i(c),s&16){const h=o||!$1(f);for(let p=0;p<a.length;p++){const g=a[p];r(g,t,n,h,!!g.dynamicChildren)}}},move:m2,hydrate:Tne};function m2(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:c,children:l,props:u}=e,d=o===2;if(d&&r(s,t,n),(!d||$1(u))&&c&16)for(let f=0;f<l.length;f++)i(l[f],t,n,2);d&&r(a,t,n)}function Tne(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:l,createText:u}},d){const f=t.target=KE(t.props,c);if(f){const h=$1(t.props),p=f._lpa||f.firstChild;if(t.shapeFlag&16)if(h)t.anchor=d(s(e),t,a(e),n,r,i,o),t.targetStart=p,t.targetAnchor=p&&s(p);else{t.anchor=s(e);let g=p;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anLine truncated
* @vue/runtime-dom v3.5.20
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let o7;const pP=typeof window<"u"&&window.trustedTypes;if(pP)try{o7=pP.createPolicy("vue",{createHTML:e=>e})}catch{}const Jz=o7?e=>o7.createHTML(e):e=>e,Cre="http://www.w3.org/2000/svg",wre="http://www.w3.org/1998/Math/MathML",Wl=typeof document<"u"?document:null,mP=Wl&&Wl.createElement("template"),Tre={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?Wl.createElementNS(Cre,e):t==="mathml"?Wl.createElementNS(wre,e):n?Wl.createElement(e,{is:n}):Wl.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>Wl.createTextNode(e),createComment:e=>Wl.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Wl.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,o){const s=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{mP.innerHTML=Jz(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=mP.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Nu="transition",s1="animation",Mm=Symbol("_vtc"),Zz={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ire=lo({},dz,Zz),Pre=e=>(e.displayName="Transition",e.props=Ire,e),Cu=Pre((e,{slots:t})=>hn(_ne,Ore(e),t)),l0=(e,t=[])=>{At(e)?e.forEach(n=>n(...t)):e&&e(...t)},gP=e=>e?At(e)?e.some(t=>t.length>1):e.length>1:!1;function Ore(e){const t={};for(const R in e)R in Zz||(t[R]=e[R]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:l=s,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=_re(i),g=p&&p[0],m=p&&p[1],{onBeforeEnter:y,onEnter:v,onEnterCancelled:E,onLeave:b,onLeaveCancelled:S,onBeforeAppear:w=y,onAppear:C=v,onAppearCancelled:_=E}=t,I=(R,F,W,J)=>{R._enterCancelled=J,u0(R,F?u:a),u0(R,F?l:s),W&&W()},O=(R,F)=>{R._isLeaving=!1,u0(R,d),u0(R,h),u0(R,f),F&&F()},L=R=>(F,W)=>{const J=R?C:v,Y=()=>I(F,R,W);l0(J,[F,Y]),vP(()=>{u0(F,R?c:o),Ol(F,R?u:a),gP(J)||yP(F,r,g,Y)})};return lo(t,{onBeforeEnter(R){l0(y,[R]),Ol(R,o),Ol(R,s)},onBeforeAppear(R){l0(w,[R]),Ol(R,c),Ol(R,l)},onEnter:L(!1),onAppear:L(!0),onLeave(R,F){R._isLeaving=!0;const W=()=>O(R,F);Ol(R,d),R._enterCancelled?(Ol(R,f),SP()):(SP(),Ol(R,f)),vP(()=>{R._isLeaving&&(u0(R,d),Ol(R,h),gP(b)||yP(R,r,m,W))}),l0(b,[R,W])},onEnterCancelled(R){I(R,!1,void 0,!0),l0(E,[R])},onAppearCancelled(R){I(R,!0,void 0,!0),l0(_,[R])},onLeaveCancelled(R){O(R),l0(S,[R])}})}function _re(e){if(e==null)return null;if(cn(e))return[k6(e.enter),k6(e.leave)];{const t=k6(e);return[t,t]}}function k6(e){return jte(e)}function Ol(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Mm]||(e[Mm]=new Set)).add(t)}function u0(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Mm];n&&(n.delete(t),n.size||(e[Mm]=void 0))}function vP(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Rre=0;function yP(e,t,n,r){const i=e._endId=++Rre,o=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:s,timeout:a,propCount:c}=kre(e,t);if(!s)return r();const l=s+"end";let u=0;const d=()=>{e.removeEventListener(l,f),o()},f=h=>{h.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},a+1),e.addEventListener(l,f)}function kre(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),i=r(`${Nu}Delay`),o=r(`${Nu}Duration`),s=EP(i,o),a=r(`${s1}Delay`),c=r(`${s1}Duration`),l=EP(a,c);let u=null,d=0,f=0;t===Nu?s>0&&(u=Nu,d=s,f=o.length):t===s1?l>0&&(u=s1,d=l,f=c.length):(d=Math.max(s,l),u=d>0?s>l?Nu:s1:null,f=u?u===Nu?o.length:c.length:0);const h=u===Nu&&/\b(transform|all)(,|$)/.test(r(`${Nu}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function EP(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>bP(n)+bP(e[r])))}function bP(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function SP(){return document.body.offsetHeight}function xre(e,t,n){const r=e[Mm];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const z3=Symbol("_vod"),Yz=Symbol("_vsh"),_r={name:"show",beforeMount(e,{value:t},{transition:n}){e[z3]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):a1(e,t)},mounted(e,{value:t},{transitioLine truncated
* pinia v3.0.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let nW;const iy=e=>nW=e,rW=Symbol();function a7(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var im;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(im||(im={}));function $re(){const e=V4(!0),t=e.run(()=>se({}));let n=[],r=[];const i=Rm({install(o){iy(i),i._a=o,o.provide(rW,i),o.config.globalProperties.$pinia=i,r.forEach(s=>n.push(s)),r=[]},use(o){return this._a?n.push(o):r.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const iW=()=>{};function DP(e,t,n,r=iW){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),r())};return!n&&G4()&&J4(i),i}function Nf(e,...t){e.slice().forEach(n=>{n(...t)})}const eie=e=>e(),LP=Symbol(),L6=Symbol();function c7(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],i=e[n];a7(i)&&a7(r)&&e.hasOwnProperty(n)&&!En(r)&&!Td(r)?e[n]=c7(i,r):e[n]=r}return e}const tie=Symbol();function nie(e){return!a7(e)||!Object.prototype.hasOwnProperty.call(e,tie)}const{assign:qu}=Object;function rie(e){return!!(En(e)&&e.effect)}function iie(e,t,n,r){const{state:i,actions:o,getters:s}=t,a=n.state.value[e];let c;function l(){a||(n.state.value[e]=i?i():{});const u=Ud(n.state.value[e]);return qu(u,o,Object.keys(s||{}).reduce((d,f)=>(d[f]=Rm(V(()=>{iy(n);const h=n._s.get(e);return s[f].call(h,h)})),d),{}))}return c=oW(e,l,t,n,r,!0),c}function oW(e,t,n={},r,i,o){let s;const a=qu({actions:{}},n),c={deep:!0};let l,u,d=[],f=[],h;const p=r.state.value[e];!o&&!p&&(r.state.value[e]={}),se({});let g;function m(_){let I;l=u=!1,typeof _=="function"?(_(r.state.value[e]),I={type:im.patchFunction,storeId:e,events:h}):(c7(r.state.value[e],_),I={type:im.patchObject,payload:_,storeId:e,events:h});const O=g=Symbol();Cn().then(()=>{g===O&&(l=!0)}),u=!0,Nf(d,I,r.state.value[e])}const y=o?function(){const{state:I}=n,O=I?I():{};this.$patch(L=>{qu(L,O)})}:iW;function v(){s.stop(),d=[],f=[],r._s.delete(e)}const E=(_,I="")=>{if(LP in _)return _[L6]=I,_;const O=function(){iy(r);const L=Array.from(arguments),R=[],F=[];function W(M){R.push(M)}function J(M){F.push(M)}Nf(f,{args:L,name:O[L6],store:S,after:W,onError:J});let Y;try{Y=_.apply(this&&this.$id===e?this:S,L)}catch(M){throw Nf(F,M),M}return Y instanceof Promise?Y.then(M=>(Nf(R,M),M)).catch(M=>(Nf(F,M),Promise.reject(M))):(Nf(R,Y),Y)};return O[LP]=!0,O[L6]=I,O},b={_p:r,$id:e,$onAction:DP.bind(null,f),$patch:m,$reset:y,$subscribe(_,I={}){const O=DP(d,_,I.detached,()=>L()),L=s.run(()=>Ye(()=>r.state.value[e],R=>{(I.flush==="sync"?u:l)&&_({storeId:e,type:im.direct,events:h},R)},qu({},c,I)));return O},$dispose:v},S=eo(b);r._s.set(e,S);const C=(r._a&&r._a.runWithContext||eie)(()=>r._e.run(()=>(s=V4()).run(()=>t({action:E}))));for(const _ in C){const I=C[_];if(En(I)&&!rie(I)||Td(I))o||(p&&nie(I)&&(En(I)?I.value=p[_]:c7(I,p[_])),r.state.value[e][_]=I);else if(typeof I=="function"){const O=E(I,_);C[_]=O,a.actions[_]=I}}return qu(S,C),qu(tr(S),C),Object.defineProperty(S,"$state",{get:()=>r.state.value[e],set:_=>{m(I=>{qu(I,_)})}}),r._p.forEach(_=>{qu(S,s.run(()=>_({store:S,app:r._a,pinia:r,options:a})))}),p&&o&&n.hydrate&&n.hydrate(S.$state,p),l=!0,u=!0,S}/*! #__NO_SIDE_EFFECTS__ */function oy(e,t,n){let r;const i=typeof t=="function";r=i?n:t;function o(s,a){const c=DC();return s=s||(c?Vt(rW,null):null),s&&iy(s),s=nW,s._s.has(e)||(i?oW(e,t,r,s):iie(e,r,s)),s._s.get(e)}return o.$id=e,o}/*!
* vue-router v4.5.1
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/const ah=typeof document<"u";function sW(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function oie(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&sW(e.default)}const wr=Object.assign;function N6(e,t){const n={};for(const r in t){const i=t[r];n[r]=mc(i)?i.map(e):e(i)}return n}const om=()=>{},mc=Array.isArray,aW=/#/g,sie=/&/g,aie=/\//g,cie=/=/g,lie=/\?/g,cW=/\+/g,uie=/%5B/g,die=/%5D/g,lW=/%5E/g,fie=/%60/g,uW=/%7B/g,hie=/%7C/g,dW=/%7D/g,pie=/%20/g;function FC(e){return encodeURI(""+e).replace(hie,"|").replace(uie,"[").replace(die,"]")}function mie(e){return FC(e).replace(uW,"{").replace(dW,"}").replace(lW,"^")}function l7(e){return FC(e).replace(cW,"%2B").replace(pie,"+").replace(aW,"%23").replace(sie,"%26").replace(fie,"`").replace(uW,"{").replace(dW,"}").replace(lW,"^")}function gie(e){return l7(e).replace(cie,"%3D")}function vie(e){return FC(e).replace(aW,"%23").replace(lie,"%3F")}function yie(e){return e==null?"":vie(e).replace(aie,"%2F")}function Bm(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const Eie=/\/$/,bie=e=>e.replace(Eie,"");function M6(e,t,n="/"){let r,i={},o="",s="";const a=t.indexOf("#");let c=t.indexOf("?");return a<c&&a>=0&&(c=-1),c>-1&&(r=t.slice(0,c),o=t.slice(c+1,a>-1?a:t.length),i=e(o)),a>-1&&(r=r||t.slice(0,a),s=t.slice(a,t.length)),r=wie(r??t,n),{fullPath:r+(o&&"?")+o+s,path:r,query:i,hash:Bm(s)}}function Sie(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function NP(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Aie(e,t,n){const r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&qh(t.matched[r],n.matched[i])&&fW(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function qh(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function fW(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Cie(e[n],t[n]))return!1;return!0}function Cie(e,t){return mc(e)?MP(e,t):mc(t)?MP(t,e):e===t}function MP(e,t){return mc(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function wie(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),i=r[r.length-1];(i===".."||i===".")&&r.push("");let o=n.length-1,s,a;for(s=0;s<r.length;s++)if(a=r[s],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(s).join("/")}const Mu={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Fm;(function(e){e.pop="pop",e.push="push"})(Fm||(Fm={}));var sm;(function(e){e.back="back",e.forward="forward",e.unknown=""})(sm||(sm={}));function Tie(e){if(!e)if(ah){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),bie(e)}const Iie=/^[^#]+#/;function Pie(e,t){return e.replace(Iie,"#")+t}function Oie(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const sy=()=>({left:window.scrollX,top:window.scrollY});function _ie(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Oie(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function BP(e,t){return(history.state?history.state.position-t:-1)+e}const u7=new Map;function Rie(e,t){u7.set(e,t)}function kie(e){const t=u7.get(e);return u7.delete(e),t}let xie=()=>location.protocol+"//"+location.host;function hW(e,t){const{pathname:n,search:r,hash:i}=t,o=e.indexOf("#");if(o>-1){let a=i.includes(e.slice(o))?e.slice(o).length:1,c=i.slice(a);return c[0]!=="/"&&(c="/"+c),NP(c,"")}return NP(n,e)+r+i}function Die(e,t,n,r){let i=[],o=[],s=null;const a=({state:f})=>{const h=hW(e,location),p=n.value,g=t.value;let m=0;if(f){if(n.value=h,t.value=f,s&&s===p){s=null;return}m=g?f.position-g.position:0}else r(h);i.forEach(y=>{y(n.value,p,{delta:m,type:Fm.pop,direction:m?m>0?sm.forward:sm.back:sm.unknown})})};function c(){s=n.value}function l(f){i.push(f);const h=()=>{const p=i.indexOf(f);p>-1&&i.splice(p,1)};return o.push(h),h}function u(){const{history:f}=window;f.state&&f.replaceState(wr({},f.state,{scroll:sy()}),"")}function d(){for(const f of o)f();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:c,listen:l,destroy:d}}function FP(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?sy():null}}function Lie(e){const{history:t,location:n}=window,r={value:hW(e,n)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,fLine truncated
* shared v10.0.8
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/function uoe(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const G3=typeof window<"u",jd=(e,t=!1)=>t?Symbol.for(e):Symbol(e),doe=(e,t,n)=>foe({l:e,k:t,s:n}),foe=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),zi=e=>typeof e=="number"&&isFinite(e),hoe=e=>jC(e)==="[object Date]",ep=e=>jC(e)==="[object RegExp]",ay=e=>Vn(e)&&Object.keys(e).length===0,co=Object.assign,poe=Object.create,Hr=(e=null)=>poe(e);let qP;const D0=()=>qP||(qP=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Hr());function $P(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function eO(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function moe(e){return e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,(r,i,o)=>`${i}="${eO(o)}"`),e=e.replace(/(\w+)\s*=\s*'([^']*)'/g,(r,i,o)=>`${i}='${eO(o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(r=>{e=e.replace(r,"$1javascript&#58;")}),e}const goe=Object.prototype.hasOwnProperty;function oc(e,t){return goe.call(e,t)}const _i=Array.isArray,ri=e=>typeof e=="function",jt=e=>typeof e=="string",yr=e=>typeof e=="boolean",Ar=e=>e!==null&&typeof e=="object",voe=e=>Ar(e)&&ri(e.then)&&ri(e.catch),SW=Object.prototype.toString,jC=e=>SW.call(e),Vn=e=>jC(e)==="[object Object]",yoe=e=>e==null?"":_i(e)||Vn(e)&&e.toString===SW?JSON.stringify(e,null,2):String(e);function HC(e,t=""){return e.reduce((n,r,i)=>i===0?n+r:n+t+r,"")}const v2=e=>!Ar(e)||_i(e);function U5(e,t){if(v2(e)||v2(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:r,des:i}=n.pop();Object.keys(r).forEach(o=>{o!=="__proto__"&&(Ar(r[o])&&!Ar(i[o])&&(i[o]=Array.isArray(r[o])?[]:Hr()),v2(i[o])||v2(r[o])?i[o]=r[o]:n.push({src:r[o],des:i[o]}))})}}/*!
* message-compiler v10.0.8
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/function Eoe(e,t,n){return{line:e,column:t,offset:n}}function f7(e,t,n){return{start:e,end:t}}const Dr={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},boe=17;function cy(e,t,n={}){const{domain:r,messages:i,args:o}=n,s=e,a=new SyntaxError(String(s));return a.code=e,t&&(a.location=t),a.domain=r,a}function Soe(e){throw e}const Rl=" ",Aoe="\r",is=`
`,Coe="\u2028",woe="\u2029";function Toe(e){const t=e;let n=0,r=1,i=1,o=0;const s=C=>t[C]===Aoe&&t[C+1]===is,a=C=>t[C]===is,c=C=>t[C]===woe,l=C=>t[C]===Coe,u=C=>s(C)||a(C)||c(C)||l(C),d=()=>n,f=()=>r,h=()=>i,p=()=>o,g=C=>s(C)||c(C)||l(C)?is:t[C],m=()=>g(n),y=()=>g(n+o);function v(){return o=0,u(n)&&(r++,i=0),s(n)&&n++,n++,i++,t[n]}function E(){return s(n+o)&&o++,o++,t[n+o]}function b(){n=0,r=1,i=1,o=0}function S(C=0){o=C}function w(){const C=n+o;for(;C!==n;)v();o=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:m,currentPeek:y,next:v,peek:E,reset:b,resetPeek:S,skipToPeek:w}}const Bu=void 0,Ioe=".",tO="'",Poe="tokenizer";function Ooe(e,t={}){const n=t.location!==!1,r=Toe(e),i=()=>r.index(),o=()=>Eoe(r.line(),r.column(),r.index()),s=o(),a=i(),c={currentType:13,offset:a,startLoc:s,endLoc:s,lastType:13,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function d(ee,$,ge,...ie){const Ie=l();if($.column+=ge,$.offset+=ge,u){const Ce=n?f7(Ie.startLoc,$):null,oe=cy(ee,Ce,{domain:Poe,args:ie});u(oe)}}function f(ee,$,ge){ee.endLoc=o(),ee.currentType=$;const ie={type:$};return n&&(ie.loc=f7(ee.startLoc,ee.endLoc)),ge!=null&&(ie.value=ge),ie}const h=ee=>f(ee,13);function p(ee,$){return ee.currentChar()===$?(ee.next(),$):(d(Dr.EXPECTED_TOKEN,o(),0,$),"")}function g(ee){let $="";for(;ee.currentPeek()===Rl||ee.currentPeek()===is;)$+=ee.currentPeek(),ee.peek();return $}function m(ee){const $=g(ee);return ee.skipToPeek(),$}function y(ee){if(ee===Bu)return!1;const $=ee.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$===95}function v(ee){if(ee===Bu)return!1;const $=ee.charCodeAt(0);return $>=48&&$<=57}function E(ee,$){const{currentType:ge}=$;if(ge!==2)return!1;g(ee);const ie=y(ee.currentPeek());return ee.resetPeek(),ie}function b(ee,$){const{currentType:ge}=$;if(ge!==2)return!1;g(ee);const ie=ee.currentPeek()==="-"?ee.peek():ee.currentPeek(),Ie=v(ie);return ee.resetPeek(),Ie}function S(ee,$){const{currentType:ge}=$;if(ge!==2)return!1;g(ee);const ie=ee.currentPeek()===tO;return ee.resetPeek(),ie}function w(ee,$){const{currentType:ge}=$;if(ge!==7)return!1;g(ee);const ie=ee.currentPeek()===".";return ee.resetPeek(),ie}function C(ee,$){const{currentType:ge}=$;if(ge!==8)return!1;g(ee);const ie=y(ee.currentPeek());return ee.resetPeek(),ie}function _(ee,$){const{currentType:ge}=$;if(!(ge===7||ge===11))return!1;g(ee);const ie=ee.currentPeek()===":";return ee.resetPeek(),ie}function I(ee,$){const{currentType:ge}=$;if(ge!==9)return!1;const ie=()=>{const Ce=ee.currentPeek();return Ce==="{"?y(ee.peek()):Ce==="@"||Ce==="|"||Ce===":"||Ce==="."||Ce===Rl||!Ce?!1:Ce===is?(ee.peek(),ie()):L(ee,!1)},Ie=ie();return ee.resetPeek(),Ie}function O(ee){g(ee);const $=ee.currentPeek()==="|";return ee.resetPeek(),$}function L(ee,$=!0){const ge=(Ie=!1,Ce="")=>{const oe=ee.currentPeek();return oe==="{"||oe==="@"||!oe?Ie:oe==="|"?!(Ce===Rl||Ce===is):oe===Rl?(ee.peek(),ge(!0,Rl)):oe===is?(ee.peek(),ge(!0,is)):!0},ie=ge();return $&&ee.resetPeek(),ie}function R(ee,$){const ge=ee.currentChar();return ge===Bu?Bu:$(ge)?(ee.next(),ge):null}function F(ee){const $=ee.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36}function W(ee){return R(ee,F)}function J(ee){const $=ee.charCodeAt(0);return $>=97&&$<=122||$>=65&&$<=90||$>=48&&$<=57||$===95||$===36||$===45}function Y(ee){return R(ee,J)}function M(ee){const $=ee.charCodeAt(0);return $>=48&&$<=57}function B(ee){return R(ee,M)}function q(ee){const $=ee.charCodeAt(0);return $>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102}function z(ee){return R(ee,q)}function A(ee){let $="",ge="";for(;$=B(ee);)ge+=$;return ge}function T(ee){let $="";for(;;){const ge=ee.currentChar();if(ge==="{"||ge==="}"||ge==="@"||ge==="|"||!ge)break;if(ge===Rl||ge===is)if(L(ee))$+=ge,ee.next();else{if(O(ee))break;$+=ge,ee.next()}else $+=ge,ee.next()}return $}function k(ee){m(ee);let $="",ge="";for(;$=Y(ee);)ge+=$;return ee.currentChar()===Bu&&d(Dr.UNTERMINATED_CLOSING_BRACE,o(),0),ge}function j(ee){m(ee);let $="";return ee.currentChar()==="-"?(ee.next(),$+=`-${A(ee)}`):$+=A(ee),ee.currentChar()===Bu&&d(Dr.UNTERMINATED_CLOSING_BRACE,o(),0),$}function re(ee){return ee!==tO&&ee!==is}function me(ee){m(ee),p(ee,"'");let $="",ge="";for(;$=R(ee,re);)$==="\\"?ge+=te(ee):ge+=$;const ie=ee.currentChar();return ie===is||ie===Bu?(d(Dr.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),ie===is&&(ee.next(),p(ee,"'")),ge):(p(ee,"'"),ge)}function te(ee){const $=ee.currentChar();switch($){case"\\":case"'":return ee.next(),`\\${$}`;case"u":return X(ee,$,4);case"U":return X(ee,$,6);default:return d(Dr.UNKNOWN_ESCAPE_SEQUENCE,o(),0,$),""}}function X(ee,$,ge){p(ee,$);let ie="";for(let Ie=0;Ie<ge;Ie++){const Ce=z(ee);if(!Ce){d(Dr.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${$}${ie}${ee.currentChar()}`);break}ie+=Ce}return`\\${$}${ie}`}function fe(ee){return ee!=="{"&&ee!=="}"&&ee!==Rl&&ee!==is}function le(ee){m(ee);let $="",ge="";for(;$=R(ee,fe);)ge+=$;return ge}function ve(ee){let $="",gLine truncated
`,o=t.needIndent?t.needIndent:n!=="arrow",s=e.helpers||[],a=Moe(e,{filename:r,breakLineCode:i,needIndent:o});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(o),s.length>0&&(a.push(`const { ${HC(s.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),tp(a,e),a.deindent(o),a.push("}"),delete e.helpers;const{code:c,map:l}=a.context();return{ast:e,code:c,map:l?l.toJSON():void 0}};function zoe(e,t={}){const n=co({},t),r=!!n.jit,i=!!n.minify,o=n.optimize==null?!0:n.optimize,a=xoe(n).parse(e);return r?(o&&Noe(a),i&&ch(a),{ast:a,code:""}):(Loe(a,n),Hoe(a,n))}/*!
* core-base v10.0.8
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/function Woe(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(D0().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(D0().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function el(e){return Ar(e)&&WC(e)===0&&(oc(e,"b")||oc(e,"body"))}const AW=["b","body"];function Voe(e){return Hd(e,AW)}const CW=["c","cases"];function Goe(e){return Hd(e,CW,[])}const wW=["s","static"];function Joe(e){return Hd(e,wW)}const TW=["i","items"];function Zoe(e){return Hd(e,TW,[])}const IW=["t","type"];function WC(e){return Hd(e,IW)}const PW=["v","value"];function y2(e,t){const n=Hd(e,PW);if(n!=null)return n;throw Um(t)}const OW=["m","modifier"];function Yoe(e){return Hd(e,OW)}const _W=["k","key"];function Xoe(e){const t=Hd(e,_W);if(t)return t;throw Um(6)}function Hd(e,t,n){for(let r=0;r<t.length;r++){const i=t[r];if(oc(e,i)&&e[i]!=null)return e[i]}return n}const RW=[...AW,...CW,...wW,...TW,..._W,...OW,...PW,...IW];function Um(e){return new Error(`unhandled node type: ${e}`)}function F6(e){return n=>Qoe(n,e)}function Qoe(e,t){const n=Voe(t);if(n==null)throw Um(0);if(WC(n)===1){const o=Goe(n);return e.plural(o.reduce((s,a)=>[...s,iO(e,a)],[]))}else return iO(e,n)}function iO(e,t){const n=Joe(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const r=Zoe(t).reduce((i,o)=>[...i,h7(e,o)],[]);return e.normalize(r)}}function h7(e,t){const n=WC(t);switch(n){case 3:return y2(t,n);case 9:return y2(t,n);case 4:{const r=t;if(oc(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(oc(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw Um(n)}case 5:{const r=t;if(oc(r,"i")&&zi(r.i))return e.interpolate(e.list(r.i));if(oc(r,"index")&&zi(r.index))return e.interpolate(e.list(r.index));throw Um(n)}case 6:{const r=t,i=Yoe(r),o=Xoe(r);return e.linked(h7(e,o),i?h7(e,i):void 0,e.type)}case 7:return y2(t,n);case 8:return y2(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Koe=e=>e;let E2=Hr();function qoe(e,t={}){let n=!1;const r=t.onError||Soe;return t.onError=i=>{n=!0,r(i)},{...zoe(e,t),detectError:n}}function $oe(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&jt(e)){yr(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||Koe)(e),i=E2[r];if(i)return i;const{ast:o,detectError:s}=qoe(e,{...t,location:!1,jit:!0}),a=F6(o);return s?a:E2[r]=a}else{const n=e.cacheKey;if(n){const r=E2[n];return r||(E2[n]=F6(e))}else return F6(e)}}let jm=null;function ese(e){jm=e}function tse(e,t,n){jm&&jm.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const nse=rse("function:translate");function rse(e){return t=>jm&&jm.emit(e,t)}const ru={INVALID_ARGUMENT:boe,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},ise=24;function iu(e){return cy(e,null,void 0)}function VC(e,t){return t.locale!=null?oO(t.locale):oO(e.locale)}let U6;function oO(e){if(jt(e))return e;if(ri(e)){if(e.resolvedOnce&&U6!=null)return U6;if(e.constructor.name==="Function"){const t=e();if(voe(t))throw iu(ru.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return U6=t}else throw iu(ru.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw iu(ru.NOT_SUPPORT_LOCALE_TYPE)}function ose(e,t,n){return[...new Set([n,..._i(t)?t:Ar(t)?Object.keys(t):jt(t)?[t]:[n]])]}function kW(e,t,n){const r=jt(n)?n:Hm,i=e;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let s=[n];for(;_i(s);)s=sO(o,s,t);const a=_i(t)||!Vn(t)?t:t.default?t.default:null;s=jt(a)?[a]:a,_i(s)&&sO(o,s,!1),i.__localeChainCache.set(r,o)}return o}function sO(e,t,n){let r=!0;for(let i=0;i<t.length&&yr(r);i++){const o=t[i];jt(o)&&(r=sse(e,t[i],n))}return r}function sse(e,t,n){let r;const i=t.split("-");do{const o=i.join("-");r=ase(e,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function ase(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!=="!";const i=t.replace(/!/g,"");e.push(i),(_i(n)||Vn(n))&&n[i]&&(r=n[i])}return r}const zd=[];zd[0]={w:[0],i:[3,0],"[":[4],o:[7]};zd[1]={w:[1],".":[2],"[":[4],o:[7]};zd[2]={w:[2],i:[3,0],0:[3,0]};zd[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};zd[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};zd[5]={"'":[4,0],o:8,l:[5,0]};zd[6]={'"':[4,0],o:8,l:[6,0]};const cse=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function lse(e){return cse.test(e)}function use(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function dse(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function fse(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:lse(t)?use(t):"*"+t}function hse(e){const t=[];let n=-1,r=0,i=0,o,s,a,c,l,u,d;const f=[];f[0]=()=>{s===void 0?s=a:s+=a},f[1]=()=>{s!==void 0&&(t.push(s),s=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4Line truncated
* vue-i18n v10.0.8
* (c) 2025 kazuya kawaguchi
* Released under the MIT License.
*/const Use="10.0.8";function jse(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(D0().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(D0().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(D0().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(D0().__INTLIFY_PROD_DEVTOOLS__=!1)}const ps={UNEXPECTED_RETURN_TYPE:ise,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function js(e,...t){return cy(e,null,void 0)}const v7=jd("__translateVNode"),y7=jd("__datetimeParts"),E7=jd("__numberParts"),HW=jd("__setPluralRules"),zW=jd("__injectWithOption"),b7=jd("__dispose");function zm(e){if(!Ar(e)||el(e))return e;for(const t in e)if(oc(e,t))if(!t.includes("."))Ar(e[t])&&zm(e[t]);else{const n=t.split("."),r=n.length-1;let i=e,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=Hr()),!Ar(i[n[s]])){o=!0;break}i=i[n[s]]}if(o||(el(i)?RW.includes(n[r])||delete e[t]:(i[n[r]]=e[t],delete e[t])),!el(i)){const s=i[n[r]];Ar(s)&&zm(s)}}return e}function JC(e,t){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=t,s=Vn(n)?n:_i(r)?Hr():{[e]:Hr()};if(_i(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:l}=a;c?(s[c]=s[c]||Hr(),U5(l,s[c])):U5(l,s)}else jt(a)&&U5(JSON.parse(a),s)}),i==null&&o)for(const a in s)oc(s,a)&&zm(s[a]);return s}function WW(e){return e.type}function VW(e,t,n){let r=Ar(t.messages)?t.messages:Hr();"__i18nGlobal"in n&&(r=JC(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{e.mergeLocaleMessage(o,r[o])});{if(Ar(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(s=>{e.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(Ar(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(s=>{e.mergeNumberFormat(s,t.numberFormats[s])})}}}function EO(e){return be(yf,null,e,0)}const bO="__INTLIFY_META__",SO=()=>[],Hse=()=>!1;let AO=0;function CO(e){return((t,n,r,i)=>e(n,r,yn()||void 0,i))}const zse=()=>{const e=yn();let t=null;return e&&(t=WW(e)[bO])?{[bO]:t}:null};function ZC(e={}){const{__root:t,__injectWithOption:n}=e,r=t===void 0,i=e.flatJson,o=G3?se:xo;let s=yr(e.inheritLocale)?e.inheritLocale:!0;const a=o(t&&s?t.locale.value:jt(e.locale)?e.locale:Hm),c=o(t&&s?t.fallbackLocale.value:jt(e.fallbackLocale)||_i(e.fallbackLocale)||Vn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a.value),l=o(JC(a.value,e)),u=o(Vn(e.datetimeFormats)?e.datetimeFormats:{[a.value]:{}}),d=o(Vn(e.numberFormats)?e.numberFormats:{[a.value]:{}});let f=t?t.missingWarn:yr(e.missingWarn)||ep(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:yr(e.fallbackWarn)||ep(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:yr(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,m=ri(e.missing)?e.missing:null,y=ri(e.missing)?CO(e.missing):null,v=ri(e.postTranslation)?e.postTranslation:null,E=t?t.warnHtmlMessage:yr(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const S=t?t.modifiers:Vn(e.modifiers)?e.modifiers:{};let w=e.pluralRules||t&&t.pluralRules,C;C=(()=>{r&&uO(null);const oe={version:Use,locale:a.value,fallbackLocale:c.value,messages:l.value,modifiers:S,pluralRules:w,missing:y===null?void 0:y,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:E,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};oe.datetimeFormats=u.value,oe.numberFormats=d.value,oe.__datetimeFormatters=Vn(C)?C.__datetimeFormatters:void 0,oe.__numberFormatters=Vn(C)?C.__numberFormatters:void 0;const Ne=wse(oe);return r&&uO(Ne),Ne})(),l1(C,a.value,c.value);function I(){return[a.value,c.value,l.value,u.value,d.value]}const O=V({get:()=>a.value,set:oe=>{a.value=oe,C.locale=a.value}}),L=V({get:()=>c.value,set:oe=>{c.value=oe,C.fallbackLocale=c.value,l1(C,a.value,oe)}}),R=V(()=>l.value),F=V(()=>u.value),W=V(()=>d.value);function J(){return ri(v)?v:null}function Y(oe){v=oe,C.postTranslation=oe}function M(){return m}function B(oe){oe!==null&&(y=CO(oe)),m=oe,C.missing=y}const q=(oe,Ne,x,N,U,de)=>{I();let we;try{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=t?Cse():void 0),we=oe(C)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=void 0)}if(x!=="translate exists"&&zi(we)&&we===ly||x==="translate exists"&&!we){const[Ae,Le]=Ne();return t&&p?N(t):U(Ae)}else{if(de(we))return we;throw js(ps.UNEXPECTED_RETURN_TYPE)}};function z(...oe){return q(Ne=>Reflect.apply(yO,null,[Ne,...oe]),()=>g7(...oe),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...oe]),Ne=>Ne,Ne=>jt(Ne))}function A(...oe){const[Ne,x,N]=oe;if(N&&!Ar(N))throw js(ps.INVALID_ARGUMENT);return z(Ne,x,co({resolvedMessage:!0},N||{}))}function T(...oe){return q(Ne=>Reflect.apply(fO,null,[Ne,...oe]),()=>p7(...oe),"datetime format",Ne=>Reflect.applLine truncated
M 50 50
m 0 ${b?"":"-"}${E}
a ${E} ${E} 0 1 1 0 ${b?"-":""}${E*2}
a ${E} ${E} 0 1 1 0 ${b?"":"-"}${E*2}
`}),c=V(()=>2*Math.PI*s.value),l=V(()=>t.type==="dashboard"?.75:1),u=V(()=>`${-1*c.value*(1-l.value)/2}px`),d=V(()=>({strokeDasharray:`${c.value*l.value}px, ${c.value}px`,strokeDashoffset:u.value})),f=V(()=>({strokeDasharray:`${c.value*l.value*(t.percentage/100)}px, ${c.value}px`,strokeDashoffset:u.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),h=V(()=>{let E;return t.color?E=v(t.percentage):E=n[t.status]||n.default,E}),p=V(()=>t.status==="warning"?KV:t.type==="line"?t.status==="success"?XV:by:t.status==="success"?h1e:ip),g=V(()=>t.type==="line"?12+t.strokeWidth*.4:t.width*.111111+2),m=V(()=>t.format(t.percentage));function y(E){const b=100/E.length;return E.map((w,C)=>Yt(w)?{color:w,percentage:(C+1)*b}:w).sort((w,C)=>w.percentage-C.percentage)}const v=E=>{var b;const{color:S}=t;if(kt(S))return S(E);if(Yt(S))return S;{const w=y(S);for(const C of w)if(C.percentage>E)return C.color;return(b=w[w.length-1])==null?void 0:b.color}};return(E,b)=>(ne(),Te("div",{class:je([P(r).b(),P(r).m(E.type),P(r).is(E.status),{[P(r).m("without-text")]:!E.showText,[P(r).m("text-inside")]:E.textInside}]),role:"progressbar","aria-valuenow":E.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[E.type==="line"?(ne(),Te("div",{key:0,class:je(P(r).b("bar"))},[G("div",{class:je(P(r).be("bar","outer")),style:Ut({height:`${E.strokeWidth}px`})},[G("div",{class:je([P(r).be("bar","inner"),{[P(r).bem("bar","inner","indeterminate")]:E.indeterminate},{[P(r).bem("bar","inner","striped")]:E.striped},{[P(r).bem("bar","inner","striped-flow")]:E.stripedFlow}]),style:Ut(P(i))},[(E.showText||E.$slots.default)&&E.textInside?(ne(),Te("div",{key:0,class:je(P(r).be("bar","innerText"))},[St(E.$slots,"default",{percentage:E.percentage},()=>[G("span",null,Ue(P(m)),1)])],2)):Ke("v-if",!0)],6)],6)],2)):(ne(),Te("div",{key:1,class:je(P(r).b("circle")),style:Ut({height:`${E.width}px`,width:`${E.width}px`})},[(ne(),Te("svg",{viewBox:"0 0 100 100"},[G("path",{class:je(P(r).be("circle","track")),d:P(a),stroke:`var(${P(r).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":E.strokeLinecap,"stroke-width":P(o),fill:"none",style:Ut(P(d))},null,14,["d","stroke","stroke-linecap","stroke-width"]),G("path",{class:je(P(r).be("circle","path")),d:P(a),stroke:P(h),fill:"none",opacity:E.percentage?1:0,"stroke-linecap":E.strokeLinecap,"stroke-width":P(o),style:Ut(P(f))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),(E.showText||E.$slots.default)&&!E.textInside?(ne(),Te("div",{key:2,class:je(P(r).e("text")),style:Ut({fontSize:`${P(g)}px`})},[St(E.$slots,"default",{percentage:E.percentage},()=>[E.status?(ne(),Ze(P(Pn),{key:1},{default:Re(()=>[(ne(),Ze(Br(P(p))))]),_:1})):(ne(),Te("span",{key:0},Ue(P(m)),1))])],6)):Ke("v-if",!0)],10,["aria-valuenow"]))}});var u3e=Rn(l3e,[["__file","progress.vue"]]);const KG=Vi(u3e),d3e=e=>["",...fw].includes(e),f3e=Un({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:d3e},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:ks},activeActionIcon:{type:ks},activeIcon:{type:ks},inactiveIcon:{type:ks},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Mt(Function)},id:String,tabindex:{type:[String,Number]},...yl(["ariaLabel"])}),h3e={[Yr]:e=>vi(e)||Yt(e)||_n(e),[ms]:e=>vi(e)||Yt(e)||_n(e),[du]:e=>vi(e)||Yt(e)||_n(e)},qG="ElSwitch",p3e=Je({name:qG}),m3e=Je({...p3e,props:f3e,emits:h3e,setup(e,{expose:t,emit:n}){const r=e,{formItem:i}=Iu(),o=fl(),s=pn("switch"),{inputId:a}=kp(r,{formItemContext:i}),c=Af(V(()=>r.loading)),l=se(r.modelValue!==!1),u=se(),d=se(),f=V(()=>[s.b(),s.m(o.value),s.is("disabled",c.value),s.is("checked",y.value)]),h=V(()=>[s.e("label"),s.em("label","left"),s.is("active",!y.value)]),p=V(()=>[s.e("label"),s.em("label","right"),s.is("active",y.value)]),g=V(()=>({width:ul(r.width)}));Ye(()=>r.modelValue,()=>{l.value=!0});const m=V(()=>l.value?r.modelValue:!1),y=V(()=>m.value===r.activeValue);[r.activeValue,r.inactiveValue].includes(m.value)||(n(Yr,r.inactiveValue),n(ms,r.inactiveValue),n(du,r.inactiveValue)),Ye(y,S=>{var w;u.value.checked=S,r.validateEvent&&((w=i==null?void 0:i.validate)==null||w.call(i,"change").catch(C=>void 0))});const v=()=>{const S=y.value?r.inactiveValue:r.activeValue;n(Yr,S),n(ms,S),n(du,S),Cn(()=>{u.value.checked=y.value})},E=()=>{if(c.value)return;const{beforeChange:S}=r;if(!S){v();return}const w=S();[D3(w),vi(w)].includes(!0)||Rp(qG,"beforeChange must return type `Promise<boolean>` or `boolean`"),D3(w)?w.then(_=>{_&&v()}).catch(_=>{}):w&&v()},b=()=>{var S,w;(w=(S=u.value)==null?void 0:S.focus)==null||w.call(S)};return ln(()=>{u.value.checked=y.value}),t({focus:b,checked:y}),(S,w)=>(ne(),Te("div",{class:je(Line truncated
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/const u4e=function(e,t){if(e&&e.addEventListener){const n=function(r){const i=l4e(r);t&&Reflect.apply(t,this,[r,i])};e.addEventListener("wheel",n,{passive:!0})}},d4e={beforeMount(e,t){u4e(e,t.value)}};let f4e=1;const h4e=Je({name:"ElTable",directives:{Mousewheel:d4e},components:{TableHeader:H3e,TableBody:X3e,TableFooter:q3e,ElScrollbar:vw,hColgroup:aJ},props:n4e,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=Vd(),n=pn("table"),r=yn();ui(Sc,r);const i=k3e(r,e);r.store=i;const o=new D3e({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=o;const s=V(()=>(i.states.data.value||[]).length===0),{setCurrentRow:a,getSelectionRows:c,toggleRowSelection:l,clearSelection:u,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:h,clearSort:p,sort:g,updateKeyChildren:m}=$3e(i),{isHidden:y,renderExpanded:v,setDragVisible:E,isGroup:b,handleMouseLeave:S,handleHeaderFooterMousewheel:w,tableSize:C,emptyBlockStyle:_,resizeProxyVisible:I,bodyWidth:O,resizeState:L,doLayout:R,tableBodyStyles:F,tableLayout:W,scrollbarViewStyle:J,scrollbarStyle:Y}=e4e(e,o,i,r),{scrollBarRef:M,scrollTo:B,setScrollLeft:q,setScrollTop:z}=r4e(),A=rp(R,50),T=`${n.namespace.value}-table_${f4e++}`;r.tableId=T,r.state={isGroup:b,resizeState:L,doLayout:R,debouncedUpdateLayout:A};const k=V(()=>{var me;return(me=e.sumText)!=null?me:t("el.table.sumText")}),j=V(()=>{var me;return(me=e.emptyText)!=null?me:t("el.table.emptyText")}),re=V(()=>sJ(i.states.originColumns.value)[0]);return t4e(r),xi(()=>{A.cancel()}),{ns:n,layout:o,store:i,columns:re,handleHeaderFooterMousewheel:w,handleMouseLeave:S,tableId:T,tableSize:C,isHidden:y,isEmpty:s,renderExpanded:v,resizeProxyVisible:I,resizeState:L,isGroup:b,bodyWidth:O,tableBodyStyles:F,emptyBlockStyle:_,debouncedUpdateLayout:A,setCurrentRow:a,getSelectionRows:c,toggleRowSelection:l,clearSelection:u,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:h,clearSort:p,doLayout:R,sort:g,updateKeyChildren:m,t,setDragVisible:E,context:r,computedSumText:k,computedEmptyText:j,tableLayout:W,scrollbarViewStyle:J,scrollbarStyle:Y,scrollBarRef:M,scrollTo:B,setScrollLeft:q,setScrollTop:z,allowDragLastColumn:e.allowDragLastColumn}}});function p4e(e,t,n,r,i,o){const s=Ki("hColgroup"),a=Ki("table-header"),c=Ki("table-body"),l=Ki("table-footer"),u=Ki("el-scrollbar"),d=RC("mousewheel");return ne(),Te("div",{ref:"tableWrapper",class:je([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ut(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[G("div",{class:je(e.ns.e("inner-wrapper"))},[G("div",{ref:"hiddenColumns",class:"hidden-columns"},[St(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?vn((ne(),Te("div",{key:0,ref:"headerWrapper",class:je(e.ns.e("header-wrapper"))},[G("table",{ref:"tableHeader",class:je(e.ns.e("header")),style:Ut(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[be(s,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),be(a,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[d,e.handleHeaderFooterMousewheel]]):Ke("v-if",!0),G("div",{ref:"bodyWrapper",class:je(e.ns.e("body-wrapper"))},[be(u,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,native:e.nativeScrollbar,onScroll:f=>e.$emit("scroll",f)},{default:Re(()=>[G("table",{ref:"tableBody",class:je(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ut({width:e.bodyWidth,tableLayout:e.tableLayout})},[be(s,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(ne(),Ze(a,{key:0,ref:"tableHeaderRef",class:je(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","sLine truncated
* @license
*
* The APCA contrast prediction algorithm is based of the formulas published
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
*
* Note that the APCA implementation is still beta, so please update to
* future versions of chroma.js when they become available.
*
* You can read more about the APCA Readability Criterion at
* https://readtech.org/ARC/
*/const bR=.027,Q8e=5e-4,K8e=.1,SR=1.14,D2=.022,AR=1.414,q8e=(e,t)=>{e=new bt(e),t=new bt(t),e.alpha()<1&&(e=hp(t,e,e.alpha(),"rgb"));const n=CR(...e.rgb()),r=CR(...t.rgb()),i=n>=D2?n:n+Math.pow(D2-n,AR),o=r>=D2?r:r+Math.pow(D2-r,AR),s=Math.pow(o,.56)-Math.pow(i,.57),a=Math.pow(o,.65)-Math.pow(i,.62),c=Math.abs(o-i)<Q8e?0:i<o?s*SR:a*SR;return(Math.abs(c)<K8e?0:c>0?c-bR:c+bR)*100};function CR(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:xl,pow:Zi,min:$8e,max:e9e,atan2:wR,abs:TR,cos:L2,sin:IR,exp:t9e,PI:PR}=Math;function n9e(e,t,n=1,r=1,i=1){var o=function(k){return 360*k/(2*PR)},s=function(k){return 2*PR*k/360};e=new bt(e),t=new bt(t);const[a,c,l]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),h=(a+u)/2,p=xl(Zi(c,2)+Zi(l,2)),g=xl(Zi(d,2)+Zi(f,2)),m=(p+g)/2,y=.5*(1-xl(Zi(m,7)/(Zi(m,7)+Zi(25,7)))),v=c*(1+y),E=d*(1+y),b=xl(Zi(v,2)+Zi(l,2)),S=xl(Zi(E,2)+Zi(f,2)),w=(b+S)/2,C=o(wR(l,v)),_=o(wR(f,E)),I=C>=0?C:C+360,O=_>=0?_:_+360,L=TR(I-O)>180?(I+O+360)/2:(I+O)/2,R=1-.17*L2(s(L-30))+.24*L2(s(2*L))+.32*L2(s(3*L+6))-.2*L2(s(4*L-63));let F=O-I;F=TR(F)<=180?F:O<=I?F+360:F-360,F=2*xl(b*S)*IR(s(F)/2);const W=u-a,J=S-b,Y=1+.015*Zi(h-50,2)/xl(20+Zi(h-50,2)),M=1+.045*w,B=1+.015*w*R,q=30*t9e(-Zi((L-275)/25,2)),A=-(2*xl(Zi(w,7)/(Zi(w,7)+Zi(25,7))))*IR(2*s(q)),T=xl(Zi(W/(n*Y),2)+Zi(J/(r*M),2)+Zi(F/(i*B),2)+A*(J/(r*M))*(F/(i*B)));return e9e(0,$8e(100,T))}function r9e(e,t,n="lab"){e=new bt(e),t=new bt(t);const r=e.get(n),i=t.get(n);let o=0;for(let s in r){const a=(r[s]||0)-(i[s]||0);o+=a*a}return Math.sqrt(o)}const i9e=(...e)=>{try{return new bt(...e),!0}catch{return!1}},o9e={cool(){return o4([Xn.hsl(180,1,.9),Xn.hsl(250,.7,.4)])},hot(){return o4(["#000","#f00","#ff0","#fff"]).mode("rgb")}},K7={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebLine truncated
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&_Ee[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},LR=Symbol("internals");function f1(e){return e&&String(e).trim().toLowerCase()}function Z5(e){return e===!1||e==null?e:Qe.isArray(e)?e.map(Z5):String(e)}function kEe(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const xEe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function m8(e,t,n,r,i){if(Qe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Qe.isString(t)){if(Qe.isString(r))return t.indexOf(r)!==-1;if(Qe.isRegExp(r))return r.test(t)}}function DEe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function LEe(e,t){const n=Qe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}let Ms=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,l){const u=f1(c);if(!u)throw new Error("header name must be a non-empty string");const d=Qe.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=Z5(a))}const s=(a,c)=>Qe.forEach(a,(l,u)=>o(l,u,c));if(Qe.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(Qe.isString(t)&&(t=t.trim())&&!xEe(t))s(REe(t),n);else if(Qe.isObject(t)&&Qe.isIterable(t)){let a={},c,l;for(const u of t){if(!Qe.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?Qe.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(a,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=f1(t),t){const r=Qe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return kEe(i);if(Qe.isFunction(n))return n.call(this,i,r);if(Qe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=f1(t),t){const r=Qe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||m8(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=f1(s),s){const a=Qe.findKey(r,s);a&&(!n||m8(r,r[a],a,n))&&(delete r[a],i=!0)}}return Qe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||m8(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Qe.forEach(this,(i,o)=>{const s=Qe.findKey(r,o);if(s){n[s]=Z5(i),delete n[o];return}const a=t?DEe(o):String(o).trim();a!==o&&delete n[o],n[a]=Z5(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Qe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Qe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[LR]=this[LR]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=f1(s);r[a]||(LEe(i,s),r[a]=!0)}return Qe.isArray(t)?t.forEach(o):o(t),this}};Ms.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Qe.reduceDescriptors(Ms.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Qe.freezeMethods(Ms);function g8(e,t){const n=this||Vg,r=t||n,i=Ms.from(r.headers);let o=r.data;return Qe.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function yZ(e){return!!(e&&e.__CANCEL__)}function Up(e,t,n){Nn.call(this,e??"canceled",Nn.ERR_CANCELED,t,n),this.name="CanceledError"}Qe.inherits(Up,Nn,{__CANCEL__:!0});function EZ(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Nn("Request failed with status code "+n.status,[Nn.ERR_BAD_REQUEST,Nn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function NEe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function MEe(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[o];s||(s=l),n[i]=c,r[i]=l;let d=o,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function BEe(e,t){let n=0,r=1e3/t,i,o;const s=(l,u=Date.now())=>{n=u,i=null,o&&(clearTimeout(o),o=null),e(...l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?s(l,u):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},r-d)))},()=>i&&s(i)]}const a4=(e,t,n=3)=>{let r=0;const i=MEe(50,250);return BEe(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-r,l=i(c),u=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-s)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},NR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},MR=e=>(...t)=>Qe.asap(()=>e(...t)),FEe=Xo.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Xo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Xo.origin),Xo.navigator&&/(msie|trident)/i.test(Xo.navigator.userAgent)):()=>!0,UEe=Xo.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];Qe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Qe.isString(r)&&s.push("path="+r),Qe.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jEe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function HEe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bZ(e,t,n){let r=!jEe(t);return e&&(r||n==!1)?HEe(e,t):t}const BR=e=>e instanceof Ms?{...e}:e;function uf(e,t){t=t||{};const n={};function r(l,u,d,f){return Qe.isPlainObject(l)&&Qe.isPlainObject(u)?Qe.merge.call({caseless:f},l,u):Qe.isPlainObject(u)?Qe.merge({},u):Qe.isArray(u)?u.slice():u}function i(l,u,d,f){if(Qe.isUndefined(u)){if(!Qe.isUndefined(l))return r(void 0,l,d,f)}else return r(l,u,d,f)}function o(l,u){if(!Qe.isUndefined(u))return r(void 0,u)}function s(l,u){if(Qe.isUndefined(u)){if(!Qe.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function a(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u,d)=>i(BR(l),BR(u),d,!0)};return Qe.forEach(Object.keys({...e,...t}),function(u){const d=c[u]||i,f=d(e[u],t[u],u);Qe.isUndefined(f)&&d!==a||(n[u]=f)}),n}const SZ=e=>{const t=uf({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=Ms.from(s),t.url=mZ(bZ(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(Qe.isFormData(n)){if(Xo.hasStandardBrowserEnv||Xo.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Xo.hasStandardBrowserEnv&&(r&&Qe.isFunction(r)&Line truncated
`+o.map(jR).join(`
`):" "+jR(o[0]):"as no adapter specified";throw new Nn("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:nb};function v8(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Up(null,e)}function HR(e){return v8(e),e.headers=Ms.from(e.headers),e.data=g8.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wZ.getAdapter(e.adapter||Vg.adapter)(e).then(function(r){return v8(e),r.data=g8.call(e,e.transformResponse,r),r.headers=Ms.from(r.headers),r},function(r){return yZ(r)||(v8(e),r&&r.response&&(r.response.data=g8.call(e,e.transformResponse,r.response),r.response.headers=Ms.from(r.response.headers))),Promise.reject(r)})}const TZ="1.11.0",Dy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Dy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const zR={};Dy.transitional=function(t,n,r){function i(o,s){return"[Axios v"+TZ+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new Nn(i(s," has been removed"+(n?" in "+n:"")),Nn.ERR_DEPRECATED);return n&&!zR[s]&&(zR[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};Dy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function e7e(e,t,n){if(typeof e!="object")throw new Nn("options must be an object",Nn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new Nn("option "+o+" must be "+c,Nn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Nn("Unknown option "+o,Nn.ERR_BAD_OPTION)}}const Y5={assertOptions:e7e,validators:Dy},Oc=Y5.validators;let q0=class{constructor(t){this.defaults=t||{},this.interceptors={request:new DR,response:new DR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=uf(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Y5.assertOptions(r,{silentJSONParsing:Oc.transitional(Oc.boolean),forcedJSONParsing:Oc.transitional(Oc.boolean),clarifyTimeoutError:Oc.transitional(Oc.boolean)},!1),i!=null&&(Qe.isFunction(i)?n.paramsSerializer={serialize:i}:Y5.assertOptions(i,{encode:Oc.function,serialize:Oc.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Y5.assertOptions(n,{baseUrl:Oc.spelling("baseURL"),withXsrfToken:Oc.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&Qe.merge(o.common,o[n.method]);o&&Qe.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=Ms.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let u,d=0,f;if(!c){const p=[HR.bind(this),void 0];for(p.unshift(...a),p.push(...l),f=p.length,u=Promise.resolve(n);d<f;)u=u.then(p[d++],p[d++]);return u}f=a.length;let h=n;for(d=0;d<f;){const p=a[d++],g=a[d++];try{h=p(h)}catch(m){g.call(this,m);break}}try{u=HR.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=uf(this.defaults,t);const n=bZ(t.baseURL,t.url,t.allowAbsoluteUrls);return mZ(n,t.params,t.paramsSerializer)}};Qe.forEach(["delete","get","head","options"],function(t){q0.prototype[t]=function(n,r){return this.request(uf(r||{},{method:t,url:n,data:(r||{}).data}))}});Qe.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(uf(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}q0.prototype[t]=n(),q0.prototype[t+"Form"]=n(!0)});let t7e=class IZ{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new Up(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new IZ(function(i){t=i}),cancel:t}}};function n7e(e){return function(n){return e.apply(null,n)}}function r7e(e){return Qe.isObject(e)&&e.isAxiosError===!0}const rb={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(rb).forEach(([e,t])=>{rb[t]=e});function PZ(e){const t=new q0(e),n=rZ(q0.prototype.request,t);return Qe.extend(n,q0.prototype,t,{allOwnKeys:!0}),Qe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return PZ(uf(e,i))},n}const to=PZ(Vg);to.Axios=q0;to.CanceledError=Up;to.CancelToken=t7e;to.isCancel=yZ;to.VERSION=TZ;to.toFormData=ky;to.AxiosError=Nn;to.Cancel=to.CanceledError;to.all=function(t){return Promise.all(t)};to.spread=n7e;to.isAxiosError=r7e;to.mergeConfig=uf;to.AxiosHeaders=Ms;to.formToJSON=e=>vZ(Qe.isHTMLForm(e)?new FormData(e):e);to.getAdapter=wZ.getAdapter;to.HttpStatusCode=rb;to.dLine truncated
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/return(function(r){var i=n,o=i.lib,s=o.WordArray,a=o.Hasher,c=i.algo,l=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=s.create([0,1518500249,1859775393,2400959708,2840853838]),p=s.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=a.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(w,C){for(var _=0;_<16;_++){var I=C+_,O=w[I];w[I]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}var L=this._hash.words,R=h.words,F=p.words,W=l.words,J=u.words,Y=d.words,M=f.words,B,q,z,A,T,k,j,re,me,te;k=B=L[0],j=q=L[1],re=z=L[2],me=A=L[3],te=T=L[4];for(var X,_=0;_<80;_+=1)X=B+w[C+W[_]]|0,_<16?X+=m(q,z,A)+R[0]:_<32?X+=y(q,z,A)+R[1]:_<48?X+=v(q,z,A)+R[2]:_<64?X+=E(q,z,A)+R[3]:X+=b(q,z,A)+R[4],X=X|0,X=S(X,Y[_]),X=X+T|0,B=T,T=A,A=S(z,10),z=q,q=X,X=k+w[C+J[_]]|0,_<16?X+=b(j,re,me)+F[0]:_<32?X+=E(j,re,me)+F[1]:_<48?X+=v(j,re,me)+F[2]:_<64?X+=y(j,re,me)+F[3]:X+=m(j,re,me)+F[4],X=X|0,X=S(X,M[_]),X=X+te|0,k=te,te=me,me=S(re,10),re=j,j=X;X=L[1]+z+me|0,L[1]=L[2]+A+te|0,L[2]=L[3]+T+k|0,L[3]=L[4]+B+j|0,L[4]=L[0]+q+re|0,L[0]=X},_doFinalize:function(){var w=this._data,C=w.words,_=this._nDataBytes*8,I=w.sigBytes*8;C[I>>>5]|=128<<24-I%32,C[(I+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,w.sigBytes=(C.length+1)*4,this._process();for(var O=this._hash,L=O.words,R=0;R<5;R++){var F=L[R];L[R]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360}return O},clone:function(){var w=a.clone.call(this);return w._hash=this._hash.clone(),w}});function m(w,C,_){return w^C^_}function y(w,C,_){return w&C|~w&_}function v(w,C,_){return(w|~C)^_}function E(w,C,_){return w&_|C&~_}function b(w,C,_){return w^(C|~_)}function S(w,C){return w<<C|w>>>32-C}i.RIPEMD160=a._createHelper(g),i.HmacRIPEMD160=a._createHmacHelper(g)})(),n.RIPEMD160})})(lv)),lv.exports}var uv={exports:{}},_7e=uv.exports,rk;function oT(){return rk||(rk=1,(function(e,t){(function(n,r){e.exports=r(sr())})(_7e,function(n){(function(){var r=n,i=r.lib,o=i.Base,s=r.enc,a=s.Utf8,c=r.algo;c.HMAC=o.extend({init:function(l,u){l=this._hasher=new l.init,typeof u=="string"&&(u=a.parse(u));var d=l.blockSize,f=d*4;u.sigBytes>f&&(u=l.finalize(u)),u.clamp();for(var h=this._oKey=u.clone(),p=this._iKey=u.clone(),g=h.words,m=p.words,y=0;y<d;y++)g[y]^=1549556828,m[y]^=909522486;h.sigBytes=p.sigBytes=f,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var u=this._hasher,d=u.finalize(l);u.reset();var f=u.finalize(this._oKey.clone().concat(d));return f}})})()})})(uv)),uv.exports}var dv={exports:{}},R7e=dv.exports,ik;function k7e(){return ik||(ik=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),iT(),oT())})(R7e,function(n){return(function(){var r=n,i=r.lib,o=i.Base,s=i.WordArray,a=r.algo,c=a.SHA256,l=a.HMAC,u=a.PBKDF2=o.extend({cfg:o.extend({keySize:128/32,hasher:c,iterations:25e4}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,f){for(var h=this.cfg,p=l.create(h.hasher,d),g=s.create(),m=s.create([1]),y=g.words,v=m.words,E=h.keySize,b=h.iterations;y.length<E;){var S=p.update(f).finalize(m);p.reset();for(var w=S.words,C=w.length,_=S,I=1;I<b;I++){_=p.finalize(_),p.reset();for(var O=_.words,L=0;L<C;L++)w[L]^=O[L]}g.concat(S),v[0]++}return g.sigBytes=E*4,g}});r.PBKDF2=function(d,f,h){return u.create(h).compute(d,f)}})(),n.PBKDF2})})(dv)),dv.exports}var fv={exports:{}},x7e=fv.exports,ok;function Qd(){return ok||(ok=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),OZ(),oT())})(x7e,function(n){return(function(){var r=n,i=r.lib,o=i.Base,s=i.WordArray,a=r.algo,c=a.MD5,l=a.EvpKDF=o.extend({cfg:o.extend({keySize:128/32,hasher:c,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,d){for(var f,h=this.cfg,p=h.hasher.create(),g=s.create(),m=g.words,y=h.keySize,v=h.iterations;m.length<y;){f&&p.update(f),f=p.update(u).finalize(d),p.reset();for(var E=1;E<v;E++)f=p.finalize(f),p.reset();g.concat(f)}return g.sigBytes=y*4,g}});r.EvpKDF=function(u,d,f){return l.create(f).compute(u,d)}})(),n.EvpKDF})})(fv)),fv.exports}var hv={exports:{}},D7e=hv.exports,sk;function bo(){return sk||(sk=1,(function(e,t){(Line truncated
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/return n.mode.CTRGladman=(function(){var r=n.lib.BlockCipherMode.extend();function i(a){if((a>>24&255)===255){var c=a>>16&255,l=a>>8&255,u=a&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,a=0,a+=c<<16,a+=l<<8,a+=u}else a+=1<<24;return a}function o(a){return(a[0]=i(a[0]))===0&&(a[1]=i(a[1])),a}var s=r.Encryptor=r.extend({processBlock:function(a,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),o(f);var h=f.slice(0);l.encryptBlock(h,0);for(var p=0;p<u;p++)a[c+p]^=h[p]}});return r.Decryptor=s,r})(),n.mode.CTRGladman})})(gv)),gv.exports}var vv={exports:{}},j7e=vv.exports,uk;function H7e(){return uk||(uk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(j7e,function(n){return n.mode.OFB=(function(){var r=n.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(o,s){var a=this._cipher,c=a.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),a.encryptBlock(u,0);for(var d=0;d<c;d++)o[s+d]^=u[d]}});return r.Decryptor=i,r})(),n.mode.OFB})})(vv)),vv.exports}var yv={exports:{}},z7e=yv.exports,dk;function W7e(){return dk||(dk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(z7e,function(n){return n.mode.ECB=(function(){var r=n.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(i,o){this._cipher.encryptBlock(i,o)}}),r.Decryptor=r.extend({processBlock:function(i,o){this._cipher.decryptBlock(i,o)}}),r})(),n.mode.ECB})})(yv)),yv.exports}var Ev={exports:{}},V7e=Ev.exports,fk;function G7e(){return fk||(fk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(V7e,function(n){return n.pad.AnsiX923={pad:function(r,i){var o=r.sigBytes,s=i*4,a=s-o%s,c=o+a-1;r.clamp(),r.words[c>>>2]|=a<<24-c%4*8,r.sigBytes+=a},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Ansix923})})(Ev)),Ev.exports}var bv={exports:{}},J7e=bv.exports,hk;function Z7e(){return hk||(hk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(J7e,function(n){return n.pad.Iso10126={pad:function(r,i){var o=i*4,s=o-r.sigBytes%o;r.concat(n.lib.WordArray.random(s-1)).concat(n.lib.WordArray.create([s<<24],1))},unpad:function(r){var i=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=i}},n.pad.Iso10126})})(bv)),bv.exports}var Sv={exports:{}},Y7e=Sv.exports,pk;function X7e(){return pk||(pk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(Y7e,function(n){return n.pad.Iso97971={pad:function(r,i){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,i)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971})})(Sv)),Sv.exports}var Av={exports:{}},Q7e=Av.exports,mk;function K7e(){return mk||(mk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(Q7e,function(n){return n.pad.ZeroPadding={pad:function(r,i){var o=i*4;r.clamp(),r.sigBytes+=o-(r.sigBytes%o||o)},unpad:function(r){for(var i=r.words,o=r.sigBytes-1,o=r.sigBytes-1;o>=0;o--)if(i[o>>>2]>>>24-o%4*8&255){r.sigBytes=o+1;break}}},n.pad.ZeroPadding})})(Av)),Av.exports}var Cv={exports:{}},q7e=Cv.exports,gk;function $7e(){return gk||(gk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(q7e,function(n){return n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding})})(Cv)),Cv.exports}var wv={exports:{}},ebe=wv.exports,vk;function tbe(){return vk||(vk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),bo())})(ebe,function(n){return(function(r){var i=n,o=i.lib,s=o.CipherParams,a=i.enc,c=a.Hex,l=i.format;l.Hex={stringify:function(u){return u.ciphertext.toString(c)},parse:function(u){var d=c.parse(u);return s.create({ciphertext:d})}}})(),n.format.Hex})})(wv)),wv.exports}var Tv={exports:{}},nbe=Tv.exports,yk;function rbe(){return yk||(yk=1,(function(e,t){(function(n,r,i){e.exports=r(sr(),Cf(),wf(),Qd(),bo())})(nbe,function(n){return(function(){var r=n,i=r.lib,o=i.BlockCipher,s=r.algo,a=[],c=[],l=[],u=[],d=[],f=[],h=[],p=[],g=[],m=[];(function(){for(var E=[],b=0;b<256;b++)b<128?E[b]=b<<1:E[b]=b<<1^283;for(var S=0,w=0,b=0;b<256;b++){var C=w^w<<1^w<<2^w<<3^w<<4;C=C>>>8^C&255^99,a[S]=C,c[C]=S;var _=E[S],I=E[_],O=E[I],L=E[C]*257^C*16843008;l[S]=L<<24|L>>>8,u[S]=L<<16|L>>>16,d[S]=L<<8|L>>>24,f[S]=L;var L=O*16843009^I*65537^_*257^S*16843008;h[C]=L<<24|L>>>8,p[C]=L<<16|L>>>16,g[C]=L<<8|L>>>24,m[C]=L,S?(S=_^E[E[E[O^_]]],w^=E[E[w]]):S=w=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],v=s.AES=o.extend({_doReset:function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var b=this._keyPriorReset=this._key,S=b.words,w=b.sigBytes/4,C=this._nRounds=w+6,_=(C+1)*4,I=this._keySchedule=[],O=0;O<_;O++)O<w?I[O]=S[O]:(E=I[O-1],O%w?w>6&&O%w==4&&(E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255]):(E=E<<8|E>>>24,E=a[E>>>24]<<24|a[E>>>16&255]<<16|a[E>>>8&255]<<8|a[E&255],E^=y[O/w|0]<<24),I[O]=I[O-w]^E);for(var L=this._invKeySchedule=[],R=0;R<_;R++){var O=_-R;if(R%4)var E=I[O];else var E=I[O-4];R<4||O<=4?L[R]=E:L[R]=h[a[E>>>24]]^p[a[E>>>16&255]]^g[a[E>>>8&255]]^mLine truncated
`;super(i),this.name="AggregateError",this.errors=r}};t.exports={AggregateError:n,ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,o){return r.slice(i,o)},Error,FunctionPrototypeCall(r,i,...o){return r.call(i,...o)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,o){return Object.defineProperty(r,i,o)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,o){return r.then(i,o)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String,StringPrototypeSlice(r,i,o){return r.slice(i,o)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,o){return r.set(i,o)},Boolean,Uint8Array}}),QZ=st((e,t)=>{tt(),rt(),nt(),t.exports={format(n,...r){return n.replace(/%([sdifj])/g,function(...[i,o]){let s=r.shift();return o==="f"?s.toFixed(6):o==="j"?JSON.stringify(s):o==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(n){switch(typeof n){case"string":if(n.includes("'"))if(n.includes('"')){if(!n.includes("`")&&!n.includes("${"))return`\`${n}\``}else return`"${n}"`;return`'${n}'`;case"number":return isNaN(n)?"NaN":Object.is(n,-0)?String(n):n;case"bigint":return`${String(n)}n`;case"boolean":case"undefined":return String(n);case"object":return"{}"}}}}),vs=st((e,t)=>{tt(),rt(),nt();var{format:n,inspect:r}=QZ(),{AggregateError:i}=yi(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",u={};function d(v,E){if(!v)throw new u.ERR_INTERNAL_ASSERTION(E)}function f(v){let E="",b=v.length,S=v[0]==="-"?1:0;for(;b>=S+4;b-=3)E=`_${v.slice(b-3,b)}${E}`;return`${v.slice(0,b)}${E}`}function h(v,E,b){if(typeof E=="function")return d(E.length<=b.length,`Code: ${v}; The provided arguments length (${b.length}) does not match the required ones (${E.length}).`),E(...b);let S=(E.match(/%[dfijoOs]/g)||[]).length;return d(S===b.length,`Code: ${v}; The provided arguments length (${b.length}) does not match the required ones (${S}).`),b.length===0?E:n(E,...b)}function p(v,E,b){b||(b=Error);class S extends b{constructor(...C){super(h(v,E,C))}toString(){return`${this.name} [${v}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:b.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${v}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=v,S.prototype[s]=!0,u[v]=S}function g(v){let E=l+v.name;return Object.defineProperty(v,"name",{value:E}),v}function m(v,E){if(v&&E&&v!==E){if(Array.isArray(E.errors))return E.errors.push(v),E;let b=new o([E,v],E.message);return b.code=E.code,b}return v||E}var y=class extends Error{constructor(v="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",E);super(v,E),this.code="ABORT_ERR",this.name="AbortError"}};p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(v,E,b)=>{d(typeof v=="string","'name' must be a string"),Array.isArray(E)||(E=[E]);let S="The ";v.endsWith(" argument")?S+=`${v} `:S+=`"${v}" ${v.includes(".")?"property":"argument"} `,S+="must be ";let w=[],C=[],_=[];for(let O of E)d(typeof O=="string","All expected entries have to be of type string"),a.includes(O)?w.push(O.toLowerCase()):c.test(O)?C.push(O):(d(O!=="object",'The value "object" should be written as "Object"'),_.push(O));if(C.length>0){let O=w.indexOf("object");O!==-1&&(w.splice(w,O,1),C.push("Object"))}if(w.length>0){switch(w.length){case 1:S+=`of type ${w[0]}`;break;case 2:S+=`one of type ${w[0]} or ${w[1]}`;break;default:{let O=w.pop();S+=`one of type ${w.join(", ")}, or ${O}`}}(C.length>0|Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),BSe=st((e,t)=>{tt(),rt(),nt();var n=xSe(),r=DSe(),i=NSe(),o=MSe();function s(a,c){return n(a)||r(a,c)||i(a,c)||o()}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}),_Y=st((e,t)=>{tt(),rt(),nt(),(function(n,r){typeof e=="object"&&typeof t<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.fastUniqueNumbers={}))})(e,function(n){var r=function(h){return function(p){var g=h(p);return p.add(g),g}},i=function(h){return function(p,g){return h.set(p,g),g}},o=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,s=536870912,a=s*2,c=function(h,p){return function(g){var m=p.get(g),y=m===void 0?g.size:m<a?m+1:0;if(!g.has(y))return h(g,y);if(g.size<s){for(;g.has(y);)y=Math.floor(Math.random()*a);return h(g,y)}if(g.size>o)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;g.has(y);)y=Math.floor(Math.random()*o);return h(g,y)}},l=new WeakMap,u=i(l),d=c(u,l),f=r(d);n.addUniqueNumber=f,n.generateUniqueNumber=d})}),FSe=st((e,t)=>{tt(),rt(),nt();function n(i,o,s,a,c,l,u){try{var d=i[l](u),f=d.value}catch(h){return void s(h)}d.done?o(f):Promise.resolve(f).then(a,c)}function r(i){return function(){var o=this,s=arguments;return new Promise(function(a,c){var l=i.apply(o,s);function u(f){n(l,a,c,u,d,"next",f)}function d(f){n(l,a,c,u,d,"throw",f)}u(void 0)})}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),RY=st((e,t)=>{tt(),rt(),nt();function n(r,i){this.v=r,this.k=i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),kY=st((e,t)=>{tt(),rt(),nt();function n(r,i,o,s){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}t.exports=n=function(c,l,u,d){function f(h,p){n(c,h,function(g){return this._invoke(h,p,g)})}l?a?a(c,l,{value:u,enumerable:!d,configurable:!d,writable:!d}):c[l]=u:(f("next",0),f("throw",1),f("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,n(r,i,o,s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),xY=st((e,t)=>{tt(),rt(),nt();var n=kY();function r(){var i,o,s=typeof Symbol=="function"?Symbol:{},a=s.iterator||"@@iterator",c=s.toStringTag||"@@toStringTag";function l(y,v,E,b){var S=v&&v.prototype instanceof d?v:d,w=Object.create(S.prototype);return n(w,"_invoke",(function(C,_,I){var O,L,R,F=0,W=I||[],J=!1,Y={p:0,n:0,v:i,a:M,f:M.bind(i,4),d:function(B,q){return O=B,L=0,R=i,Y.n=q,u}};function M(B,q){for(L=B,R=q,o=0;!J&&F&&!z&&o<W.length;o++){var z,A=W[o],T=Y.p,k=A[2];B>3?(z=k===q)&&(R=A[(L=A[4])?5:(L=3,3)],A[4]=A[5]=i):A[0]<=T&&((z=B<2&&T<A[1])?(L=0,Y.v=q,Y.n=A[1]):T<k&&(z=B<3||A[0]>q||q>k)&&(A[4]=B,A[5]=q,Y.n=k,L=0))}if(z||B>1)return u;throw J=!0,q}return function(B,q,z){if(F>1)throw TypeError("Generator is already running");for(J&&q===1&&M(q,z),L=q,R=z;(o=L<2?i:R)||!J;){O||(L?L<3?(L>1&&(Y.n=-1),M(L,R)):Y.n=R:Y.v=R);try{if(F=2,O){if(L||(B="next"),o=O[B]){if(!(o=o.call(O,R)))throw TypeError("iterator result is not an object");if(!o.done)return o;R=o.value,L<2&&(L=0)}else L===1&&(o=O.return)&&o.call(O),L<2&&(R=TypeError("The iterator does not provide a '"+B+"' method"),L=1);O=i}else if((o=(J=Y.n<0)?R:C.call(_,Y))!==u)break}catch(A){O=i,L=1,R=A}finally{F=1}}return{value:o,done:J}}})(y,E,b),!0),w}var u={};function d(){}function f(){}function h(){}o=Object.getPrototypeOf;var p=[][a]?o(o([][a]())):(n(o={},a,function(){return this}),o),g=h.prototype=d.prototype=Object.create(p);function m(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,h):(y.__proto__=h,n(y,c,"GeneratorFunction")),y.prototype=Object.create(g),y}return f.prototype=h,n(g,"constructor",h),n(h,"constructor",f),f.displayName="GeneratorFunction",n(h,c,"GeneratorFunction"),n(g),n(g,c,"Generator"),n(g,a,function(){return this}),n(g,"toString",function(){return"[object Generator]"}),(t.exports=r=function(){return{w:l,m}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),DY=st((e,t)=>{tt(),rt(),nt();var n=RY(),r=kY();function i(o,s){function a(l,u,d,f){try{var h=o[l](u),p=h.value;return p instanceof n?s.resolve(p.v).then(function(g){a("next",g,d,f)},function(g){a("throw",g,d,f)}):s.resolve(p).then(function(g){h.value=g,d(h)},function(g){return a("throw",g,d,f)})}catch(g){f(g)}}var c;this.next||(r(i.prototype),r(i.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(l,u,d){function f(){return new s(function(h,p){a(l,d,h,p)})}return c=c?c.then(f,f):f()},!0)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),LY=st((e,t)=>{tt(),rt(),nt();var n=xY(),r=DY();function i(o,s,a,c,l){return new r(n().w(o,s,a,c),l||Promise)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),USe=st((e,t)=>{tt(),rt(),nt();var n=LY();functLine truncated
`)>=0)return!1;return!0}function we(ue,Ee){var He;if(ue.indent===" ")He=" ";else if(typeof ue.indent=="number"&&ue.indent>0)He=_.call(Array(ue.indent+1)," ");else return null;return{base:He,prev:_.call(Array(Ee+1),He)}}function Ae(ue,Ee){if(ue.length===0)return"";var He=`
`+Ee.prev+Ee.base;return He+_.call(ue,","+He)+`
`+Ee.prev}function Le(ue,Ee){var He=j(ue),Xe=[];if(He){Xe.length=ue.length;for(var qe=0;qe<ue.length;qe++)Xe[qe]=pe(ue,qe)?Ee(ue[qe],ue):""}var It=typeof R=="function"?R(ue):[],We;if(W){We={};for(var $e=0;$e<It.length;$e++)We["$"+It[$e]]=It[$e]}for(var ht in ue)pe(ue,ht)&&(He&&String(Number(ht))===ht&&ht<ue.length||W&&We["$"+ht]instanceof Symbol||(w.call(/[^\w$]/,ht)?Xe.push(Ee(ht,ue)+": "+Ee(ue[ht],ue)):Xe.push(ht+": "+Ee(ue[ht],ue))));if(typeof R=="function")for(var Ht=0;Ht<It.length;Ht++)Y.call(ue,It[Ht])&&Xe.push("["+Ee(It[Ht])+"]: "+Ee(ue[It[Ht]],ue));return Xe}return Qv}function IAe(){if($S)return qv;$S=!0;var e=Wp(),t=dAe(),n=TAe(),r=Jg(),i=e("%WeakMap%",!0),o=e("%Map%",!0),s=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),c=t("WeakMap.prototype.has",!0),l=t("Map.prototype.get",!0),u=t("Map.prototype.set",!0),d=t("Map.prototype.has",!0),f=function(m,y){for(var v=m,E;(E=v.next)!==null;v=E)if(E.key===y)return v.next=E.next,E.next=m.next,m.next=E,E},h=function(m,y){var v=f(m,y);return v&&v.value},p=function(m,y,v){var E=f(m,y);E?E.value=v:m.next={key:y,next:m.next,value:v}},g=function(m,y){return!!f(m,y)};return qv=function(){var m,y,v,E={assert:function(b){if(!E.has(b))throw new r("Side channel does not contain "+n(b))},get:function(b){if(i&&b&&(typeof b=="object"||typeof b=="function")){if(m)return s(m,b)}else if(o){if(y)return l(y,b)}else if(v)return h(v,b)},has:function(b){if(i&&b&&(typeof b=="object"||typeof b=="function")){if(m)return c(m,b)}else if(o){if(y)return d(y,b)}else if(v)return g(v,b);return!1},set:function(b,S){i&&b&&(typeof b=="object"||typeof b=="function")?(m||(m=new i),a(m,b,S)):o?(y||(y=new o),u(y,b,S)):(v||(v={key:{},next:null}),p(v,b,S))}};return E},qv}function yT(){if(eA)return $v;eA=!0;var e=String.prototype.replace,t=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return $v={default:n.RFC3986,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},$v}function zY(){if(tA)return e3;tA=!0;var e=yT(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r=(function(){for(var m=[],y=0;y<256;++y)m.push("%"+((y<16?"0":"")+y.toString(16)).toUpperCase());return m})(),i=function(m){for(;m.length>1;){var y=m.pop(),v=y.obj[y.prop];if(n(v)){for(var E=[],b=0;b<v.length;++b)typeof v[b]<"u"&&E.push(v[b]);y.obj[y.prop]=E}}},o=function(m,y){for(var v=y&&y.plainObjects?Object.create(null):{},E=0;E<m.length;++E)typeof m[E]<"u"&&(v[E]=m[E]);return v},s=function m(y,v,E){if(!v)return y;if(typeof v!="object"){if(n(y))y.push(v);else if(y&&typeof y=="object")(E&&(E.plainObjects||E.allowPrototypes)||!t.call(Object.prototype,v))&&(y[v]=!0);else return[y,v];return y}if(!y||typeof y!="object")return[y].concat(v);var b=y;return n(y)&&!n(v)&&(b=o(y,E)),n(y)&&n(v)?(v.forEach(function(S,w){if(t.call(y,w)){var C=y[w];C&&typeof C=="object"&&S&&typeof S=="object"?y[w]=m(C,S,E):y.push(S)}else y[w]=S}),y):Object.keys(v).reduce(function(S,w){var C=v[w];return t.call(S,w)?S[w]=m(S[w],C,E):S[w]=C,S},b)},a=function(m,y){return Object.keys(y).reduce(function(v,E){return v[E]=y[E],v},m)},c=function(m,y,v){var E=m.replace(/\+/g," ");if(v==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},l=1024,u=function(m,y,v,E,b){if(m.length===0)return m;var S=m;if(typeof m=="symbol"?S=Symbol.prototype.toString.call(m):typeof m!="string"&&(S=String(m)),v==="iso-8859-1")return escape(S).replace(/%u[0-9a-f]{4}/gi,function(R){return"%26%23"+parseInt(R.slice(2),16)+"%3B"});for(var w="",C=0;C<S.length;C+=l){for(var _=S.length>=l?S.slice(C,C+l):S,I=[],O=0;O<_.length;++O){var L=_.charCodeAt(O);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||b===e.RFC1738&&(L===40||L===41)){I[I.length]=_.charAt(O);continue}if(L<128){I[I.length]=r[L];continue}if(L<2048){I[I.length]=r[192|L>>6]+r[128|L&63];continue}if(L<55296||L>=57344){I[I.length]=r[224|L>>12]+r[128|L>>6&63]+r[128|L&63];continue}O+=1,L=65536+((L&1023)<<10|_.charCodeAt(O)&1023),I[I.length]=r[240|L>>18]+r[128|L>>12&63]+r[128|L>>6&63]+r[128|L&63]}w+=I.join("")}return w},d=function(m){for(var y=[{obj:{o:m},prop:"o"}],v=[],E=0;E<y.length;++E)for(var b=y[E],S=b.obj[b.prop],w=Object.keys(S),C=0;C<w.length;++C){var _=w[C],I=S[_];typeof I=="object"&&I!==null&&v.indexOf(I)===-1&&(y.push({obj:S,prop:_}),v.push(I))}return i(y),m},f=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},h=function(m){return!m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},p=function(m,y){return[].concat(m,y)},g=function(m,y){if(n(m)){for(var v=[],E=0;E<m.length;E+=1)v.push(y(m[E]));return v}return y(m)};return e3={arrayToObject:o,assign:a,combine:p,compact:d,decode:c,encode:u,isBuffer:h,isRegExp:f,maybeMap:g,merge:s},e3}function PAe(){if(nA)return t3;nA=!0;var e=IAe(),t=zY(),n=yT(),r=Object.prototype.hasOwnProperty,i={brackets:function(g){return g+"[]"},comma:"comma",indices:function(g,mLine truncated
`," "],s=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(s),c=["%","/","?",";","#"].concat(a),l=["/","?","#"],u=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=_Ae();function y(S,w,C){if(S&&typeof S=="object"&&S instanceof t)return S;var _=new t;return _.parse(S,w,C),_}t.prototype.parse=function(S,w,C){if(typeof S!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof S);var _=S.indexOf("?"),I=_!==-1&&_<S.indexOf("#")?"?":"#",O=S.split(I),L=/\\/g;O[0]=O[0].replace(L,"/"),S=O.join(I);var R=S;if(R=R.trim(),!C&&S.split("#").length===1){var F=i.exec(R);if(F)return this.path=R,this.href=R,this.pathname=F[1],F[2]?(this.search=F[2],w?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):w&&(this.search="",this.query={}),this}var W=n.exec(R);if(W){W=W[0];var J=W.toLowerCase();this.protocol=J,R=R.substr(W.length)}if(C||W||R.match(/^\/\/[^@/]+@[^@/]+/)){var Y=R.substr(0,2)==="//";Y&&!(W&&p[W])&&(R=R.substr(2),this.slashes=!0)}if(!p[W]&&(Y||W&&!g[W])){for(var M=-1,B=0;B<l.length;B++){var q=R.indexOf(l[B]);q!==-1&&(M===-1||q<M)&&(M=q)}var z,A;M===-1?A=R.lastIndexOf("@"):A=R.lastIndexOf("@",M),A!==-1&&(z=R.slice(0,A),R=R.slice(A+1),this.auth=decodeURIComponent(z)),M=-1;for(var B=0;B<c.length;B++){var q=R.indexOf(c[B]);q!==-1&&(M===-1||q<M)&&(M=q)}M===-1&&(M=R.length),this.host=R.slice(0,M),R=R.slice(M),this.parseHost(),this.hostname=this.hostname||"";var T=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!T)for(var k=this.hostname.split(/\./),B=0,j=k.length;B<j;B++){var re=k[B];if(re&&!re.match(d)){for(var me="",te=0,X=re.length;te<X;te++)re.charCodeAt(te)>127?me+="x":me+=re[te];if(!me.match(d)){var fe=k.slice(0,B),le=k.slice(B+1),ve=re.match(f);ve&&(fe.push(ve[1]),le.unshift(ve[2])),le.length&&(R="/"+le.join(".")+R),this.hostname=fe.join(".");break}}}this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=e.toASCII(this.hostname));var Z=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+Z,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!h[J])for(var B=0,j=a.length;B<j;B++){var pe=a[B];if(R.indexOf(pe)!==-1){var K=encodeURIComponent(pe);K===pe&&(K=escape(pe)),R=R.split(pe).join(K)}}var ce=R.indexOf("#");ce!==-1&&(this.hash=R.substr(ce),R=R.slice(0,ce));var ye=R.indexOf("?");if(ye!==-1?(this.search=R.substr(ye),this.query=R.substr(ye+1),w&&(this.query=m.parse(this.query)),R=R.slice(0,ye)):w&&(this.search="",this.query={}),R&&(this.pathname=R),g[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Z=this.pathname||"",ee=this.search||"";this.path=Z+ee}return this.href=this.format(),this};function v(S){return typeof S=="string"&&(S=y(S)),S instanceof t?S.format():t.prototype.format.call(S)}t.prototype.format=function(){var S=this.auth||"";S&&(S=encodeURIComponent(S),S=S.replace(/%3A/i,":"),S+="@");var w=this.protocol||"",C=this.pathname||"",_=this.hash||"",I=!1,O="";this.host?I=S+this.host:this.hostname&&(I=S+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(I+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(O=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var L=this.search||O&&"?"+O||"";return w&&w.substr(-1)!==":"&&(w+=":"),this.slashes||(!w||g[w])&&I!==!1?(I="//"+(I||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):I||(I=""),_&&_.charAt(0)!=="#"&&(_="#"+_),L&&L.charAt(0)!=="?"&&(L="?"+L),C=C.replace(/[?#]/g,function(R){return encodeURIComponent(R)}),L=L.replace("#","%23"),w+I+C+L+_};function E(S,w){return y(S,!1,!0).resolve(w)}t.prototype.resolve=function(S){return this.resolveObject(y(S,!1,!0)).format()};function b(S,w){return S?y(S,!1,!0).resolveObject(w):w}return t.prototype.resolveObject=function(S){if(typeof S=="string"){var w=new t;w.parse(S,!1,!0),S=w}for(var C=new t,_=Object.keys(this),I=0;I<_.length;I++){var O=_[I];C[O]=this[O]}if(C.hash=S.hash,S.href==="")return C.href=C.format(),C;if(S.slashes&&!S.protocol){for(var L=Object.keys(S),R=0;R<L.length;R++){var F=L[R];F!=="protocol"&&(C[F]=S[F])}return g[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(S.protocol&&S.protocol!==C.protocol){if(!g[S.protocol]){for(var W=Object.keys(S),J=0;J<W.length;J++){var Y=W[J];C[Y]=S[Y]}return C.href=C.format(),C}if(C.protocol=S.protocol,!S.host&&!p[S.protocol]){for(var j=(S.pathname||"").split("/");j.length&&!(S.host=j.shift()););S.host||(S.host=""),S.hostname||(S.hostname=""),j[0]!==""&&j.unshift(""),j.length<2&&j.unshift(""),C.pathname=j.join("/")}else C.pathname=S.pathname;if(C.search=S.search,C.query=S.query,C.host=S.host||"",C.auth=S.auth,C.hostname=S.hostname||S.host,C.port=S.port,C.pathnameLine truncated
`)&&(t=t.replace(oX,"%0A")),t.includes("\r")&&(t=t.replace(sX,"%0D")),t.includes(" ")&&(t=t.replace(aX,"%09")),r.pathname=t,r}var GY,Qv,qS,Kv,qv,$S,$v,eA,e3,tA,t3,nA,n3,rA,r3,iA,od,oA,Ho,Rx,JY,ZY,YY,XY,QY,KY,qY,$Y,eX,tX,d4,nX,rX,iX,oX,sX,aX,DAe=Vs(()=>{tt(),rt(),nt(),QSe(),fAe(),wAe(),jY(),GY=Object.freeze(Object.create(null)),Qv={},qS=!1,Kv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,qv={},$S=!1,$v={},eA=!1,e3={},tA=!1,t3={},nA=!1,n3={},rA=!1,r3={},iA=!1,od={},oA=!1,Ho=RAe(),Ho.parse,Ho.resolve,Ho.resolveObject,Ho.format,Ho.Url,Rx=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,Ho.URL=typeof URL<"u"?URL:null,Ho.pathToFileURL=VY,Ho.fileURLToPath=WY,JY=Ho.Url,ZY=Ho.format,YY=Ho.resolve,XY=Ho.resolveObject,QY=Ho.parse,KY=Ho.URL,qY=92,$Y=47,eX=97,tX=122,d4=Rx==="win32",nX=/\//g,rX=/%/g,iX=/\\/g,oX=/\n/g,sX=/\r/g,aX=/\t/g}),LAe=st((e,t)=>{tt(),rt(),nt(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),ET=st(e=>{tt(),rt(),nt(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=r;var t=Pf(),n=(Ao(),zr(So));function r(o,s){let a=new Array(o.length);for(let c=0;c<o.length;c++)typeof o[c].chunk=="string"?a[c]=n.Buffer.from(o[c].chunk,"utf8"):a[c]=o[c].chunk;this._write(n.Buffer.concat(a),"binary",s)}var i=class extends t.Duplex{constructor(s,a,c){super({objectMode:!0});et(this,"socket");et(this,"proxy");et(this,"isSocketOpen");et(this,"writeQueue");this.proxy=a,this.socket=c,this.writeQueue=[],s.objectMode||(this._writev=r.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",l=>{!this.destroyed&&this.readable&&this.push(l)})}_read(s){this.proxy.read(s)}_write(s,a,c){this.isSocketOpen?this.writeToProxy(s,a,c):this.writeQueue.push({chunk:s,encoding:a,cb:c})}_final(s){this.writeQueue=[],this.proxy.end(s)}_destroy(s,a){this.writeQueue=[],this.proxy.destroy(),a(s)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(s,a,c){this.proxy.write(s,a)===!1?this.proxy.once("drain",c):c()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:s,encoding:a,cb:c}=this.writeQueue.shift();this.writeToProxy(s,a,c)}}};e.BufferedDuplex=i}),B2=st(e=>{tt(),rt(),nt();var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var n=(Ao(),zr(So)),r=t(LAe()),i=t(bu()),o=Pf(),s=t(jy()),a=ET(),c=(0,i.default)("mqttjs:ws"),l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function u(y,v){let E=`${y.protocol}://${y.hostname}:${y.port}${y.path}`;return typeof y.transformWsUrl=="function"&&(E=y.transformWsUrl(E,y,v)),E}function d(y){let v=y;return y.port||(y.protocol==="wss"?v.port=443:v.port=80),y.path||(v.path="/"),y.wsOptions||(v.wsOptions={}),!s.default&&!y.forceNativeWebSocket&&y.protocol==="wss"&&l.forEach(E=>{Object.prototype.hasOwnProperty.call(y,E)&&!Object.prototype.hasOwnProperty.call(y.wsOptions,E)&&(v.wsOptions[E]=y[E])}),v}function f(y){let v=d(y);if(v.hostname||(v.hostname=v.host),!v.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let E=new URL(document.URL);v.hostname=E.hostname,v.port||(v.port=Number(E.port))}return v.objectMode===void 0&&(v.objectMode=!(v.binary===!0||v.binary===void 0)),v}function h(y,v,E){c("createWebSocket"),c(`protocol: ${E.protocolId} ${E.protocolVersion}`);let b=E.protocolId==="MQIsdp"&&E.protocolVersion===3?"mqttv3.1":"mqtt";c(`creating new Websocket for url: ${v} and protocol: ${b}`);let S;return E.createWebsocket?S=E.createWebsocket(v,[b],E):S=new r.default(v,[b],E.wsOptions),S}function p(y,v){let E=v.protocolId==="MQIsdp"&&v.protocolVersion===3?"mqttv3.1":"mqtt",b=u(v,y),S;return v.createWebsocket?S=v.createWebsocket(b,[E],v):S=new WebSocket(b,[E]),S.binaryType="arraybuffer",S}var g=(y,v)=>{c("streamBuilder");let E=d(v);E.hostname=E.hostname||E.host||"localhost";let b=u(E,y),S=h(y,b,E),w=r.default.createWebSocketStream(S,E.wsOptions);return w.url=b,S.on("close",()=>{w.destroy()}),w};e.streamBuilder=g;var m=(y,v)=>{c("browserStreamBuilder");let E,b=f(v).browserBufferSize||1024*512,S=v.browserBufferTimeout||1e3,w=!v.objectMode,C=p(y,v),_=O(v,J,Y);v.objectMode||(_._writev=a.writev.bind(_)),_.on("close",()=>{C.close()});let I=typeof C.addEventListener<"u";C.readyState===C.OPEN?(E=_,E.socket=C):(E=new a.BufferedDuplex(v,_,C),I?C.addEventListener("open",L):C.onopen=L),I?(C.addEventListener("close",R),C.addEventListener("error",F),C.addEventListener("message",W)):(C.onclose=R,C.onerror=F,C.onmessage=W);function O(M,B,q){let z=new o.Transform({objectMode:M.objectMode});return z._write=B,z._flush=q,z}function L(){c("WebSocket onOpen"),E instanceof a.BufferedDuplex&&E.socketReady()}function R(M){c("WebSocket onClose",M),E.end(),E.destroy()}function F(M){c("WebSocket onError",M);let B=new Error("WebSocket error");B.event=M,E.destroy(B)}async Line truncated
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
@babel/runtime/helpers/regenerator.js:
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
*/function UAe(e){return"elegoo/{sn}/api_register".replace("{sn}",e)}function hX(e,t){return"elegoo/{sn}/{request_id}/register_response".replace("{sn}",e).replace("{request_id}",t)}function jAe(e,t){return"elegoo/{sn}/{client_id}/api_request".replace("{sn}",e).replace("{client_id}",t)}function HAe(e,t){return"elegoo/{sn}/{client_id}/api_response".replace("{sn}",e).replace("{client_id}",t)}function zAe(e){return"elegoo/{sn}/api_status".replace("{sn}",e)}const WAe=3e4,VAe=2,GAe=1e3,x0=class x0{constructor(){et(this,"client",null);et(this,"pendingRequests",new Map);et(this,"registerSuccess",!1);et(this,"subscribedTopics",new Set);et(this,"requestIdCounter",1);et(this,"curAutoReportId",-1);et(this,"registerRetryCount",0);et(this,"MAX_REGISTER_RETRY",10);et(this,"lastRegisterError","");et(this,"lastMessageTime",0);et(this,"heartbeatTimer",null);et(this,"heartbeatTimeoutCount",0);et(this,"clientId","");et(this,"registerRequestId","");et(this,"sn","");et(this,"heartbeatOffline",!1);et(this,"emitter",sT())}handleHeartbeatFailure(t){if(!this.heartbeatOffline&&(Pe.warn("[MQTT] 心跳连续未响应,判定为离线,准备重连",t),this.heartbeatTimeoutCount=0,this.heartbeatOffline=!0,this.emitter.emit("disconnected"),this.client))try{this.client.reconnecting||this.client.reconnect()}catch(n){Pe.error("[MQTT] 心跳重连失败",n)}}setClientId(t){this.clientId=t}setRegisterRequestId(t){this.registerRequestId=t}setSn(t){this.sn=t}resetRegisterRetryCount(){this.registerRetryCount=0}static getInstance(){return x0.instance||(x0.instance=new x0),x0.instance}connect(t){var i;if((i=this.client)!=null&&i.connected)return;const n={clientId:this.clientId,clean:!0,reconnectPeriod:GAe,username:qi.username,password:qi.access_code,...t},r=`ws://${qi.ip}:9001`;Pe.log("[MQTT] 当前连接打印机ip:",qi.ip),this.client=FAe.connect(r,n),this.client.on("connect",()=>{Pe.log("[MQTT] 连接成功"),this.emitter.emit("connected")}),this.client.on("error",o=>{this.emitter.emit("disconnected")}),this.client.on("close",()=>{Pe.warn("[MQTT] 连接已关闭,将自动重连"),this.emitter.emit("disconnected")}),this.client.on("reconnect",()=>{Pe.log("[MQTT] 正在重连..."),this.emitter.emit("disconnected")}),this.client.on("offline",()=>{Pe.warn("[MQTT] 连接离线,将自动重连"),this.emitter.emit("disconnected")}),this.client.on("message",(o,s)=>{this.onReceiveMessage(o,s.toString())})}disconnect(){var t;(t=this.client)==null||t.end(),this.pendingRequests.clear(),this.subscribedTopics.clear(),this.emitter.emit("disconnected")}handleRegisterFailure(){this.registerRetryCount++,Pe.warn(`[MQTT] 注册失败,准备重新注册... (第${this.registerRetryCount}次重试)`),this.registerSuccess=!1,this.registerRetryCount===this.MAX_REGISTER_RETRY&&this.lastRegisterError!=w7.TooManyClients&&this.emitter.emit("registerMaxRetryReached"),setTimeout(()=>{this.client&&this.client.connected&&(Pe.log("[MQTT] 开始重新注册..."),this.emitter.emit("connected"))},3e3)}subscribe(t,n){var r;this.subscribedTopics.has(t)||(r=this.client)==null||r.subscribe(t,{qos:1},i=>{var o;if(i){Pe.error(`[MQTT] Failed to subscribe topic: ${t}`,i);return}this.subscribedTopics.add(t),Pe.log(`[MQTT] 订阅主题成功: ${t}`),(o=this.client)==null||o.on("message",(s,a)=>{s===t&&n(JSON.parse(a.toString()))})})}publish(t,n){var r;(r=this.client)==null||r.publish(t,JSON.stringify(n),{qos:1},i=>{i?Pe.error(`[MQTT] Failed to publish message: ${t}`,i):Pe.log("[MQTT] 发布消息 :",n)})}async request(t,n,r,i=5e3){if(!this.registerSuccess)throw new Error(ou.global.t("toastMessages.DeviceNotRegistered"));await this.ensureSubscribe(n);const o=this.requestIdCounter++;let s={};return r!=null&&r.method?s={...r,id:o}:s={...r},new Promise((a,c)=>{const l=setTimeout(()=>{this.pendingRequests.delete(o.toString()),c(new Error(ou.global.t("toastMessages.RequestTimeout")))},i);this.pendingRequests.set(o.toString(),{resolve:a,reject:c,timer:l}),this.publish(t,s)})}async requestRegister(t,n,r,i=5e3){await this.ensureSubscribe(n);const o=this.clientId,s={...r,client_id:o};return new Promise((a,c)=>{const l=setTimeout(()=>{Pe.log("[MQTT] 注册超时,删除设备注册请求",this.clientId),this.pendingRequests.delete(this.clientId.toString()),this.handleRegisterFailure(),c(new Error(ou.global.t("toastMessages.RegisterTimeout")))},i);this.pendingRequests.set(this.clientId.toString(),{resolve:a,reject:c,timer:l}),this.publish(t,s)})}async ensureSubscribe(t){if(!this.subscribedTopics.has(t))return new Promise((n,r)=>{var i;(i=this.client)==null||i.subscribe(t,{qos:1},o=>{o?(r(o),Pe.error("[MQTT] Failed to subscribe topic",t)):(Pe.log("[MQTT]话题订阅成功",t),this.subscribedTopics.add(t),n())})})}getErrorMessage(t){return C7(t)}onReceiveMessage(t,n){try{const r=JSON.parse(n);if(r.method!==Rt.MessageAutoReport&&(this.lastMessageTime=Date.now(),this.heartbeatOffline=!1,this.heartbeatTimer&&(this.heartbeatTimeoutCount=0,clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)Line truncated
\v\f\r                 \u2028\u2029\uFEFF`,ERe=Gp,bRe=la,PA=$Q,mL=Wr("".replace),SRe=RegExp("^["+PA+"]+"),ARe=RegExp("(^|[^"+PA+"])["+PA+"]+$"),CRe=function(e){return function(t){var n=bRe(ERe(t));return 1&e&&(n=mL(n,SRe,"")),2&e&&(n=mL(n,ARe,"$1")),n}},wRe={trim:CRe(3)},TRe=GX.PROPER,IRe=Xr,gL=$Q,PRe=wRe.trim;Gn({target:"String",proto:!0,forced:(function(e){return IRe((function(){return!!gL[e]()||"​…᠎"[e]()!=="​…᠎"||TRe&&gL[e].name!==e}))})("trim")},{trim:function(){return PRe(this)}});var ORe=za("String").trim,_Re=Co,RRe=ORe,o9=String.prototype,kRe=function(e){var t=e.trim;return typeof e=="string"||e===o9||_Re(o9,e)&&t===o9.trim?RRe:t},ao=kr(kRe),eK={exports:{}};(function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(n){return n.trim().split(`
`).map((r=>r.trim()))},t.splitSections=function(n){return n.split(`
m=`).map(((r,i)=>(i>0?"m="+r:r).trim()+`\r
`))},t.getDescription=function(n){const r=t.splitSections(n);return r&&r[0]},t.getMediaSections=function(n){const r=t.splitSections(n);return r.shift(),r},t.matchPrefix=function(n,r){return t.splitLines(n).filter((i=>i.indexOf(r)===0))},t.parseCandidate=function(n){let r;r=n.indexOf("a=candidate:")===0?n.substring(12).split(" "):n.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let o=8;o<r.length;o+=2)switch(r[o]){case"raddr":i.relatedAddress=r[o+1];break;case"rport":i.relatedPort=parseInt(r[o+1],10);break;case"tcptype":i.tcpType=r[o+1];break;case"ufrag":i.ufrag=r[o+1],i.usernameFragment=r[o+1];break;default:i[r[o]]===void 0&&(i[r[o]]=r[o+1])}return i},t.writeCandidate=function(n){const r=[];r.push(n.foundation);const i=n.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(n.protocol.toUpperCase()),r.push(n.priority),r.push(n.address||n.ip),r.push(n.port);const o=n.type;return r.push("typ"),r.push(o),o!=="host"&&n.relatedAddress&&n.relatedPort&&(r.push("raddr"),r.push(n.relatedAddress),r.push("rport"),r.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(r.push("ufrag"),r.push(n.usernameFragment||n.ufrag)),"candidate:"+r.join(" ")},t.parseIceOptions=function(n){return n.substring(14).split(" ")},t.parseRtpMap=function(n){let r=n.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(n){let r=n.payloadType;n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType);const i=n.channels||n.numChannels||1;return"a=rtpmap:"+r+" "+n.name+"/"+n.clockRate+(i!==1?"/"+i:"")+`\r
`},t.parseExtmap=function(n){const r=n.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},t.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r
`},t.parseFmtp=function(n){const r={};let i;const o=n.substring(n.indexOf(" ")+1).split(";");for(let s=0;s<o.length;s++)i=o[s].trim().split("="),r[i[0].trim()]=i[1];return r},t.writeFmtp=function(n){let r="",i=n.payloadType;if(n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const o=[];Object.keys(n.parameters).forEach((s=>{n.parameters[s]!==void 0?o.push(s+"="+n.parameters[s]):o.push(s)})),r+="a=fmtp:"+i+" "+o.join(";")+`\r
`}return r},t.parseRtcpFb=function(n){const r=n.substring(n.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},t.writeRtcpFb=function(n){let r="",i=n.payloadType;return n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach((o=>{r+="a=rtcp-fb:"+i+" "+o.type+(o.parameter&&o.parameter.length?" "+o.parameter:"")+`\r
`})),r},t.parseSsrcMedia=function(n){const r=n.indexOf(" "),i={ssrc:parseInt(n.substring(7,r),10)},o=n.indexOf(":",r);return o>-1?(i.attribute=n.substring(r+1,o),i.value=n.substring(o+1)):i.attribute=n.substring(r+1),i},t.parseSsrcGroup=function(n){const r=n.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map((i=>parseInt(i,10)))}},t.getMid=function(n){const r=t.matchPrefix(n,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(n){const r=n.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},t.getDtlsParameters=function(n,r){return{role:"auto",fingerprints:t.matchPrefix(n+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(n,r){let i="a=setup:"+r+`\r
`;return n.fingerprints.forEach((o=>{i+="a=fingerprint:"+o.algorithm+" "+o.value+`\r
`})),i},t.parseCryptoLine=function(n){const r=n.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},t.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?t.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r
`},t.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const r=n.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},t.getCryptoParameters=function(n,r){return t.matchPrefix(n+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(n,r){const i=t.matchPrefix(n+r,"a=ice-ufrag:")[0],o=t.matchPrefix(n+r,"a=ice-pwd:")[0];return i&&o?{usernameFragment:i.substring(12),password:o.substring(10)}:null},t.writeIceParameters=function(n){let r="a=ice-ufrag:"+n.usernameFragment+`\r
a=ice-pwd:`+n.password+`\r
`;return n.iceLite&&(r+=`a=ice-lite\r
`),r},t.parseRtpParameters=function(n){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(n)[0].split(" ");r.profile=i[2];for(let s=3;s<i.length;s++){const a=i[s],c=t.matchPrefix(n,"a=rtpmap:"+a+" ")[0];if(c){const l=t.parseRtpMap(c),u=t.matchPrefix(n,"a=fmtp:"+a+" ");switch(l.parameters=u.length?t.parseFmtp(u[0]):{},l.rtcpFeedback=t.matchPrefix(n,"a=rtcp-fb:"+a+" ").map(t.parseRtcpFb),r.codecs.push(l),l.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(l.name.toUpperCase())}}}t.matchPrefix(n,"a=extmap:").forEach((s=>{r.headerExtensions.push(t.parseExtmap(s))}));const o=t.matchPrefix(n,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((s=>{o.forEach((a=>{s.rtcpFeedback.find((c=>c.type===a.type&&c.parameter===a.parameter))||s.rtcpFeedback.push(a)}))})),r},t.writeRtpDescription=function(n,r){let i="";i+="m="+n+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map((s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType)).join(" ")+`\r
`,i+=`c=IN IP4 0.0.0.0\r
`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,r.codecs.forEach((s=>{i+=t.writeRtpMap(s),i+=t.writeFmtp(s),i+=t.writeRtcpFb(s)}));let o=0;return r.codecs.forEach((s=>{s.maxptime>o&&(o=s.maxptime)})),o>0&&(i+="a=maxptime:"+o+`\r
`),r.headerExtensions&&r.headerExtensions.forEach((s=>{i+=t.writeExtmap(s)})),i},t.parseRtpEncodingParameters=function(n){const r=[],i=t.parseRtpParameters(n),o=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,a=t.matchPrefix(n,"a=ssrc:").map((f=>t.parseSsrcMedia(f))).filter((f=>f.attribute==="cname")),c=a.length>0&&a[0].ssrc;let l;const u=t.matchPrefix(n,"a=ssrc-group:FID").map((f=>f.substring(17).split(" ").map((h=>parseInt(h,10)))));u.length>0&&u[0].length>1&&u[0][0]===c&&(l=u[0][1]),i.codecs.forEach((f=>{if(f.name.toUpperCase()==="RTX"&&f.parameters.apt){let h={ssrc:c,codecPayloadType:parseInt(f.parameters.apt,10)};c&&l&&(h.rtx={ssrc:l}),r.push(h),o&&(h=JSON.parse(JSON.stringify(h)),h.fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},r.push(h))}})),r.length===0&&c&&r.push({ssrc:c});let d=t.matchPrefix(n,"b=");return d.length&&(d=d[0].indexOf("b=TIAS:")===0?parseInt(d[0].substring(7),10):d[0].indexOf("b=AS:")===0?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,r.forEach((f=>{f.maxBitrate=d}))),r},t.parseRtcpParameters=function(n){const r={},i=t.matchPrefix(n,"a=ssrc:").map((a=>t.parseSsrcMedia(a))).filter((a=>a.attribute==="cname"))[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const o=t.matchPrefix(n,"a=rtcp-rsize");r.reducedSize=o.length>0,r.compound=o.length===0;const s=t.matchPrefix(n,"a=rtcp-mux");return r.mux=s.length>0,r},t.writeRtcpParameters=function(n){let r="";return n.reducedSize&&(r+=`a=rtcp-rsize\r
`),n.mux&&(r+=`a=rtcp-mux\r
`),n.ssrc!==void 0&&n.cname&&(r+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r
`),r},t.parseMsid=function(n){let r;const i=t.matchPrefix(n,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const o=t.matchPrefix(n,"a=ssrc:").map((s=>t.parseSsrcMedia(s))).filter((s=>s.attribute==="msid"));return o.length>0?(r=o[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(n){const r=t.parseMLine(n),i=t.matchPrefix(n,"a=max-message-size:");let o;i.length>0&&(o=parseInt(i[0].substring(19),10)),isNaN(o)&&(o=65536);const s=t.matchPrefix(n,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:o};const a=t.matchPrefix(n,"a=sctpmap:");if(a.length>0){const c=a[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:o}}},t.writeSctpDescription=function(n,r){let i=[];return i=n.protocol!=="DTLS/SCTP"?["m="+n.kind+" 9 "+n.protocol+" "+r.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+r.port+`\r
`]:["m="+n.kind+" 9 "+n.protocol+" "+r.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r
`],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r
`),i.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(n,r,i){let o;const s=r!==void 0?r:2;return o=n||t.generateSessionId(),`v=0\r
o=`+(i||"thisisadapterortc")+" "+o+" "+s+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`},t.getDirection=function(n,r){const i=t.splitLines(n);for(let o=0;o<i.length;o++)switch(i[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[o].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(n){return t.splitLines(n)[0].split(" ")[0].substring(2)},t.isRejected=function(n){return n.split(" ",2)[1]==="0"},t.parseMLine=function(n){const r=t.splitLines(n)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(n){const r=t.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const r=t.splitLines(n);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},e.exports=t})(eK);var tK=eK.exports,zh=kr(tK),xRe=XAe({__proto__:null,default:zh},[tK]);function l3(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&((n=JSON.parse(JSON.stringify(n))).candidate=n.candidate.substr(2)),n.candidate&&n.candidate.length){const r=new t(n),i=zh.parseCandidate(n.candidate),o=Object.assign(r,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(n)},e.RTCIceCandidate.prototype=t.prototype,_f(e,"icecandidate",(n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new e.RTCIceCandidate(n.candidate),writable:"false"}),n)))}function OA(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||_f(e,"icecandidate",(t=>{if(t.candidate){const n=zh.parseCandidate(t.candidate.candidate);n.type==="relay"&&(t.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return t}))}function u3(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});const n=function(a){if(!a||!a.sdp)return!1;const c=zh.splitSections(a.sdp);return c.shift(),c.some((l=>{const u=zh.parseMLine(l);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1}))},r=function(a){const c=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const l=parseInt(c[1],10);return l!=l?-1:l},i=function(a){let c=65536;return t.browser==="firefox"&&(c=t.version<57?a===-1?16384:2147483637:t.version<60?t.version===57?65535:65536:2147483637),c},o=function(a,c){let l=65536;t.browser==="firefox"&&t.version===57&&(l=65535);const u=zh.matchPrefix(a.sdp,"a=max-message-size:");return u.length>0?l=parseInt(u[0].substr(19),10):t.browser==="firefox"&&c!==-1&&(l=2147483637),l},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser==="chrome"&&t.version>=76){const{sdpSemantics:a}=this.getConfiguration();a==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const a=r(arguments[0]),c=i(a),l=o(arguments[0],a);let u;u=c===0&&l===0?Number.POSITIVE_INFINITY:c===0||l===0?Math.max(c,l):Math.min(c,l);const d={};Object.defineProperty(d,"maxMessageSize",{get:()=>u}),this._sctp=d}return s.apply(this,arguments)}}function d3(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(r,i){const o=r.send;r.send=function(){const s=arguments[0],a=s.length||s.size||s.byteLength;if(r.readyState==="open"&&i.sctp&&a>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return o.apply(r,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const r=n.apply(this,arguments);return t(r,this),r},_f(e,"datachannel",(r=>(t(r.channel,r.target),r)))}function _A(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((n=>{const r=t[n];t[n]=function(){return this._connectionstatechangepoly||(this._connectionstLine truncated
a=extmap-allow-mixed`)!==-1){const i=r.sdp.split(`
`).filter((o=>ao(o).call(o)!=="a=extmap-allow-mixed")).join(`
`);e.RTCSessionDescription&&r instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:r.type,sdp:i}):r.sdp=i}return n.apply(this,arguments)}}function f3(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&n.length!==0&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser==="chrome"&&t.version<78||t.browser==="firefox"&&t.version<68||t.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?ot.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),ot.resolve())})}function h3(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&n.length!==0&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let r=arguments[0]||{};if(typeof r!="object"||r.type&&r.sdp)return n.apply(this,arguments);if(r={type:r.type,sdp:r.sdp},!r.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":r.type="offer";break;default:r.type="answer"}return r.sdp||r.type!=="offer"&&r.type!=="answer"?n.apply(this,[r]):(r.type==="offer"?this.createOffer:this.createAnswer).apply(this).then((i=>n.apply(this,[i])))})}var DRe=Object.freeze({__proto__:null,removeExtmapAllowMixed:RA,shimAddIceCandidateNullOrEmpty:f3,shimConnectionState:_A,shimMaxMessageSize:u3,shimParameterlessSetLocalDescription:h3,shimRTCIceCandidate:l3,shimRTCIceCandidateRelayProtocol:OA,shimSendThrowTypeError:d3});(function(){let{window:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=xX,r=(function(o){const s={browser:null,version:null};if(o===void 0||!o.navigator)return s.browser="Not a browser.",s;const{navigator:a}=o;if(a.mozGetUserMedia)s.browser="firefox",s.version=z2(a.userAgent,/Firefox\/(\d+)\./,1);else if(a.webkitGetUserMedia||o.isSecureContext===!1&&o.webkitRTCPeerConnection)s.browser="chrome",s.version=z2(a.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!o.RTCPeerConnection||!a.userAgent.match(/AppleWebKit\/(\d+)\./))return s.browser="Not a supported browser.",s;s.browser="safari",s.version=z2(a.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=o.RTCRtpTransceiver&&"currentDirection"in o.RTCRtpTransceiver.prototype}return s})(e),i={browserDetails:r,commonShim:DRe,extractVersion:z2,disableLog:_Te,disableWarnings:RTe,sdp:xRe};switch(r.browser){case"chrome":if(!fL||!TA||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=fL,f3(e,r),h3(e),TQ(e,r),IQ(e),TA(e,r),PQ(e),xQ(e,r),OQ(e),_Q(e),RQ(e),DQ(e,r),l3(e),OA(e),_A(e),u3(e,r),d3(e),RA(e,r);break;case"firefox":if(!hL||!IA||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=hL,f3(e,r),h3(e),LQ(e,r),IA(e,r),NQ(e),FQ(e),MQ(e),BQ(e),UQ(e),jQ(e),HQ(e),zQ(e),WQ(e),l3(e),_A(e),u3(e,r),d3(e);break;case"safari":if(!pL||!t.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=pL,f3(e,r),h3(e),XQ(e),KQ(e),JQ(e),VQ(e),GQ(e),QQ(e),ZQ(e),qQ(e),l3(e),OA(e),u3(e,r),d3(e),RA(e,r);break;default:n("Unsupported browser!")}})({window:typeof window>"u"?void 0:window});var LRe=za("Array").keys,NRe=Al,MRe=Gi,BRe=Co,FRe=LRe,s9=Array.prototype,URe={DOMTokenList:!0,NodeList:!0},jRe=function(e){var t=e.keys;return e===s9||BRe(s9,e)&&t===s9.keys||MRe(URe,NRe(e))?FRe:t},Ts=kr(jRe),vL=Zp,HRe=TypeError,zRe=Jy,WRe=Ha,VRe=$d,r6=function(e,t,n){var r=zRe(t);r in e?WRe.f(e,r,VRe(0,n)):e[r]=n},yL=IT,GRe=Ru,JRe=r6,ZRe=Array,YRe=Math.max,GT=function(e,t,n){for(var r=GRe(e),i=yL(t,r),o=yL(n===void 0?r:n,r),s=ZRe(YRe(o-i,0)),a=0;i<o;i++,a++)JRe(s,a,e[i]);return s.length=a,s},EL=GT,XRe=Math.floor,kA=function(e,t){var n=e.length,r=XRe(n/2);return n<8?QRe(e,t):KRe(e,kA(EL(e,0,r),t),kA(EL(e,r),t),t)},QRe=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},KRe=function(e,t,n,r){for(var i=t.length,o=n.length,s=0,a=0;s<i||a<o;)e[s+a]=s<i&&a<o?r(t[s],n[a])<=0?t[s++]:n[a++]:s<i?t[s++]:n[a++];return e},nK=kA,bL=Of.match(/firefox\/(\d+)/i),qRe=!!bL&&+bL[1],$Re=/MSIE|Trident/.test(Of),SL=Of.match(/AppleWebKit\/(\d+)\./),eke=!!SL&&+SL[1],tke=Gn,rK=Wr,nke=ja,rke=Sl,AL=Ru,ike=function(e,t){if(!delete e[t])throw HRe("Cannot delete property "+vL(t)+" of "+vL(e))},CL=la,JT=Xr,oke=nK,ske=Zy,wL=qRe,ake=$Re,TL=ff,IL=eke,Ed=[],PL=rK(Ed.sort),cke=rK(Ed.push),lke=JT((function(){Ed.sort(void 0)})),uke=JT((function(){Ed.sort(null)})),dke=ske("sort"),OL=!JT((function(){if(TL)return TL<70;if(!(wL&&wL>3)){if(ake)return!0;if(IL)return IL<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){caseLine truncated
`).forEach((function(h){var p,g;f=h.indexOf(":"),u=ao(p=h.substring(0,f)).call(p).toLowerCase(),d=ao(g=h.substring(f+1)).call(g),!u||l[u]&&WLe[u]||(u==="set-cookie"?l[u]?l[u].push(d):l[u]=[d]:l[u]=l[u]?l[u]+", "+d:d)})),l})(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=g1(t)){const r=dt.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return(function(o){const s=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let c;for(;c=a.exec(o);)s[c[1]]=c[2];return s})(i);if(dt.isFunction(n))return n.call(this,i,r);if(dt.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=g1(t)){const r=dt.findKey(this,t);return!(!r||this[r]===void 0||n&&!O9(0,this[r],r,n))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=g1(s)){const a=dt.findKey(r,s);!a||n&&!O9(0,r[a],a,n)||(delete r[a],i=!0)}}return dt.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];t&&!O9(0,this[o],o,t,!0)||(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return dt.forEach(this,((i,o)=>{var s;const a=dt.findKey(r,o);if(a)return n[a]=m3(i),void delete n[o];const c=t?(function(l){return ao(l).call(l).toLowerCase().replace(/([a-z\d])(\w*)/g,((u,d,f)=>d.toUpperCase()+f))})(o):ao(s=String(o)).call(s);c!==o&&delete n[o],n[c]=m3(i),r[c]=!0})),this}concat(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.constructor.concat(this,...n)}toJSON(t){const n=Object.create(null);return dt.forEach(this,((r,i)=>{r!=null&&r!==!1&&(n[i]=t&&dt.isArray(r)?r.join(", "):r)})),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((t=>{let[n,r]=t;return n+": "+r})).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t){const n=new this(t);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.forEach((s=>n.set(s))),n}static accessor(t){const n=(this[GN]=this[GN]={accessors:{}}).accessors,r=this.prototype;function i(o){const s=g1(o);n[s]||((function(a,c){const l=dt.toCamelCase(" "+c);["get","set","has"].forEach((u=>{Object.defineProperty(a,u+l,{value:function(d,f,h){return this[u].call(this,c,d,f,h)},configurable:!0})}))})(r,o),n[s]=!0)}return dt.isArray(t)?t.forEach(i):i(t),this}}g3.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),dt.reduceDescriptors(g3.prototype,((e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(i){this[r]=i}}})),dt.freezeMethods(g3);var hu=g3;function _9(e,t){const n=this||iI,r=t||n,i=hu.from(r.headers);let o=r.data;return dt.forEach(e,(function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function eq(e){return!(!e||!e.__CANCEL__)}function s2(e,t,n){cr.call(this,e??"canceled",cr.ERR_CANCELED,t,n),this.name="CanceledError"}dt.inherits(s2,cr,{__CANCEL__:!0});var VLe=Kc.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];dt.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),dt.isString(r)&&s.push("path="+r),dt.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function tq(e,t){return e&&!(function(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)})(t)?(function(n,r){return r?n.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):n})(e,t):t}var GLe=Kc.hasStandardBrowserEnv?(function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(i){const o=dt.isString(i)?r(i):i;return o.protocol===n.protocol&&o.host===n.host}})():function(){return!0};function JN(e,t){let n=0;const r=(function(i,o){i=i||10;const s=new Array(i),a=new Array(i);let c,l=0,u=0;return o=o!==void 0?o:1e3,function(d){const f=Date.now(),h=a[u];c||(c=f),s[l]=d,a[l]=f;let p=u,g=0;for(;p!==l;)g+=s[p++],p%=i;if(l=(l+1)%i,l===u&&(u=(u+1)%i),f-c<o)return;const m=h&&f-h;return m?Math.round(1e3*g/m):void 0}})(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a);n=o;const l={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:i};l[t?"download":"upload"]=!0,e(l)}}var JLe=typeof XMLHttpRequest<"u"&&function(e){return new ot((function(t,n){let r=e.data;const i=hu.from(e.headers).normalize();let o,s,{responseType:a,withXSRFToken:c}=e;function l(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}if(dt.isFormData(r)){if(Kc.hasStandardBrowserEnv||Kc.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((s=i.getContentType())!==!1){const[p,...g]=s?s.split(";").map((m=>ao(m).call(m))).filter(Boolean):[];i.setContentType([p||"multipart/form-data",...g].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+g))}const d=tq(e.baseURL,e.url);function f(){if(!u)return;const p=hu.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());(function(g,m,y){const v=y.config.validateStatus;y.status&&v&&!v(y.status)?m(new cr("Request failed with status code "+y.status,[cr.ERR_BAD_REQUEST,cr.ERR_BAD_RESPONSE][Math.floor(y.status/100)-4],y.config,y.request,y)):g(y)})((function(g){t(g),l()}),(function(g){n(g),l()}),{data:a&&a!=="text"&&a!=="json"?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:p,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),aK(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=f:u.onreadystatechange=function(){u&&u.readyState===4&&(u.status!==0||u.responseURL&&u.responseURL.indexOf("file:")===0)&&setTimeout(f)},u.onabort=function(){u&&(n(new cr("Request aborted",cr.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new cr("Network Error",cr.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const g=e.transitional||cK;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),n(new cr(p,g.clarifyTimeoutError?cr.ETIMEDOUT:cr.ECONNABORTELine truncated
`+o.map(ZN).join(`
`):" "+ZN(o[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r},adapters:UA};function R9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s2(null,e)}function YN(e){return R9(e),e.headers=hu.from(e.headers),e.data=_9.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nq.getAdapter(e.adapter||iI.adapter)(e).then((function(t){return R9(e),t.data=_9.call(e,e.transformResponse,t),t.headers=hu.from(t.headers),t}),(function(t){return eq(t)||(R9(e),t&&t.response&&(t.response.data=_9.call(e,e.transformResponse,t.response),t.response.headers=hu.from(t.response.headers))),ot.reject(t)}))}function XN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}const QN=e=>e instanceof hu?(function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?XN(Object(r),!0).forEach((function(i){H(t,i,r[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XN(Object(r)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))}))}return t})({},e):e;function yp(e,t){t=t||{};const n={};function r(l,u,d){return dt.isPlainObject(l)&&dt.isPlainObject(u)?dt.merge.call({caseless:d},l,u):dt.isPlainObject(u)?dt.merge({},u):dt.isArray(u)?u.slice():u}function i(l,u,d){return dt.isUndefined(u)?dt.isUndefined(l)?void 0:r(void 0,l,d):r(l,u,d)}function o(l,u){if(!dt.isUndefined(u))return r(void 0,u)}function s(l,u){return dt.isUndefined(u)?dt.isUndefined(l)?void 0:r(void 0,l):r(void 0,u)}function a(l,u,d){return d in t?r(l,u):d in e?r(void 0,l):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u)=>i(QN(l),QN(u),!0)};return dt.forEach(Object.keys(Object.assign({},e,t)),(function(l){const u=c[l]||i,d=u(e[l],t[l],l);dt.isUndefined(d)&&u!==a||(n[l]=d)})),n}const rq="1.6.8",oI={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{oI[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const KN={};oI.transitional=function(e,t,n){function r(i,o){return"[Axios v"+rq+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,s)=>{if(e===!1)throw new cr(r(o," has been removed"+(t?" in "+t:"")),cr.ERR_DEPRECATED);return t&&!KN[o]&&(KN[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,o,s)}};var jA={assertOptions:function(e,t,n){if(typeof e!="object")throw new cr("options must be an object",cr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new cr("option "+o+" must be "+c,cr.ERR_BAD_OPTION_VALUE)}else if(n!==!0)throw new cr("Unknown option "+o,cr.ERR_BAD_OPTION)}},validators:oI};const Wu=jA.validators;let v3=class{constructor(e){this.defaults=e,this.interceptors={request:new WL,response:new WL}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
`+i):n.stack=i}throw n}}_request(e,t){typeof e=="string"?(t=t||{}).url=e:t=e||{},t=yp(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&jA.assertOptions(n,{silentJSONParsing:Wu.transitional(Wu.boolean),forcedJSONParsing:Wu.transitional(Wu.boolean),clarifyTimeoutError:Wu.transitional(Wu.boolean)},!1),r!=null&&(dt.isFunction(r)?t.paramsSerializer={serialize:r}:jA.assertOptions(r,{encode:Wu.function,serialize:Wu.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&dt.merge(i.common,i[t.method]);i&&dt.forEach(["delete","get","head","post","put","patch","common"],(h=>{delete i[h]})),t.headers=hu.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(a=a&&h.synchronous,s.unshift(h.fulfilled,h.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(h){c.push(h.fulfilled,h.rejected)}));let u,d=0;if(!a){const h=[YN.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,c),u=h.length,l=ot.resolve(t);d<u;)l=l.then(h[d++],h[d++]);return l}u=s.length;let f=t;for(d=0;d<u;){const h=s[d++],p=s[d++];try{f=h(f)}catch(g){p.call(this,g);break}}try{l=YN.call(this,f)}catch(h){return ot.reject(h)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return aK(tq((e=yp(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};dt.forEach(["delete","get","head","options"],(function(e){v3.prototype[e]=function(t,n){return this.request(yp(n||{},{method:e,url:t,data:(n||{}).data}))}})),dt.forEach(["post","put","patch"],(function(e){function t(n){return function(r,i,o){return this.request(yp(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}v3.prototype[e]=t(),v3.prototype[e+"Form"]=t(!0)}));var y3=v3;class sI{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new ot((function(i){n=i}));const r=this;this.promise.then((i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null})),this.promise.then=i=>{let o;const s=new ot((a=>{r.subscribe(a),o=a})).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t((function(i,o,s){r.reason||(r.reason=new s2(i,o,s),n(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new sI((function(n){t=n})),cancel:t}}}var YLe=sI;const HA={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(HA).forEach((e=>{let[t,n]=e;HA[n]=t}));var XLe=HA;const Xi=(function e(t){const n=new y3(t),r=iK(y3.prototype.request,n);return dt.extend(r,y3.prototype,n,{allOwnKeys:!0}),dt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(i){return e(yp(t,i))},r})(iI);Xi.Axios=y3,Xi.CanceledError=s2,Xi.CancelToken=YLe,Xi.isCancel=eq,Xi.VERSION=rq,Xi.toFormData=y4,Xi.AxiosError=cr,Xi.Cancel=Xi.CanceledError,Xi.all=function(e){return ot.all(e)},Xi.spread=function(e){return function(t){return e.apply(null,t)}},Xi.isAxiosError=function(e){return dt.isObject(e)&&e.isAxiosError===!0},Xi.mergeConfig=yp,Xi.AxiosHeaders=hu,Xi.formToJSON=e=>$K(dt.isHTMLForm(e)?new FormData(e):e),Xi.getAdapter=nq.getAdapter,Xi.HttpStatusCode=XLe,Xi.default=Xi;var Lo=Xi;const QLe=()=>{};function sg(){const e={promise:void 0,isResolved:!1,isRejected:!1,isFinished:!1,resolve:void 0,reject:void 0,cancel:QLe};return e.promise=new ot(((t,n)=>{e.resolve=r=>{e.isFinished||(e.isResolved=!0,e.isFinished=!0,t(r),e.value=r)},e.reject=r=>{e.isFinished||(e.isRejected=!0,e.isFinished=!0,n(r))}})),e}const n5=new Map,r5=new Map,Rc=new Map;let ii=(function(e){return e.WIN_10Line truncated
`).concat(this.stack):"".concat(this.stack)}print(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error",t=arguments.length>1?arguments[1]:void 0;return e==="error"&&(t||console).error(this.toString()),e==="warning"&&(t||console).warn(this.toString()),this}throw(e){throw this.print("error",e),this}};function nu(e,t){if(typeof e!="boolean")throw new Be(Q.INVALID_PARAMS,"Invalid ".concat(t,": The value is of the boolean type."))}function Kr(e,t,n){if(!lt(n).call(n,e))throw new Be(Q.INVALID_PARAMS,"".concat(t," can only be set as ").concat(JSON.stringify(n)))}function Ln(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e4;if(e<n||e>r||(!(arguments.length>4&&arguments[4]!==void 0)||arguments[4])&&!(function(i){return typeof i=="number"&&i%1==0})(e))throw new Be(Q.INVALID_PARAMS,"invalid ".concat(t,": the value range is [").concat(n,", ").concat(r,"]. integer only"))}function x9(e,t){if(typeof e!="number"){if(!(e.min||e.max||e.ideal||e.exact))throw new Be(Q.INVALID_PARAMS,"".concat(t," is not a valid ConstrainLong"));e.min!==void 0&&Ln(e.min,"".concat(t,".min"),0,1/0),e.max!==void 0&&Ln(e.max,"".concat(t,".max"),1,1/0),e.exact!==void 0&&Ln(e.exact,"".concat(t,".exact"),1,1/0),e.ideal!==void 0&&Ln(e.ideal,"".concat(t,".ideal"),1,1/0)}else Ln(e,t,1,1/0)}function pi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:255,i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(e==null)throw new Be(Q.INVALID_PARAMS,"".concat(t||"param"," cannot be empty"));if(!fq(e,n,r,i))throw new Be(Q.INVALID_PARAMS,"Invalid ".concat(t||"string param",": Length of the string: [").concat(n,",").concat(r,"].").concat(i?" ASCII characters only.":""))}function Zl(e,t){if(!Array.isArray(e))throw new Be(Q.INVALID_PARAMS,"".concat(t," should be an array"))}function ur(e){return e==null}function fq(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:255,r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];return typeof e=="string"&&e.length<=n&&e.length>=t&&(!r||(function(i){if(typeof i!="string")return!1;for(let o=0;o<i.length;o+=1){const s=i.charCodeAt(o);if(s<0||s>255)return!1}return!0})(e))}var F1=(function(e){return e.COVERED="COVERED",e.POSITION="POSITION",e.SIZE="SIZE",e.STYLE="STYLE",e})(F1||{}),VA=(function(e){return e.UNMOUNTED="UNMOUNTED",e.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT",e})(VA||{});const hq=new class{constructor(){er(this,"_clientSize",null),er(this,"getClientWidth",(()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth)),er(this,"getClientHeight",(()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight)),er(this,"getStyle",(e=>window.getComputedStyle(e,null))),er(this,"checkCssVisibleProperty",(e=>{var t;let n=!0;const r=this.getStyle(e),{display:i,visibility:o,opacity:s,filter:a}=r;return(i==="none"||lt(t=["hidden","collapse"]).call(t,o)||Number(s)<.1)&&(n=!1),!!n&&(a&&a.split(" ").filter((c=>{var l;const u=c.split("(")[0];return lt(l=["brightness","blur","opacity"]).call(l,u)})).map((c=>{const[l,u]=c.split(/\(|\)/);return[l,Number(u.match(/^[0-9\.]+/))]})).forEach((c=>{const[l,u]=c;switch(l){case"brightness":(u<.1||u>3)&&(n=!1);break;case"blur":u>3&&(n=!1);break;case"opacity":u<.1&&(n=!1)}})),n)})),er(this,"checkPropertyUpToAllParentNodes",((e,t)=>{let n=!0,r=!0;const i=s=>t(s);let o=e;for(;o&&r;)i(o)||(n=!1,r=!1),o=o.parentElement,o||(r=!1);return n})),er(this,"checkActualCssVisibleIncludeInherit",(e=>this.checkPropertyUpToAllParentNodes(e,this.checkCssVisibleProperty))),er(this,"getSizeAboutClient",(e=>{const{width:t,height:n,left:r,right:i,top:o,bottom:s}=e.getBoundingClientRect(),a=this.getClientWidth(),c=this.getClientHeight();return{width:t,height:n,left:r,right:i,top:o,bottom:s,clientWidth:a,clientHeight:c,clientMin:Math.min(a,c)}})),er(this,"checkActualSize",(()=>{const{width:e,height:t,clientMin:n}=this._clientSize;return this.checkSizeIsVisible(e,t,n)})),er(this,"elementFromPoint",((e,t)=>document.elementFromPoint?document.elementFromPoint(e,t):null)),er(this,"checkCoverForAPoint",((e,t,n)=>{const r=this.elementFromPoint(e,t);return r!==null&&r!==n})),er(this,"getPointPositionList",(()=>{const{width:e,height:t,left:n,top:r}=this._clientSize,i=e/6,o=t/6,s=[],a=10**6;for(let c=0;c<5;c++)for(let l=0;l<5;l++){const u=(n*a+(c===0?.1:c===4?(i*c*a-1e5)/a:i*c)*a)/a,d=(r*a+(l===0?.1:l===4?(o*l*a-1e5)/a:o*l)*a)/a;s.push({x:u,y:d})}return[...s]})),er(this,"checkElementCover",(e=>this.getPointPositionList().map((t=>this.checkCoverForAPoint(t.x,t.y,e))).filter((t=>!!t)).length>6)),er(this,"checkSizeIsVisible",((e,t,n)=>(e>50||n/e<=10)&&(t>50||n/t<=10))),er(this,"checkSizeOfPartInClient",(()=>{const{left:e,right:t,top:n,bottom:r,clientHeight:i,clientWidth:o,clientMin:s}=this._clientSize;let aLine truncated
Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`):D.warning(`We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.
It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.
Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`),ws.emit("autoplay-failed")}}function Yq(e,t,n,r){if(!e)return;const i=mt.getBaseInfoBySessionId(e);if(!i)return;const o=i.info,s=Date.now(),a=or(or({},o),{},{vid:o.vid===void 0?0:Number(o.vid),lts:s,elapse:s-i.startTime,cbRegistered:ws.onAutoplayFailed||ws.onAudioAutoplayFailed?1:-1,errorMsg:n,mediaType:t,trackId:r,extend:void 0});mt.send({type:dr.AUTOPLAY_FAILED,data:a},!0)}const ABe=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","error"],Io=new class{constructor(){Fe(this,"onAutoplayFailed",void 0),Fe(this,"elementMap",new Map),Fe(this,"elementStateMap",new Map),Fe(this,"elementsNeedToResume",[]),Fe(this,"sinkIdMap",new Map),Fe(this,"autoResumeAfterInterruption",(e=>{Array.from(this.elementMap.entries()).forEach((t=>{let[n,r]=t;const i=this.elementStateMap.get(n),o=r.srcObject.getAudioTracks()[0],s=o&&o.readyState;if(D.debug("resume after interrupted, ele: ".concat(i," audio: ").concat(s," ").concat(e)),s==="live"){if(e)return r.pause(),void r.play();if(In.curState==="running")return Ep()?(r.pause(),void r.play()):void(i&&i==="paused"&&r.play())}}))})),Fe(this,"autoResumeAfterInterruptionOnIOS15_16",(()=>{Array.from(this.elementMap.entries()).forEach((e=>{let[t,n]=e;const r=n.srcObject.getAudioTracks()[0];r&&r.readyState==="live"&&(D.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),n.pause(),n.play())}))})),this.autoResumeAudioElement(),In.on(mi.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),In.on(mi.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),In.on(mi.STATE_CHANGE,(()=>{vo()&&In.prevState==="suspended"&&In.curState==="running"&&this.autoResumeAfterInterruption()}))}async setSinkID(e,t){const n=this.elementMap.get(e);if(this.sinkIdMap.set(e,t),n)try{await n.setSinkId(t)}catch(r){throw new Be(Q.PERMISSION_DENIED,"can not set sink id: "+r.toString())}}play(e,t,n,r){if(this.elementMap.has(t))return;const i=document.createElement("audio");i.autoplay=!0,i.srcObject=new MediaStream([e]),this.bindAudioElementEvents(t,i),this.elementMap.set(t,i),this.elementStateMap.set(t,oo.INIT),this.setVolume(t,n);const o=this.sinkIdMap.get(t);if(o)try{i.setSinkId(o).catch((a=>{D.warning("[".concat(t,"] set sink id failed"),a.toString())}))}catch(a){D.warning("[".concat(t,"] set sink id failed"),a.toString())}const s=i.play();s&&s.then&&s.catch((a=>{r&&Yq(r,"audio",a.message,t),D.warning("audio element play warning",a.toString()),this.elementMap.has(t)&&a.name==="NotAllowedError"&&(D.warning("detected audio element autoplay failed"),this.elementsNeedToResume.push(i),u6((()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),Zq()})))}))}updateTrack(e,t){const n=this.elementMap.get(e);n&&(n.srcObject=new MediaStream([t]))}isPlaying(e){return this.elementMap.has(e)&&this.elementStateMap.get(e)==="playing"}setVolume(e,t){const n=this.elementMap.get(e);n&&(t=Math.max(0,Math.min(100,t)),n.volume=t/100)}stop(e){const t=this.elementMap.get(e);if(this.sinkIdMap.delete(e),!t)return;const n=this.elementsNeedToResume.indexOf(t);this.elementsNeedToResume.splice(n,1),t.srcObject=null,t.remove(),this.elementMap.delete(e),this.elementStateMap.delete(e)}bindAudioElementEvents(e,t){ABe.forEach((n=>{t.addEventListener(n,(r=>{const i=this.elementStateMap.get(e),o=r.type==="pause"?"paused":r.type;if(D.debug("[".concat(e,"] audio-element-status change ").concat(i," => ").concat(o)),r.type==="error"){const s=t==null?void 0:t.error;s&&D.error("[".concat(e,"] media error, code: ").concat(s.code,", message: ").concat(s.message))}this.elementStateMap.set(e,o)}))}))}getPlayerState(e){return this.elementStateMap.get(e)||"uninit"}autoResumeAudioElement(){const e=()=>{this.elementsNeedToResume.forEach((t=>{t.play().then((n=>{D.debug("Auto resume audio element success")})).catch((n=>{D.warning("Auto resume audio element failed!",n)}))})),this.elementsNeedToResume=[]};new ot((t=>{document.body?t():window.addEventListener("load",(()=>t()))})).then((()=>{ag()?document.body.addEventListener("click",e,!0):(document.body.addEventListener("touchstart",e,!0),document.body.addEventListener("mousedown",e,!0))}))}};function Or(){return function(e,t,n){const r=n.value;return typeof r=="function"&&(n.value=function(){this._isClosed&&new Be(Q.INVALID_OPERATION,"[".concat(this.getTrackId(),"] cannot operate a closed track")).print("warning",D);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];const a=r.apply(this,o);return a instanceof ot?new ot(((c,l)=>{a.then(c).catch(l)})):a}),n}}class Xq extends fr{constructor(t){super(),Fe(this,"name","VideoProcessorDestination"),Fe(this,"ID","0"),Fe(this,"_source",void 0),Fe(this,"videoContext",void 0),Fe(this,"inputTrack",void 0),this.videoContext=t}get kind(){return"video"}get enabled(){return!0}pipe(){throw new Be(Q.NOT_SUPPORTED,"VideoProcLine truncated
Probably you are making pipeline like this:
videoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).`);t.track&&t.track!==this.inputTrack&&(this.videoContext.chained=!0,this.inputTrack=t.track,this.emit(yo.ON_TRACK,t.track))}reset(){this.inputTrack=void 0,this.videoContext.chained=!1,this.emit(yo.ON_TRACK,void 0)}}class Qq extends fr{set chained(t){this._chained=t}get chained(){return this._chained}constructor(t,n){super(),Fe(this,"constraintsMap",new Map),Fe(this,"statsRegistry",[]),Fe(this,"usageRegistry",[]),Fe(this,"trackId",void 0),Fe(this,"direction",void 0),Fe(this,"_chained",!1),this.trackId=t,this.direction=n}async getConstraints(){return await ki(this,Fs.REQUEST_CONSTRAINTS)}async requestApplyConstraints(t,n){var r;return D.info("processor ".concat(n.name," requestApplyConstraints for ").concat(this.trackId)),t&&this.constraintsMap.set(n,t),Fn(this,Fs.REQUEST_UPDATE_CONSTRAINTS,Array.from(pu(r=this.constraintsMap).call(r)))}async requestRevertConstraints(t){var n;if(this.constraintsMap.has(t))return D.info("processor ".concat(t.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(t),Fn(this,Fs.REQUEST_UPDATE_CONSTRAINTS,Array.from(pu(n=this.constraintsMap).call(n)))}registerStats(t,n,r){this.statsRegistry.find((i=>i.processorID===t.ID&&i.processorName===t.name&&i.type===n))||this.statsRegistry.push({processorName:t.name,processorID:t.ID,type:n,cb:r})}unregisterStats(t,n){const r=this.statsRegistry.findIndex((i=>i.processorID===t.ID&&i.processorName===t.name&&i.type===n));r!==-1&&this.statsRegistry.splice(r,1)}gatherStats(){const t=[];for(const{processorID:n,processorName:r,type:i,cb:o}of this.statsRegistry)try{const s=o();t.push({processorID:n,processorName:r,type:i,stats:s})}catch(s){D.error(new Be(Q.UNEXPECTED_ERROR,s.message))}return t}registerUsage(t,n){this.usageRegistry.find((r=>r.processorID===t.ID&&r.processorName===t.name))||this.usageRegistry.push({processorID:t.ID,processorName:t.name,cb:n})}unregisterUsage(t){const n=this.usageRegistry.findIndex((r=>r.processorID===t.ID&&r.processorName===t.name));n!==-1&&this.usageRegistry.splice(n,1)}async gatherUsage(){const t=[];if(!this.chained)return[];for(const{cb:n}of this.usageRegistry)try{let r=n();r instanceof ot&&(r=await r),t.push(or(or({},r),{},{direction:this.direction}))}catch(r){D.error("gather extension usage error",r)}return t}getDirection(){return this.direction}}class Kq extends fr{constructor(t){super(),Fe(this,"name","AudioProcessorDestination"),Fe(this,"ID","0"),Fe(this,"inputTrack",void 0),Fe(this,"inputNode",void 0),Fe(this,"audioProcessorContext",void 0),Fe(this,"_source",void 0),this.audioProcessorContext=t}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new Be(Q.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new Be(Q.NOT_SUPPORTED,"AudioProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.audioProcessorContext.chained=!1,this.emit(yo.ON_TRACK,void 0),this.emit(yo.ON_NODE,void 0)}updateInput(t){if(t.context!==this.audioProcessorContext)throw new Error(`ProcessorContext passed to AudioTrack.processorDestination doesn't match it's belonging AudioTrack's context.
Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).`);t.track&&this.inputTrack!==t.track&&(this.audioProcessorContext.chained=!0,this.inputTrack=t.track,this.emit(yo.ON_TRACK,this.inputTrack)),t.node&&this.inputNode!==t.node&&(this.audioProcessorContext.chained=!0,this.inputNode=t.node,this.emit(yo.ON_NODE,this.inputNode))}}class qq extends fr{set chained(t){this._chained=t}get chained(){return this._chained}constructor(t,n,r){super(),Fe(this,"constraintsMap",new Map),Fe(this,"statsRegistry",[]),Fe(this,"audioContext",void 0),Fe(this,"trackId",void 0),Fe(this,"direction",void 0),Fe(this,"usageRegistry",[]),Fe(this,"_chained",!1),this.audioContext=t,this.trackId=n,this.direction=r}async getConstraints(){return ki(this,Fs.REQUEST_CONSTRAINTS)}getAudioContext(){return this.audioContext}async requestApplyConstraints(t,n){var r;return D.info("processor ".concat(n.name," requestApplyConstraints for ").concat(this.trackId)),t&&this.constraintsMap.set(n,t),Fn(this,Fs.REQUEST_UPDATE_CONSTRAINTS,Array.from(pu(r=this.constraintsMap).call(r)))}async requestRevertConstraints(t){var n;if(this.constraintsMap.has(t))return this.constraintsMap.delete(t),Fn(this,Fs.REQUEST_UPDATE_CONSTRAINTS,Array.from(pu(n=this.constraintsMap).call(n)))}registerStats(t,n,r){this.statsRegistry.find((i=>i.processorID===t.ID&&i.processorName===t.name&&i.type===n))||this.statsRegistry.push({processorName:t.name,processorID:t.ID,type:n,cb:r})}unregisterStats(t,n){const r=this.statsRegistry.findIndex((i=>i.processorID===t.ID&&i.processorName===t.name&&i.type===n));r!==-1&&this.statsRegistry.splice(r,1)}gatherStats(){const t=[];for(const{processorID:n,processorName:r,type:i,cb:o}of this.statsRegistry)try{const s=o();t.push({processorID:n,processorName:r,type:i,stats:s})}catch(s){D.error(new Be(Q.UNEXPECTED_ERROR,s.message))}return t}registerUsage(t,n){this.usageRegistry.find((r=>r.processorID===t.ID&&r.processorName===t.name))||this.usageRegistry.push({processorID:t.ID,processorName:t.name,cb:n})}unregisterUsage(t){const n=this.usageRegistry.findIndex((r=>r.processorID===t.ID&&r.processorName===t.name));n!==-1&&this.usageRegistry.splice(n,1)}async gatherUsage(){const t=[];if(!this.chained)return[];for(const{cb:n}of this.usageRegistry)try{let r=n();r instanceof ot&&(r=await r),t.push(or(or({},r),{},{direction:this.direction}))}catch(r){D.error("gather extension usage error",r)}return t}getDirection(){return this.direction}}class rC extends fr{get isPlayed(){return!0}get isFreeze(){return!1}constructor(){super(),Fe(this,"context",void 0),Fe(this,"processSourceNode",void 0),Fe(this,"outputTrack",void 0),Fe(this,"processedNode",void 0),Fe(this,"clonedTrack",void 0),Fe(this,"outputNode",void 0),this.outputNode=new CBe}setVolume(){}createOutputTrack(){throw new Be(Q.NOT_SUPPORTED,"can not create output MediaStreamTrack when WebAudio disabled")}getOriginVolumeLevel(){return 0}getAccurateVolumeLevel(){return 0}stopGetAudioBuffer(){}startGetAudioBuffer(){}play(){}stop(){}destroy(){}updateTrack(){}updateOriginTrack(){}createMediaStreamSourceNode(){}}class CBe{disconnect(){}connect(){}}function $q(e){return new ot(((t,n)=>{let r=!1;const i=document.createElement("video");i.setAttribute("autoplay",""),i.setAttribute("muted",""),i.muted=!0,i.autoplay=!0,i.setAttribute("playsinline",""),i.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(i);const o=vo()?"canplay":"playing";i.addEventListener(o,(()=>{const s=i.videoWidth,a=i.videoHeight;!s&&Er()||(r=!0,i.srcObject=null,i.remove(),t([s,a]))})),i.srcObject=new MediaStream([e]),i.play().catch(d6),setTimeout((()=>{r||(i.srcObject=null,i.remove(),t([i.videoWidth,i.videoHeight]))}),4e3)}))}function O4(e){const t={};e.facingMode&&(t.facingMode=e.facingMode),e.cameraId&&(t.deviceId={exact:e.cameraId});const n=$c(e.encoderConfig);return n.width!=null&&(t.width=n.width),n.height!=null&&(t.height=n.height),!dq()&&n.frameRate&&(t.frameRate=n.frameRate),oq()&&typeof t.frameRate=="object"&&(t.frameRate.max=60),Er()&&(t.frameRate={ideal:30,max:30}),t}function lB(e){const t={};if(dq()||(e.AGC!==void 0&&(t.autoGainControl=e.AGC),e.AEC!==void 0&&(t.echoCancellation=e.AEC),e.ANS!==void 0&&(t.noiseSuppression=e.ANS,Od()&&e.ANS&&(t.googHighpassFilter=e.ANS))),e.encoderConfig){const n=P4(e.encoderConfig);t.channelCount=n.stereo?2:1,t.sampleRate=n.sampleRate,t.sampleSize=n.sampleSize}return e.microphoneId&&(t.deviceId={exact:e.microphoneId}),c6()&&(t.sampleRate=void 0),t}const wBe=e=>{const t=e._encoderConfig;if(!t)return;const{frameRate:n,width:r,height:i}=e.getMediaStreamTrackSettings();let{frameRate:o=n,width:s=r,height:a=i}=t;if(!o||!s||!a)return;s=D9(s),a=D9(a),o=D9(o);const{max:c,min:l}=(function(h,p,g){const m=200*Math.pow(g/15,.6)*Math.pow(h*p/640/360,.75);return{min:Math.floor(m),max:Math.floor(4*m)}})(s,a,o),{bitrateMax:u,bitrateMin:d}=t||{};u||D.debug("calculate bitrate: [w: ".concat(s,", h: ").concLine truncated
`,a="".concat("\r").concat(s),c=" ";let l;function u(z){return z>="0"&&z<="9"}function d(z){return z>="!"&&z<="~"}function f(z){return d(z)||z>="€"&&z<="ÿ"}function h(z){return z==="!"||z>="#"&&z<="'"||z>="*"&&z<="+"||z>="-"&&z<="."||z>="0"&&z<="9"||z>="A"&&z<="Z"||z>="^"&&z<="~"}function p(z){return z>="1"&&z<="9"}function g(z){return z>="A"&&z<="Z"||z>="a"&&z<="z"}function m(z){return z==="d"||z==="h"||z==="m"||z==="s"}function y(z){return z>""&&z<" "||z>"\v"&&z<"\f"||z>""&&z<"ÿ"}function v(z){return g(z)||u(z)||z==="+"||z==="/"}function E(z){return u(z)||g(z)||z==="+"||z==="/"||z==="-"||z==="_"}function b(z){return g(z)||u(z)||z==="+"||z==="/"}function S(z,A){var T=Object.keys(z);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(z);A&&(k=k.filter((function(j){return Object.getOwnPropertyDescriptor(z,j).enumerable}))),T.push.apply(T,k)}return T}function w(z){for(var A=1;A<arguments.length;A++){var T=arguments[A]!=null?arguments[A]:{};A%2?S(Object(T),!0).forEach((function(k){C(z,k,T[k])})):Object.getOwnPropertyDescriptors?Object.defineProperties(z,Object.getOwnPropertyDescriptors(T)):S(Object(T)).forEach((function(k){Object.defineProperty(z,k,Object.getOwnPropertyDescriptor(T,k))}))}return z}function C(z,A,T){return A in z?Object.defineProperty(z,A,{value:T,enumerable:!0,configurable:!0,writable:!0}):z[A]=T,z}(function(z){z.VERSION="v",z.ORIGIN="o",z.SESSION_NAME="s",z.INFORMATION="i",z.URI="u",z.EMAIL="e",z.PHONE="p",z.CONNECTION="c",z.BANDWIDTH="b",z.TIME="t",z.REPEAT="r",z.ZONE_ADJUSTMENTS="z",z.KEY="k",z.ATTRIBUTE="a",z.MEDIA="m"})(l||(l={}));class _{consumeText(A,T){let k=T;for(;k<A.length;){const j=A[k];if(j==="\0"||j==="\r"||j===s)break;k+=1}if(k-T==0)throw new Error("Invalid text, at ".concat(A));return k}consumeUnicastAddress(A,T,k){return this.consumeTill(A,T,c)}consumeOneOrMore(A,T,k){let j=T;for(;k(A[j]);)j++;if(j-T==0)throw new Error("Invalid rule at ".concat(T,"."));return j}consumeSpace(A,T){if(A[T]===c)return T+1;throw new Error("Invalid space at ".concat(T,"."))}consumeIP4Address(A,T){let k=T;for(let j=0;j<4;j++)if(k=this.consumeDecimalUChar(A,k),j!==3){if(A[k]!==".")throw new Error("Invalid IP4 address.");k++}return k}consumeDecimalUChar(A,T){let k=T;for(let re=0;re<3&&u(A[k]);re++,k++);if(k-T==0)throw new Error("Invalid decimal uchar.");const j=parseInt(A.slice(T,k));if(j>=0&&j<=255)return k;throw new Error("Invalid decimal uchar")}consumeIP6Address(A,T){let k=this.consumeHexpart(A,T);return A[k]===":"&&(k+=1,k=this.consumeIP4Address(A,k)),k}consumeHexpart(A,T){let k=T;if(A[k]===":"&&A[k+1]===":"){k+=2;try{k=this.consumeHexseq(A,k)}catch{}return k}if(k=this.consumeHexseq(A,k),A[k]===":"&&A[k+1]===":"){k+=2;try{k=this.consumeHexseq(A,k)}catch{}return k}return k}consumeHexseq(A,T){let k=T;for(;k=this.consumeHex4(A,k),A[k]===":"&&A[k+1]!==":";)k+=1;return k}consumeHex4(A,T){let k=0;for(;k<4;k++)if(!((j=A[T+k])>="0"&&j<="9"||j>="a"&&j<="f"||j>="A"&&j<="F")){if(k===0)throw new Error("Invalid hex 4");break}var j;return T+k}consumeFQDN(A,T){let k=T;for(;u(A[k])||g(A[k])||A[k]==="-"||A[k]===".";)k+=1;if(k-T<4)throw new Error("Invalid FQDN");return k}consumeExtnAddr(A,T){return this.consumeOneOrMore(A,T,f)}consumeMulticastAddress(A,T,k){switch(k){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(A,T);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(A,T);default:try{return this.consumeFQDN(A,T)}catch{return this.consumeExtnAddr(A,T)}}}consumeIP6MulticastAddress(A,T){const k=this.consumeHexpart(A,T);return A[k]==="/"?this.consumeInteger(A,k+1):k}consumeIP4MulticastAddress(A,T){let k=T+3;const j=A.slice(T,k),re=parseInt(j);if(re<224||re>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let me=0;me<3;me++){if(A[k]!==".")throw new Error("Invalid IP4 multicast address.");k+=1,k=this.consumeDecimalUChar(A,k)}return A[k]==="/"&&(k+=1),k=this.consumeTTL(A,k),A[k]==="/"&&(k=this.consumeInteger(A,k)),k}consumeInteger(A,T){if(!p(A[T]))throw new Error("Invalid integer.");for(T+=1;u(A[T]);)T+=1;return T}consumeTTL(A,T){if(A[T]==="0")return T+1;if(!p(A[T]))throw new Error("Invalid TTL.");T+=1;for(let k=0;k<2&&u(A[T]);k++)T+=1;return T}consumeToken(A,T){return this.consumeOneOrMore(A,T,h)}consumeTime(A,T){let k=T;if(A[k]==="0")return k+1;for(p(A[k])&&(k+=1);u(A[k]);)k++;if(k-T<10)throw new Error("Invalid time");return k}consumeAddress(A,T){return this.consumeTill(A,T,c)}consumeTypedTime(A,T){let k=T;return k=this.consumeOneOrMore(A,k,u),m(A[k])?k+1:k}consumeRepeatInterval(A,T){if(!p(A[T]))throw new Error("Invalid repeat interval");for(T+=1;u(A[T]);)T+=1;return m(A[T])&&(T+=1),T}consumePort(A,T){return this.consumeOneOrMore(A,T,u)}consume(A,T,k){for(let j=0;j<k.length;j++){if(T+j>=A.length)throw new Error("consume exceeding value length");if(A[T+j]!==k[j])throw new Error("consume ".concat(k," failed at ").concat(j))}return T+k.length}consumeTill(A,T,k){let j=T;for(;j<A.length&&(typeof k!="Line truncated
`),e),t==="offer"?i=>{p$(i,"answer",n==="local"?"remote":"local",r)}:void 0}function Lc(e,t){return typeof he(e)===t?he(e):void 0}function zF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Gu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zF(Object(n),!0).forEach((function(r){H(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zF(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}const fE=new Map;class kBe extends fr{get state(){return this._state}set state(t){if(t===this._state)return;const n=this._state;this._state=t,t==="DISCONNECTED"&&this._disconnectedReason?this.emit(Ci.CONNECTION_STATE_CHANGE,t,n,this._disconnectedReason):this.emit(Ci.CONNECTION_STATE_CHANGE,t,n)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(t){D.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(t)),this._joinGatewayStartTime=t}constructor(t,n){super(),H(this,"store",void 0),H(this,"joinInfo",void 0),H(this,"key",void 0),H(this,"ntpOffset",0),H(this,"signal",void 0),H(this,"role",void 0),H(this,"inChannelInfo",{joinAt:null,duration:0}),H(this,"spec",void 0),H(this,"_state","DISCONNECTED"),H(this,"_statsCollector",void 0),H(this,"_disconnectedReason",void 0),H(this,"isSignalRecover",!1),H(this,"hasChangeBGPAddress",!1),H(this,"trafficStatsInterval",void 0),H(this,"networkQualityInterval",void 0),H(this,"_joinGatewayStartTime",0),H(this,"_signalTimeout",!1),H(this,"_clientRoleOptions",void 0),H(this,"_isProactiveJoin",!1),this.store=t,this.spec=n,this.signal=this.store.useP2P?new BF(Gu(Gu({},n),{},{retryConfig:n.websocketRetryConfig}),t):new tMe(Gu(Gu({},n),{},{retryConfig:n.websocketRetryConfig}),t),this._statsCollector=n.statsCollector,this.role=n.role||"audience",this._clientRoleOptions=n.clientRoleOptions,this.handleSignalEvents()}async join(t,n,r){this.store.joinGatewayStart(),t.cloudProxyServer!=="disabled"&&(this.hasChangeBGPAddress=!0);const i=Date.now();let o=fE.get(t.cname);if(o||(o=new Map,fE.set(t.cname,o)),this._isProactiveJoin=!0,o.has(t.uid)){const l=new xe(Q.UID_CONFLICT);throw mt.joinGateway(t.sid,{lts:i,succ:!1,ec:l.code,addr:null,uid:t.uid,cid:t.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!t.proxyServer,signalChannel:"0",preload:t.preload}),this._isProactiveJoin=!1,l}o.set(t.uid,!0),this.joinInfo=t,this.key=n;let s=0;this.joinGatewayStartTime=i;const a=t.proxyServer;try{D.debug("[".concat(this.store.clientId,"] use websocket join uid ").concat(s));const l=t.gatewayAddrs.map((u=>{let{address:d}=u;const[f,h]=d.split(":"),p={host:f,port:h};return t.proxyServer&&(p.proxy=t.proxyServer),p}));s=(await this.signal.init(l,r)).uid,D.debug("[".concat(this.store.clientId,"] websocket join uid ").concat(s," cost ").concat(Date.now()-this.joinGatewayStartTime))}catch(l){var c;throw D.error("[".concat(this.store.clientId,"] User join failed"),l.toString()),mt.joinGateway(t.sid,{lts:i,succ:!1,ec:((c=l.data)===null||c===void 0?void 0:c.desc)||l.code,errorMsg:l.message,addr:this.signal.url,uid:t.uid,cid:t.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!a,signalChannel:"0",preload:t.preload}),this._isProactiveJoin=!1,o.delete(t.uid),this.signal.close(),l}return this.state="CONNECTED",this.inChannelInfo.joinAt=Date.now(),D.debug("[".concat(this.store.clientId,"] Connected to gateway server")),this.trafficStatsInterval=window.setInterval((()=>{this.updateTrafficStats().catch((l=>{D.warning("[".concat(this.store.clientId,"] get traffic stats error"),l.toString())}))}),3e3),this.networkQualityInterval=window.setInterval((()=>{navigator&&navigator.onLine!==void 0&&!navigator.onLine?this.emit(Ci.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6}):this._signalTimeout?this.emit(Ci.NETWORK_QUALITY,{downlinkNetworkQuality:5,uplinkNetworkQuality:5}):this.state==="CONNECTED"&&this._statsCollector.trafficStats?this.emit(Ci.NETWORK_QUALITY,{uplinkNetworkQuality:DM(this._statsCollector.trafficStats.B_unq),downlinkNetworkQuality:DM(this._statsCollector.trafficStats.B_dnq)}):this.emit(Ci.NETWORK_QUALITY,{uplinkNetworkQuality:0,downlinkNetworkQuality:0})}),2e3),this.store.joinGatewayEnd(),s}async leave(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1?arguments[1]:void 0;if(this.state!=="DISCONNECTED"){n!==Tn.FALLBACK&&(this.state="DISCONNECTING");try{t||this.signal.connectionState!==Hn.CONNECTED||await(function(r,i){return i===1/0?r:ot.race([r,qLe(i)])})(this.signal.request(Dt.LEAVE,void 0,!0),3e3)}catch(r){D.warning("[".concat(this.store.clientId,"] leave request failed, ignore"),r)}this.signal.close(n),n!==Tn.FALLBACK&&Line truncated
`)},S=function(M,B,q){return B instanceof Blob?(q=q!==void 0?q+"":typeof B.name=="string"?B.name:"blob",B.name===q&&Object.prototype.toString.call(B)!=="[object Blob]"||(B=new File([B],q)),[String(M),B]):[String(M),String(B)]},w=function(M,B){if(M.length<B)throw new TypeError(B+" argument required, but only "+M.length+" present.")},C=typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:this,_=C.FormData,I=C.XMLHttpRequest&&C.XMLHttpRequest.prototype.send,O=C.Request&&C.fetch,L=C.navigator&&C.navigator.sendBeacon,R=C.Element&&C.Element.prototype,F=C.Symbol&&Symbol.toStringTag;F&&(Blob.prototype[F]||(Blob.prototype[F]="Blob"),"File"in C&&!File.prototype[F]&&(File.prototype[F]="File"));try{new File([],"")}catch{C.File=function(B,q,z){return B=new Blob(B,z||{}),Object.defineProperties(B,{name:{value:q},lastModified:{value:+(z&&z.lastModified!==void 0?new Date(z.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),F&&Object.defineProperty(B,F,{value:"File"}),B}}var W=function(M){return M.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},J=function(M){this.i=[];var B=this;M&&E(M.elements,(function(q){if(q.name&&!q.disabled&&q.type!=="submit"&&q.type!=="button"&&!q.matches("form fieldset[disabled] *"))if(q.type==="file"){var z=q.files&&q.files.length?q.files:[new File([],"",{type:"application/octet-stream"})];E(z,(function(A){B.append(q.name,A)}))}else q.type==="select-multiple"||q.type==="select-one"?E(q.options,(function(A){!A.disabled&&A.selected&&B.append(q.name,A.value)})):q.type==="checkbox"||q.type==="radio"?q.checked&&B.append(q.name,q.value):(z=q.type==="textarea"?b(q.value):q.value,B.append(q.name,z))}))};if((e=J.prototype).append=function(M,B,q){w(arguments,2),this.i.push(S(M,B,q))},e.delete=function(M){w(arguments,1);var B=[];M=String(M),E(this.i,(function(q){q[0]!==M&&B.push(q)})),this.i=B},e.entries=function M(){var B,q=this;return v(M,(function(z){if(z.h==1&&(B=0),z.h!=3)return B<q.i.length?z=h(z,q.i[B]):(z.h=0,z=void 0),z;B++,z.h=2}))},e.forEach=function(M,B){w(arguments,1);for(var q=a(this),z=q.next();!z.done;z=q.next()){var A=a(z.value);z=A.next().value,A=A.next().value,M.call(B,A,z,this)}},e.get=function(M){w(arguments,1);var B=this.i;M=String(M);for(var q=0;q<B.length;q++)if(B[q][0]===M)return B[q][1];return null},e.getAll=function(M){w(arguments,1);var B=[];return M=String(M),E(this.i,(function(q){q[0]===M&&B.push(q[1])})),B},e.has=function(M){w(arguments,1),M=String(M);for(var B=0;B<this.i.length;B++)if(this.i[B][0]===M)return!0;return!1},e.keys=function M(){var B,q,z,A,T=this;return v(M,(function(k){if(k.h==1&&(B=a(T),q=B.next()),k.h!=3)return q.done?void(k.h=0):(z=q.value,A=a(z),h(k,A.next().value));q=B.next(),k.h=2}))},e.set=function(M,B,q){w(arguments,2),M=String(M);var z=[],A=S(M,B,q),T=!0;E(this.i,(function(k){k[0]===M?T&&(T=!z.push(A)):z.push(k)})),T&&z.push(A),this.i=z},e.values=function M(){var B,q,z,A,T=this;return v(M,(function(k){if(k.h==1&&(B=a(T),q=B.next()),k.h!=3)return q.done?void(k.h=0):(z=q.value,(A=a(z)).next(),h(k,A.next().value));q=B.next(),k.h=2}))},J.prototype._asNative=function(){for(var M=new _,B=a(this),q=B.next();!q.done;q=B.next()){var z=a(q.value);q=z.next().value,z=z.next().value,M.append(q,z)}return M},J.prototype._blob=function(){var M="----formdata-polyfill-"+Math.random(),B=[],q="--"+M+`\r
Content-Disposition: form-data; name="`;return this.forEach((function(z,A){return typeof z=="string"?B.push(q+W(b(A))+`"\r
\r
`+b(z)+`\r
`):B.push(q+W(b(A))+'"; filename="'+W(z.name)+`"\r
Content-Type: `+(z.type||"application/octet-stream")+`\r
\r
`,z,`\r
`)})),B.push("--"+M+"--"),new Blob(B,{type:"multipart/form-data; boundary="+M})},J.prototype[Symbol.iterator]=function(){return this.entries()},J.prototype.toString=function(){return"[object FormData]"},R&&!R.matches&&(R.matches=R.matchesSelector||R.mozMatchesSelector||R.msMatchesSelector||R.oMatchesSelector||R.webkitMatchesSelector||function(M){for(var B=(M=(this.document||this.ownerDocument).querySelectorAll(M)).length;0<=--B&&M.item(B)!==this;);return-1<B}),F&&(J.prototype[F]="FormData"),I){var Y=C.XMLHttpRequest.prototype.setRequestHeader;C.XMLHttpRequest.prototype.setRequestHeader=function(M,B){Y.call(this,M,B),M.toLowerCase()==="content-type"&&(this.B=!0)},C.XMLHttpRequest.prototype.send=function(M){M instanceof J?(M=M._blob(),this.B||this.setRequestHeader("Content-Type",M.type),I.call(this,M)):I.call(this,M)}}O&&(C.fetch=function(M,B){return B&&B.body&&B.body instanceof J&&(B.body=B.body._blob()),O.call(this,M,B)}),L&&(C.navigator.sendBeacon=function(M,B){return B instanceof J&&(B=B._asNative()),L.call(this,M,B)}),C.FormData=J}})();const pg=()=>{const e=he("AREAS");return e.length===0&&e.push(gn.GLOBAL),vc(e).call(e,((t,n,r)=>{const i=m$(n);return i?r===0?i:"".concat(t,",").concat(i):t}),"")},m$=e=>e===gn.OVERSEA?"".concat(Ui.ASIA,",").concat(Ui.EUROPE,",").concat(Ui.AFRICA,",").concat(Ui.NORTH_AMERICA,",").concat(Ui.SOUTH_AMERICA,",").concat(Ui.OCEANIA):Ui[e],xBe=e=>{const t={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return e.map((n=>{const r=m6[n],i=Object.keys(r);i&&i.map((o=>{o!=="CODE"&&(t[o]=t[o].concat(r[o]))}))})),t},I3={GLOBAL:{ASIA:[gn.CHINA,gn.JAPAN,gn.INDIA,gn.KOREA,gn.HKMC],EUROPE:[],NORTH_AMERICA:[gn.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},b5=Object.keys(I3[gn.GLOBAL]),pE=[gn.CHINA,gn.NORTH_AMERICA,gn.EUROPE,gn.ASIA,gn.JAPAN,gn.INDIA,gn.OCEANIA,gn.SOUTH_AMERICA,gn.AFRICA,gn.KOREA,gn.HKMC,gn.US],DBe=function(e,t){let n=[];if(lt(e).call(e,gn.GLOBAL)){const o=[gn.GLOBAL,gn.OVERSEA],s=Object.keys(m6);if(t===gn.GLOBAL)throw new xe(Q.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(t===gn.CHINA)n=[gn.OVERSEA];else if(i=t,lt(b5).call(b5,i)){const a=(r=t,I3[gn.GLOBAL][r]||[]),c=[...o,t,...a];n=s.filter((l=>!lt(c).call(c,l)))}else if((function(a){let c=!1;return b5.forEach((l=>{var u;lt(u=I3[gn.GLOBAL][l]).call(u,a)&&(c=!0)})),c})(t)){const a=(function(l){let u;return b5.forEach((d=>{var f;lt(f=I3[gn.GLOBAL][d]).call(f,l)&&(u=d)})),u})(t),c=[...o,a,t];n=s.filter((l=>!lt(c).call(c,l)))}else n=e;n=(function(a){const c=[];return pE.forEach((l=>{lt(a).call(a,l)&&c.push(l)})),c.concat(a.filter((l=>!lt(pE).call(pE,l))))})(n)}else n=e;var r,i;return n};function WF(e){var t,n;if(!e&&lt(t=he("AREAS")).call(t,gn.EXTENSIONS))return D.debug("update area from ap : reset"),void TI(cNe,!0);if(!lt(n=he("AREAS")).call(n,gn.GLOBAL)||!e)return;let r=m6.EXTENSIONS;r&&(r={CODE:m$(gn.EXTENSIONS),WEBCS_DOMAIN:["ap-web-1-".concat(e,".agora.io")],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-".concat(e,".ap.sd-rtn.com")],PROXY_CS:["proxy-ap-web-".concat(e,".agora.io")],CDS_AP:["cds-ap-web-1-".concat(e,".agora.io"),"cds-ap-web-2-".concat(e,".ap.sd-rtn.com")],ACCOUNT_REGISTER:["sua-ap-web-1-".concat(e,".agora.io"),"sua-ap-web-2-".concat(e,".ap.sd-rtn.com")],UAP_AP:["uap-ap-web-1-".concat(e,".agora.io"),"uap-ap-web-2-".concat(e,".ap.sd-rtn.com")],EVENT_REPORT_DOMAIN:["statscollector-1-".concat(e,".agora.io")],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-".concat(e,".agora.io")],LOG_UPLOAD_SERVER:["logservice-".concat(e,".agora.io")],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy-".concat(e,".agora.io")]},D.debug("update area from ap success: ".concat(e,",config is "),r),Dn("AREAS",[gn.EXTENSIONS],!0),Object.keys(r).map((i=>{i==="LOG_UPLOAD_SERVER"||i==="EVENT_REPORT_DOMAIN"||i==="EVENT_REPORT_BACKUP_DOMAIN"||i==="PROXY_SERVER_TYPE3"?Dn(i,r[i][0]):Dn(i,r[i])})))}function TI(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const n=mt.reportApiInvoke(null,{name:Zr.SET_AREA,options:e,tag:vr.TRACER});try{let r=[];if(typeof e=="string"&&(r=[e]),Array.isArray(e)&&(e.forEach((o=>{if(!lt(IM).call(IM,o))throw new xe(Q.INVALID_PARAMS,"invalid area code")})),r=e),Object.prototype.toString.call(e)==="[object Object]"){const{areaCode:o,excludedArea:s}=e;if(!o)throw new xe(Q.INVALID_PARAMS,"area code is needed");let a=o;typeof o=="string"&&(a=[o]),r=s?DBe(a,s):a}if(!t){if(bd.AREAS){const o=new xe(Q.PROHIBITED_OPERATION,"setArea is prohibited because of config-distribute");return n.onError(o),void D.warning("setArea is prohibited because of config-distribute")}if(lt(r).call(r,gn.GLOBAL)&&he("AREAS")===gn.EXTENSIONS){const o=new xe(Q.PROHIBITED_OPERATION,"setArea is prohibited because of ap extensions");return n.onError(o),void D.warning("setArea is prohibited because of ap extensions")}}Dn("AREAS",r,t);const i=xBe(r);Object.keys(i).map((o=>{o==="LOG_UPLOAD_SERVER"||Line truncated
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`):gi.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`),this._rtpCapabilities=i,this._candidates=r,this._iceParameters=t,this._dtlsParameters=n,this._localCapabilities=o;const d=s===po.RECEIVE_ONLY?this.rtpCapabilities.send:this.rtpCapabilities.recv,f=s===po.RECEIVE_ONLY?this._localCapabilities.recv:this._localCapabilities.send,h=s===po.RECEIVE_ONLY?i.send.videoCodecs:bm(vt.VIDEO,d,f,c),p=s===po.RECEIVE_ONLY?i.send.audioCodecs:bm(vt.AUDIO,d,f,l);for(const g of u.mediaDescriptions)g.attributes.iceUfrag=t.iceUfrag,g.attributes.icePwd=t.icePwd,g.attributes.fingerprints=n.fingerprints,g.attributes.candidates=r,g.attributes.setup=this.setup,g.media.mediaType==="application"&&(g.attributes.sctpPort="5000"),g.media.mediaType==="video"&&(g.media.fmts=h.map((m=>m.payloadType.toString(10))),g.attributes.payloads=h,g.attributes.extmaps=d.videoExtensions),g.media.mediaType==="audio"&&(g.media.fmts=p.map((m=>m.payloadType.toString(10))),g.attributes.payloads=p,g.attributes.extmaps=d.audioExtensions,Tp(g));this.sessionDesc=u,this.currentMidIndex=u.mediaDescriptions.length-1}toString(){return gi.print(this.sessionDesc)}hasMid(e){return Array.isArray(e)?e.every((t=>this.hasMid(t))):this.sessionDesc.mediaDescriptions.some((t=>t.attributes.mid===e))}send(e,t,n,r,i){n=n.replace(/ /g,"-");const{ssrcs:o,ssrcGroups:s}=_0(t,this.cname,he("SYNC_GROUP")?n:void 0),a=this.findPreloadMediaDesc(o);if(a){if(Er()&&this.firefoxSsrcMidMap.set(o[0].ssrcId,a.attributes.mid),i&&(i.twcc||i.remb)){const c=this.sessionDesc.mediaDescriptions.indexOf(a);return this.sessionDesc.mediaDescriptions[c]=this.mungSendMediaDesc(a,i),{mid:a.attributes.mid,needExchangeSDP:!0}}return{mid:a.attributes.mid,needExchangeSDP:!1}}{const c=this.findAvailableMediaIndex(e,o,r);let l;return c===-1?(l=this.createOrRecycleSendMedia(e,o,s,"sendonly",r,i),this.updateBundleMids()):(l=Lr(this.sessionDesc.mediaDescriptions[c]),l.attributes.direction="sendonly",l.attributes.ssrcs=o,l.attributes.ssrcGroups=s,this.sessionDesc.mediaDescriptions[c]=this.mungSendMediaDesc(l,i)),Er()&&this.firefoxSsrcMidMap.set(o[0].ssrcId,l.attributes.mid),{needExchangeSDP:!0,mid:l.attributes.mid}}}stopSending(e){const t=this.sessionDesc.mediaDescriptions.filter((n=>n.attributes.mid&&e.indexOf(n.attributes.mid)!==-1));if(t.length!==e.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");t.forEach((n=>{n.attributes.ssrcs=[]})),this.updateBundleMids()}receive(e,t,n){const r=[];return e.forEach((i=>{const o=i._mediaStreamTrack.kind,s=this.findAvailableRecvMediaIndex(o);let a,c=!1;s===-1?(c=!0,a=this.createOrRecycleRecvMedia(i,[],"recvonly",t,n),this.updateBundleMids()):(a=Lr(this.sessionDesc.mediaDescriptions[s]),a.attributes.direction="recvonly"),r.push({mid:a.attributes.mid,needCreateTransceiver:c})})),r}stopReceiving(e){const t=this.sessionDesc.mediaDescriptions.filter((n=>e.indexOf(n.attributes.mid)!==-1));if(t.length!==e.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");t.forEach((n=>{n.media.port="0",n.attributes.direction="inactive"})),this.updateBundleMids()}addRemoteCandidate(e){const{foundation:t,protocol:n,address:r,port:i,type:o,relatedAddress:s,relatedPort:a,priority:c}=new RTCIceCandidate(e),l={foundation:t??"",componentId:"1",transport:n??"",priority:c?c+"":"",connectionAddress:r??"",port:i?i+"":"",type:o?o+"":"",relAddr:s??"",relPort:a?a+"":"",extension:{}};this.candidates.some((u=>u.priority===l.priority&&u.connectionAddress===l.connectionAddress&&u.port===l.port))||(this._candidates.push(l),this.sessionDesc.mediaDescriptions.forEach((u=>{u.attributes.candidates=this.candidates})))}clearRemoteCandidate(){this._candidates=[],this.sessionDesc.mediaDescriptions[0].attributes.candidates=this._candidates}createOrRecycleRecvMedia(e,t,n,r,i){const o=e._mediaStreamTrack.kind,s=this.rtpCapabilities.recv,a=bm(o,s,this.localCapabilities.send,o===vt.AUDIO?i:r),c=o===vt.VIDEO?s.videoExtensions:s.audioExtensions,l="".concat(++this.currentMidIndex);let u={media:{mediaType:o,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:a.map((f=>f.payloadType.toString(10)))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:[],extmaps:c,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:t,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:a,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:n,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(l)}};u=this.mungRecvMediaDsec(u,e);const d=this.findFirstClosedMedia(o);if(d){const f=this.sessionDesc.mediaDescriptions.indexOf(d);this.sessionDesc.mediaDescriptions[f]=u}else this.sessionDesc.mediaDescriptions.push(u);return u}muteRemote(e){const t=this.sessionDesc.mediaDescriptions.filter((n=>lt(e).call(e,n.attributes.mid||"")));if(t.length!==e.length)throw new Error("mediaDescriptions' lLine truncated
`),t),n==="offer"?o=>{this.logSDPExchange(o,"answer",r==="local"?"remote":"local",i)}:void 0}async muteLocal(t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const n=this.peerConnection.getTransceivers().filter((s=>s.mid&&t.indexOf(s.mid)!==-1));if(n.length!==t.length)throw new Error("Transceivers' length doesn't match mids' length.");n.map((s=>{s.direction="inactive"}));const r=await this.peerConnection.createOffer(),i=this.logSDPExchange(r.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(r),this.remoteSDP.muteRemote(t);const o=this.remoteSDP.toString();i==null||i(o),await this.setRemoteDescription({type:"answer",sdp:o})}catch(n){throw new Be(Q.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(n.toString()))}}async unmuteLocal(t){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const n=this.peerConnection.getTransceivers().filter((s=>s.mid&&t.indexOf(s.mid)!==-1));if(n.length!==t.length)throw new Error("Transceivers' length doesn't match mids' length.");n.map((async s=>{s.direction="sendonly"}));const r=await this.peerConnection.createOffer(),i=this.logSDPExchange(r.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(r),this.remoteSDP.unmuteRemote(t);const o=this.remoteSDP.toString();i==null||i(o),await this.setRemoteDescription({type:"answer",sdp:o})}catch(n){throw new Be(Q.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(n.toString()))}}async getRemoteSSRC(t,n){var r,i;if(n=(r=n)!==null&&r!==void 0?r:(i=this.currentRemoteDescription)===null||i===void 0?void 0:i.sdp){var o;const s=(o=gi.parse(n).mediaDescriptions.find((a=>a.attributes.mid===t)))===null||o===void 0?void 0:o.attributes.ssrcs;return s==null?void 0:s[0].ssrcId}}async setRemoteDescription(t){var n;await this.peerConnection.setRemoteDescription(t),lt(n=["connected","completed"]).call(n,this.peerConnection.iceConnectionState)||(this.isReady=!0,this.addRemoteCandidate())}mungReceiveAnswerSDP(t,n,r){const i=gi.parse(t),o=i.mediaDescriptions.find((s=>s.attributes.mid===n));return o&&r===vt.AUDIO&&o.media.mediaType==="audio"&&Tp(o),gi.print(i)}},ft(Zn.prototype,"establish",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"establish"),Zn.prototype),ft(Zn.prototype,"connect",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"connect"),Zn.prototype),ft(Zn.prototype,"receive",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"receive"),Zn.prototype),ft(Zn.prototype,"mockReceive",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"mockReceive"),Zn.prototype),ft(Zn.prototype,"stopReceiving",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"stopReceiving"),Zn.prototype),ft(Zn.prototype,"restartICE",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"restartICE"),Zn.prototype),ft(Zn.prototype,"close",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"close"),Zn.prototype),ft(Zn.prototype,"updateEncoderConfig",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"updateEncoderConfig"),Zn.prototype),ft(Zn.prototype,"updateSendParameters",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"updateSendParameters"),Zn.prototype),ft(Zn.prototype,"replaceTrack",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"replaceTrack"),Zn.prototype),ft(Zn.prototype,"muteLocal",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"muteLocal"),Zn.prototype),ft(Zn.prototype,"unmuteLocal",[Ea],Object.getOwnPropertyDescriptor(Zn.prototype,"unmuteLocal"),Zn.prototype),Zn);function Ea(e,t,n){const r=e[t];if(typeof r!="function")throw new Error("Cannot use mutex on object property.");return n.value=async function(){const i=this.mutex,o=await i.lock("From P2PConnection.".concat(t));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return await r.apply(this,a)}finally{o()}},n}function uC(e,t){let n=document.createElement("video"),r=document.createElement("canvas");n.setAttribute("style","display:none"),r.setAttribute("style","display:none"),n.setAttribute("muted",""),n.muted=!0,n.setAttribute("autoplay",""),n.autoplay=!0,n.setAttribute("playsinline",""),r.width=hs(t.width),r.height=hs(t.height);const i=hs(t.framerate||15);document.body.append(n),document.body.append(r);let o=e._mediaStreamTrack;n.srcObject=new MediaStream([o]),n.play();const s=r.getContext("2d");if(!s)throw new xe(Q.UNEXPECTED_ERROR,"can not get canvas context");const a=fn(),c=r.captureStream(a.supportRequestFrame?0:i).getVideoTracks()[0];c.canvas||(c.canvas=r),r.startCapture=()=>{if(!n)return r.stopCapture&&r.stopCapture();if(n.paused&&n.play(),n.videoHeight>2&&n.videoWidth>2){const u=n.videoWidth,d=n.videoHeight/u,f=r.width*d;Math.abs(f-r.height)>=2&&(D.debug("adjust low stream resolution","".concat(r.width,"x").concat(r.height," -> ").concat(r.width,"x").concat(f)),r.height=f)}s.drawImage(n,0,0,r.width,r.height),c.requestFrame&&c.requestFrame(),o!==e._mediaStreamTrack&&(o=e._mediaStreamTrLine truncated
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
a=ice-lite
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:audio
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:video
`);this.rtpCapabilities=a,this.candidates=s,this.iceParameters=i,this.dtlsParameters=o,this.setup=c,this.localCapabilities=l,this.cname=d;for(let h=0;h<f.mediaDescriptions.length;h++){const p=f.mediaDescriptions[h];if(p.attributes.iceUfrag=i.iceUfrag,p.attributes.icePwd=i.icePwd,p.attributes.fingerprints=o.fingerprints,p.attributes.candidates=s,p.attributes.setup=c,p.media.mediaType==="video"){p.media.fmts=a.videoCodecs.map((m=>m.payloadType.toString(10)));let g=a.videoCodecs.filter((m=>{var y,v;return(y=m.rtpMap)===null||y===void 0?void 0:lt(v=y.encodingName.toLowerCase()).call(v,u)}));g.length===0&&(g=a.videoCodecs),p.attributes.payloads=g,p.attributes.extmaps=a.videoExtensions}p.media.mediaType==="audio"&&(p.media.fmts=a.audioCodecs.map((g=>g.payloadType.toString(10))),p.attributes.payloads=a.audioCodecs,p.attributes.extmaps=a.audioExtensions),f.mediaDescriptions[h]=this.mungMediaDesc(p)}this.sessionDesc=f,this.currentMidIndex=f.mediaDescriptions.length-1}toString(){return gi.print(this.sessionDesc)}send(r,i,o){const{ssrcs:s,ssrcGroups:a}=_0(i,this.cname),c=this.sessionDesc.mediaDescriptions.find((d=>r===vt.VIDEO?d.media.mediaType==="video":d.media.mediaType==="audio")),l=s[0].attributes.label,u=s[0].attributes.mslabel;return c.attributes.ssrcs=c.attributes.ssrcs.concat(s),c.attributes.ssrcGroups=c.attributes.ssrcGroups.concat(a),{id:l,mslabel:u}}batchSend(r){return r.map((i=>{let{kind:o,ssrcMsg:s}=i;return this.send(o,s,void 0)}))}stopSending(r){this.sessionDesc.mediaDescriptions.forEach((i=>{const o=[],s=[],a=[];i.attributes.ssrcs.forEach((c=>{lt(r).call(r,c.attributes.label||"")?a.push(c):o.push(c)})),i.attributes.ssrcGroups.forEach((c=>{var l;lt(l=a.map((u=>u.ssrcId))).call(l,c.ssrcIds[0])||s.push(c)})),i.attributes.ssrcs=o,i.attributes.ssrcGroups=s}))}mute(r){const i=this.sessionDesc.mediaDescriptions.find((o=>o.attributes.mid===r));if(!i)throw new Error("mediaDescription not found with ".concat(r," in remote SDP when calling RemoteSDP.mute."));i.attributes.direction="inactive"}unmute(r){const i=this.sessionDesc.mediaDescriptions.find((o=>o.attributes.mid===r));if(!i)throw new Error("mediaDescription not found with ".concat(r," in remote SDP when calling RemoteSDP.unmute."));i.attributes.direction="sendonly"}receive(r,i,o){r.forEach(((s,a)=>{const c=s._mediaStreamTrack,l=this.sessionDesc.mediaDescriptions.findIndex((d=>d.attributes.mid===c.kind)),u=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[l],s);this.sessionDesc.mediaDescriptions[l]=u}))}stopReceiving(r){}updateCandidates(r){r===ls.TCP?this.candidates.forEach((i=>{this.candidates.findIndex((o=>o.transport==="tcp"&&o.connectionAddress===i.connectionAddress&&o.port===i.port))===-1&&this.candidates.push(_U(_U({},i),{},{foundation:"tcpcandidate",priority:Number(i.priority)-1+"",transport:"tcp",port:Number(i.port)+90+""}))})):this.candidates=this.candidates.filter((i=>i.transport!=="tcp"));for(const i of this.sessionDesc.mediaDescriptions)i.attributes.candidates=this.candidates}restartICE(r){r=Lr(r),this.iceParameters=r,this.sessionDesc.mediaDescriptions.forEach((i=>{i.attributes.iceUfrag=r.iceUfrag,i.attributes.icePwd=r.icePwd}))}predictReceivingMids(r){const i=[];for(let o=0;o<r;o++)i.push((this.currentMidIndex+o+1).toString(10));return i}mungRecvMediaDsec(r,i){const o=Lr(r);return wp(o,i),CI(o,i),o}updateRecvMedia(r,i){const o=this.sessionDesc.mediaDescriptions.findIndex((s=>s.attributes.mid===r));if(o!==-1){const s=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[o],i);this.sessionDesc.mediaDescriptions[o]=s}}bumpMid(r){this.currentMidIndex+=r}updateTrackLabel(r,i,o){const s=this.sessionDesc.mediaDescriptions.find((c=>r===vt.VIDEO?c.attributes.mid==="video":c.attributes.mid==="audio"));if(s){const c=s.attributes.ssrcs.find((l=>l.attributes.label===i));var a;c&&(c.attributes.label=o,(a=c.attributes.msid)===null||a===void 0||a.replace(i,o))}}mungMediaDesc(r){const i=Lr(r);return AI(i),(function(o){const s=o.attributes.extmaps.find((a=>a.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"));s&&o.attributes.extmaps.splice(o.attributes.extmaps.indexOf(s),1),o.attributes.payloads.forEach((a=>{const c=a.rtcpFeedbacks.findIndex((l=>l.type==="transport-cc"));c!==-1&&a.rtcpFeedbacks.splice(c,1)}))})(i),i}getSSRC(r){for(const i of this.sessionDesc.mediaDescriptions)for(const o of i.attributes.ssrcs)if(o.attributes.label===r)return[o]}}(A5(A5({},t),{},{rtpCapabilities:t.rtpCapabilities.send,localCapabilities:this.localCapabilities,sdkCodec:this.store.codec}));const n=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(this.initialOffer),await this.peerConnection.setRemoteDescription({type:"answer",sdp:n})}catch(n){throw new Be(Q.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(n.toString()))}}async updateRemoteRTPCapabilities(t,n){throw new Be(Q.NOT_SUPPORTED,"Planb mode does not support createDataChannels.")}getPreMedia(t){}send(t,n){var r=this;return cc((function*(Line truncated
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=ice-lite
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`);this._rtpCapabilities=t;const r=this.rtpCapabilities.send,i=this.localCapabilities.send;for(const o of n.mediaDescriptions){if(o.attributes.iceUfrag=this._iceParameters.iceUfrag,o.attributes.icePwd=this._iceParameters.icePwd,o.attributes.fingerprints=this._dtlsParameters.fingerprints,o.attributes.candidates=this._candidates,o.attributes.setup=this.setup,o.media.mediaType==="application"&&(o.attributes.sctpPort="5000"),o.media.mediaType==="video"){if(r.videoCodecs.length===0){const s=i.videoCodecs.filter((a=>{var c,l;return(c=a.rtpMap)===null||c===void 0?void 0:lt(l=c.encodingName.toLowerCase()).call(l,"vp8")}))||[i.videoCodecs[0]];o.media.fmts=s.map((a=>a.payloadType.toString(10))),o.attributes.payloads=s,o.attributes.extmaps=[]}else if(o.media.fmts=r.videoCodecs.map((s=>s.payloadType.toString(10))),o.attributes.payloads=r.videoCodecs,o.attributes.extmaps=r.videoExtensions,he("PRELOAD_MEDIA_COUNT")>0){const{ssrcs:s,ssrcGroups:a}=_0([{ssrcId:xU,rtx:he("USE_SUB_RTX")?40001:void 0}],this.cname);o.attributes.ssrcs=s,o.attributes.ssrcGroups=a}}if(o.media.mediaType==="audio"){if(r.audioCodecs.length===0){const s=i.audioCodecs.filter((a=>{var c,l;return(c=a.rtpMap)===null||c===void 0?void 0:lt(l=c.encodingName.toLowerCase()).call(l,"opus")}))||[i.audioCodecs[0]];o.media.fmts=s.map((a=>a.payloadType.toString(10))),o.attributes.payloads=s,o.attributes.extmaps=[]}else if(o.media.fmts=r.audioCodecs.map((s=>s.payloadType.toString(10))),o.attributes.payloads=r.audioCodecs,o.attributes.extmaps=r.audioExtensions,Tp(o),he("PRELOAD_MEDIA_COUNT")>0){const{ssrcs:s,ssrcGroups:a}=_0([{ssrcId:2e4}],this.cname);o.attributes.ssrcs=s,o.attributes.ssrcGroups=a}}}return this.sessionDesc=n,this.currentMidIndex=n.mediaDescriptions.length-1,this.sessionDesc}updateCandidates(t){const n=this._candidates.filter((r=>r.transport==="udp"));if(t===ls.TCP){if(n.length===0)return;if(he("TCP_CANDIDATE_ONLY")){const r=this._candidates.filter((i=>i.transport==="tcp"));n.forEach((i=>{r.findIndex((o=>o.connectionAddress===i.connectionAddress))===-1&&r.push(Zu(Zu({},i),{},{foundation:"tcpcandidate",priority:Number(i.priority)-1+"",transport:"tcp",port:Number(i.port)+90+""}))})),this._candidates=r}else{const r=[];n.forEach((i=>{r.push(Zu(Zu({},i),{},{foundation:"tcpcandidate",priority:Number(i.priority)-1+"",transport:"tcp",port:Number(i.port)+90+""}))})),this._candidates=[...n,...r]}}else if(t===ls.RELAY){if(n.length!==0)return;{const r=this._candidates.filter((i=>i.transport==="tcp"));r.forEach((i=>{n.push(Zu(Zu({},i),{},{foundation:"udpcandidate",priority:Number(i.priority)+1+"",transport:"udp",port:Number(i.port)-90+""}))})),this._candidates=[...n,...r]}}else n.length===0?(this._candidates.filter((r=>r.transport==="tcp")).forEach((r=>{n.push(Zu(Zu({},r),{},{foundation:"udpcandidate",priority:Number(r.priority)+1+"",transport:"udp",port:Number(r.port)-90+""}))})),this._candidates=n):this._candidates=this._candidates.filter((r=>r.transport!=="tcp"));for(const r of this.sessionDesc.mediaDescriptions)r.attributes.candidates=this.candidates}restartICE(t){t=Lr(t),this._iceParameters=t,this.sessionDesc.mediaDescriptions.forEach((n=>{n.attributes.iceUfrag=t.iceUfrag,n.attributes.icePwd=t.icePwd}))}predictReceivingMids(t){const n=[];for(let r=0;r<t;r++)n.push((this.currentMidIndex+r+1).toString(10));return n}findAvailableMediaIndex(t,n){return this.sessionDesc.mediaDescriptions.findIndex((r=>{const i=r.media.mediaType===t&&r.media.port!=="0"&&(r.attributes.direction==="sendonly"||r.attributes.direction==="sendrecv")&&r.attributes.ssrcs.length===0;if(Er()){if(i){const o=this.firefoxSsrcMidMap.get(n[0].ssrcId);return!(o||r.attributes.mid!=="0"&&r.attributes.mid!=="1")||!(!o||o!==r.attributes.mid)}return!1}return i}))}createOrRecycleDataChannel(){for(const r of this.sessionDesc.mediaDescriptions)if(r.media.mediaType==="application")return{mediaDesc:r,needExchangeSDP:!1};this.currentMidIndex+=1;const t="".concat(this.currentMidIndex),n={media:{mediaType:"application",port:w1,protos:["UDP","DTLS","SCTP"],fmts:["webrtc-datachannel"]},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:[],fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[],rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,mid:"".concat(t),sctpPort:"5000"}};return this.sessionDesc.mediaDescriptions.push(n),{mediaDesc:n,needExchangeSDP:!0}}createOrRecycleRecvMedia(t,n,r,i,o,s){const a=t._mediaStreamTrack.kind,c=this.rtpCapabilities.recv,l=bm(a,c,this.localCapabilities.send,a===vt.VIDEO?i:o),u=a===vt.VIDEO?c.videoExtensions:c.audioExtensions;this.currentMidIndex+=1;const d="".concat(this.currentMidIndex);let f={media:{mediaType:a,port:w1,protos:["UDP","TLS","RTP","SAVPF"],fmts:l.map((p=>p.payloadType.toLine truncated
sendFps `).concat(L,", bwe ").concat(R,", switch from ").concat(I.adaptationConfig.scale," to ").concat(F.scale," ")),I.adaptationConfig=bE(bE({},I.adaptationConfig),F),b(F))}}),he("CHECK_LOCAL_STATS_INTERVAL")),_=bE({},y);D4.set(m,{timer:C,adaptationConfig:_,originConfig:y,adaptationFunc:b}),D.debug("[".concat(m,"] start adaptation, originConfig: ").concat(JSON.stringify(y),", degradationPreference: ").concat(E))})(this.id+a.mid,c,this,g,(m=>{n&&this.updateAdaptation(n,m)}),this.getLocalVideoStats.bind(this))}if(t._encoderConfig){var u;const{bitrateMax:g,frameRate:m,scaleResolutionDownBy:y}=t._encoderConfig;g&&(s.maxBitrate=1e3*g),(lt(u=t._hints).call(u,nr.LOW_STREAM)||t.isUseScaleResolutionDownBy)&&(m&&(s.maxFramerate=hs(m)),y&&y>=1&&(s.scaleResolutionDownBy=y))}const{maxFramerate:d}=he("ENCODER_CONFIG_LIMIT");if(d&&typeof d=="number"&&(s.maxFramerate=s.maxFramerate?Math.min(s.maxFramerate,d):d),he("DSCP_TYPE")&&Bd()){var f;const g=he("DSCP_TYPE");lt(f=["very-low","low","medium","high"]).call(f,g)&&(s.networkPriority=g)}const h=n.getParameters(),p=(i=h.encodings)===null||i===void 0?void 0:i[0];Er()&&!p&&(o.encodings=[s]),p&&Object.assign(p,s),Object.assign(h,o),D.debug("[".concat(t.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(h.encodings))),await n.setParameters(h),await(async function(g,m,y){try{var v;if(!fn().supportSetRtpSenderParameters||!(function(C){return C==="vp9"})(g)||!he("ENABLE_SVC"))return;const E={},b={},S=m.getParameters(),w=(v=S.encodings)===null||v===void 0?void 0:v[0];b.scalabilityMode=oC(y),w&&Object.assign(w,b),Object.assign(S,E),await m.setParameters(S),D.debug("[updateAdaptation] updateRtpSenderEncodings scalabilityMode success: ".concat(JSON.stringify(S.encodings)))}catch(E){D.debug("[updateAdaptation] updateRtpSenderEncodings scalabilityMode failed",E)}})(this.store.codec,n,he("SVC_MODE"))}async updateAdaptation(t,n){var r,i;if(!t)return D.debug("[updateAdaptation] no rtpSender found");if(!fn().supportSetRtpSenderParameters)return D.debug("[updateAdaptation] Browser not support set rtp-sender parameters");const o={},{bitrateMax:s,frameRate:a,scaleResolutionDownBy:c}=n;s&&(o.maxBitrate=1e3*s),a&&(o.maxFramerate=hs(a)),c&&c>=1&&lt(r=["vp8","vp9"]).call(r,this.store.codec)&&(o.scaleResolutionDownBy=c);const l=t.getParameters(),u=(i=l.encodings)===null||i===void 0?void 0:i[0];u&&Object.assign(u,o),Object.assign(l,{});try{await t.setParameters(l),D.debug("[updateAdaptation] updateRtpSenderEncodings: ".concat(JSON.stringify(l.encodings)))}catch(d){!("transport"in t)||t.transport&&t.transport.state==="connected"?this.peerConnectionState!=="connected"?D.debug("[updateAdaptation] peerConnection not connected}"):D.debug("[updateAdaptation] updateRtpSenderEncodings failed",d):D.debug("[updateAdaptation] rtpSender transport not connected}")}}async applySendEncodings(t,n){try{if(!fn().supportSetRtpSenderParameters||t.length!==n.length)return;for(let r=0;r<t.length;r++){const i=t[r],o=n[r];o instanceof Kn&&!this.isVP8Simulcast(o)&&await this.updateRtpSenderEncodings(o,i.sender)}}catch{D.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(t,n,r){const i=gi.parse(t);return n.forEach(((o,s)=>{const a=r[s],c=i.mediaDescriptions.find((l=>l.attributes.mid===a));c&&(wp(c,o),d$(c,o,this.store.codec))})),gi.print(i)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=t=>{var n;(n=this.onFirstAudioReceived)===null||n===void 0||n.call(this,t)},this.statsFilter.onFirstVideoReceived=t=>{var n;(n=this.onFirstVideoReceived)===null||n===void 0||n.call(this,t)},this.statsFilter.onFirstAudioDecoded=t=>{var n;(n=this.onFirstAudioDecoded)===null||n===void 0||n.call(this,t)},this.statsFilter.onFirstVideoDecoded=(t,n,r)=>{var i;(i=this.onFirstVideoDecoded)===null||i===void 0||i.call(this,t,n,r)},this.statsFilter.onSelectedLocalCandidateChanged=(t,n)=>{var r;(r=this.onSelectedLocalCandidateChanged)===null||r===void 0||r.call(this,t,n)},this.statsFilter.onSelectedRemoteCandidateChanged=(t,n)=>{var r;(r=this.onSelectedRemoteCandidateChanged)===null||r===void 0||r.call(this,t,n)},this.statsFilter.onFirstVideoDecodedTimeout=t=>{var n;(n=this.onFirstVideoDecodedTimeout)===null||n===void 0||n.call(this,t)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(t,n){if(t.length===n.length)for(let c=0;c<t.length;c++){var r,i,o,s,a;const l=t[c],u=n[c];if(u instanceof Kn&&!lt(r=u._hints).call(r,nr.LOW_STREAM)&&(i=u._encoderConfig)!==null&&i!==void 0&&i.bitrateMax&&((o=u._encoderConfig)===null||o===void 0?void 0:o.bitrateMax)>200&&(s=u._scalabilityMode)!==null&&s!==void 0&&s.numSpatialLayers&&((a=u._scalabilityMode)===nuLine truncated
`),t),n==="offer"?o=>{this.logSDPExchange(o,"answer",r==="local"?"remote":"local",i)}:void 0}async getRemoteSSRC(t){if(!this.remoteSDP)return;const n=this.remoteSDP.getSSRC(t);return n&&n.length!==0?n[0].ssrcId:void 0}setConfiguration(t){if(fn().supportPCSetConfiguration){const n=V1.resolvePCConfiguration(t);this.peerConnection.setConfiguration(n)}}},ft(tn.prototype,"updateRemoteRTPCapabilities",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"updateRemoteRTPCapabilities"),tn.prototype),ft(tn.prototype,"connect",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"connect"),tn.prototype),ft(tn.prototype,"updateRemoteConnect",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"updateRemoteConnect"),tn.prototype),ft(tn.prototype,"createDataChannels",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"createDataChannels"),tn.prototype),ft(tn.prototype,"receive",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"receive"),tn.prototype),ft(tn.prototype,"batchReceive",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"batchReceive"),tn.prototype),ft(tn.prototype,"stopReceiving",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"stopReceiving"),tn.prototype),ft(tn.prototype,"muteRemote",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"muteRemote"),tn.prototype),ft(tn.prototype,"unmuteRemote",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"unmuteRemote"),tn.prototype),ft(tn.prototype,"muteLocal",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"muteLocal"),tn.prototype),ft(tn.prototype,"unmuteLocal",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"unmuteLocal"),tn.prototype),ft(tn.prototype,"close",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"close"),tn.prototype),ft(tn.prototype,"updateEncoderConfig",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"updateEncoderConfig"),tn.prototype),ft(tn.prototype,"updateSendParameters",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"updateSendParameters"),tn.prototype),ft(tn.prototype,"replaceTrack",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"replaceTrack"),tn.prototype),ft(tn.prototype,"updateAdaptation",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"updateAdaptation"),tn.prototype),ft(tn.prototype,"getRemoteSSRC",[wo],Object.getOwnPropertyDescriptor(tn.prototype,"getRemoteSSRC"),tn.prototype),tn);function wo(e,t,n){const r=e[t];if(typeof r!="function")throw new Error("Cannot use mutex on object property.");return n.value=async function(){const i=this.mutex,o=await i.lock("From P2PConnection.".concat(t));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return await r.apply(this,a)}finally{o()}},n}var Xt;function BU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BU(Object(n),!0).forEach((function(r){H(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BU(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function FU(e){var t,n,r,i=2;for(typeof Symbol<"u"&&(n=aFe,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new O3(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function O3(e){function t(n){if(Object(n)!==n)return ot.reject(new TypeError(n+" is not an object."));var r=n.done;return ot.resolve(n.value).then((function(i){return{value:i,done:r}}))}return O3=function(n){this.s=n,this.n=n.next},O3.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?ot.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?ot.reject(n):t(r.apply(this.s,arguments))}},new O3(e)}let w5=(Xt=class extends fr{get state(){return this._state}set state(e){const t=this._state;this._state=e,this.emit(Ot.StateChange,t,this._state)}constructor(e,t){super(),H(this,"isPlanB",void 0),H(this,"store",void 0),H(this,"statsUploader",void 0),H(this,"connection",void 0),H(this,"localTrackMap",new Map),H(this,"remoteUserMap",new Map),H(this,"localDataChannels",[]),H(this,"remoteDataChannelMap",new Map),H(this,"pendingLocalTracks",[]),H(this,"pendingRemoteTracks",[]),H(this,"pendingLocalDataChannels",[]),H(this,"pendingRemoteDataChannels",[]),H(this,"statsCollector",void 0),H(this,"shouldForwardP2PCreation",void 0),H(this,"iceFailedCount",0),H(this,"dtlsFailedCount",0),H(this,"mutex",new Hi("P2PChannel-mutex")),H(this,"_state",bn.Disconnected),H(this,"_pcStatsUploadType",he("NEW_ICE_RESTART")?Dl.FIRST_CONNECTION:Dl.OLD_FIRST_CONNECTION),H(this,"_isInRestartIce",!1),H(this,"_isStartRestartIce",!1),H(this,"_restartStates",["disconnected","failed"]),H(this,"_restartTimLine truncated
STM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+
HvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy
xQiYDz3vqa6bP29adwIDAQAB`),w=new Uint8Array(new ArrayBuffer(S.length));for(let C=0;C<S.length;C+=1)w[C]=S.charCodeAt(C);return w})(),y=await window.crypto.subtle.importKey("spki",m,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),v=cI(g),E=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},y,v);return(function(b){let S="";for(let w=0;w<b.length;w+=1)S+=String.fromCharCode(b[w]);return window.btoa(S)})(new Uint8Array(E))})(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new xe(Q.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(d.aessalt=this._encryptionSalt)}if(this._encryptDataStream&&(this._encryptionMode==="aes-128-gcm2"||this._encryptionMode==="aes-256-gcm2"))if(this._encryptionSalt&&this._encryptionSecret)if(window.crypto.subtle){const g=new TextEncoder,m=he("USE_PURE_ENCRYPTION_MASTER_KEY")?g.encode(d.appId+this._encryptionSecret+this._encryptionSecret):g.encode(d.appId+d.cname+this._encryptionSecret);this._encryptDataStreamIv=await(async function(y,v,E){const b=await window.crypto.subtle.importKey("raw",v,"PBKDF2",!1,["deriveBits","deriveKey"]),S=y==="aes-128-gcm2"?128:256,w=await window.crypto.subtle.deriveBits({name:"PBKDF2",iterations:gM,hash:"SHA-256",salt:E},b,S+nNe);return new Uint8Array(w).subarray(S/8)})(this._encryptionMode,m,H0(this._encryptionSalt)),this._encryptDataStreamKey=await(async function(y,v,E){const b=await window.crypto.subtle.importKey("raw",v,"PBKDF2",!1,["deriveBits","deriveKey"]),S=y==="aes-128-gcm2"?128:256;return await window.crypto.subtle.deriveKey({name:"PBKDF2",iterations:gM,hash:"SHA-256",salt:E},b,{name:"AES-GCM",length:S},!0,["encrypt","decrypt"])})(this._encryptionMode,m,H0(this._encryptionSalt))}else a?D.warning("[".concat(this._clientId,"] encrypt datastream must be running in a secure context, fallback to plain data stream")):D.warning("[".concat(this._clientId,"] current browser do not support WebCrypto ,fallback to plain data stream")),this._encryptDataStream=!1;else this._encryptDataStream=!1,D.debug("[".concat(this._clientId,"] no salt / secret, cannot support encrypt data stream, fallback to plain data stream"));this._startSession(this._sessionId,{channel:t,appId:e,stringUid:d.stringUid});const f=this._sessionId;setTimeout((()=>{this.connectionState==="CONNECTING"&&f===this._sessionId&&mt.joinChannelTimeout(this._sessionId,5)}),5e3);try{var h;let g;const m=d.cloudProxyServer;if(lt(h=["proxy3","proxy4","proxy5"]).call(h,m)){const S=he("PROXY_SERVER_TYPE3");Array.isArray(S)?d.proxyServer=S[0]:d.proxyServer=S}if(mt.setProxyServer(d.proxyServer),D.setProxyServer(d.proxyServer),this.store.requestAPStart(),c){if(D.debug("[".concat(this._clientId,"] get serverInfo Success from Preload Cache ").concat(d.stringUid?", ".concat(d.stringUid," => ").concat(c.intUid):""," ")),d.stringUid&&!d.uid&&(d.uid=c.intUid),g={gatewayInfo:c.ap.gatewayInfo},he("JOIN_WITH_FALLBACK_MEDIA_PROXY")&&d.turnServer.mode==="auto")if(c.ap.proxyInfo.addresses.length===0)D.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers");else{const S=(await Oq(c.ap.proxyInfo,c.ap.gatewayInfo.uid)).map((w=>({turnServerURL:w.address,tcpport:w.tcpport||Ti.tcpport,udpport:w.udpport||Ti.udpport,username:w.username||Ti.username,password:w.password||Ti.password,forceturn:!1,security:!0})));d.turnServer={mode:"manual",servers:S}}GU(c,d.stringUid)}else{if(d.stringUid&&!d.uid){let S;[S,g]=await ot.all([y$(d.stringUid,d,this._axiosCancelSource.token,this._config.httpRetryConfig||jr,this.store),ZF(d,this._axiosCancelSource.token,this._config.httpRetryConfig||jr,!0,this.store)]),D.debug("[".concat(this._clientId,"] getUserAccount Success ").concat(d.stringUid," => ").concat(S)),d.uid=S,g.gatewayInfo.uid=S,g.gatewayInfo.res.uid=S}else g=await ZF(d,this._axiosCancelSource.token,this._config.httpRetryConfig||jr,!0,this.store);if(!this._joinAndNotLeaveYet)throw new xe(Q.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"))}this.store.requestAPEnd(),setTimeout((()=>{this._configDistribute.startGetConfigDistribute(d,this._axiosCancelSource.token),this._configDistribute.on(QA.UPDATE_BITRATE_LIMIT,(S=>{this._p2pChannel.updateBitrateLimit(S)}))}),0),this._key=n||e;const y=g.gatewayInfo,v=d.uid?d.uid:y.uid;this._joinInfo=$a($a({},d),{},{cid:y.cid,uid:v,vid:y.vid,apResponse:y.res,apGatewayAddress:y.apGatewayAddress,uni_lbs_ip:y.uni_lbs_ip,gatewayAddrs:y.gatewayAddrs}),this.store.intUid=v;const E=await this._joinGateway();if(!this._joinAndNotLeaveYet)throw new xe(Q.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));u.onSuccess(E),this._appId=e,this._channelName=d.cname,this._uid=E,this.store.uid=E,setTimeout((()=>{this._networkQualityInterval&&window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=window.setInterval(this._handleUpdateNetworkQuality,2e3),window.addEventListener(Ri()?"beforeunload":"pagehide",this._handleBeforeUnload),this._statsCollector.startUpdateStats()}),0);coLine truncated
The secret must contain at least 1 lowercase alphabetical character,
The secret must contain at least 1 uppercase alphabetical character,
The secret must contain at least 1 numeric character,
The secret must contain at least one special character,
The secret must be eight characters or longer.
`),this._encryptionMode=e,this._encryptionSecret=t,n&&(this._encryptionSalt=_d(n))}async renewToken(e){if(pi(e,"token",1,2047),!this._key||!this._joinInfo)throw new xe(Q.INVALID_OPERATION,"renewToken should not be called before user join");const t=this._key;this._key=e,this._joinInfo&&(this._joinInfo.token=e);const n=await this._renewTokenMutex.lock();try{if(he("USE_NEW_TOKEN")){D.debug("[".concat(this._clientId,"] start renew token with ticket from unilbs"));const r=await jBe(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||jr);D.debug("[".concat(this._clientId,"] get ticket from unilbs success")),await this._gateway.renewToken({token:e,ticket:r})}else D.debug("[".concat(this._clientId,"] start renew token without ticket")),await this._gateway.renewToken({token:e});D.debug("[".concat(this._clientId,"] renewToken success"))}catch(r){throw this._key=t,this._joinInfo.token=t,D.error("[".concat(this._clientId,"] renewToken failed"),r.toString()),r}finally{n()}}enableAudioVolumeIndicator(){this._audioVolumeIndicationInterval?D.warning("you have already enabled audio volume indicator!"):this._audioVolumeIndicationInterval=window.setInterval((()=>{const e=this._p2pChannel.getAudioLevels();this.safeEmit($t.VOLUME_INDICATOR,e)}),he("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3)}getRTCStats(){const e=this._statsCollector.getRTCStats(),t=this._gateway.getInChannelInfo();return e.Duration=Math.round(t.duration/1e3),e}async startLiveStreaming(e,t){if(!t){if(this.codec!=="h264")throw new xe(Q.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");if(!this._p2pChannel.hasLocalMedia())throw new xe(Q.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming")}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(e)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(e))throw new xe(Q.LIVE_STREAMING_TASK_CONFLICT);const n=t?au.TRANSCODE:au.RAW;return this._createLiveStreamingClient(n).startLiveStreamingTask(e,n)}setLiveTranscoding(e){return this._createLiveStreamingClient(au.TRANSCODE).setTranscodingConfig(e)}async stopLiveStreaming(e){const t=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter((n=>n&&n.hasUrl(e)));if(!t.length)throw new xe(Q.INVALID_PARAMS,"can not find live streaming url to stop");await ot.all(t.map((n=>n&&n.stopLiveStreamingTask(e))))}async startChannelMediaRelay(e){IU(e),await this._createChannelMediaRelayClient().startChannelMediaRelay(e)}async updateChannelMediaRelay(e){IU(e),await this._createChannelMediaRelayClient().updateChannelMediaRelay(e)}async stopChannelMediaRelay(){await this._createChannelMediaRelayClient().stopChannelMediaRelay(),this._statsCollector.onStatsChanged&&(this._statsCollector.onStatsChanged=void 0)}async sendStreamMessage(e){var t;let n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!this._joinInfo)throw new xe(Q.INVALID_OPERATION,"can not send data stream, not joined");if((typeof e=="string"||e instanceof Uint8Array)&&(e={payload:e}),typeof e.payload=="string"){const i=new TextEncoder;e.payload=i.encode(e.payload)}let r=!1;if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&lt(t=["aes-128-gcm2","aes-256-gcm2"]).call(t,this._encryptionMode)&&(r=!0,e.payload=await(async function(i,o,s){var a;const c=vc(a=Array.from(s)).call(a,((g,m)=>g+m),0),l={serverTs:0,seq:rNe++,length:s.length,checkSum:c},u=new Uint8Array(hM(c,2)),d=new ArrayBuffer(Yf),f=new DataView(d);f.setUint32(0,l.serverTs),f.setUint16(4,l.seq),f.setUint16(6,l.length),f.setUint16(8,l.checkSum);const h=16-s.length%16;s=lM(s,new Uint8Array(h));const p=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i,tagLength:mM,additionalData:u},o,s);return lM(new Uint8Array(d),new Uint8Array(p))})(this._encryptDataStreamIv,this._encryptDataStreamKey,e.payload)),new Blob([e.payload]).size>1024)throw new xe(Q.INVALID_PARAMS,r?"encrypted stream message out of range.":"stream message out of range.");return this._gateway.signal.request(Dt.DATA_STREAM,{payload:_d(e.payload),syncWithAudio:e.syncWithAudio,sendTs:Date.now()-dFe},!n)}sendMetadata(e){if(!this._joinInfo)throw new xe(Q.INVALID_OPERATION,"can not send metadata, not joined");if(new Blob([e]).size>1024)throw new xe(Q.METADATA_OUT_OF_RANGE);return this._gateway.signal.request(Dt.SEND_METADATA,{session_id:this._joinInfo.sid,metadata:_d(e)})}async sendCustomReportMessage(e){if(Array.isArray(e)||(e=[e]),e.forEach(oNe),!this._joinInfo)throw new xe(Q.INVALID_OPERATION,"can not send custom report, not joined");await mt.sendCustomReportMessage(this._joinInfo.sid,e)}getLocalAudioStats(){return this._statsCollector.getLocalAudioTrackStats()}getRemoteAudioStats(){return this._statsCollector.getRemoteAudioTrackStats()}getLocalVideoStats(){return this._statsCollector.getLocalVideoTrackStats()}getRemoteVideoStats(){return this._statsCollector.getRemoteVideoTrackStats()}getRemoteNetworkQuality(){return thisLine truncated
+2
View File
@@ -390,6 +390,8 @@ set(SLIC3R_GUI_SOURCES
GUI/Printer/PrinterFileSystem.cpp
GUI/Printer/PrinterFileSystem.h
GUI/PrinterWebView.cpp
GUI/PrinterWebViewHandler.cpp
GUI/PrinterWebViewHandler.hpp
GUI/PrinterWebView.hpp
GUI/PrintHostDialogs.cpp
GUI/PrintHostDialogs.hpp
+2 -4
View File
@@ -46,6 +46,7 @@
#include "Widgets/ProgressDialog.hpp"
#include "BindDialog.hpp"
#include "../Utils/MacDarkMode.hpp"
#include "../Utils/PrintHost.hpp"
#include <fstream>
#include <string_view>
@@ -4162,15 +4163,12 @@ void MainFrame::load_printer_url()
return;
auto cfg = preset_bundle.printers.get_edited_preset().config;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
wxString url = from_u8(PrintHost::get_print_host_webui(&cfg));
wxString apikey;
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
if (cfg.has("printhost_apikey") && (host_type == htPrusaLink || host_type == htPrusaConnect))
apikey = cfg.opt_string("printhost_apikey");
if (!url.empty()) {
if (!url.Lower().starts_with("http"))
url = wxString::Format("http://%s", url);
load_printer_url(url, apikey);
}
}
+2 -3
View File
@@ -81,6 +81,7 @@
#include "GUI_Utils.hpp"
#include "GUI_Factories.hpp"
#include "wxExtensions.hpp"
#include "../Utils/PrintHost.hpp"
#include "MainFrame.hpp"
#include "format.hpp"
#include "3DScene.hpp"
@@ -2483,13 +2484,11 @@ void Sidebar::update_all_preset_comboboxes()
p->m_bpButton_ams_filament->Hide();
auto print_btn_type = MainFrame::PrintSelectType::eExportGcode;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
wxString url = from_u8(PrintHost::get_print_host_webui(&cfg));
wxString apikey;
if(url.empty())
url = wxString::Format("file://%s/web/orca/missing_connection.html", from_u8(resources_dir()));
else {
if (!url.Lower().starts_with("http"))
url = wxString::Format("http://%s", url);
const auto host_type = cfg.option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
if (cfg.has("printhost_apikey") && (host_type != htSimplyPrint))
apikey = cfg.opt_string("printhost_apikey");
+1 -1
View File
@@ -643,7 +643,7 @@ void ElegooPrintHostSendDialog::init() {
auto preset_bundle = wxGetApp().preset_bundle;
auto model_id = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
if (!boost::starts_with(model_id, "Elegoo-C")) {
if (model_id != "Elegoo-CC" && model_id != "Elegoo-C") {
PrintHostSendDialog::init();
return;
}
+40 -8
View File
@@ -1,16 +1,17 @@
#include "PrinterWebView.hpp"
#include "I18N.hpp"
#include "PrinterWebViewHandler.hpp"
#include "slic3r/GUI/PrinterWebView.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/MainFrame.hpp"
#include "libslic3r_version.h"
#include <boost/filesystem/path.hpp>
#include <wx/sizer.h>
#include <wx/string.h>
#include <wx/toolbar.h>
#include <wx/textdlg.h>
#include <slic3r/GUI/Widgets/WebView.hpp>
#include <wx/webview.h>
@@ -19,13 +20,17 @@
#include <webkit2/webkit2.h>
#endif
namespace pt = boost::property_tree;
namespace Slic3r {
namespace GUI {
PrinterWebView::PrinterWebView(wxWindow *parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
, m_browser(nullptr)
, m_zoomFactor(100)
, m_apikey()
, m_apikey_sent(false)
, m_url_deferred()
, m_handler(std::make_unique<PrinterWebViewHandler>(*this))
{
wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
@@ -47,6 +52,8 @@ PrinterWebView::PrinterWebView(wxWindow *parent)
m_browser->Bind(wxEVT_WEBVIEW_ERROR, &PrinterWebView::OnError, this);
m_browser->Bind(wxEVT_WEBVIEW_LOADED, &PrinterWebView::OnLoaded, this);
m_browser->Bind(wxEVT_WEBVIEW_NEWWINDOW, &PrinterWebView::OnNewWindow, this);
m_browser->Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, &PrinterWebView::OnScriptMessage, this);
SetSizer(topsizer);
@@ -64,9 +71,6 @@ PrinterWebView::PrinterWebView(wxWindow *parent)
}
*/
//Zoom
m_zoomFactor = 100;
//Connect the idle events
Bind(wxEVT_CLOSE_WINDOW, &PrinterWebView::OnClose, this);
@@ -76,11 +80,18 @@ PrinterWebView::~PrinterWebView()
{
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Start";
SetEvtHandlerEnabled(false);
m_handler.reset();
// Destroy the webview
if(m_browser){
m_browser->Destroy();
m_browser = nullptr;
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " End";
}
void PrinterWebView::load_url(wxString& url, wxString apikey)
{
// this->Show();
@@ -89,6 +100,7 @@ void PrinterWebView::load_url(wxString& url, wxString apikey)
return;
m_apikey = apikey;
m_apikey_sent = false;
m_handler = create_printer_webview_handler(*this);
if (this->IsShown()) {
//ORCA: m_url_deferred will be cleared on load success
@@ -190,14 +202,34 @@ void PrinterWebView::OnError(wxWebViewEvent &evt)
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": error loading page %1% %2% %3% %4%") %evt.GetURL() %evt.GetTarget() %e %evt.GetString();
}
void PrinterWebView::OnLoaded(wxWebViewEvent &evt)
void PrinterWebView::OnLoaded(wxWebViewEvent& evt)
{
if (evt.GetURL().IsEmpty())
return;
//ORCA: url loaded successfully, safe to clear
m_url_deferred.clear();
SendAPIKey();
if (m_handler != nullptr) {
m_handler->on_loaded(evt);
return;
}
}
void PrinterWebView::OnNewWindow(wxWebViewEvent& evt)
{
const wxString url = evt.GetURL();
if (!url.empty())
wxLaunchDefaultBrowser(url);
evt.Veto();
}
void PrinterWebView::OnScriptMessage(wxWebViewEvent& evt)
{
if (m_handler != nullptr)
m_handler->on_script_message(evt);
}
} // GUI
} // Slic3r
+8 -1
View File
@@ -25,11 +25,14 @@
#include <wx/tbarbase.h>
#include "wx/textctrl.h"
#include <wx/timer.h>
#include <memory>
namespace Slic3r {
namespace GUI {
class PrinterWebViewHandler;
class PrinterWebView : public wxPanel {
public:
@@ -41,20 +44,24 @@ public:
void OnClose(wxCloseEvent& evt);
void OnError(wxWebViewEvent& evt);
void OnLoaded(wxWebViewEvent& evt);
void OnNewWindow(wxWebViewEvent& evt);
void OnScriptMessage(wxWebViewEvent& evt);
void reload();
void update_mode();
bool Show(bool show = true) override;
private:
friend class PrinterWebViewHandler;
void SendAPIKey();
wxWebView* m_browser;
long m_zoomFactor;
wxString m_apikey;
bool m_apikey_sent;
wxString m_url_deferred;
std::unique_ptr<PrinterWebViewHandler> m_handler;
// DECLARE_EVENT_TABLE()
};
+339
View File
@@ -0,0 +1,339 @@
#include "PrinterWebViewHandler.hpp"
#include "I18N.hpp"
#include "PrinterWebView.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/Widgets/WebView.hpp"
#include "slic3r/Utils/PrintHost.hpp"
#include "libslic3r/Preset.hpp"
#include <nlohmann/json.hpp>
#include <atomic>
#include <boost/filesystem/path.hpp>
#include <thread>
#include <wx/filedlg.h>
#include <wx/string.h>
using json = nlohmann::json;
namespace Slic3r {
namespace GUI {
PrinterWebViewHandler::PrinterWebViewHandler(PrinterWebView& owner)
: m_owner(owner)
{
}
PrinterWebViewHandler::~PrinterWebViewHandler() = default;
void PrinterWebViewHandler::on_loaded(wxWebViewEvent &evt)
{
}
void PrinterWebViewHandler::on_script_message(wxWebViewEvent &evt)
{
}
PrinterWebView& PrinterWebViewHandler::owner() const
{
return m_owner;
}
wxWebView* PrinterWebViewHandler::browser() const
{
return m_owner.m_browser;
}
namespace {
DynamicPrintConfig* get_active_printer_config()
{
if (wxGetApp().preset_bundle == nullptr)
return nullptr;
return &wxGetApp().preset_bundle->printers.get_edited_preset().config;
}
std::string json_string(const json& node, const char* key)
{
auto it = node.find(key);
return (it != node.end() && it->is_string()) ? it->get<std::string>() : std::string();
}
std::string dump_json(const json& node)
{
return node.dump(-1, ' ', false, json::error_handler_t::replace);
}
boost::filesystem::path path_from_utf8(const std::string& utf8_path)
{
#ifdef _WIN32
const wxString wide_path = wxString::FromUTF8(utf8_path.c_str());
return boost::filesystem::path(wide_path.ToStdWstring());
#else
return boost::filesystem::path(utf8_path);
#endif
}
std::string filename_to_utf8(const boost::filesystem::path& path)
{
#ifdef _WIN32
const wxString wx_filename(path.filename().c_str());
const wxScopedCharBuffer utf8 = wx_filename.ToUTF8();
return utf8.data() != nullptr ? std::string(utf8.data()) : std::string();
#else
return path.filename().string();
#endif
}
class ElegooPrinterWebViewHandler final : public PrinterWebViewHandler {
public:
explicit ElegooPrinterWebViewHandler(PrinterWebView& owner)
: PrinterWebViewHandler(owner)
{
}
~ElegooPrinterWebViewHandler() override
{
stop_upload = true;
if (upload_thread.joinable())
upload_thread.join();
if (sn_thread.joinable())
sn_thread.join();
}
void on_script_message(wxWebViewEvent &evt) override
{
const wxString message = evt.GetString();
if (message.empty())
return;
json root = json::parse(message.ToUTF8().data(), nullptr, false);
if (root.is_discarded() || !root.is_object())
return;
std::string request_id = json_string(root, "id");
std::string method = json_string(root, "method");
json params = root.contains("params") && root["params"].is_object() ? root["params"] : json::object();
if (method.empty()) {
method = json_string(root, "command");
if (params.empty() && root.contains("data") && root["data"].is_object())
params = root["data"];
}
if (method == "open" || method == "common_openurl") {
const std::string url = json_string(params, "url").empty() ? json_string(root, "url") : json_string(params, "url");
if (!url.empty())
wxLaunchDefaultBrowser(url);
if (!request_id.empty())
send_ipc_message("response", request_id, method, 0, "success");
return;
}
if (method == "upload_file") {
handle_upload_request(request_id, method, dump_json(params));
return;
}
if (method == "open_file_dialog") {
handle_open_file_dialog_request(request_id, method, dump_json(params));
return;
}
if (method == "get_sn") {
handle_get_sn_request(request_id, method);
return;
}
}
private:
void send_ipc_message(const char* type, const std::string& request_id, const std::string& method, int code,
const std::string& message, const std::string& data_json = "{}")
{
if (browser() == nullptr)
return;
json body = json::object();
body["type"] = type;
if (!request_id.empty())
body["id"] = request_id;
if (!method.empty())
body["method"] = method;
json data = json::parse(data_json, nullptr, false);
if (data.is_discarded())
data = json::object();
body["data"] = std::move(data);
if (std::string(type) == "response") {
body["code"] = code;
body["message"] = message;
}
const wxString payload = wxString::FromUTF8(dump_json(body));
const wxString script = "if (typeof HandleStudio === 'function') { HandleStudio(" + payload + "); } else { window.postMessage(" + payload + ", '*'); }";
wxGetApp().CallAfter([this, script]() {
if (browser() != nullptr)
WebView::RunScript(browser(), script);
});
}
void handle_upload_request(const std::string& request_id, const std::string& method, const std::string& params_json)
{
if (upload_in_progress.exchange(true)) {
send_ipc_message("response", request_id, method, 1, "Upload already in progress");
return;
}
if (upload_thread.joinable())
upload_thread.join();
json params = json::parse(params_json, nullptr, false);
if (params.is_discarded())
params = json::object();
std::string file_path = json_string(params, "filePath");
std::string file_name = json_string(params, "fileName");
if (file_path.empty()) {
upload_in_progress = false;
send_ipc_message("response", request_id, method, 1, "Missing filePath");
return;
}
// HTML IPC passes UTF-8 strings; decode explicitly to avoid Windows codepage issues.
boost::filesystem::path source_path = path_from_utf8(file_path);
if (file_name.empty())
file_name = filename_to_utf8(source_path);
DynamicPrintConfig* config = get_active_printer_config();
std::unique_ptr<PrintHost> print_host(config == nullptr ? nullptr : PrintHost::get_print_host(config));
if (print_host == nullptr) {
upload_in_progress = false;
send_ipc_message("response", request_id, method, 1, "Could not get a valid Printer Host reference");
return;
}
stop_upload = false;
upload_thread = std::thread([this, request_id, method, file_path, file_name, source_path, print_host = std::move(print_host)]() mutable {
std::string error_message;
PrintHostUpload upload_data;
upload_data.use_3mf = false;
upload_data.post_action = PrintHostPostUploadAction::None;
upload_data.source_path = source_path;
upload_data.upload_path = path_from_utf8(file_name);
const bool success = print_host->upload(
std::move(upload_data),
[this, request_id](Http::Progress progress, bool& cancel) {
cancel = stop_upload.load();
json data = {
{"uploadedBytes", static_cast<uint64_t>(progress.ulnow)},
{"totalBytes", static_cast<uint64_t>(progress.ultotal)}
};
send_ipc_message("event", request_id, "upload_progress", 0, "", dump_json(data));
},
[&error_message](wxString error) {
error_message = error.ToUTF8().data();
},
[this, request_id](wxString tag, wxString status) {
json data = {
{"tag", tag.ToUTF8().data()},
{"status", status.ToUTF8().data()}
};
send_ipc_message("event", request_id, "upload_info", 0, "", dump_json(data));
});
upload_in_progress = false;
if (success) {
json data = {
{"success", true},
{"filePath", file_path},
{"fileName", file_name}
};
send_ipc_message("response", request_id, method, 0, "success", dump_json(data));
} else {
if (error_message.empty())
error_message = "Upload failed";
send_ipc_message("response", request_id, method, 1, error_message);
}
});
}
void handle_open_file_dialog_request(const std::string& request_id, const std::string& method, const std::string& params_json)
{
json params = json::parse(params_json, nullptr, false);
if (params.is_discarded())
params = json::object();
const std::string filter = json_string(params, "filter").empty() ? "All files (*.*)|*.*" : json_string(params, "filter");
wxWindow* parent = owner().GetParent();
if (parent == nullptr)
parent = wxGetApp().GetTopWindow();
wxFileDialog open_file_dialog(parent, _L("Open File"), "", "", wxString::FromUTF8(filter), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
json data = json::object();
data["files"] = json::array();
if (open_file_dialog.ShowModal() != wxID_CANCEL)
data["files"].push_back(open_file_dialog.GetPath().ToUTF8().data());
send_ipc_message("response", request_id, method, 0, "success", dump_json(data));
}
void handle_get_sn_request(const std::string& request_id, const std::string& method)
{
if (sn_request_in_progress.exchange(true)) {
send_ipc_message("response", request_id, method, 1, "SN request already in progress");
return;
}
if (sn_thread.joinable())
sn_thread.join();
sn_thread = std::thread([this, request_id, method]() {
std::string sn;
DynamicPrintConfig* config = get_active_printer_config();
std::unique_ptr<PrintHost> print_host(config == nullptr ? nullptr : PrintHost::get_print_host(config));
if (print_host != nullptr)
sn = print_host->get_sn();
sn_request_in_progress = false;
json data = {
{"sn", sn}
};
send_ipc_message("response", request_id, method, 0, "success", dump_json(data));
});
}
std::atomic<bool> upload_in_progress { false };
std::atomic<bool> sn_request_in_progress { false };
std::atomic<bool> stop_upload { false };
std::thread upload_thread;
std::thread sn_thread;
};
} // namespace
std::unique_ptr<PrinterWebViewHandler> create_printer_webview_handler(PrinterWebView& owner)
{
auto cfg = get_active_printer_config();
if(cfg == nullptr) return nullptr;
const auto host_type = cfg->option<ConfigOptionEnum<PrintHostType>>("host_type")->value;
switch (host_type)
{
case PrintHostType::htElegooLink:
return std::make_unique<ElegooPrinterWebViewHandler>(owner);
default:
return nullptr;
}
}
} // GUI
} // Slic3r
+36
View File
@@ -0,0 +1,36 @@
#ifndef slic3r_PrinterWebViewHandler_hpp_
#define slic3r_PrinterWebViewHandler_hpp_
#include <memory>
#include <wx/webview.h>
#include <wx/string.h>
class wxWebView;
namespace Slic3r {
namespace GUI {
class PrinterWebView;
class PrinterWebViewHandler {
public:
explicit PrinterWebViewHandler(PrinterWebView& owner);
virtual ~PrinterWebViewHandler();
virtual void on_loaded(wxWebViewEvent &evt);
virtual void on_script_message(wxWebViewEvent &evt);
protected:
PrinterWebView& owner() const;
wxWebView* browser() const;
private:
PrinterWebView& m_owner;
};
std::unique_ptr<PrinterWebViewHandler> create_printer_webview_handler(PrinterWebView& owner);
} // GUI
} // Slic3r
#endif /* slic3r_PrinterWebViewHandler_hpp_ */
+465 -37
View File
@@ -11,6 +11,7 @@
#include <boost/asio.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
@@ -58,6 +59,69 @@ namespace Slic3r {
namespace {
constexpr const char* ELEGOO_CC2_DEFAULT_TOKEN = "123456";
enum class ElegooPrinterType {
Other,
CC,
CC2,
};
ElegooPrinterType classify_printer_model(const std::string& printer_model)
{
if (!boost::algorithm::starts_with(printer_model, "Elegoo Centauri"))
return ElegooPrinterType::Other;
const auto last_char = printer_model.find_last_not_of(" \t\r\n");
if (last_char != std::string::npos && printer_model[last_char] == '2')
return ElegooPrinterType::CC2;
return ElegooPrinterType::CC;
}
std::string get_cc2_token(const std::string& apikey)
{
return apikey.empty() ? ELEGOO_CC2_DEFAULT_TOKEN : apikey;
}
bool parse_cc2_response(const std::string& body, std::string& error_message, std::string* serial_number = nullptr)
{
try {
pt::ptree root;
std::istringstream is(body);
pt::read_json(is, root);
const int error_code = root.get<int>("error_code", -1);
if (error_code != 0) {
error_message = root.get<std::string>("message", "Printer returned an error");
if (error_message.empty())
error_message = "Printer returned an error";
error_message += " (" + std::to_string(error_code) + ")";
return false;
}
if (serial_number != nullptr) {
const auto system_info = root.get_child_optional("system_info");
if (!system_info) {
error_message = "Missing system_info in response";
return false;
}
const auto sn = system_info->get_optional<std::string>("sn");
if (!sn || sn->empty()) {
error_message = "Missing printer serial number in response";
return false;
}
*serial_number = *sn;
}
return true;
} catch (const std::exception&) {
error_message = "Error parsing response";
return false;
}
}
std::string get_host_from_url(const std::string& url_in)
{
std::string url = url_in;
@@ -220,15 +284,126 @@ namespace Slic3r {
return ret_val;
}
std::string path_to_utf8(const boost::filesystem::path& path)
{
#ifdef WIN32
return boost::nowide::narrow(path.wstring());
#else
return path.string();
#endif
}
std::string filename_to_utf8(const boost::filesystem::path& path)
{
#ifdef WIN32
return boost::nowide::narrow(path.filename().wstring());
#else
return path.filename().string();
#endif
}
} //namespace
ElegooLink::ElegooLink(DynamicPrintConfig *config):
OctoPrint(config) {
OctoPrint(config), m_printerModel(config->opt_string("printer_model")) {
}
std::string ElegooLink::get_print_host_webui(DynamicPrintConfig* config)
{
if (config == nullptr)
return {};
std::string fallback_webui = config->opt_string("print_host_webui");
if (fallback_webui.empty())
fallback_webui = config->opt_string("print_host");
if (!fallback_webui.empty()) {
const bool has_http_scheme = boost::algorithm::istarts_with(fallback_webui, "http");
const bool has_file_scheme = boost::algorithm::istarts_with(fallback_webui, "file:");
if (!has_http_scheme && !has_file_scheme)
fallback_webui = "http://" + fallback_webui;
}
const std::string host = config->opt_string("print_host");
if (host.empty())
return fallback_webui;
if (classify_printer_model(config->opt_string("printer_model")) != ElegooPrinterType::CC2)
return fallback_webui;
std::string web_path = resources_dir() + "/plugins/elegoolink/web/lan_service_web/index.html";
std::replace(web_path.begin(), web_path.end(), '\\', '/');
web_path = "file://" + web_path;
web_path += "?access_code=" + get_cc2_token(config->opt_string("printhost_apikey"));
web_path += "&ip=" + get_host_from_url(host) + "&id=elegoo_123456";
const std::string lang = GUI::wxGetApp().current_language_code_safe().utf8_string();
if (!lang.empty())
web_path += "&lang=" + lang;
if (GUI::get_app_config()->get_bool("developer_mode"))
web_path += "&dev=true";
return web_path;
}
std::string ElegooLink::cc2_token() const
{
return get_cc2_token(m_apikey);
}
std::string ElegooLink::make_cc2_info_url() const
{
return make_url("system/info?X-Token=" + escape_string(cc2_token()));
}
std::string ElegooLink::make_cc2_upload_url() const
{
return make_url("upload");
}
const char* ElegooLink::get_name() const { return "ElegooLink"; }
PrintHostPostUploadActions ElegooLink::get_post_upload_actions() const
{
if (classify_printer_model(m_printerModel) == ElegooPrinterType::CC2) {
return PrintHostPostUploadAction::None;
} else {
return PrintHostPostUploadAction::StartPrint;
}
}
std::string ElegooLink::get_sn() const
{
if (classify_printer_model(m_printerModel) != ElegooPrinterType::CC2)
return "";
const char* name = get_name();
std::string sn;
const auto token = cc2_token();
auto http = Http::get(make_cc2_info_url());
http.timeout_connect(10)
.timeout_max(15);
http.header("X-Token", token);
http.header("Accept", "application/json");
http.on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting CC2 device info for SN: %2%, HTTP %3%, body: `%4%`") % name % error % status % body;
})
.on_complete([&](std::string body, unsigned status) {
std::string error_message;
if (!parse_cc2_response(body, error_message, &sn)) {
BOOST_LOG_TRIVIAL(warning) << boost::format("%1%: Failed to parse CC2 SN response, HTTP %2%, reason: %3%") % name % status % error_message;
sn.clear();
}
})
#ifdef WIN32
.ssl_revoke_best_effort(m_ssl_revoke_best_effort)
#endif // WIN32
.perform_sync();
return sn;
}
bool ElegooLink::elegoo_test(wxString& msg) const{
@@ -268,11 +443,54 @@ namespace Slic3r {
return res;
}
bool ElegooLink::test(wxString &curl_msg) const{
if(OctoPrint::test(curl_msg)){
return true;
switch (classify_printer_model(m_printerModel)) {
case ElegooPrinterType::Other:
return OctoPrint::test(curl_msg);
case ElegooPrinterType::CC2:
return elegoo_cc2_test(curl_msg);
case ElegooPrinterType::CC:
return elegoo_test(curl_msg);
}
curl_msg="";
return elegoo_test(curl_msg);
return false;
}
bool ElegooLink::elegoo_cc2_test(wxString& msg) const
{
const char* name = get_name();
bool res = true;
const auto token = cc2_token();
auto url = make_cc2_info_url();
auto http = Http::get(std::move(url));
http.header("X-Token", token);
http.header("Accept", "application/json");
http.on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting CC2 device info: %2%, HTTP %3%, body: `%4%`") % name % error % status % body;
res = false;
if (status == 401 || status == 403)
msg = format_error(body, "Invalid access code", status);
else
msg = format_error(body, error.empty() ? "CC2 device not detected" : error, status);
})
.on_complete([&](std::string body, unsigned status) {
BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: Got CC2 device info: %2%") % name % body;
std::string error_message;
std::string serial_number;
if (!parse_cc2_response(body, error_message, &serial_number)) {
res = false;
msg = format_error(body, error_message.empty() ? "CC2 device not detected" : error_message, status);
return;
}
res = true;
})
#ifdef WIN32
.ssl_revoke_best_effort(m_ssl_revoke_best_effort)
.on_ip_resolve([&](std::string address) {
msg = GUI::from_u8(address);
})
#endif // WIN32
.perform_sync();
return res;
}
#ifdef WIN32
@@ -320,12 +538,53 @@ namespace Slic3r {
}
bool ElegooLink::test_with_resolved_ip(wxString& msg) const
{
// Elegoo supports both otcoprint and Elegoo link
if (OctoPrint::test_with_resolved_ip(msg)) {
return true;
switch (classify_printer_model(m_printerModel)) {
case ElegooPrinterType::Other:
return OctoPrint::test_with_resolved_ip(msg);
case ElegooPrinterType::CC2:
return elegoo_cc2_test_with_resolved_ip(msg);
case ElegooPrinterType::CC:
return elegoo_test_with_resolved_ip(msg);
}
msg = "";
return elegoo_test_with_resolved_ip(msg);
return false;
}
bool ElegooLink::elegoo_cc2_test_with_resolved_ip(wxString& msg) const
{
const char* name = get_name();
bool res = true;
const auto token = cc2_token();
auto url = substitute_host(make_cc2_info_url(), GUI::into_u8(msg));
std::string host_header = get_host_from_url(m_host);
auto http = Http::get(url);
msg.Clear();
http.header("Host", host_header);
http.header("X-Token", token);
http.header("Accept", "application/json");
http.on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting CC2 device info at %2% : %3%, HTTP %4%, body: `%5%`") % name % url %
error % status % body;
res = false;
if (status == 401 || status == 403)
msg = format_error(body, "Invalid access code", status);
else
msg = format_error(body, error.empty() ? "CC2 device not detected" : error, status);
})
.on_complete([&](std::string body, unsigned status) {
std::string error_message;
std::string serial_number;
if (!parse_cc2_response(body, error_message, &serial_number)) {
res = false;
msg = format_error(body, error_message.empty() ? "CC2 device not detected" : error_message, status);
return;
}
res = true;
})
.ssl_revoke_best_effort(m_ssl_revoke_best_effort)
.perform_sync();
return res;
}
#endif // WIN32
@@ -343,25 +602,31 @@ namespace Slic3r {
#ifdef WIN32
bool ElegooLink::upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const
{
wxString test_msg_or_host_ip = "";
const auto printer_type = classify_printer_model(m_printerModel);
if (printer_type == ElegooPrinterType::Other)
return OctoPrint::upload_inner_with_resolved_ip(std::move(upload_data), prorgess_fn, error_fn, info_fn, resolved_addr);
info_fn(L"resolve", boost::nowide::widen(resolved_addr.to_string()));
// If test fails, test_msg_or_host_ip contains the error message.
// Otherwise on Windows it contains the resolved IP address of the host.
// Test_msg already contains resolved ip and will be cleared on start of test().
test_msg_or_host_ip = GUI::from_u8(resolved_addr.to_string());
//Elegoo supports both otcoprint and Elegoo link
if(OctoPrint::test_with_resolved_ip(test_msg_or_host_ip)){
return OctoPrint::upload_inner_with_host(upload_data, prorgess_fn, error_fn, info_fn);
if (printer_type == ElegooPrinterType::CC2) {
wxString cc2_msg = GUI::from_u8(resolved_addr.to_string());
if (!elegoo_cc2_test_with_resolved_ip(cc2_msg)) {
error_fn(std::move(cc2_msg));
return false;
}
std::string url = substitute_host(make_cc2_upload_url(), resolved_addr.to_string());
info_fn(L"resolve", boost::nowide::widen(url));
return loopUploadCC2(url, get_host_from_url(m_host), std::move(upload_data), prorgess_fn, error_fn, info_fn);
}
test_msg_or_host_ip = GUI::from_u8(resolved_addr.to_string());
if(!elegoo_test_with_resolved_ip(test_msg_or_host_ip)){
error_fn(std::move(test_msg_or_host_ip));
wxString legacy_msg = GUI::from_u8(resolved_addr.to_string());
if (!elegoo_test_with_resolved_ip(legacy_msg)) {
error_fn(std::move(legacy_msg));
return false;
}
std::string url = substitute_host(make_url("uploadFile/upload"), resolved_addr.to_string());
info_fn(L"resolve", boost::nowide::widen(url));
@@ -372,23 +637,46 @@ namespace Slic3r {
bool ElegooLink::upload_inner_with_host(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const
{
// If test fails, test_msg_or_host_ip contains the error message.
// Otherwise on Windows it contains the resolved IP address of the host.
wxString test_msg_or_host_ip;
//Elegoo supports both otcoprint and Elegoo link
if(OctoPrint::test(test_msg_or_host_ip)){
return OctoPrint::upload_inner_with_host(upload_data, prorgess_fn, error_fn, info_fn);
const auto printer_type = classify_printer_model(m_printerModel);
if (printer_type == ElegooPrinterType::Other)
return OctoPrint::upload_inner_with_host(std::move(upload_data), prorgess_fn, error_fn, info_fn);
if (printer_type == ElegooPrinterType::CC2) {
wxString cc2_msg;
if (!elegoo_cc2_test(cc2_msg)) {
error_fn(std::move(cc2_msg));
return false;
}
std::string url;
#ifdef WIN32
if (m_host.find("https://") == 0 || cc2_msg.empty() || !GUI::get_app_config()->get_bool("allow_ip_resolve"))
#endif // _WIN32
{
url = make_cc2_upload_url();
}
#ifdef WIN32
else {
info_fn(L"resolve", cc2_msg);
url = substitute_host(make_cc2_upload_url(), GUI::into_u8(cc2_msg));
BOOST_LOG_TRIVIAL(info) << "CC2 upload address after ip resolve: " << url;
}
#endif // _WIN32
return loopUploadCC2(url, get_host_from_url(m_host), std::move(upload_data), prorgess_fn, error_fn, info_fn);
}
test_msg_or_host_ip="";
if(!elegoo_test(test_msg_or_host_ip)){
error_fn(std::move(test_msg_or_host_ip));
wxString legacy_msg;
if(!elegoo_test(legacy_msg)){
error_fn(std::move(legacy_msg));
return false;
}
std::string url;
#ifdef WIN32
// Workaround for Windows 10/11 mDNS resolve issue, where two mDNS resolves in succession fail.
if (m_host.find("https://") == 0 || test_msg_or_host_ip.empty() || !GUI::get_app_config()->get_bool("allow_ip_resolve"))
if (m_host.find("https://") == 0 || legacy_msg.empty() || !GUI::get_app_config()->get_bool("allow_ip_resolve"))
#endif // _WIN32
{
// If https is entered we assume signed ceritificate is being used
@@ -403,8 +691,8 @@ namespace Slic3r {
// This new address returns in "test_msg_or_host_ip" variable.
// Solves troubles of uploades failing with name address.
// in original address (m_host) replace host for resolved ip
info_fn(L"resolve", test_msg_or_host_ip);
url = substitute_host(make_url("uploadFile/upload"), GUI::into_u8(test_msg_or_host_ip));
info_fn(L"resolve", legacy_msg);
url = substitute_host(make_url("uploadFile/upload"), GUI::into_u8(legacy_msg));
BOOST_LOG_TRIVIAL(info) << "Upload address after ip resolve: " << url;
}
#endif // _WIN32
@@ -490,11 +778,11 @@ namespace Slic3r {
bool ElegooLink::loopUpload(std::string url, PrintHostUpload upload_data, ProgressFn progress_fn, ErrorFn error_fn, InfoFn info_fn) const
{
const char* name = get_name();
const auto upload_filename = upload_data.upload_path.filename().string();
std::string source_path = upload_data.source_path.string();
const auto upload_filename = filename_to_utf8(upload_data.upload_path);
std::string source_path = path_to_utf8(upload_data.source_path);
// calc file size
std::ifstream file(source_path, std::ios::binary | std::ios::ate);
boost::nowide::ifstream file(source_path, std::ios::binary | std::ios::ate);
std::streamsize size = file.tellg();
file.close();
const std::string fileSize = std::to_string(size);
@@ -583,6 +871,146 @@ namespace Slic3r {
return res;
}
bool ElegooLink::uploadPartCC2(Http& http,
const std::string& host_header,
const std::string& token,
const std::string& md5,
const boost::filesystem::path& path,
const std::string& filename,
size_t filesize,
size_t offset,
size_t length,
ProgressFn prorgess_fn,
ErrorFn error_fn) const
{
const char* name = get_name();
boost::nowide::ifstream file(path, std::ios::binary);
if (!file.is_open()) {
error_fn(_L("Failed to open file for upload."));
return false;
}
file.seekg(static_cast<std::streamoff>(offset), std::ios::beg);
std::string chunk(length, '\0');
file.read(chunk.data(), static_cast<std::streamsize>(length));
if (!file && static_cast<size_t>(file.gcount()) != length) {
error_fn(_L("Failed to read file chunk for upload."));
return false;
}
chunk.resize(static_cast<size_t>(file.gcount()));
const size_t end_offset = offset + chunk.size() - 1;
const auto range = std::string("bytes ") + std::to_string(offset) + "-" + std::to_string(end_offset) + "/" + std::to_string(filesize);
bool result = false;
http.headers_reset();
if (!host_header.empty())
http.header("Host", host_header);
http.header("Accept", "application/json")
.header("Content-Type", "application/octet-stream")
.header("Content-Length", std::to_string(chunk.size()))
.header("Content-Range", range)
.header("X-File-Name", filename)
.header("X-File-MD5", md5)
.header("X-Token", token)
.set_post_body(chunk)
.on_complete([&](std::string body, unsigned status) {
BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: CC2 chunk uploaded: HTTP %2%: %3%") % name % status % body;
std::string error_message;
if (!parse_cc2_response(body, error_message)) {
error_fn(format_error(body, error_message.empty() ? "CC2 upload failed" : error_message, status));
return;
}
result = true;
})
.on_error([&](std::string body, std::string error, unsigned status) {
BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error uploading CC2 chunk: %2%, HTTP %3%, body: `%4%`") % name % error % status % body;
if (status == 401 || status == 403)
error_fn(format_error(body, "Invalid access code", status));
else
error_fn(format_error(body, error.empty() ? "CC2 upload failed" : error, status));
})
.on_progress([&](Http::Progress progress, bool& cancel) {
if (progress.ultotal == progress.ulnow)
return;
prorgess_fn(std::move(progress), cancel);
if (cancel)
BOOST_LOG_TRIVIAL(info) << name << ": CC2 upload canceled";
})
#ifdef WIN32
.ssl_revoke_best_effort(m_ssl_revoke_best_effort)
#endif
.perform_sync();
return result;
}
bool ElegooLink::loopUploadCC2(std::string url,
const std::string& host_header,
PrintHostUpload upload_data,
ProgressFn progress_fn,
ErrorFn error_fn,
InfoFn info_fn) const
{
BOOST_LOG_TRIVIAL(info) << get_name() << ": Uploading file to Elegoo CC2";
const auto upload_filename = filename_to_utf8(upload_data.upload_path);
std::string source_path = path_to_utf8(upload_data.source_path);
std::string md5;
bbl_calc_md5(source_path, md5);
std::transform(md5.begin(), md5.end(), md5.begin(), [](unsigned char ch) { return static_cast<char>(std::tolower(ch)); });
boost::nowide::ifstream file(source_path, std::ios::binary | std::ios::ate);
if (!file.is_open()) {
error_fn(_L("Failed to open file for upload."));
return false;
}
const std::streamsize size = file.tellg();
file.close();
if (size <= 0) {
error_fn(_L("The file is empty or could not be read."));
return false;
}
if (md5.empty()) {
error_fn(_L("Failed to calculate file checksum."));
return false;
}
const std::string token = cc2_token();
const int packageCount = static_cast<int>((size + MAX_UPLOAD_PACKAGE_LENGTH - 1) / MAX_UPLOAD_PACKAGE_LENGTH);
auto http = Http::put2(url);
http.timeout_connect(30)
.timeout_max(180);
bool res = false;
for (int i = 0; i < packageCount; ++i) {
const size_t offset = MAX_UPLOAD_PACKAGE_LENGTH * static_cast<size_t>(i);
size_t length = MAX_UPLOAD_PACKAGE_LENGTH;
if (i == packageCount - 1 && size % MAX_UPLOAD_PACKAGE_LENGTH > 0)
length = static_cast<size_t>(size % MAX_UPLOAD_PACKAGE_LENGTH);
res = uploadPartCC2(
http, host_header, token, md5, source_path, upload_filename, static_cast<size_t>(size), offset, length,
[size, i, progress_fn](Http::Progress progress, bool& cancel) {
const size_t uploaded = static_cast<size_t>(i) * MAX_UPLOAD_PACKAGE_LENGTH + progress.ulnow;
Http::Progress merged(0, 0, static_cast<size_t>(size), std::min(static_cast<size_t>(size), uploaded), progress.buffer,
progress.upload_spd);
progress_fn(merged, cancel);
},
error_fn);
if (!res)
break;
}
if (res && upload_data.post_action == PrintHostPostUploadAction::StartPrint)
BOOST_LOG_TRIVIAL(info) << get_name() << ": CC2 upload completed; start print is not supported.";
(void) info_fn;
return res;
}
bool ElegooLink::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const
{
#ifndef WIN32
+30 -2
View File
@@ -20,14 +20,16 @@ class ElegooLink : public OctoPrint
public:
ElegooLink(DynamicPrintConfig *config);
~ElegooLink() override = default;
static std::string get_print_host_webui(DynamicPrintConfig *config);
const char* get_name() const override;
virtual bool test(wxString &curl_msg) const override;
wxString get_test_ok_msg() const override;
wxString get_test_failed_msg(wxString& msg) const override;
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
std::string get_sn() const override;
bool has_auto_discovery() const override { return false; }
bool can_test() const override { return true; }
PrintHostPostUploadActions get_post_upload_actions() const override { return PrintHostPostUploadAction::StartPrint; }
PrintHostPostUploadActions get_post_upload_actions() const override;
protected:
#ifdef WIN32
virtual bool upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const;
@@ -39,9 +41,9 @@ protected:
virtual bool test_with_resolved_ip(wxString& curl_msg) const override;
bool elegoo_test_with_resolved_ip(wxString& curl_msg) const;
#endif
private:
bool elegoo_test(wxString& curl_msg) const;
bool elegoo_cc2_test(wxString& curl_msg) const;
bool print(WebSocketClient& client,
std::string timeLapse,
std::string heatedBedLeveling,
@@ -54,6 +56,12 @@ private:
ProgressFn prorgess_fn,
ErrorFn error_fn,
InfoFn info_fn) const;
bool loopUploadCC2(std::string url,
const std::string& host_header,
PrintHostUpload upload_data,
ProgressFn prorgess_fn,
ErrorFn error_fn,
InfoFn info_fn) const;
bool uploadPart(Http &http,
std::string md5,
@@ -66,6 +74,26 @@ private:
ProgressFn prorgess_fn,
ErrorFn error_fn,
InfoFn info_fn) const;
bool uploadPartCC2(Http& http,
const std::string& host_header,
const std::string& token,
const std::string& md5,
const boost::filesystem::path& path,
const std::string& filename,
size_t filesize,
size_t offset,
size_t length,
ProgressFn prorgess_fn,
ErrorFn error_fn) const;
std::string cc2_token() const;
std::string make_cc2_info_url() const;
std::string make_cc2_upload_url() const;
#ifdef WIN32
bool elegoo_cc2_test_with_resolved_ip(wxString& curl_msg) const;
#endif
std::string m_printerModel;
};
}
+15
View File
@@ -570,6 +570,21 @@ Http& Http::header(std::string name, const std::string &value)
return *this;
}
Http& Http::headers_reset()
{
if (!p) { return *this; }
::curl_slist_free_all(p->headerlist);
p->headerlist = nullptr;
p->headerlist = curl_slist_append(p->headerlist, "Expect:");
std::lock_guard<std::mutex> l(g_mutex);
for (auto it = extra_headers.begin(); it != extra_headers.end(); ++it)
this->header(it->first, it->second);
return *this;
}
Http& Http::remove_header(std::string name)
{
if (p) {
+2
View File
@@ -109,6 +109,8 @@ public:
Http& set_range(const std::string& range);
// Sets a HTTP header field.
Http& header(std::string name, const std::string &value);
// Clears all custom headers and restores default implicit headers.
Http& headers_reset();
// Removes a header field.
Http& remove_header(std::string name);
// Authorization by HTTP digest, based on RFC2617.
+34
View File
@@ -74,6 +74,40 @@ PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
}
}
std::string PrintHost::get_print_host_webui(DynamicPrintConfig* config)
{
if (config == nullptr)
return {};
std::string webui_url;
const auto* host_type_opt = config->option<ConfigOptionEnum<PrintHostType>>("host_type");
const auto host_type = host_type_opt != nullptr ? host_type_opt->value : htOctoPrint;
switch (host_type) {
case htElegooLink: {
webui_url = ElegooLink::get_print_host_webui(config);
break;
}
default: break;
}
if (webui_url.empty()) {
webui_url = config->opt_string("print_host_webui");
if (webui_url.empty())
webui_url = config->opt_string("print_host");
if (webui_url.empty())
return webui_url;
}
const bool has_http_scheme = boost::algorithm::istarts_with(webui_url, "http");
const bool has_file_scheme = boost::algorithm::istarts_with(webui_url, "file:");
if (!has_http_scheme && !has_file_scheme)
webui_url = "http://" + webui_url;
return webui_url;
}
wxString PrintHost::format_error(const std::string &body, const std::string &error, unsigned status) const
{
if (status != 0) {
+7
View File
@@ -63,6 +63,12 @@ public:
// A print host usually does not support multiple printers, with the exception of Repetier server.
virtual bool supports_multiple_printers() const { return false; }
virtual std::string get_host() const = 0;
/**
* Get the serial number for connecting to the printer.
* For Elegoo CC2, the device details connection to the printer requires the serial number.
* Other print hosts do not need to implement this interface, and it returns an empty string by default.
*/
virtual std::string get_sn() const { return ""; }
// Support for Repetier server multiple groups & printers. Not supported by other print hosts.
// Returns false if not supported. May throw HostNetworkError.
@@ -73,6 +79,7 @@ public:
virtual bool get_storage(wxArrayString& /*storage_path*/, wxArrayString& /*storage_name*/) const { return false; }
static PrintHost* get_print_host(DynamicPrintConfig *config);
static std::string get_print_host_webui(DynamicPrintConfig *config);
//Support for cloud webui login
virtual bool is_cloud() const { return false; }