@formant/data-sdk 1.21.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,64 @@
1
- "use strict";var Se=Object.defineProperty;var Ee=(a,e,t)=>e in a?Se(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>(Ee(a,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("base-64"),D=require("date-fns"),C=require("@formant/realtime-sdk"),ke=require("eventemitter3"),Oe=require("pako"),Re=require("base64-js");function be(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const u=be(D),Ae="https://api.formant.io";function je(a,e){try{if(e.get("formant_stage"))return"https://api-stage.formant.io";if(e.get("formant_dev"))return"https://api-dev.formant.io";if(e.get("formant_local"))return"https://api.formant.local";if(e.get("formant_url")){const t=e.get("formant_url");if(t!==null)try{return new URL(t).origin}catch{console.warn(`Ignoring malformed \`formant_url\` url parameter: ${t}`)}}}catch{}return typeof a<"u"&&"FORMANT_API_URL"in a&&typeof a.FORMANT_API_URL=="string"?a.FORMANT_API_URL:Ae}const h=je(typeof window<"u"?window:globalThis,new URLSearchParams(typeof window<"u"&&window.location?window.location.search:void 0));class U extends Error{constructor(t){super("login failed");s(this,"reason");this.reason=t,this.name="LoginFailureError",Object.setPrototypeOf(this,new.target.prototype)}}class J extends Error{constructor(t){super("login challenged");s(this,"challenge");this.challenge=t,this.name="LoginChallengedError",Object.setPrototypeOf(this,new.target.prototype)}}class Pe{constructor({apiUrl:e,refreshAuthToken:t,addAccessTokenRefreshListener:n}){s(this,"_refreshToken");s(this,"_isShareToken",!1);s(this,"_currentOrganization");s(this,"_currentUser");s(this,"_defaultDeviceId");s(this,"_token");s(this,"_waitingForAuth",new Set);s(this,"_refreshTimer");s(this,"_apiUrl");s(this,"_refreshAuthToken");s(this,"_addAccessTokenRefreshListener");this._apiUrl=e,this._refreshAuthToken=t,this._addAccessTokenRefreshListener=n}get token(){return this._token}get currentUser(){return this._currentUser}get currentOrganization(){return this._currentOrganization}get defaultDeviceId(){return this._defaultDeviceId}get refreshToken(){return this._refreshToken}get isShareToken(){return this._isShareToken}async login(e,t,n={}){const{advanced:i=!1}=n;try{const o=await fetch(`${this._apiUrl}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:e,password:t}),headers:{"Content-Type":"application/json"}}),c=await o.json();if(o.status!==200)throw new U(c.message);if("challenge"in c)throw new J(c.challenge);const{authentication:d}=c;return await this.loginWithToken(d.accessToken,d.refreshToken),i?{result:"success",authentication:d}:d}catch(o){if(i||console.error("login() failed",{err:o}),this._waitingForAuth.forEach(c=>c(!1)),this._waitingForAuth.clear(),!i)throw o;return o instanceof J?{result:"challenged",challenge:o.challenge}:{result:"failure",reason:o instanceof U?o.reason:o instanceof Error?o.message:String(o)}}}async loginWithToken(e,t){var i;const n=JSON.parse(G.decode(e.split(".")[1]));try{let o;if(this._isShareToken=n["formant:claims"]&&n["formant:claims"].type=="share",n["formant:claims"]&&(this._currentOrganization=n["formant:claims"].organizationId),n["custom:organization_id"]&&(this._currentOrganization=n["custom:organization_id"]),this._isShareToken||(o=n.sub),n["formant:claims"]&&n["formant:claims"].userId&&(o=n["formant:claims"].userId),o&&((i=this._currentUser)==null?void 0:i.id)!==o){const c=await fetch(`${this._apiUrl}/v1/admin/users/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+e}}),d=await c.json();if(c.status!==200)throw new Error(d.message);this._currentUser=d}this._token=e,this._waitingForAuth.forEach(c=>c(!0))}catch(o){console.error("loginWithToken() failed",{err:o}),this._waitingForAuth.forEach(c=>c(!1))}finally{this._waitingForAuth.clear()}t&&(this._refreshToken=t,setInterval(async()=>{if(this._refreshToken){const c=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this._refreshToken})})).json();this._token=c.authentication.accessToken}},1e3*60*60))}isAuthenticated(){return this._token!==void 0}getCurrentUser(){return this._currentUser}async waitTilAuthenticated(){return this.token!==void 0?!0:new Promise(e=>{this._waitingForAuth.add(e)})}async listenForRefresh(){const t=()=>{this._refreshTimer=void 0,this._refreshAuthToken()};this._addAccessTokenRefreshListener(n=>{this._refreshTimer&&clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(t,36e5),this.loginWithToken(n)}),this._refreshTimer=setTimeout(t,36e5)}async forgotPassword(e){await fetch(`${this._apiUrl}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:e}),headers:{"Content-Type":"application/json"}})}async confirmForgotPassword(e){return(await fetch(`${this._apiUrl}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})).ok}async respondToNewPasswordRequiredChallenge(e){const t=await fetch(`${this._apiUrl}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(t.ok)return await t.json();throw new Error("respond-to-new-password-required-challenge failed")}async loginWithGoogle(e){return await(await fetch(`${this._apiUrl}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})).json()}async refresh(e){const n=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})})).json();await this.loginWithToken(n.authentication.accessToken,e)}async checkSso(e,t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/check-sso`,{method:"POST",body:JSON.stringify({email:e,allowUserAutoCreation:t}),headers:{"Content-Type":"application/json"}})).json()}async loginWithSso(e,t){const i=await(await fetch(`${this._apiUrl}/v1/admin/auth/login-sso`,{method:"POST",body:JSON.stringify({token:e,refreshToken:t}),headers:{"Content-Type":"application/json"}})).json();if(!i.authentication)throw new Error("Failed to login with SSO");return await this.loginWithToken(i.authentication.accessToken,i.authentication.refreshToken)}}function k(){return typeof window<"u"&&window.location?new URLSearchParams(window.location.search).get("module"):null}function T(a){if(!(window&&window.parent))throw new Error("cannot send message to non-existent parent");window.parent.postMessage(a,"*")}function H(){const a=k();if(!a)throw new Error("No module context");T({type:"refresh_auth_token",module:a})}function W(a){function e(t){const n=t.data;n.type==="auth_token"&&a(n.token)}return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}const r=new Pe({apiUrl:h,refreshAuthToken:H,addAccessTokenRefreshListener:W});async function De(a){return(await(await fetch(`${h}/v1/admin/module-configurations/${a}`,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).configuration}function Ne(){T({type:"hide_analytics_date_picker"})}function Le(a){T({type:"go_to_device",deviceId:a})}function Ie(a){T({type:"go_to_time",time:a.getTime()})}function $e(){const a=k();if(!a)throw new Error("No module context");T({type:"request_module_data",module:a})}function Me(a,e){const t=k();if(!t)throw new Error("No module context");T({type:"send_channel_data",source:t,channel:a,data:e})}function ze(a,e){const t=k();if(!t)throw new Error("No module context");T({type:"set_module_data_time_range",module:t,before:a,after:e||0})}function Be(a){const e=k();if(!e)throw new Error("No module context");T({type:"setup_module_menus",module:e,menus:a})}function qe(a){T({type:"show_message",message:a})}function _e(a,e){const t=n=>{const i=n.data;i.type==="channel_data"&&i.channel===a&&e({source:i.source,data:i.data})};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function xe(a){const e=t=>{const n=t.data;n.type==="module_menu_item_clicked"&&a(n.menu)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}function Ue(a){const e=t=>{const n=t.data;n.type==="module_configuration"&&a(n)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}function Je(a){const e=k();e&&T({type:"request_module_data",module:e});const t=n=>{const i=n.data;i.type==="module_data"&&a({streams:i.streams,time:i.time,queryRange:i.queryRange})};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function Ve(a){T({type:"request_devices"});const e=t=>{const n=t.data;n.type==="overview_devices"&&a(n.data)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}const Fe=1,K=1e3,Q=60*K,X=60*Q,I=24*X,Ge=7*I,He=30*I,We=365*I,$={millisecond:Fe,second:K,minute:Q,hour:X,day:I,week:Ge,month:He,year:We};function Ke(a,e){return a.filter(t=>e.includes(t.type))}function Qe(a,e,t){const n=e.getTime(),i=t.getTime();return a.map(o=>({...o,points:o.points.filter(([c])=>c>=n&&c<i)})).filter(({points:o})=>o.length>0)}class V{constructor({capacity:e,timeout:t}={}){s(this,"entries",new Map);s(this,"metadata",new Map);s(this,"capacity");s(this,"staleIntervalMs");this.capacity=e||1e4,this.staleIntervalMs=t||$.minute}get(e,t){const n=this.keyToCacheKey(e);return this.isStale(n)&&!this.isGenerating(n)&&t&&this.generate(e,t),this.entries.get(n)}set(e,t){const n=this.keyToCacheKey(e);this.metadata.set(n,{generating:!1,staleAt:performance.now()+this.staleIntervalMs});const i=this.entries.get(n);JSON.stringify(i)===JSON.stringify(t)||(this.entries.set(n,t),this.enforceMaxSize())}clear(){this.entries.clear(),[...this.metadata.values()].forEach(e=>e.generating=!1)}clearKey(e){this.metadata.delete(e),this.entries.delete(e)}keyToCacheKey(e){return JSON.stringify(e)}enforceMaxSize(){for(;this.metadata.size>this.capacity&&this.metadata.size>0;){const[e]=[...this.metadata.entries()].reduce(([t,n],[i,o])=>o.staleAt<n.staleAt?[i,o]:[t,n]);this.clearKey(e)}}isStale(e){const t=this.metadata.get(e);return t?(t==null?void 0:t.staleAt)<performance.now():!0}isGenerating(e){const t=this.metadata.get(e);return t?t.generating:!1}generate(e,t){const n=this.keyToCacheKey(e),i=this.metadata.get(n)||{},o=t().then(c=>{const d=this.metadata.get(n);return(d==null?void 0:d.generating)!==o||this.set(e,c),c}).catch(c=>{throw this.metadata.delete(n),c});this.metadata.set(n,{...i,generating:o,staleAt:performance.now()+this.staleIntervalMs})}}async function M(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/queries/queries`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}class Xe{constructor(){s(this,"queryStoreCache",new V({capacity:1e4,timeout:20*$.second}));s(this,"liveQueryStoreCache",new V({capacity:1e4,timeout:200*$.millisecond}))}moduleQuery(e,t,n,i,o,c=!1){const d={...e,names:[...t],types:[...n]},y=this.query(d,i,o,c);return y===void 0||y==="too much data"?y:Ke(y,n)}query(e,t,n,i=!1){const o={...e,start:D.startOfMinute(t).toISOString(),end:i?n.toISOString():D.addMinutes(D.roundToNearestMinutes(n),1).toISOString(),latestOnly:i},c=n>D.addSeconds(new Date,-20);let d;return c?d=this.liveQueryCache(o):d=this.queryCache(o),!d||d==="too much data"||i?d:Qe(d,t,n)}queryCache(e){return this.queryStoreCache.get(e,async()=>{try{return await M(e)}catch(t){throw t}})}liveQueryCache(e){return this.liveQueryStoreCache.get(e,async()=>{try{return await M(e)}catch(t){throw t}})}}const Ye=new Xe;function Ze(a,e,t){const n=i=>{const o=i.data;if(o.type==="module_data"){const{start:c,end:d}=o.queryRange;t(Ye.moduleQuery({},a,e,new Date(c),new Date(d),!1))}};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}async function et(a,e,t){return new Promise(n=>{T({type:"request_date",minTime:e,maxTime:t,time:a});const i=o=>{const c=o.data;c.type==="date_response"&&(window.removeEventListener("message",i),n(c.data))};window.addEventListener("message",i)})}async function tt(a,e){return new Promise(t=>{const n=Math.random().toString();T({type:"prompt",promptId:n,schema:a,okText:e==null?void 0:e.okText,cancelText:e==null?void 0:e.cancelText});const i=o=>{const c=o.data;c.type==="prompt_response"&&c.promptId===n&&t(c.data),window.removeEventListener("message",i)};window.addEventListener("message",i)})}const g=class g{static isModule(){return k()!==null}static async getCurrentModuleConfiguration(){let e=new URLSearchParams("");typeof window<"u"&&window.location&&(e=new URLSearchParams(window.location.search));const t=e.get("configuration");if(!(t===null||t.trim()===""))return De(t.trim())}static get isOnline(){return g._isOnline}static listenForConnectionEvents(){const e=t=>{const{data:n}=t;n.type==="formant_online"&&(this._isOnline=n.online)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}static checkConnection(e=1e3){return new Promise((t,n)=>{const i=setTimeout(()=>n(new Error("deadline expired: took too long")),e),o=c=>{window.removeEventListener("message",o),clearTimeout(i);const{data:d}=c;d.type==="formant_online"&&(this._isOnline=d.online,t(d.online))};window.addEventListener("message",o),T({type:"formant_online"})})}static waitForConnection(e=5e3){let t=!1;const n=new Promise((c,d)=>{setTimeout(()=>{t=!0,d(new Error("deadline expired: took too long"))},e)}),i=c=>new Promise(d=>setTimeout(d,c)),o=async()=>{for(await i(50);!t&&!(this.isOnline||await this.checkConnection);)await i(500)};return Promise.race([n,o()])}};s(g,"getCurrentModuleContext",k),s(g,"disableAnalyticsBottomBar",Ne),s(g,"goToDevice",Le),s(g,"goToTime",Ie),s(g,"refreshAuthToken",H),s(g,"requestModuleData",$e),s(g,"sendChannelData",Me),s(g,"setModuleDateTimeRange",ze),s(g,"setupModuleMenus",Be),s(g,"showMessage",qe),s(g,"addAccessTokenRefreshListener",W),s(g,"addChannelDataListener",_e),s(g,"addMenuListener",xe),s(g,"addModuleConfigurationListener",Ue),s(g,"addModuleDataListener",Je),s(g,"addOverviewDeviceListener",Ve),s(g,"addStreamListener",Ze),s(g,"getDate",et),s(g,"prompt",tt),s(g,"_isOnline",null);let N=g;function f(a,e){if(a!==void 0)return a;throw new Error(e||"Value is undefined")}const p={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3,HEADLESS:4},nt={...p,Unknown:p.UNKNOWN,Teleop:p.TELEOP,PortForward:p.PORT_FORWARD,Observe:p.OBSERVE,Headless:p.HEADLESS,unknown:p.UNKNOWN,teleop:p.TELEOP,portForward:p.PORT_FORWARD,observe:p.OBSERVE,headless:p.HEADLESS},O=Symbol("RtcClientPool.instance");var hn;class j{constructor(e){s(this,hn,null);s(this,"createClient");s(this,"ttlMs");s(this,"proxyHandler");s(this,"proxyReceivers",new Map);s(this,"teardownTimeout",null);s(this,"dispatch",(e,t)=>{this.proxyReceivers.forEach(n=>n==null?void 0:n(e,t))});const{createClient:t,ttlMs:n=0}=e;this.createClient=t,this.ttlMs=Math.max(n,0),this.proxyHandler={get:(i,o,c)=>{switch(o){case"shutdown":return()=>this.releaseInstance(c);default:return Reflect.get(i,o,c)}}}}get isActive(){return this[O]!==null}get size(){return this.proxyReceivers.size}get(e){const t=new Proxy(this.allocate(),this.proxyHandler);return this.proxyReceivers.set(t,e??null),t}allocate(){if(this[O])return this.teardownTimeout&&(clearTimeout(this.teardownTimeout),this.teardownTimeout=null),this[O];const e=this.createClient(this.dispatch);return this[O]=e,e}async teardown(){const e=this[O];if(!e){console.warn("singleton has already been shutdown!");return}try{await e.shutdown()}finally{this[O]=null}}async releaseInstance(e){return this.proxyReceivers.delete(e)?this.proxyReceivers.size!==0?!1:(!this.teardownTimeout&&Number.isFinite(this.ttlMs)&&(this.ttlMs===0?await this.teardown():this.teardownTimeout=setTimeout(()=>{this.teardown().catch(t=>console.error("teardown failed",{err:t})).finally(()=>this.teardownTimeout=null)},this.ttlMs)),!0):(console.warn("this instance has already been released!"),!1)}}hn=O;const P=async()=>f(r.token,"Realtime when user isn't authorized"),R={[p.UNKNOWN]:new j({ttlMs:2500,createClient:a=>new C.RtcClient({signalingClient:new C.SignalingPromiseClient(h),getToken:P,sessionType:p.UNKNOWN,receive:a})}),[p.TELEOP]:new j({ttlMs:2500,createClient:a=>new C.RtcClient({signalingClient:new C.SignalingPromiseClient(h),getToken:P,sessionType:p.TELEOP,receive:a})}),[p.PORT_FORWARD]:new j({ttlMs:2500,createClient:a=>new C.RtcClient({signalingClient:new C.SignalingPromiseClient(h),getToken:P,sessionType:p.PORT_FORWARD,receive:a})}),[p.OBSERVE]:new j({ttlMs:2500,createClient:a=>new C.RtcClient({signalingClient:new C.SignalingPromiseClient(h),getToken:P,sessionType:p.OBSERVE,receive:a})}),[p.HEADLESS]:new j({ttlMs:2500,createClient:a=>new C.RtcClient({signalingClient:new C.SignalingPromiseClient(h),getToken:P,sessionType:p.HEADLESS,receive:a})})},at={...R,unknown:R[p.UNKNOWN],teleop:R[p.TELEOP],portForward:R[p.PORT_FORWARD],observe:R[p.OBSERVE],headless:R[p.HEADLESS]},z=R[p.TELEOP],it=a=>{const{sessionType:e}=a;return e?at[e]:z};class Y{constructor(e){s(this,"token");this.captureSession=e}async ingestJSON(e){if(!this.token){const n=await(await fetch(`${h}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=n.token}await fetch(`${h}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(e)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}function b(a){return new Promise(e=>setTimeout(e,a))}const rt=a=>a!==void 0&&a.capabilities!==void 0&&a.capabilitySet!==void 0;class Z{constructor(e){s(this,"ready",!1);s(this,"listeners",[]);s(this,"openListeners",[]);s(this,"closeListeners",[]);s(this,"errorListeners",[]);s(this,"binaryListeners",[]);s(this,"error");s(this,"decoder",new TextDecoder);this.dataChannel=e,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.setReady()},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(t=>t())},this.dataChannel.onerror=t=>{console.error(t),this.error="An error occurred in DataChannel",this.errorListeners.forEach(n=>n(t))},this.dataChannel.onmessage=t=>{this.listeners.forEach(n=>{const i=new Uint8Array(t.data),o=this.decoder.decode(i);n(o)}),this.binaryListeners.forEach(n=>{n(new Uint8Array(t.data))})}}setReady(){this.ready=!0,this.openListeners.forEach(e=>e())}addOpenListener(e){this.openListeners.push(e)}removeOpenListener(e){this.openListeners=this.openListeners.filter(t=>t!==e)}addCloseListener(e){this.closeListeners.push(e)}removeCloseListener(e){this.closeListeners=this.closeListeners.filter(t=>t!==e)}addErrorListener(e){this.errorListeners.push(e)}removeErrorListener(e){this.errorListeners=this.errorListeners.filter(t=>t!==e)}async waitTilReady(){return this.ready?!0:new Promise((t,n)=>{let i=setInterval(()=>{this.dataChannel.readyState==="open"&&this.setReady(),this.ready&&(clearInterval(i),t(!0)),this.error&&n(this.error)},10)})}send(e){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(e)}sendBinary(e){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(e)}addListener(e){this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);if(t===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(t,1)}addBinaryListener(e){this.binaryListeners.push(e)}removeBinaryListener(e){const t=this.binaryListeners.indexOf(e);if(t===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(t,1)}}class ee{constructor(e,t){s(this,"currentListeners",[]);s(this,"onRealtimeMessage",(e,t)=>{t.payload.jointState&&this.currentListeners.forEach(n=>{t.payload.jointState&&n(t.payload.jointState)})});this.device=e,this.config=t}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(e){this.currentListeners.push(e)}}class te{constructor(e,t,n){s(this,"channel");s(this,"requestIdToResponseMap",new Map);this.device=e,this.channel_name=t,this.timeout=n}addOpenListener(e){f(this.channel,"channel not initalized").addOpenListener(e)}removeOpenListener(e){f(this.channel,"channel not initalized").removeOpenListener(e)}addCloseListener(e){f(this.channel,"channel not initalized").addCloseListener(e)}removeCloseListener(e){f(this.channel,"channel not initalized").removeCloseListener(e)}addErrorListener(e){f(this.channel,"channel not initalized").addErrorListener(e)}removeErrorListener(e){f(this.channel,"channel not initalized").removeErrorListener(e)}}class ne extends te{constructor(){super(...arguments);s(this,"RESPONSE_SUCCESS_BYTE",0);s(this,"decoder",new TextDecoder)}generateBinaryId(){const t=new Uint8Array(16);for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return t}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(t=>{const i=t.slice(0,16).toString();if(i.length===0)throw new Error("Invalid response");const o=t.slice(16);if(o.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(i)&&this.requestIdToResponseMap.set(i,o)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:i,timeout:o}=this;await n.waitTilReady();const c=this.generateBinaryId(),d=c.toString();i.set(d,!0),n.sendBinary(new Uint8Array([...c,...t]));const y=new Date().getTime();for(;new Date().getTime()<y+o;)if(await b(50),i.has(d)){const m=i.get(d);if(m!==!0){i.delete(d);const w=m[0]===this.RESPONSE_SUCCESS_BYTE,v=m.slice(1);if(w)return v;throw console.error({name:"AdapterError",message:this.decoder.decode(v)}),new Error("Binary request datachannel adapter error")}}throw i.delete(d),console.error({name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class ae extends te{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(e=>{const t=JSON.parse(e),{id:n,data:i,error:o}=t;if(!n)throw new Error("Invalid response");if(!i&&!o)throw new Error("Invalid response");this.requestIdToResponseMap.has(n)&&this.requestIdToResponseMap.set(n,t)})}async request(e){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:t,requestIdToResponseMap:n,timeout:i}=this;await t.waitTilReady();const o=this.generateTextId();n.set(o,!0),t.send(JSON.stringify({id:o,data:e}));const c=new Date().getTime();for(;new Date().getTime()<c+i;)if(await b(50),n.has(o)){const d=n.get(o);if(d!==!0){n.delete(o);const{data:y,error:m}=d;if(y)return y;if(m)throw console.error({name:"AdapterError",message:m}),new Error("Text request datachannel adapter error")}}throw n.delete(o),console.error({name:"TimeoutError",message:`Request timed out after ${i/1e3} seconds`}),new Error("Text request datachannel request timed out")}}class ie extends ke.EventEmitter{constructor(){super(...arguments);s(this,"rtcClient");s(this,"remoteDevicePeerId",null);s(this,"realtimeListeners",[]);s(this,"connectionMonitorInterval");s(this,"handleMessage",(t,n)=>{this.realtimeListeners.forEach(i=>i(t,n))})}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}assertNotCancelled(t){if(t)throw new Error("Cancelled by deadline")}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}addRealtimeListener(t){this.realtimeListeners.push(t)}removeRealtimeListener(t){const n=this.realtimeListeners.indexOf(t);if(n===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(n,1)}async getRealtimeManipulators(){const t=await this.getConfiguration(),n=[];for(const i of t.teleop.rosStreams??[])i.topicType=="sensor_msgs/JointState"&&n.push(new ee(this,{currentJointStateStream:{name:i.topicName},plannedJointStateStream:i.plannedTopic?{name:i.plannedTopic}:void 0,planValidStream:i.planValidTopic?{name:i.planValidTopic}:void 0,endEffectorStream:i.endEffectorTopic?{name:i.endEffectorTopic}:void 0,endEffectorLinkName:i.endEffectorLinkName,baseReferenceFrame:i.baseReferenceFrame,localFrame:i.localFrame}));return n}async getRealtimeVideoStreams(){var i,o,c;const t=await this.getConfiguration(),n=[];for(const d of((i=t.teleop)==null?void 0:i.hardwareStreams)??[])d.rtcStreamType==="h264-video-frame"&&n.push({name:d.name});for(const d of((o=t.teleop)==null?void 0:o.rosStreams)??[])d.topicType=="formant/H264VideoFrame"&&n.push({name:d.topicName}),(d.topicType==="sensor_msgs/Image"||d.topicType==="sensor_msgs/CompressedImage")&&d.encodeVideo&&n.push({name:d.topicName});for(const d of((c=t.teleop)==null?void 0:c.customStreams)??[])d.rtcStreamType==="h264-video-frame"&&n.push({name:d.name});return n}createCustomRequestDataChannel(t,n=3e3){return new ae(this,t,n)}createCustomBinaryRequestDataChannel(t,n=3e3){return new ne(this,t,n)}async startListeningToRealtimeVideo(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(t){const n=f(this.rtcClient,"Realtime connection has not been started"),i=await this.getRemotePeer();n.controlRemoteStream(f(i).id,{streamName:t,enablePriorityUpload:!1,pipeline:"telemetry"})}async changeStreamAudioType(t,n){const i=f(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();i.controlRemoteStream(f(o).id,{streamName:t,setAudioFormat:n})}async createCustomDataChannel(t,n){const i=f(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer(),c=await new Promise(d=>{i.createCustomDataChannel(f(o).id,t,{ordered:!0,...n},!1,(y,m)=>{const w=new Z(m);d(w)})});return await c.waitTilReady(),c}async sendRealtimeMessage(t,n={channelLabel:"stream.reliable"}){const i=f(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();i.send(f(o).id,t,n)}async getRealtimeAudioStreams(){var i,o,c;const t=await this.getConfiguration(),n=[];for(const d of((i=t.teleop)==null?void 0:i.hardwareStreams)??[])d.rtcStreamType==="audio-chunk"&&n.push({name:d.name});for(const d of((o=t.teleop)==null?void 0:o.rosStreams)??[])d.topicType=="audio_common_msgs/AudioData"&&n.push({name:d.topicName});for(const d of((c=t.teleop)==null?void 0:c.customStreams)??[])d.rtcStreamType==="audio-chunk"&&n.push({name:d.name});return n}}const ot=new TextEncoder;new TextDecoder;function st(a){const e=JSON.stringify(a),t=ot.encode(e),n=Oe.deflate(t);return Re.fromByteArray(n)}async function re(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function oe(a,e){if(!r.token)throw new Error("Not authenticated");const n=(await re()).filter(d=>d.name===e);if(n.length===0)return console.warn("View does not exist or it is misspell"),null;const i=await fetch(`${h}/v1/admin/shares`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),o=h.replace("api","app"),{code:c}=await i.json();return`${o}/shares/${c}#${st({viewId:n[0].id})}`}const ct=["day","week","month","year","hour","minute","quarter"],dt=["interval","start","end","sub","get"];function se(a){return a.count<2?0:a.sumOfSquares/(a.count-1)}function ce(a){return Math.sqrt(se(a))}function de(a){return a.max}function he(a){return a.min}function le(a){return a.count===0?-1:a.sum/a.count}function ue(a){return a.sum}function me(a){return a.count}const ht={min:he,max:de,"standard deviation":ce,average:le,sum:ue,count:me},B={day:{interval:u.eachDayOfInterval,start:u.startOfDay,end:u.endOfDay,sub:u.subDays,get:u.getDay},week:{interval:u.eachWeekOfInterval,start:u.startOfWeek,end:u.endOfWeek,sub:u.subWeeks,get:u.getWeek},month:{interval:u.eachMonthOfInterval,start:u.startOfMonth,end:u.endOfMonth,sub:u.subMonths,get:u.getMonth},year:{interval:u.eachYearOfInterval,start:u.startOfYear,end:u.endOfYear,sub:u.subYears,get:u.getYear},hour:{interval:u.eachHourOfInterval,start:u.startOfHour,end:u.endOfHour,sub:u.subHours,get:u.getHours},minute:{interval:u.eachMinuteOfInterval,start:u.startOfMinute,end:u.endOfMinute,sub:u.subMinutes,get:u.getMinutes},quarter:{interval:u.eachQuarterOfInterval,start:u.startOfQuarter,end:u.endOfQuarter,sub:u.subQuarters,get:u.getQuarter}},fe=(a,e)=>a.split("/")[0]+"/"+a.split("/")[1]+"–"+e.split("/")[0]+"/"+e.split("/")[1];async function q(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function we(a,e,t,n,i){const o=B[e];return await Promise.all(Array(t).fill(0).map(async(c,d)=>{const y=new Date(n),m=o.sub(o.start(y),t-d-1),w=o.sub(o.end(y),t-d-1),v=fe(m.toLocaleDateString(),w.toLocaleDateString()),S=await q({...i,eventTypes:a,start:new Date(m).toISOString(),end:new Date(w).toISOString()});return{date:v,events:S}}))}async function _(a,e){return(await q({...a,eventTypes:["annotation"]})).filter(o=>!!o.tags&&Object.keys(o.tags).includes(e)).reduce((o,c)=>{const d=c.tags[e];return d in o?(o[d]+=1,o):(o[d]=1,o)},{})}async function pe(a,e,t){const{end:n,start:i}=a,c=B[t].interval({start:new Date(i),end:new Date(n)}),d=c.map((m,w)=>{const v=new Date(m).toISOString(),S=w===c.length-1?new Date(Date.now()).toISOString():new Date(c[w+1]);return _({...a,start:v,end:S},e)}),y=await Promise.all(d);return c.map((m,w)=>({date:new Date(m).toISOString(),annotations:y[w]}))}async function ye(a,e,t,n,i){let o=a;Array.isArray(a)||(o=[a]);let c=e;return Array.isArray(e)||(c=[e]),(await(await fetch(`${h}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:o,end:n.toISOString(),names:c,start:t.toISOString(),tags:i}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function ge(){if(!r.token)throw new Error("Not authenticated");const a=z.get();try{return await a.getSessions()}finally{await a.shutdown()}}async function ve(){if(!r.token)throw new Error("Not authenticated");const a=z.get();try{return await a.getPeers()}finally{await a.shutdown()}}async function lt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/devices`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function ut(a,e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/devices/${a}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function mt(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function ft(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function wt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/devices/${a}/disable`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}class E extends ie{constructor(e,t,n,i){super(),this.id=e,this.name=t,this.organizationId=n,this.tags=i}async getLatestTelemetry(){return(await(await fetch(`${h}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async getConfiguration(e=!1){let t=await fetch(`${h}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}});const n=await t.json();if(!n.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const i=e?n.desiredConfigurationVersion:n.state.reportedConfiguration.version;return t=await fetch(`${h}/v1/admin/devices/${this.id}/configurations/${i}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),(await t.json()).document}async getAgentVersion(){var n;const t=await(await fetch(`${h}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json();return(n=t==null?void 0:t.state)==null?void 0:n.agentVersion}async getFileUrl(e){return(await(await fetch(`${h}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[e]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).fileUrls}async startRealtimeConnection(e={}){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const{sessionType:t,deadlineMs:n=1e4,maxConnectRetries:i=3}=typeof e=="number"?{sessionType:e}:e,c=it({sessionType:t}).get(this.handleMessage);let d=!1;const y=new Promise((w,v)=>setTimeout(()=>{d=!0,v(new Error("Connection timed out: the connection could not be finalized in time, possibly due to network issues or misconfigured settings."))},n)),m=async()=>{if("isReady"in c)for(;!c.isReady();)this.assertNotCancelled(d),await b(100);const w=await this.getRemoteDevicePeerId(c);this.assertNotCancelled(d);let v;for(let A=0;A<i&&(v=await c.connect(w),!v);A++)b(100),this.assertNotCancelled(d);if(!v)throw new Error(`Session could not be created: exhausted ${i} retries`);let S=0;for(;!d&&c.getConnectionStatus(w)!=="connected";)await b(100),S+=1;return this.assertNotCancelled(d),console.debug(`${new Date().toISOString()} :: Connection completed after ${S} retries`),w};return Promise.race([m(),y]).then(w=>{this.remoteDevicePeerId=w,this.initConnectionMonitoring(),this.rtcClient=c,this.emit("connect")}).catch(w=>{throw console.debug(`${new Date().toISOString()} :: Connection failed: %o`,w),this.remoteDevicePeerId=null,c.shutdown().catch(v=>{console.error("rtcClient cannot shutdown: %o",v)}),this.emit("connection_failed",w),w})}async getRemoteDevicePeerId(e){const n=(await e.getPeers()).find(i=>i.deviceId===this.id);if(!rt(n))throw new Error("Cannot find peer, is the robot offline?");return n.id}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let e=!1;if(this.rtcClient){const n=this.rtcClient.getConnections().find(i=>i.getRemotePeerId()===this.remoteDevicePeerId&&i.isActive());(n===void 0||!n.isReady())&&(console.debug(`${new Date().toISOString()} :: data channel closed`),e=!0)}(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0||e)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(t=>{console.error(t)}))},1e3)}async getRemotePeer(){const t=(await f(this.rtcClient,"Realtime connection has not been started").getPeers()).find(n=>n.deviceId===this.id);return f(t,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){let e=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.remoteDevicePeerId?(await this.rtcClient.disconnect(this.remoteDevicePeerId),this.remoteDevicePeerId=null):e=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(e)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){const e=await ve(),t=await ge(),n=e.find(i=>i.deviceId===this.id);return n?t[n.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${h}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items.map(n=>({name:n.name,id:n.id,command:n.command,description:n.description,parameterEnabled:n.parameterEnabled,parameterValue:n.parameterValue,parameterMeta:n.parameterMeta,enabled:n.enabled,tags:n.tags}))}async sendCommand(e,t,n,i){var w;const c=(await this.getAvailableCommands()).find(v=>v.name===e);if(!c)throw new Error(`Could not find command with name "${e}"`);let d="";t===void 0?c.parameterEnabled&&c.parameterValue&&(d=c.parameterValue):d=t;let y={value:d,scrubberTime:(n||new Date).toISOString(),meta:{...c.parameterMeta,...i}};return await fetch(`${h}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:c.id,organizationId:this.organizationId,deviceId:this.id,command:c.command,parameter:y,userId:(w=r.currentUser)==null?void 0:w.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})}async getCommand(e){return await fetch(`${h}/v1/admin/commands/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})}async createCaptureStream(e){const n=await(await fetch(`${h}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:e,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json();return new Y(n)}async getTelemetry(e,t,n,i){return await ye(this.id,e,t,n,i)}async getTelemetryStreams(){var d,y;const e=await this.getConfiguration(),t=await fetch(`${h}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),n=[],i=[];return(y=(d=e.telemetry)==null?void 0:d.streams)==null||y.forEach(m=>{m.disabled!==!0&&n.push(m.name),m.onDemand===!0&&i.push(m.name)}),console.log(i),(await t.json()).items.filter(m=>!n.includes(m)).map(m=>({name:m,onDemand:i.includes(m)}))}async createInterventionRequest(e,t,n,i){return await(await fetch(`${h}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:e,interventionType:t,time:new Date().toISOString(),deviceId:this.id,tags:i,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async addInterventionResponse(e,t,n){return await(await fetch(`${h}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:e,interventionType:t,data:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async getAnnotationCount(e,t){return await _({...e,deviceIds:[this.id]},t)}async getAnnotationCountByIntervals(e,t,n){return await pe({...e,deviceIds:[this.id]},t,n)}async eventsCounter(e,t,n,i,o){return await we(e,t,n,i,{...o,deviceIds:[this.id]})}async createShareLink(e,t){return e.scope.deviceIds=[this.id],await oe(e,t)}}s(E,"createDevice",lt),s(E,"patchDevice",ut),s(E,"getDevicesData",mt),s(E,"queryDevicesData",ft),s(E,"disableDevice",wt);class Te extends ie{constructor(t){super();s(this,"id");s(this,"telemetryStreamActive",!1);s(this,"streamTelemetry",{});this.peerUrl=t}async getLatestTelemetry(){this.telemetryStreamActive||this.subscribeToTelemetry();const t=this.streamTelemetry;return Object.entries(t).map(([i,o])=>({deviceId:this.id,streamName:i,streamType:"json",currentValue:o,currentValueTime:o.timestamp,tags:{}}))}subscribeToTelemetry(){this.telemetryStreamActive=!0;let t=0;const n=new XMLHttpRequest;n.responseType="text",n.addEventListener("error",i=>{this.handleXHRError("error")}),n.addEventListener("abort",i=>{this.handleXHRError("abort")}),n.addEventListener("timeout",i=>{this.handleXHRError("timeout")}),n.addEventListener("readystatechange",i=>{n.readyState===XMLHttpRequest.DONE&&this.handleXHRError("closed")}),n.addEventListener("progress",i=>{const o=i.loaded,c=o-t;t=o,n.responseText.substr(-c).split(`
2
- `).forEach(m=>{var w;if(m.length>0){const v=JSON.parse(m);if((w=v.result)!=null&&w.datapoint){const S=v.result.datapoint,A=S.stream;delete S.stream,this.streamTelemetry[A]=S}}})}),n.open("POST",`${this.peerUrl}/v1/telemetry`),n.send()}handleXHRError(t){console.warn(`Telemetry stream ended: ${t}`),this.telemetryStreamActive=!1}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.document}async startRealtimeConnection(t){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const n=new C.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:t});for(await n.connectLan(this.peerUrl);n.getConnectionStatus(this.peerUrl)!=="connected";)await b(100);this.rtcClient=n,this.initConnectionMonitoring()}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let t=!1;this.rtcClient&&this.rtcClient.getConnectionStatus(this.peerUrl)!=="connected"&&(console.debug(`${new Date().toISOString()} :: data channel closed`),t=!0),(!this.rtcClient||t)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(n=>{console.error(n)}))},1e3)}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){let t=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.id?(await this.rtcClient.disconnect(this.id),this.remoteDevicePeerId=null):t=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(t)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async sendCommand(t,n,i,o){const c={value:n,scrubberTime:(i||new Date).toISOString(),meta:o};return await fetch(`${this.peerUrl}/v1/enqueue-command`,{method:"POST",body:JSON.stringify({command:t,parameter:c}),headers:{"Content-Type":"application/json"}})}}async function pt(a,e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/devices/${a}`,{method:"PATCH",body:JSON.stringify({fleetId:e}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function yt(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/queries/queries`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).aggregates}async function gt(a){if(!r.token)throw new Error("Not authenticated");await fetch(`${h}/v1/admin/fleets/${a}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})}async function vt(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Tt(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Ct(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function Ce(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items.map(n=>new E(n.id,n.name,n.organizationId,n.tags))}async function St(){if(!r.token)throw new Error("Not authenticated");let a=new URLSearchParams("");typeof window<"u"&&window.location&&(a=new URLSearchParams(window.location.search));const e=a.get("group");if(e===null||e.trim()==="")return;const t=await fetch(`${h}/v1/admin/groups/`+e,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),{tagKey:n,tagValue:i}=await t.json();return await Ce({tags:{[n]:[i]},enabled:!0,type:"default"})}async function Et(a){if(!r.token)throw new Error("Not authenticated");const t=await(await fetch(`${h}/v1/admin/devices/${a}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json(),n=t.name;return new E(a,n,t.organizationId,t.tags)}async function x(){if(!r.token)throw new Error("Not authenticated");const e=await(await fetch(`${h}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json();return e.items,e.items.map(t=>new E(t.id,t.name,f(r.currentOrganization),t.tags))}async function kt(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/events/query/id=${a}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Ot(a){const t=await(await fetch(`${h}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[a]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json();if(t.fileUrls.length===0)throw new Error("File not found");return t.fileUrls[0]}async function Rt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/fleets/${a}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function bt(a){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/fleets/${a}/devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function At(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function jt(...a){const e=a.flat().filter(i=>!!i);return e.length===0?[]:(await(await fetch(`${h}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:e}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Pt(){if(!r.token)throw new Error("Not authenticated");const t=(await(await fetch(`${h}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items;return(await x()).filter(i=>t.includes(i.id))}async function Dt(){if(!r.token)throw new Error("Not authenticated");const t=(await(await fetch(`${h}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items.map(i=>i.deviceId);return(await x()).filter(i=>t.includes(i.id))}async function Nt(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items.filter(t=>t.enabled)}async function Lt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function It(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function $t(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/fleets`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Mt(a,e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/fleets/${a}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function zt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/streams/${a.id}`,{method:"PATCH",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function Bt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/views/${a.id}`,{method:"PATCH",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function qt(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function _t(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/fleets`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function xt(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/event-trigger-groups`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}async function Ut(a){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/event-trigger-groups/${a}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}async function Jt(a,e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/event-trigger-groups/${a}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}const l=class l{static async setDefaultDevice(e){l.defaultDeviceId=e}static async getCurrentDevice(){if(!r.token)throw new Error("Not authenticated");if(!l.defaultDeviceId)throw new Error("No known default device");const n=(await(await fetch(`${h}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items.find(c=>c.id===l.defaultDeviceId),i=n.name,o=new E(l.defaultDeviceId,i,f(r.currentOrganization),n.tags);return l.knownContext.push(new WeakRef(o)),o}static async getPeerDevice(e){const t=new Te(e);return t.id=await t.getDeviceId(),t}static async getDevice(e){const t=await Et(e);return l.knownContext.push(new WeakRef(t)),t}};s(l,"defaultDeviceId"),s(l,"knownContext",[]),s(l,"createFleet",_t),s(l,"listFleets",$t),s(l,"getFleet",Rt),s(l,"patchFleet",Mt),s(l,"deleteFleet",gt),s(l,"addDeviceToFleet",pt),s(l,"getFleetDevices",bt),s(l,"aggregateTelemetry",yt),s(l,"createShareLink",oe),s(l,"eventsCounter",we),s(l,"getAnalyticStreams",vt),s(l,"getAnalyticsModules",Tt),s(l,"getAnalyticsRows",Ct),s(l,"getAnnotationCount",_),s(l,"getAnnotationCountByIntervals",pe),s(l,"getCurrentGroup",St),s(l,"getDevices",x),s(l,"getEvent",kt),s(l,"getFileUrl",Ot),s(l,"getInterventions",At),s(l,"getLatestTelemetry",jt),s(l,"getOnlineDevices",Pt),s(l,"getPeers",ve),s(l,"getRealtimeDevices",Dt),s(l,"getRealtimeSessions",ge),s(l,"getStreams",Nt),s(l,"getTaskReportRows",Lt),s(l,"getTaskReportTables",It),s(l,"getTelemetry",ye),s(l,"getViews",re),s(l,"patchStream",zt),s(l,"patchView",Bt),s(l,"queryAnalytics",qt),s(l,"queryDevices",Ce),s(l,"queryEvents",q),s(l,"queryTelemetry",M),s(l,"getAllEventTriggerGroup",xt),s(l,"getEventTriggerGroup",Ut),s(l,"patchEventTriggergroup",Jt);let L=l;class Vt{static async set(e,t,n){try{const i=await fetch(h+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:f(r.currentUser).organizationId,key:e,value:t,tags:n}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),o=await i.json();if(i.status!==200)throw new Error(o.message)}catch(i){throw i}}static async get(e){try{const t=await fetch(h+`/v1/admin/key-value/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.value}catch(t){throw t}}static async list(){try{const e=await fetch(h+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}}),t=await e.json();if(e.status!==200)throw new Error(t.message);return t.items}catch(e){throw e}}static async delete(e){try{if(!(await fetch(h+`/v1/admin/key-value/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).ok)throw new Error("Unable to handle request");return}catch(t){throw t}}static async query(e){try{const t=await fetch(h+"/v1/admin/key-value/query",{method:"POST",body:JSON.stringify({keys:e}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}});if(!t.ok)throw new Error("Unable to handle request");return(await t.json()).items}catch(t){throw t}}}function Ft(a){return Uint8Array.from(G.decode(a),e=>e.charCodeAt(0))}function F(){const{userAgent:a}=navigator;return a?a.includes("Firefox/")?"Firefox":a.includes("Edg/")?"Edge":a.includes("Chrome/")?"Chrome":a.includes("Safari/")?"Safari":a.includes("MSIE/")||a.includes("Trident/")?"IE":"Other":"Other"}const Gt="audio-chunk";class Ht{constructor(e,t){s(this,"muted",!1);s(this,"hasReceivedData",!1);s(this,"audioContext");s(this,"chunks",[]);s(this,"isPlaying",!1);s(this,"startTime",0);s(this,"lastChunkOffset",0);s(this,"bufferSize",3);s(this,"receive",async e=>{var c;const t=(c=e.payload.audioChunk)==null?void 0:c.chunk_data;if(!t)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:n,muted:i}=this;if(!n||e.header.stream.streamType!==Gt||i!==!1)return;const o=Ft(t);try{await n.decodeAudioData(o.buffer,this.scheduleChunk)}catch(d){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:d}),this.changeAudioWireFormat("wav")}});s(this,"scheduleChunk",e=>{const{audioContext:t}=this;if(!t)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(i=>{i.stop()}),this.isPlaying=!1,this.chunks=[]);const n=this.createChunk(e);n&&n.buffer&&(this.isPlaying===!1&&(this.startTime=t.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),n.start(this.startTime+this.lastChunkOffset,0,e.duration),this.lastChunkOffset+=n.buffer.duration,this.chunks.push(n))});this.device=e,this.stream=t,this.device.startListeningToRealtimeDataStream(t),this.device.addRealtimeListener((i,o)=>{this.receive(o)}),F()==="Safari"||F()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const n=window.AudioContext||window.webkitAudioContext;this.audioContext=new n}async play(){var e,t;((e=this.audioContext)==null?void 0:e.state)==="suspended"&&await((t=this.audioContext)==null?void 0:t.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(e){const{audioContext:t}=this;if(!t)return;const n=t.createBufferSource();return n.buffer=e,n.connect(t.destination),n.loop=!1,n.onended=i=>{this.chunks.splice(this.chunks.indexOf(n),1),this.chunks.length===0&&(this.isPlaying=!1)},n}changeAudioWireFormat(e){const{stream:t}=this;(async()=>await this.device.changeStreamAudioType(t.name,e))()}}class Wt{static async listAccounts(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/accounts`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}static async createAccounts(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/accounts`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async getAccount(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/accounts/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async patchAccount(e,t){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/accounts/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async deleteAccount(e){if(!r.token)throw new Error("Not authenticated");if(!(await fetch(`${h}/v1/admin/accounts/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).ok)throw new Error("Unable to delete account")}static async getAccountTree(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/accounts/${e}/tree`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}}class Kt{static async listRoles(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/roles`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}static async createRole(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/roles`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async getRole(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/roles/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async patchRole(e,t){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/roles/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async deleteRole(e){if(!r.token)throw new Error("Not authenticated");await fetch(`${h}/v1/admin/roles/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})}}class Qt{static async listUsers(){if(!r.token)throw new Error("Not authenticated");return(await(await fetch(`${h}/v1/admin/users`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()).items}static async createUser(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/users`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async getUser(e){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/users/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async patchUser(e,t){if(!r.token)throw new Error("Not authenticated");return await(await fetch(`${h}/v1/admin/users/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})).json()}static async deleteUser(e){if(!r.token)throw new Error("Not authenticated");await fetch(`${h}/v1/admin/users/${e}`,{method:"PATCH",body:JSON.stringify({enabled:!1,roleId:null,teamId:null}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+r.token}})}}const Xt=["viewer","operator","administrator"],Yt="viewer",Zt="operator",en="administrator",tn=["year","month","week","day","hour","minute"],nn=["tag","sheet","user"],an=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],rn=["unknown","operational","offline","error"],on=["selection","labeling","teleop"],sn=["info","warning","error","critical"],cn=["video/mp4"],dn=a=>new Promise(e=>setTimeout(e,a*1e3));try{const a=typeof window<"u"&&window.location?new URLSearchParams(window.location.search):new URLSearchParams(""),e=a.get("device");e&&L.setDefaultDevice(e);const t=a.get("auth");t&&r.loginWithToken(t),a.get("module")&&r.listenForRefresh(),typeof window<"u"&&N.listenForConnectionEvents()}catch{}Object.defineProperty(exports,"createRtcStreamMessage",{enumerable:!0,get:()=>C.createRtcStreamMessage});exports.Account=Wt;exports.App=N;exports.AudioPlayer=Ht;exports.Authentication=r;exports.BinaryRequestDataChannel=ne;exports.CaptureStream=Y;exports.DataChannel=Z;exports.Device=E;exports.Fleet=L;exports.KeyValue=Vt;exports.Manipulator=ee;exports.PeerDevice=Te;exports.Role=Kt;exports.SessionType=nt;exports.TextRequestDataChannel=ae;exports.User=Qt;exports.accessLevels=Xt;exports.administrator=en;exports.aggregateByDateFunctions=B;exports.aggregateFunctionMap=ht;exports.aggregateFunctions=dt;exports.aggregateLevels=tn;exports.annotationTypes=nn;exports.eventTypes=an;exports.formatTimeFrameText=fe;exports.getAverage=le;exports.getCount=me;exports.getMax=de;exports.getMin=he;exports.getStandardDeviation=ce;exports.getSum=ue;exports.getVariance=se;exports.healthStatuses=rn;exports.interventionTypes=on;exports.operator=Zt;exports.severities=sn;exports.timeout=dn;exports.vailableAggregationIntervals=ct;exports.videoMimeTypes=cn;exports.viewer=Yt;
1
+ "use strict";var _n=Object.defineProperty;var vn=(e,t,n)=>t in e?_n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var be=(e,t,n)=>(vn(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DEFAULT_FORMANT_API_URL="https://api.formant.io";function whichFormantApiUrl(e,t){try{if(t.get("formant_stage"))return"https://api-stage.formant.io";if(t.get("formant_dev"))return"https://api-dev.formant.io";if(t.get("formant_local"))return"https://api.formant.local";if(t.get("formant_url")){const n=t.get("formant_url");if(n!==null)try{return new URL(n).origin}catch{console.warn(`Ignoring malformed \`formant_url\` url parameter: ${n}`)}}}catch{}return typeof e<"u"&&"FORMANT_API_URL"in e&&typeof e.FORMANT_API_URL=="string"?e.FORMANT_API_URL:DEFAULT_FORMANT_API_URL}const FORMANT_API_URL=whichFormantApiUrl(typeof window<"u"?window:globalThis,new URLSearchParams(typeof window<"u"&&window.location?window.location.search:void 0));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var base64={exports:{}};/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */base64.exports;(function(e,t){(function(n){var r=t,o=e&&e.exports==r&&e,l=typeof commonjsGlobal=="object"&&commonjsGlobal;(l.global===l||l.window===l)&&(n=l);var u=function(f){this.message=f};u.prototype=new Error,u.prototype.name="InvalidCharacterError";var s=function(f){throw new u(f)},g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,d=function(f){f=String(f).replace(c,"");var p=f.length;p%4==0&&(f=f.replace(/==?$/,""),p=f.length),(p%4==1||/[^+a-zA-Z0-9/]/.test(f))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var S=0,N,B,E="",T=-1;++T<p;)B=g.indexOf(f.charAt(T)),N=S%4?N*64+B:B,S++%4&&(E+=String.fromCharCode(255&N>>(-2*S&6)));return E},w=function(f){f=String(f),/[^\0-\xFF]/.test(f)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var p=f.length%3,S="",N=-1,B,E,T,h,R=f.length-p;++N<R;)B=f.charCodeAt(N)<<16,E=f.charCodeAt(++N)<<8,T=f.charCodeAt(++N),h=B+E+T,S+=g.charAt(h>>18&63)+g.charAt(h>>12&63)+g.charAt(h>>6&63)+g.charAt(h&63);return p==2?(B=f.charCodeAt(N)<<8,E=f.charCodeAt(++N),h=B+E,S+=g.charAt(h>>10)+g.charAt(h>>4&63)+g.charAt(h<<2&63)+"="):p==1&&(h=f.charCodeAt(N),S+=g.charAt(h>>2)+g.charAt(h<<4&63)+"=="),S},v={encode:w,decode:d,version:"1.0.0"};if(r&&!r.nodeType)if(o)o.exports=v;else for(var y in v)v.hasOwnProperty(y)&&(r[y]=v[y]);else n.base64=v})(commonjsGlobal)})(base64,base64.exports);var base64Exports=base64.exports;class LoginFailureError extends Error{constructor(n){super("login failed");be(this,"reason");this.reason=n,this.name="LoginFailureError",Object.setPrototypeOf(this,new.target.prototype)}}class LoginChallengedError extends Error{constructor(n){super("login challenged");be(this,"challenge");this.challenge=n,this.name="LoginChallengedError",Object.setPrototypeOf(this,new.target.prototype)}}class AuthenticationStore{constructor({apiUrl:t,refreshAuthToken:n,addAccessTokenRefreshListener:r}){be(this,"_refreshToken");be(this,"_isShareToken",!1);be(this,"_currentOrganization");be(this,"_currentUser");be(this,"_defaultDeviceId");be(this,"_token");be(this,"_waitingForAuth",new Set);be(this,"_refreshTimer");be(this,"_apiUrl");be(this,"_refreshAuthToken");be(this,"_addAccessTokenRefreshListener");this._apiUrl=t,this._refreshAuthToken=n,this._addAccessTokenRefreshListener=r}get token(){return this._token}get currentUser(){return this._currentUser}get currentOrganization(){return this._currentOrganization}get defaultDeviceId(){return this._defaultDeviceId}get refreshToken(){return this._refreshToken}get isShareToken(){return this._isShareToken}async login(t,n,r={}){const{advanced:o=!1}=r;try{const l=await fetch(`${this._apiUrl}/v1/admin/auth/login`,{method:"POST",body:JSON.stringify({email:t,password:n}),headers:{"Content-Type":"application/json"}}),u=await l.json();if(l.status!==200)throw new LoginFailureError(u.message);if("challenge"in u)throw new LoginChallengedError(u.challenge);const{authentication:s}=u;return await this.loginWithToken(s.accessToken,s.refreshToken),o?{result:"success",authentication:s}:s}catch(l){if(o||console.error("login() failed",{err:l}),this._waitingForAuth.forEach(u=>u(!1)),this._waitingForAuth.clear(),!o)throw l;return l instanceof LoginChallengedError?{result:"challenged",challenge:l.challenge}:{result:"failure",reason:l instanceof LoginFailureError?l.reason:l instanceof Error?l.message:String(l)}}}async loginWithToken(t,n){var o;const r=JSON.parse(base64Exports.decode(t.split(".")[1]));try{let l;if(this._isShareToken=r["formant:claims"]&&r["formant:claims"].type=="share",r["formant:claims"]&&(this._currentOrganization=r["formant:claims"].organizationId),r["custom:organization_id"]&&(this._currentOrganization=r["custom:organization_id"]),this._isShareToken||(l=r.sub),r["formant:claims"]&&r["formant:claims"].userId&&(l=r["formant:claims"].userId),l&&((o=this._currentUser)==null?void 0:o.id)!==l){const u=await fetch(`${this._apiUrl}/v1/admin/users/${l}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+t}}),s=await u.json();if(u.status!==200)throw new Error(s.message);this._currentUser=s}this._token=t,this._waitingForAuth.forEach(u=>u(!0))}catch(l){console.error("loginWithToken() failed",{err:l}),this._waitingForAuth.forEach(u=>u(!1))}finally{this._waitingForAuth.clear()}n&&(this._refreshToken=n,setInterval(async()=>{if(this._refreshToken){const u=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this._refreshToken})})).json();this._token=u.authentication.accessToken}},1e3*60*60))}isAuthenticated(){return this._token!==void 0}async loginToPeer(t,n){if((await fetch(`${t}/login`,{method:"POST",body:JSON.stringify({password:n}),headers:{"Content-Type":"application/json"}})).status!==200)throw new LoginFailureError("Invalid authentication")}getCurrentUser(){return this._currentUser}async waitTilAuthenticated(){return this.token!==void 0?!0:new Promise(t=>{this._waitingForAuth.add(t)})}async listenForRefresh(){const n=()=>{this._refreshTimer=void 0,this._refreshAuthToken()};this._addAccessTokenRefreshListener(r=>{this._refreshTimer&&clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(n,36e5),this.loginWithToken(r)}),this._refreshTimer=setTimeout(n,36e5)}async forgotPassword(t){await fetch(`${this._apiUrl}/v1/admin/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:t}),headers:{"Content-Type":"application/json"}})}async confirmForgotPassword(t){return(await fetch(`${this._apiUrl}/v1/admin/auth/confirm-forgot-password`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).ok}async respondToNewPasswordRequiredChallenge(t){const n=await fetch(`${this._apiUrl}/v1/admin/auth/respond-to-new-password-required-challenge`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});if(n.ok)return await n.json();throw new Error("respond-to-new-password-required-challenge failed")}async loginWithGoogle(t){return await(await fetch(`${this._apiUrl}/v1/admin/auth/login-google`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).json()}async refresh(t){const r=await(await fetch(`${this._apiUrl}/v1/admin/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})})).json();await this.loginWithToken(r.authentication.accessToken,t)}async checkSso(t,n){return await(await fetch(`${this._apiUrl}/v1/admin/auth/check-sso`,{method:"POST",body:JSON.stringify({email:t,allowUserAutoCreation:n}),headers:{"Content-Type":"application/json"}})).json()}async loginWithSso(t,n){const o=await(await fetch(`${this._apiUrl}/v1/admin/auth/login-sso`,{method:"POST",body:JSON.stringify({token:t,refreshToken:n}),headers:{"Content-Type":"application/json"}})).json();if(!o.authentication)throw new Error("Failed to login with SSO");return await this.loginWithToken(o.authentication.accessToken,o.authentication.refreshToken)}}function getCurrentModuleContext(){return typeof window<"u"&&window.location?new URLSearchParams(window.location.search).get("module"):null}function sendAppMessage(e){if(!(window&&window.parent))throw new Error("cannot send message to non-existent parent");window.parent.postMessage(e,"*")}function refreshAuthToken(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"refresh_auth_token",module:e})}function addAccessTokenRefreshListener(e){function t(n){const r=n.data;r.type==="auth_token"&&e(r.token)}return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}const Authentication=new AuthenticationStore({apiUrl:FORMANT_API_URL,refreshAuthToken,addAccessTokenRefreshListener});async function getModuleConfiguration(e){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/module-configurations/${e}`,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).configuration}function disableAnalyticsBottomBar(){sendAppMessage({type:"hide_analytics_date_picker"})}function goToDevice(e){sendAppMessage({type:"go_to_device",deviceId:e})}function goToTime(e){sendAppMessage({type:"go_to_time",time:e.getTime()})}function requestModuleData(){const e=getCurrentModuleContext();if(!e)throw new Error("No module context");sendAppMessage({type:"request_module_data",module:e})}function sendChannelData(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"send_channel_data",source:n,channel:e,data:t})}function setModuleDateTimeRange(e,t){const n=getCurrentModuleContext();if(!n)throw new Error("No module context");sendAppMessage({type:"set_module_data_time_range",module:n,before:e,after:t||0})}function setupModuleMenus(e){const t=getCurrentModuleContext();if(!t)throw new Error("No module context");sendAppMessage({type:"setup_module_menus",module:t,menus:e})}function showMessage(e){sendAppMessage({type:"show_message",message:e})}function addChannelDataListener(e,t){const n=r=>{const o=r.data;o.type==="channel_data"&&o.channel===e&&t({source:o.source,data:o.data})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addMenuListener(e){const t=n=>{const r=n.data;r.type==="module_menu_item_clicked"&&e(r.menu)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleConfigurationListener(e){const t=n=>{const r=n.data;r.type==="module_configuration"&&e(r)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function addModuleDataListener(e){const t=getCurrentModuleContext();t&&sendAppMessage({type:"request_module_data",module:t});const n=r=>{const o=r.data;o.type==="module_data"&&e({streams:o.streams,time:o.time,queryRange:o.queryRange})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function addOverviewDeviceListener(e){sendAppMessage({type:"request_devices"});const t=n=>{const r=n.data;r.type==="overview_devices"&&e(r.data)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function _typeof(e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function toInteger(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function requiredArgs(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function toDate(e){requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||_typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function addDays(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function addMonths(e,t){requiredArgs(2,arguments);var n=toDate(e),r=toInteger(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),l=new Date(n.getTime());l.setMonth(n.getMonth()+r+1,0);var u=l.getDate();return o>=u?l:(n.setFullYear(l.getFullYear(),l.getMonth(),o),n)}function addMilliseconds(e,t){requiredArgs(2,arguments);var n=toDate(e).getTime(),r=toInteger(t);return new Date(n+r)}var MILLISECONDS_IN_HOUR=36e5;function addHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_HOUR)}var defaultOptions={};function getDefaultOptions(){return defaultOptions}function startOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),y=v.getDay(),f=(y<w?7:0)+y-w;return v.setDate(v.getDate()-f),v.setHours(0,0,0,0),v}function startOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(0,0,0,0),t}var MILLISECONDS_IN_MINUTE=6e4;function addMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*MILLISECONDS_IN_MINUTE)}function addQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*3;return addMonths(e,r)}function addSeconds(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMilliseconds(e,n*1e3)}function addWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t),r=n*7;return addDays(e,r)}function addYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,n*12)}function getQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=Math.floor(t.getMonth()/3)+1;return n}var roundingMap={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},defaultRoundingMethod="trunc";function getRoundingMethod(e){return e?roundingMap[e]:roundingMap[defaultRoundingMethod]}function endOfDay(e){requiredArgs(1,arguments);var t=toDate(e);return t.setHours(23,59,59,999),t}function endOfMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function eachDayOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=l.getTime();if(!(o.getTime()<=u))throw new RangeError("Invalid interval");var s=[],g=o;g.setHours(0,0,0,0);var c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g.setDate(g.getDate()+c),g.setHours(0,0,0,0);return s}function eachHourOfInterval(e,t){var n;requiredArgs(1,arguments);var r=e||{},o=toDate(r.start),l=toDate(r.end),u=o.getTime(),s=l.getTime();if(!(u<=s))throw new RangeError("Invalid interval");var g=[],c=o;c.setMinutes(0,0,0);var d=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=s;)g.push(toDate(c)),c=addHours(c,d);return g}function startOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(0,0),t}function eachMinuteOfInterval(e,t){var n;requiredArgs(1,arguments);var r=startOfMinute(toDate(e.start)),o=toDate(e.end),l=r.getTime(),u=o.getTime();if(l>=u)throw new RangeError("Invalid interval");var s=[],g=r,c=Number((n=t==null?void 0:t.step)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number equal to or greater than 1");for(;g.getTime()<=u;)s.push(toDate(g)),g=addMinutes(g,c);return s}function eachMonthOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime(),l=[];if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var u=n;for(u.setHours(0,0,0,0),u.setDate(1);u.getTime()<=o;)l.push(toDate(u)),u.setMonth(u.getMonth()+1);return l}function startOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function eachQuarterOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=startOfQuarter(n),u=startOfQuarter(r);o=u.getTime();for(var s=[],g=l;g.getTime()<=o;)s.push(toDate(g)),g=addQuarters(g,1);return s}function eachWeekOfInterval(e,t){requiredArgs(1,arguments);var n=e||{},r=toDate(n.start),o=toDate(n.end),l=o.getTime();if(!(r.getTime()<=l))throw new RangeError("Invalid interval");var u=startOfWeek(r,t),s=startOfWeek(o,t);u.setHours(15),s.setHours(15),l=s.getTime();for(var g=[],c=u;c.getTime()<=l;)c.setHours(0),g.push(toDate(c)),c=addWeeks(c,1),c.setHours(15);return g}function startOfMonth(e){requiredArgs(1,arguments);var t=toDate(e);return t.setDate(1),t.setHours(0,0,0,0),t}function endOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function startOfYear(e){requiredArgs(1,arguments);var t=toDate(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eachYearOfInterval(e){requiredArgs(1,arguments);var t=e||{},n=toDate(t.start),r=toDate(t.end),o=r.getTime();if(!(n.getTime()<=o))throw new RangeError("Invalid interval");var l=[],u=n;for(u.setHours(0,0,0,0),u.setMonth(0,1);u.getTime()<=o;)l.push(toDate(u)),u.setFullYear(u.getFullYear()+1);return l}function endOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(59,59,999),t}function endOfWeek(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&o!==void 0?o:d.weekStartsOn)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=toDate(e),y=v.getDay(),f=(y<w?-7:0)+6-(y-w);return v.setDate(v.getDate()+f),v.setHours(23,59,59,999),v}function endOfMinute(e){requiredArgs(1,arguments);var t=toDate(e);return t.setSeconds(59,999),t}function endOfQuarter(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth(),r=n-n%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function getDay(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getDay();return n}function getHours(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getHours();return n}function getMinutes(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMinutes();return n}function getMonth(e){requiredArgs(1,arguments);var t=toDate(e),n=t.getMonth();return n}function getWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=toDate(e),w=d.getFullYear(),v=getDefaultOptions(),y=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:v.firstWeekContainsDate)!==null&&r!==void 0?r:(g=v.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(y>=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setFullYear(w+1,0,y),f.setHours(0,0,0,0);var p=startOfWeek(f,t),S=new Date(0);S.setFullYear(w,0,y),S.setHours(0,0,0,0);var N=startOfWeek(S,t);return d.getTime()>=p.getTime()?w+1:d.getTime()>=N.getTime()?w:w-1}function startOfWeekYear(e,t){var n,r,o,l,u,s,g,c;requiredArgs(1,arguments);var d=getDefaultOptions(),w=toInteger((n=(r=(o=(l=t==null?void 0:t.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(u=t.locale)===null||u===void 0||(s=u.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&o!==void 0?o:d.firstWeekContainsDate)!==null&&r!==void 0?r:(g=d.locale)===null||g===void 0||(c=g.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),v=getWeekYear(e,t),y=new Date(0);y.setFullYear(v,0,w),y.setHours(0,0,0,0);var f=startOfWeek(y,t);return f}var MILLISECONDS_IN_WEEK=6048e5;function getWeek(e,t){requiredArgs(1,arguments);var n=toDate(e),r=startOfWeek(n,t).getTime()-startOfWeekYear(n,t).getTime();return Math.round(r/MILLISECONDS_IN_WEEK)+1}function getYear(e){return requiredArgs(1,arguments),toDate(e).getFullYear()}function startOfHour(e){requiredArgs(1,arguments);var t=toDate(e);return t.setMinutes(0,0,0),t}function subDays(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addDays(e,-n)}function roundToNearestMinutes(e,t){var n;if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=toInteger((n=t==null?void 0:t.nearestTo)!==null&&n!==void 0?n:1);if(r<1||r>30)throw new RangeError("`options.nearestTo` must be between 1 and 30");var o=toDate(e),l=o.getSeconds(),u=o.getMinutes()+l/60,s=getRoundingMethod(t==null?void 0:t.roundingMethod),g=s(u/r)*r,c=u%r,d=Math.round(c/r)*r;return new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),g+d)}function subMonths(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMonths(e,-n)}function subHours(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addHours(e,-n)}function subMinutes(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addMinutes(e,-n)}function subQuarters(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addQuarters(e,-n)}function subWeeks(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addWeeks(e,-n)}function subYears(e,t){requiredArgs(2,arguments);var n=toInteger(t);return addYears(e,-n)}const millisecond=1,second=1e3,minute=60*second,hour=60*minute,day=24*hour,week=7*day,month=30*day,year=365*day,duration={millisecond,second,minute,hour,day,week,month,year};function filterDataByType(e,t){return e.filter(n=>t.includes(n.type))}function filterDataByTime(e,t,n){const r=t.getTime(),o=n.getTime();return e.map(l=>({...l,points:l.points.filter(([u])=>u>=r&&u<o)})).filter(({points:l})=>l.length>0)}class StoreCache{constructor({capacity:t,timeout:n}={}){be(this,"entries",new Map);be(this,"metadata",new Map);be(this,"capacity");be(this,"staleIntervalMs");this.capacity=t||1e4,this.staleIntervalMs=n||duration.minute}get(t,n){const r=this.keyToCacheKey(t);return this.isStale(r)&&!this.isGenerating(r)&&n&&this.generate(t,n),this.entries.get(r)}set(t,n){const r=this.keyToCacheKey(t);this.metadata.set(r,{generating:!1,staleAt:performance.now()+this.staleIntervalMs});const o=this.entries.get(r);JSON.stringify(o)===JSON.stringify(n)||(this.entries.set(r,n),this.enforceMaxSize())}clear(){this.entries.clear(),[...this.metadata.values()].forEach(t=>t.generating=!1)}clearKey(t){this.metadata.delete(t),this.entries.delete(t)}keyToCacheKey(t){return JSON.stringify(t)}enforceMaxSize(){for(;this.metadata.size>this.capacity&&this.metadata.size>0;){const[t]=[...this.metadata.entries()].reduce(([n,r],[o,l])=>l.staleAt<r.staleAt?[o,l]:[n,r]);this.clearKey(t)}}isStale(t){const n=this.metadata.get(t);return n?(n==null?void 0:n.staleAt)<performance.now():!0}isGenerating(t){const n=this.metadata.get(t);return n?n.generating:!1}generate(t,n){const r=this.keyToCacheKey(t),o=this.metadata.get(r)||{},l=n().then(u=>{const s=this.metadata.get(r);return(s==null?void 0:s.generating)!==l||this.set(t,u),u}).catch(u=>{throw this.metadata.delete(r),u});this.metadata.set(r,{...o,generating:l,staleAt:performance.now()+this.staleIntervalMs})}}async function queryTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}class QueryStore{constructor(){be(this,"queryStoreCache",new StoreCache({capacity:1e4,timeout:20*duration.second}));be(this,"liveQueryStoreCache",new StoreCache({capacity:1e4,timeout:200*duration.millisecond}))}moduleQuery(t,n,r,o,l,u=!1){const s={...t,names:[...n],types:[...r]},g=this.query(s,o,l,u);return g===void 0||g==="too much data"?g:filterDataByType(g,r)}query(t,n,r,o=!1){const l={...t,start:startOfMinute(n).toISOString(),end:o?r.toISOString():addMinutes(roundToNearestMinutes(r),1).toISOString(),latestOnly:o},u=r>addSeconds(new Date,-20);let s;return u?s=this.liveQueryCache(l):s=this.queryCache(l),!s||s==="too much data"||o?s:filterDataByTime(s,n,r)}queryCache(t){return this.queryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}liveQueryCache(t){return this.liveQueryStoreCache.get(t,async()=>{try{return await queryTelemetry(t)}catch(n){throw n}})}}const queryStore=new QueryStore;function addStreamListener(e,t,n){const r=o=>{const l=o.data;if(l.type==="module_data"){const{start:u,end:s}=l.queryRange;n(queryStore.moduleQuery({},e,t,new Date(u),new Date(s),!1))}};return window.addEventListener("message",r),()=>window.removeEventListener("message",r)}async function getDate(e,t,n){return new Promise(r=>{sendAppMessage({type:"request_date",minTime:t,maxTime:n,time:e});const o=l=>{const u=l.data;u.type==="date_response"&&(window.removeEventListener("message",o),r(u.data))};window.addEventListener("message",o)})}async function prompt(e,t){return new Promise(n=>{const r=Math.random().toString();sendAppMessage({type:"prompt",promptId:r,schema:e,okText:t==null?void 0:t.okText,cancelText:t==null?void 0:t.cancelText});const o=l=>{const u=l.data;u.type==="prompt_response"&&u.promptId===r&&n(u.data),window.removeEventListener("message",o)};window.addEventListener("message",o)})}const Ge=class Ge{static isModule(){return getCurrentModuleContext()!==null}static async getCurrentModuleConfiguration(){let t=new URLSearchParams("");typeof window<"u"&&window.location&&(t=new URLSearchParams(window.location.search));const n=t.get("configuration");if(!(n===null||n.trim()===""))return getModuleConfiguration(n.trim())}static get isOnline(){return Ge._isOnline}static listenForConnectionEvents(){const t=n=>{const{data:r}=n;r.type==="formant_online"&&(this._isOnline=r.online)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}static checkConnection(t=1e3){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("deadline expired: took too long")),t),l=u=>{window.removeEventListener("message",l),clearTimeout(o);const{data:s}=u;s.type==="formant_online"&&(this._isOnline=s.online,n(s.online))};window.addEventListener("message",l),sendAppMessage({type:"formant_online"})})}static waitForConnection(t=5e3){let n=!1;const r=new Promise((u,s)=>{setTimeout(()=>{n=!0,s(new Error("deadline expired: took too long"))},t)}),o=u=>new Promise(s=>setTimeout(s,u)),l=async()=>{for(await o(50);!n&&!(this.isOnline||await this.checkConnection);)await o(500)};return Promise.race([r,l()])}};be(Ge,"getCurrentModuleContext",getCurrentModuleContext),be(Ge,"disableAnalyticsBottomBar",disableAnalyticsBottomBar),be(Ge,"goToDevice",goToDevice),be(Ge,"goToTime",goToTime),be(Ge,"refreshAuthToken",refreshAuthToken),be(Ge,"requestModuleData",requestModuleData),be(Ge,"sendChannelData",sendChannelData),be(Ge,"setModuleDateTimeRange",setModuleDateTimeRange),be(Ge,"setupModuleMenus",setupModuleMenus),be(Ge,"showMessage",showMessage),be(Ge,"addAccessTokenRefreshListener",addAccessTokenRefreshListener),be(Ge,"addChannelDataListener",addChannelDataListener),be(Ge,"addMenuListener",addMenuListener),be(Ge,"addModuleConfigurationListener",addModuleConfigurationListener),be(Ge,"addModuleDataListener",addModuleDataListener),be(Ge,"addOverviewDeviceListener",addOverviewDeviceListener),be(Ge,"addStreamListener",addStreamListener),be(Ge,"getDate",getDate),be(Ge,"prompt",prompt),be(Ge,"_isOnline",null);let App=Ge;function defined(e,t){if(e!==void 0)return e;throw new Error(t||"Value is undefined")}var dist={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(module,exports){(function(e,t){module.exports=t()})(window,function(){return function(e){function t(c){for(var d,w,v=c[0],y=c[1],f=0,p=[];f<v.length;f++)w=v[f],Object.prototype.hasOwnProperty.call(r,w)&&r[w]&&p.push(r[w][0]),r[w]=0;for(d in y)Object.prototype.hasOwnProperty.call(y,d)&&(e[d]=y[d]);for(g&&g(c);p.length;)p.shift()()}var n={},r={0:0};function o(c){if(n[c])return n[c].exports;var d=n[c]={i:c,l:!1,exports:{}};return e[c].call(d.exports,d,d.exports,o),d.l=!0,d.exports}o.e=function(){return Promise.resolve()},o.m=e,o.c=n,o.d=function(c,d,w){o.o(c,d)||Object.defineProperty(c,d,{enumerable:!0,get:w})},o.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},o.t=function(c,d){if(1&d&&(c=o(c)),8&d||4&d&&typeof c=="object"&&c&&c.__esModule)return c;var w=Object.create(null);if(o.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:c}),2&d&&typeof c!="string")for(var v in c)o.d(w,v,(function(y){return c[y]}).bind(null,v));return w},o.n=function(c){var d=c&&c.__esModule?function(){return c.default}:function(){return c};return o.d(d,"a",d),d},o.o=function(c,d){return Object.prototype.hasOwnProperty.call(c,d)},o.p="",o.oe=function(c){throw console.error(c),c};var l=window.webpackJsonpFormantRealtimeSDK=window.webpackJsonpFormantRealtimeSDK||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var g=u;return o(o.s=232)}([function(e,t,n){n.d(t,"a",function(){return I});var r=n(16),o=n(55),l=n(15),u=n.n(l),s=n(18);function g(K,Y){if(Y.length<K)throw new TypeError(K+" argument"+(K>1?"s":"")+" required, but only "+Y.length+" present")}function c(K){if(K===null||K===!0||K===!1)return NaN;var Y=Number(K);return isNaN(Y)?Y:Y<0?Math.ceil(Y):Math.floor(Y)}var d={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},w=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,v=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,y=/^([+-])(\d{2})(?::?(\d{2}))?$/;function f(K){var Y,ne={},ie=K.split(d.dateTimeDelimiter);if(ie.length>2)return ne;if(/:/.test(ie[0])?Y=ie[0]:(ne.date=ie[0],Y=ie[1],d.timeZoneDelimiter.test(ne.date)&&(ne.date=K.split(d.timeZoneDelimiter)[0],Y=K.substr(ne.date.length,K.length))),Y){var ue=d.timezone.exec(Y);ue?(ne.time=Y.replace(ue[1],""),ne.timezone=ue[1]):ne.time=Y}return ne}function p(K,Y){var ne=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+Y)+"})|(\\d{2}|[+-]\\d{"+(2+Y)+"})$)"),ie=K.match(ne);if(!ie)return{year:NaN,restDateString:""};var ue=ie[1]?parseInt(ie[1]):null,we=ie[2]?parseInt(ie[2]):null;return{year:we===null?ue:100*we,restDateString:K.slice((ie[1]||ie[2]).length)}}function S(K,Y){if(Y===null)return new Date(NaN);var ne=K.match(w);if(!ne)return new Date(NaN);var ie=!!ne[4],ue=N(ne[1]),we=N(ne[2])-1,Oe=N(ne[3]),Ee=N(ne[4]),De=N(ne[5])-1;if(ie)return function(Ae,Ie,ze){return Ie>=1&&Ie<=53&&ze>=0&&ze<=6}(0,Ee,De)?function(Ae,Ie,ze){var $e=new Date(0);$e.setUTCFullYear(Ae,0,4);var nt=$e.getUTCDay()||7,_t=7*(Ie-1)+ze+1-nt;return $e.setUTCDate($e.getUTCDate()+_t),$e}(Y,Ee,De):new Date(NaN);var Te=new Date(0);return function(Ae,Ie,ze){return Ie>=0&&Ie<=11&&ze>=1&&ze<=(h[Ie]||(R(Ae)?29:28))}(Y,we,Oe)&&function(Ae,Ie){return Ie>=1&&Ie<=(R(Ae)?366:365)}(Y,ue)?(Te.setUTCFullYear(Y,we,Math.max(ue,Oe)),Te):new Date(NaN)}function N(K){return K?parseInt(K):1}function B(K){var Y=K.match(v);if(!Y)return NaN;var ne=E(Y[1]),ie=E(Y[2]),ue=E(Y[3]);return function(we,Oe,Ee){return we===24?Oe===0&&Ee===0:Ee>=0&&Ee<60&&Oe>=0&&Oe<60&&we>=0&&we<25}(ne,ie,ue)?36e5*ne+6e4*ie+1e3*ue:NaN}function E(K){return K&&parseFloat(K.replace(",","."))||0}function T(K){if(K==="Z")return 0;var Y=K.match(y);if(!Y)return 0;var ne=Y[1]==="+"?-1:1,ie=parseInt(Y[2]),ue=Y[3]&&parseInt(Y[3])||0;return function(we,Oe){return Oe>=0&&Oe<=59}(0,ue)?ne*(36e5*ie+6e4*ue):NaN}var h=[31,null,31,30,31,30,31,31,30,31,30,31];function R(K){return K%400==0||K%4==0&&K%100!=0}function W(K){return(W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function X(K){return g(1,arguments),K instanceof Date||W(K)==="object"&&Object.prototype.toString.call(K)==="[object Date]"}function m(K){return(m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y})(K)}function b(K){g(1,arguments);var Y=Object.prototype.toString.call(K);return K instanceof Date||m(K)==="object"&&Y==="[object Date]"?new Date(K.getTime()):typeof K=="number"||Y==="[object Number]"?new Date(K):(typeof K!="string"&&Y!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function G(K){const Y=function(ne,ie){var ue;g(1,arguments);var we=c((ue=ie==null?void 0:ie.additionalDigits)!==null&&ue!==void 0?ue:2);if(we!==2&&we!==1&&we!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(typeof ne!="string"&&Object.prototype.toString.call(ne)!=="[object String]")return new Date(NaN);var Oe,Ee=f(ne);if(Ee.date){var De=p(Ee.date,we);Oe=S(De.restDateString,De.year)}if(!Oe||isNaN(Oe.getTime()))return new Date(NaN);var Te,Ae=Oe.getTime(),Ie=0;if(Ee.time&&(Ie=B(Ee.time),isNaN(Ie)))return new Date(NaN);if(!Ee.timezone){var ze=new Date(Ae+Ie),$e=new Date(0);return $e.setFullYear(ze.getUTCFullYear(),ze.getUTCMonth(),ze.getUTCDate()),$e.setHours(ze.getUTCHours(),ze.getUTCMinutes(),ze.getUTCSeconds(),ze.getUTCMilliseconds()),$e}return Te=T(Ee.timezone),isNaN(Te)?new Date(NaN):new Date(Ae+Ie+Te)}(K);if(!function(ne){if(g(1,arguments),!X(ne)&&typeof ne!="number")return!1;var ie=b(ne);return!isNaN(Number(ie))}(Y))throw new Error(`Invalid ISO 8601 date string (${K})`);return Y}const j=Math.pow(2,20),C=j;var z=n(4),P=n(28);function D(K){return u()(K,{cycles:!0})}var O=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};function L(K,Y={}){const{redacted:ne=!0}=Y,ie=De=>ne?Object(P.a)(De):De;if(!K.stack)return{message:D(ie(K))};const{name:ue,message:we,stack:Oe}=K,Ee=O(K,["name","message","stack"]);return{name:ue,message:we!==void 0?we:D(ie(K)),stack:Oe,meta:Ee&&Object.keys(Ee).length===0?void 0:ie(Ee)}}function U(K,Y={}){const{message:ne,stack:ie,meta:ue}=L(K,Y);return`${ie||ne||""}${ue&&Object.keys(ue).length>0?` -- ${D(ue)}`:""}`}var A=n(40),V=n(14),q=n.n(V),Q=function(K,Y,ne,ie){return new(ne||(ne=Promise))(function(ue,we){function Oe(Te){try{De(ie.next(Te))}catch(Ae){we(Ae)}}function Ee(Te){try{De(ie.throw(Te))}catch(Ae){we(Ae)}}function De(Te){var Ae;Te.done?ue(Te.value):(Ae=Te.value,Ae instanceof ne?Ae:new ne(function(Ie){Ie(Ae)})).then(Oe,Ee)}De((ie=ie.apply(K,Y||[])).next())})},ee=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};class te extends q.a{constructor(Y,ne){super(),this.endpoint=Y,this.metadata=ne,this.logClient=this.getLogClient()}getLogClient(){return Q(this,void 0,void 0,function*(){const{LogClient:Y}=yield Promise.resolve().then(n.bind(null,235));return new Y(this.endpoint)})}log(Y,ne){return Q(this,void 0,void 0,function*(){const{level:ie,message:ue,error:we}=Y,Oe=ee(Y,["level","message","error"]);this.emit("logged");try{yield(yield this.logClient).log([{timestamp:new Date().toISOString(),level:ie,message:`${ue}`.substring(0,1e3),error:we!==void 0?L(we):void 0,meta:Object.assign(Object.assign({},Oe),this.metadata)}])}catch(Ee){console.error(`Failed to log to log-api: ${U(Ee)}`)}ne()})}}var k=function(K,Y){var ne={};for(var ie in K)Object.prototype.hasOwnProperty.call(K,ie)&&Y.indexOf(ie)<0&&(ne[ie]=K[ie]);if(K!=null&&typeof Object.getOwnPropertySymbols=="function"){var ue=0;for(ie=Object.getOwnPropertySymbols(K);ue<ie.length;ue++)Y.indexOf(ie[ue])<0&&Object.prototype.propertyIsEnumerable.call(K,ie[ue])&&(ne[ie[ue]]=K[ie[ue]])}return ne};const x={app:z.a,namespace:z.i,buildTag:z.b,instanceId:A.a},_=z.e?s.format.printf(K=>{var{timestamp:Y,level:ne,message:ie,error:ue}=K,we=k(K,["timestamp","level","message","error"]);const Oe=Object.assign(Object.assign({timestamp:Y?G(Y).getTime():new Date().getTime(),level:ne.toUpperCase(),message:ie},ue?{error:L(ue)}:{}),{meta:Object.assign(Object.assign({},x),we)});return u()(Oe,{cycles:!0})}):s.format.printf(K=>{var{timestamp:Y,level:ne,message:ie,error:ue}=K,we=k(K,["timestamp","level","message","error"]);let Oe=`${Y||new Date().toISOString()} ${ne.toUpperCase()}: ${ie} `;return Object.keys(we).length>0&&(Oe+=u()(we,{cycles:!0})),ue&&(Oe+=`
2
+ ${U(ue)}`),Oe}),I=Object(s.createLogger)({level:z.f});if(I.add(new s.transports.Console({format:_,level:"debug"})),I.transports.forEach(K=>{K.silent=!z.g}),z.d&&I.add(new te(z.d,x)),z.h){const K=o.resolve(r.tmpdir(),`silly-${z.a}.log`);I.debug("Logging silly logs to file",{filename:K}),I.add(new s.transports.File({filename:K,maxsize:1*C,maxFiles:10,format:s.format.combine(($="silly",Object(s.format)(Y=>Y.level===$&&Y)()),_),level:"silly"}))}var $},function(e,t,n){n.d(t,"a",function(){return r});const r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}},function(e,t){var n,r,o=e.exports={};function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(S){if(n===setTimeout)return setTimeout(S,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(S,0);try{return n(S,0)}catch{try{return n.call(null,S,0)}catch{return n.call(this,S,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:l}catch{n=l}try{r=typeof clearTimeout=="function"?clearTimeout:u}catch{r=u}})();var g,c=[],d=!1,w=-1;function v(){d&&g&&(d=!1,g.length?c=g.concat(c):w=-1,c.length&&y())}function y(){if(!d){var S=s(v);d=!0;for(var N=c.length;N;){for(g=c,c=[];++w<N;)g&&g[w].run();w=-1,N=c.length}g=null,d=!1,function(B){if(r===clearTimeout)return clearTimeout(B);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(B);try{r(B)}catch{try{return r.call(null,B)}catch{return r.call(this,B)}}}(S)}}function f(S,N){this.fun=S,this.array=N}function p(){}o.nextTick=function(S){var N=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)N[B-1]=arguments[B];c.push(new f(S,N)),c.length!==1||d||s(y)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(S){return[]},o.binding=function(S){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(S){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")}),Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")}),Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")}),Object.defineProperty(t,"configs",{value:n(116)})},function(e,t,n){(function(r){n.d(t,"a",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"j",function(){return g}),n.d(t,"b",function(){return c}),n.d(t,"f",function(){return d}),n.d(t,"e",function(){return w}),n.d(t,"g",function(){return v}),n.d(t,"d",function(){return y}),n.d(t,"c",function(){return f}),n.d(t,"h",function(){return p});var o=n(101);const l=o.from({ENVIRONMENT:r.env.ENV,AGGREGATE_LEVEL:r.env.AGGREGATE_LEVEL,API_ENDPOINT:r.env.API_ENDPOINT,APP:"realtime-sdk",APP_PATH:r.env.APP_PATH,BUILD_TAG:r.env.BUILD_TAG,ENABLE_SELF_SERVE:r.env.ENABLE_SELF_SERVE,ENABLE_SENTRY:r.env.ENABLE_SENTRY,ENABLE_SENTRY_PROFILING:r.env.ENABLE_SENTRY_PROFILING,GIT_COMMIT:r.env.GIT_COMMIT,JEST_WORKER_ID:r.env.JEST_WORKER_ID,LOG_API_ENDPOINT:r.env.LOG_API_ENDPOINT,LOG_JSON:"false",LOG_LEVEL:r.env.LOG_LEVEL,LOG_TO_CONSOLE:r.env.LOG_TO_CONSOLE,LOG_TO_FILE:r.env.LOG_TO_FILE,NAMESPACE:"production",SENTRY_DSN:r.env.SENTRY_DSN,SHEET_EXPORT_MAX_ROW_COUNT:r.env.SHEET_EXPORT_MAX_ROW_COUNT,STABLE_AGENT_VERSION:r.env.STABLE_AGENT_VERSION,VERSION:r.env.VERSION}),u=(l.get("ENVIRONMENT").default("").asString(),l.get("APP").default("").asString()),s=(l.get("APP_PATH").default("").asString(),l.get("API_ENDPOINT").default("").asString(),l.get("NAMESPACE").default("").asString()),g=l.get("VERSION").default("").asString(),c=l.get("BUILD_TAG").default("").asString(),d=(l.get("GIT_COMMIT").default("").asString(),l.get("ENABLE_SENTRY").default("false").asBool(),l.get("ENABLE_SENTRY_PROFILING").default("false").asBool(),l.get("SENTRY_DSN").default("").asString(),l.get("LOG_LEVEL").default("debug").asString()),w=l.get("LOG_JSON").default("true").asBool(),v=l.get("LOG_TO_CONSOLE").default("true").asBool(),y=(l.get("STABLE_AGENT_VERSION").default("").asString(),l.get("LOG_API_ENDPOINT").asString()),f=l.get("JEST_WORKER_ID").asString(),p=(l.get("SHEET_EXPORT_MAX_ROW_COUNT").default("10000").asIntPositive(),l.get("LOG_TO_FILE").default("false").asBoolStrict());l.get("ENABLE_SELF_SERVE").default("true").asBoolStrict(),l.get("AGGREGATE_LEVEL").default("hour").asEnum(["day","hour","minute"])}).call(this,n(2))},function(e,t,n){(function(r){var o=n(141),l=n(142),u=n(63);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(_,I){if(s()<I)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(_=new Uint8Array(I)).__proto__=c.prototype:(_===null&&(_=new c(I)),_.length=I),_}function c(_,I,$){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(_,I,$);if(typeof _=="number"){if(typeof I=="string")throw new Error("If encoding is specified then the first argument must be a string");return v(this,_)}return d(this,_,I,$)}function d(_,I,$,K){if(typeof I=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&I instanceof ArrayBuffer?function(Y,ne,ie,ue){if(ne.byteLength,ie<0||ne.byteLength<ie)throw new RangeError("'offset' is out of bounds");if(ne.byteLength<ie+(ue||0))throw new RangeError("'length' is out of bounds");return ne=ie===void 0&&ue===void 0?new Uint8Array(ne):ue===void 0?new Uint8Array(ne,ie):new Uint8Array(ne,ie,ue),c.TYPED_ARRAY_SUPPORT?(Y=ne).__proto__=c.prototype:Y=y(Y,ne),Y}(_,I,$,K):typeof I=="string"?function(Y,ne,ie){if(typeof ie=="string"&&ie!==""||(ie="utf8"),!c.isEncoding(ie))throw new TypeError('"encoding" must be a valid string encoding');var ue=0|p(ne,ie),we=(Y=g(Y,ue)).write(ne,ie);return we!==ue&&(Y=Y.slice(0,we)),Y}(_,I,$):function(Y,ne){if(c.isBuffer(ne)){var ie=0|f(ne.length);return(Y=g(Y,ie)).length===0||ne.copy(Y,0,0,ie),Y}if(ne){if(typeof ArrayBuffer<"u"&&ne.buffer instanceof ArrayBuffer||"length"in ne)return typeof ne.length!="number"||(ue=ne.length)!=ue?g(Y,0):y(Y,ne);if(ne.type==="Buffer"&&u(ne.data))return y(Y,ne.data)}var ue;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(_,I)}function w(_){if(typeof _!="number")throw new TypeError('"size" argument must be a number');if(_<0)throw new RangeError('"size" argument must not be negative')}function v(_,I){if(w(I),_=g(_,I<0?0:0|f(I)),!c.TYPED_ARRAY_SUPPORT)for(var $=0;$<I;++$)_[$]=0;return _}function y(_,I){var $=I.length<0?0:0|f(I.length);_=g(_,$);for(var K=0;K<$;K+=1)_[K]=255&I[K];return _}function f(_){if(_>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|_}function p(_,I){if(c.isBuffer(_))return _.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(_)||_ instanceof ArrayBuffer))return _.byteLength;typeof _!="string"&&(_=""+_);var $=_.length;if($===0)return 0;for(var K=!1;;)switch(I){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":case void 0:return te(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*$;case"hex":return $>>>1;case"base64":return k(_).length;default:if(K)return te(_).length;I=(""+I).toLowerCase(),K=!0}}function S(_,I,$){var K=!1;if((I===void 0||I<0)&&(I=0),I>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0)<=(I>>>=0))return"";for(_||(_="utf8");;)switch(_){case"hex":return z(this,I,$);case"utf8":case"utf-8":return G(this,I,$);case"ascii":return j(this,I,$);case"latin1":case"binary":return C(this,I,$);case"base64":return b(this,I,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,I,$);default:if(K)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),K=!0}}function N(_,I,$){var K=_[I];_[I]=_[$],_[$]=K}function B(_,I,$,K,Y){if(_.length===0)return-1;if(typeof $=="string"?(K=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,isNaN($)&&($=Y?0:_.length-1),$<0&&($=_.length+$),$>=_.length){if(Y)return-1;$=_.length-1}else if($<0){if(!Y)return-1;$=0}if(typeof I=="string"&&(I=c.from(I,K)),c.isBuffer(I))return I.length===0?-1:E(_,I,$,K,Y);if(typeof I=="number")return I&=255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?Y?Uint8Array.prototype.indexOf.call(_,I,$):Uint8Array.prototype.lastIndexOf.call(_,I,$):E(_,[I],$,K,Y);throw new TypeError("val must be string, number or Buffer")}function E(_,I,$,K,Y){var ne,ie=1,ue=_.length,we=I.length;if(K!==void 0&&((K=String(K).toLowerCase())==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(_.length<2||I.length<2)return-1;ie=2,ue/=2,we/=2,$/=2}function Oe(Ae,Ie){return ie===1?Ae[Ie]:Ae.readUInt16BE(Ie*ie)}if(Y){var Ee=-1;for(ne=$;ne<ue;ne++)if(Oe(_,ne)===Oe(I,Ee===-1?0:ne-Ee)){if(Ee===-1&&(Ee=ne),ne-Ee+1===we)return Ee*ie}else Ee!==-1&&(ne-=ne-Ee),Ee=-1}else for($+we>ue&&($=ue-we),ne=$;ne>=0;ne--){for(var De=!0,Te=0;Te<we;Te++)if(Oe(_,ne+Te)!==Oe(I,Te)){De=!1;break}if(De)return ne}return-1}function T(_,I,$,K){$=Number($)||0;var Y=_.length-$;K?(K=Number(K))>Y&&(K=Y):K=Y;var ne=I.length;if(ne%2!=0)throw new TypeError("Invalid hex string");K>ne/2&&(K=ne/2);for(var ie=0;ie<K;++ie){var ue=parseInt(I.substr(2*ie,2),16);if(isNaN(ue))return ie;_[$+ie]=ue}return ie}function h(_,I,$,K){return x(te(I,_.length-$),_,$,K)}function R(_,I,$,K){return x(function(Y){for(var ne=[],ie=0;ie<Y.length;++ie)ne.push(255&Y.charCodeAt(ie));return ne}(I),_,$,K)}function W(_,I,$,K){return R(_,I,$,K)}function X(_,I,$,K){return x(k(I),_,$,K)}function m(_,I,$,K){return x(function(Y,ne){for(var ie,ue,we,Oe=[],Ee=0;Ee<Y.length&&!((ne-=2)<0);++Ee)ie=Y.charCodeAt(Ee),ue=ie>>8,we=ie%256,Oe.push(we),Oe.push(ue);return Oe}(I,_.length-$),_,$,K)}function b(_,I,$){return I===0&&$===_.length?o.fromByteArray(_):o.fromByteArray(_.slice(I,$))}function G(_,I,$){$=Math.min(_.length,$);for(var K=[],Y=I;Y<$;){var ne,ie,ue,we,Oe=_[Y],Ee=null,De=Oe>239?4:Oe>223?3:Oe>191?2:1;if(Y+De<=$)switch(De){case 1:Oe<128&&(Ee=Oe);break;case 2:(192&(ne=_[Y+1]))==128&&(we=(31&Oe)<<6|63&ne)>127&&(Ee=we);break;case 3:ne=_[Y+1],ie=_[Y+2],(192&ne)==128&&(192&ie)==128&&(we=(15&Oe)<<12|(63&ne)<<6|63&ie)>2047&&(we<55296||we>57343)&&(Ee=we);break;case 4:ne=_[Y+1],ie=_[Y+2],ue=_[Y+3],(192&ne)==128&&(192&ie)==128&&(192&ue)==128&&(we=(15&Oe)<<18|(63&ne)<<12|(63&ie)<<6|63&ue)>65535&&we<1114112&&(Ee=we)}Ee===null?(Ee=65533,De=1):Ee>65535&&(Ee-=65536,K.push(Ee>>>10&1023|55296),Ee=56320|1023&Ee),K.push(Ee),Y+=De}return function(Te){var Ae=Te.length;if(Ae<=4096)return String.fromCharCode.apply(String,Te);for(var Ie="",ze=0;ze<Ae;)Ie+=String.fromCharCode.apply(String,Te.slice(ze,ze+=4096));return Ie}(K)}t.Buffer=c,t.SlowBuffer=function(_){return+_!=_&&(_=0),c.alloc(+_)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=r.TYPED_ARRAY_SUPPORT!==void 0?r.TYPED_ARRAY_SUPPORT:function(){try{var _=new Uint8Array(1);return _.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},_.foo()===42&&typeof _.subarray=="function"&&_.subarray(1,1).byteLength===0}catch{return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(_){return _.__proto__=c.prototype,_},c.from=function(_,I,$){return d(null,_,I,$)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(_,I,$){return function(K,Y,ne,ie){return w(Y),Y<=0?g(K,Y):ne!==void 0?typeof ie=="string"?g(K,Y).fill(ne,ie):g(K,Y).fill(ne):g(K,Y)}(null,_,I,$)},c.allocUnsafe=function(_){return v(null,_)},c.allocUnsafeSlow=function(_){return v(null,_)},c.isBuffer=function(_){return!(_==null||!_._isBuffer)},c.compare=function(_,I){if(!c.isBuffer(_)||!c.isBuffer(I))throw new TypeError("Arguments must be Buffers");if(_===I)return 0;for(var $=_.length,K=I.length,Y=0,ne=Math.min($,K);Y<ne;++Y)if(_[Y]!==I[Y]){$=_[Y],K=I[Y];break}return $<K?-1:K<$?1:0},c.isEncoding=function(_){switch(String(_).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(_,I){if(!u(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return c.alloc(0);var $;if(I===void 0)for(I=0,$=0;$<_.length;++$)I+=_[$].length;var K=c.allocUnsafe(I),Y=0;for($=0;$<_.length;++$){var ne=_[$];if(!c.isBuffer(ne))throw new TypeError('"list" argument must be an Array of Buffers');ne.copy(K,Y),Y+=ne.length}return K},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var _=this.length;if(_%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var I=0;I<_;I+=2)N(this,I,I+1);return this},c.prototype.swap32=function(){var _=this.length;if(_%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var I=0;I<_;I+=4)N(this,I,I+3),N(this,I+1,I+2);return this},c.prototype.swap64=function(){var _=this.length;if(_%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var I=0;I<_;I+=8)N(this,I,I+7),N(this,I+1,I+6),N(this,I+2,I+5),N(this,I+3,I+4);return this},c.prototype.toString=function(){var _=0|this.length;return _===0?"":arguments.length===0?G(this,0,_):S.apply(this,arguments)},c.prototype.equals=function(_){if(!c.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_||c.compare(this,_)===0},c.prototype.inspect=function(){var _="",I=t.INSPECT_MAX_BYTES;return this.length>0&&(_=this.toString("hex",0,I).match(/.{2}/g).join(" "),this.length>I&&(_+=" ... ")),"<Buffer "+_+">"},c.prototype.compare=function(_,I,$,K,Y){if(!c.isBuffer(_))throw new TypeError("Argument must be a Buffer");if(I===void 0&&(I=0),$===void 0&&($=_?_.length:0),K===void 0&&(K=0),Y===void 0&&(Y=this.length),I<0||$>_.length||K<0||Y>this.length)throw new RangeError("out of range index");if(K>=Y&&I>=$)return 0;if(K>=Y)return-1;if(I>=$)return 1;if(this===_)return 0;for(var ne=(Y>>>=0)-(K>>>=0),ie=($>>>=0)-(I>>>=0),ue=Math.min(ne,ie),we=this.slice(K,Y),Oe=_.slice(I,$),Ee=0;Ee<ue;++Ee)if(we[Ee]!==Oe[Ee]){ne=we[Ee],ie=Oe[Ee];break}return ne<ie?-1:ie<ne?1:0},c.prototype.includes=function(_,I,$){return this.indexOf(_,I,$)!==-1},c.prototype.indexOf=function(_,I,$){return B(this,_,I,$,!0)},c.prototype.lastIndexOf=function(_,I,$){return B(this,_,I,$,!1)},c.prototype.write=function(_,I,$,K){if(I===void 0)K="utf8",$=this.length,I=0;else if($===void 0&&typeof I=="string")K=I,$=this.length,I=0;else{if(!isFinite(I))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");I|=0,isFinite($)?($|=0,K===void 0&&(K="utf8")):(K=$,$=void 0)}var Y=this.length-I;if(($===void 0||$>Y)&&($=Y),_.length>0&&($<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var ne=!1;;)switch(K){case"hex":return T(this,_,I,$);case"utf8":case"utf-8":return h(this,_,I,$);case"ascii":return R(this,_,I,$);case"latin1":case"binary":return W(this,_,I,$);case"base64":return X(this,_,I,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,_,I,$);default:if(ne)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),ne=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(_,I,$){var K="";$=Math.min(_.length,$);for(var Y=I;Y<$;++Y)K+=String.fromCharCode(127&_[Y]);return K}function C(_,I,$){var K="";$=Math.min(_.length,$);for(var Y=I;Y<$;++Y)K+=String.fromCharCode(_[Y]);return K}function z(_,I,$){var K=_.length;(!I||I<0)&&(I=0),(!$||$<0||$>K)&&($=K);for(var Y="",ne=I;ne<$;++ne)Y+=ee(_[ne]);return Y}function P(_,I,$){for(var K=_.slice(I,$),Y="",ne=0;ne<K.length;ne+=2)Y+=String.fromCharCode(K[ne]+256*K[ne+1]);return Y}function D(_,I,$){if(_%1!=0||_<0)throw new RangeError("offset is not uint");if(_+I>$)throw new RangeError("Trying to access beyond buffer length")}function O(_,I,$,K,Y,ne){if(!c.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>Y||I<ne)throw new RangeError('"value" argument is out of bounds');if($+K>_.length)throw new RangeError("Index out of range")}function L(_,I,$,K){I<0&&(I=65535+I+1);for(var Y=0,ne=Math.min(_.length-$,2);Y<ne;++Y)_[$+Y]=(I&255<<8*(K?Y:1-Y))>>>8*(K?Y:1-Y)}function U(_,I,$,K){I<0&&(I=4294967295+I+1);for(var Y=0,ne=Math.min(_.length-$,4);Y<ne;++Y)_[$+Y]=I>>>8*(K?Y:3-Y)&255}function A(_,I,$,K,Y,ne){if($+K>_.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function V(_,I,$,K,Y){return Y||A(_,0,$,4),l.write(_,I,$,K,23,4),$+4}function q(_,I,$,K,Y){return Y||A(_,0,$,8),l.write(_,I,$,K,52,8),$+8}c.prototype.slice=function(_,I){var $,K=this.length;if((_=~~_)<0?(_+=K)<0&&(_=0):_>K&&(_=K),(I=I===void 0?K:~~I)<0?(I+=K)<0&&(I=0):I>K&&(I=K),I<_&&(I=_),c.TYPED_ARRAY_SUPPORT)($=this.subarray(_,I)).__proto__=c.prototype;else{var Y=I-_;$=new c(Y,void 0);for(var ne=0;ne<Y;++ne)$[ne]=this[ne+_]}return $},c.prototype.readUIntLE=function(_,I,$){_|=0,I|=0,$||D(_,I,this.length);for(var K=this[_],Y=1,ne=0;++ne<I&&(Y*=256);)K+=this[_+ne]*Y;return K},c.prototype.readUIntBE=function(_,I,$){_|=0,I|=0,$||D(_,I,this.length);for(var K=this[_+--I],Y=1;I>0&&(Y*=256);)K+=this[_+--I]*Y;return K},c.prototype.readUInt8=function(_,I){return I||D(_,1,this.length),this[_]},c.prototype.readUInt16LE=function(_,I){return I||D(_,2,this.length),this[_]|this[_+1]<<8},c.prototype.readUInt16BE=function(_,I){return I||D(_,2,this.length),this[_]<<8|this[_+1]},c.prototype.readUInt32LE=function(_,I){return I||D(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+16777216*this[_+3]},c.prototype.readUInt32BE=function(_,I){return I||D(_,4,this.length),16777216*this[_]+(this[_+1]<<16|this[_+2]<<8|this[_+3])},c.prototype.readIntLE=function(_,I,$){_|=0,I|=0,$||D(_,I,this.length);for(var K=this[_],Y=1,ne=0;++ne<I&&(Y*=256);)K+=this[_+ne]*Y;return K>=(Y*=128)&&(K-=Math.pow(2,8*I)),K},c.prototype.readIntBE=function(_,I,$){_|=0,I|=0,$||D(_,I,this.length);for(var K=I,Y=1,ne=this[_+--K];K>0&&(Y*=256);)ne+=this[_+--K]*Y;return ne>=(Y*=128)&&(ne-=Math.pow(2,8*I)),ne},c.prototype.readInt8=function(_,I){return I||D(_,1,this.length),128&this[_]?-1*(255-this[_]+1):this[_]},c.prototype.readInt16LE=function(_,I){I||D(_,2,this.length);var $=this[_]|this[_+1]<<8;return 32768&$?4294901760|$:$},c.prototype.readInt16BE=function(_,I){I||D(_,2,this.length);var $=this[_+1]|this[_]<<8;return 32768&$?4294901760|$:$},c.prototype.readInt32LE=function(_,I){return I||D(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},c.prototype.readInt32BE=function(_,I){return I||D(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},c.prototype.readFloatLE=function(_,I){return I||D(_,4,this.length),l.read(this,_,!0,23,4)},c.prototype.readFloatBE=function(_,I){return I||D(_,4,this.length),l.read(this,_,!1,23,4)},c.prototype.readDoubleLE=function(_,I){return I||D(_,8,this.length),l.read(this,_,!0,52,8)},c.prototype.readDoubleBE=function(_,I){return I||D(_,8,this.length),l.read(this,_,!1,52,8)},c.prototype.writeUIntLE=function(_,I,$,K){_=+_,I|=0,$|=0,K||O(this,_,I,$,Math.pow(2,8*$)-1,0);var Y=1,ne=0;for(this[I]=255&_;++ne<$&&(Y*=256);)this[I+ne]=_/Y&255;return I+$},c.prototype.writeUIntBE=function(_,I,$,K){_=+_,I|=0,$|=0,K||O(this,_,I,$,Math.pow(2,8*$)-1,0);var Y=$-1,ne=1;for(this[I+Y]=255&_;--Y>=0&&(ne*=256);)this[I+Y]=_/ne&255;return I+$},c.prototype.writeUInt8=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,1,255,0),c.TYPED_ARRAY_SUPPORT||(_=Math.floor(_)),this[I]=255&_,I+1},c.prototype.writeUInt16LE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[I]=255&_,this[I+1]=_>>>8):L(this,_,I,!0),I+2},c.prototype.writeUInt16BE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[I]=_>>>8,this[I+1]=255&_):L(this,_,I,!1),I+2},c.prototype.writeUInt32LE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[I+3]=_>>>24,this[I+2]=_>>>16,this[I+1]=_>>>8,this[I]=255&_):U(this,_,I,!0),I+4},c.prototype.writeUInt32BE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[I]=_>>>24,this[I+1]=_>>>16,this[I+2]=_>>>8,this[I+3]=255&_):U(this,_,I,!1),I+4},c.prototype.writeIntLE=function(_,I,$,K){if(_=+_,I|=0,!K){var Y=Math.pow(2,8*$-1);O(this,_,I,$,Y-1,-Y)}var ne=0,ie=1,ue=0;for(this[I]=255&_;++ne<$&&(ie*=256);)_<0&&ue===0&&this[I+ne-1]!==0&&(ue=1),this[I+ne]=(_/ie>>0)-ue&255;return I+$},c.prototype.writeIntBE=function(_,I,$,K){if(_=+_,I|=0,!K){var Y=Math.pow(2,8*$-1);O(this,_,I,$,Y-1,-Y)}var ne=$-1,ie=1,ue=0;for(this[I+ne]=255&_;--ne>=0&&(ie*=256);)_<0&&ue===0&&this[I+ne+1]!==0&&(ue=1),this[I+ne]=(_/ie>>0)-ue&255;return I+$},c.prototype.writeInt8=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,1,127,-128),c.TYPED_ARRAY_SUPPORT||(_=Math.floor(_)),_<0&&(_=255+_+1),this[I]=255&_,I+1},c.prototype.writeInt16LE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[I]=255&_,this[I+1]=_>>>8):L(this,_,I,!0),I+2},c.prototype.writeInt16BE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[I]=_>>>8,this[I+1]=255&_):L(this,_,I,!1),I+2},c.prototype.writeInt32LE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[I]=255&_,this[I+1]=_>>>8,this[I+2]=_>>>16,this[I+3]=_>>>24):U(this,_,I,!0),I+4},c.prototype.writeInt32BE=function(_,I,$){return _=+_,I|=0,$||O(this,_,I,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),c.TYPED_ARRAY_SUPPORT?(this[I]=_>>>24,this[I+1]=_>>>16,this[I+2]=_>>>8,this[I+3]=255&_):U(this,_,I,!1),I+4},c.prototype.writeFloatLE=function(_,I,$){return V(this,_,I,!0,$)},c.prototype.writeFloatBE=function(_,I,$){return V(this,_,I,!1,$)},c.prototype.writeDoubleLE=function(_,I,$){return q(this,_,I,!0,$)},c.prototype.writeDoubleBE=function(_,I,$){return q(this,_,I,!1,$)},c.prototype.copy=function(_,I,$,K){if($||($=0),K||K===0||(K=this.length),I>=_.length&&(I=_.length),I||(I=0),K>0&&K<$&&(K=$),K===$||_.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("sourceStart out of bounds");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),_.length-I<K-$&&(K=_.length-I+$);var Y,ne=K-$;if(this===_&&$<I&&I<K)for(Y=ne-1;Y>=0;--Y)_[Y+I]=this[Y+$];else if(ne<1e3||!c.TYPED_ARRAY_SUPPORT)for(Y=0;Y<ne;++Y)_[Y+I]=this[Y+$];else Uint8Array.prototype.set.call(_,this.subarray($,$+ne),I);return ne},c.prototype.fill=function(_,I,$,K){if(typeof _=="string"){if(typeof I=="string"?(K=I,I=0,$=this.length):typeof $=="string"&&(K=$,$=this.length),_.length===1){var Y=_.charCodeAt(0);Y<256&&(_=Y)}if(K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!c.isEncoding(K))throw new TypeError("Unknown encoding: "+K)}else typeof _=="number"&&(_&=255);if(I<0||this.length<I||this.length<$)throw new RangeError("Out of range index");if($<=I)return this;var ne;if(I>>>=0,$=$===void 0?this.length:$>>>0,_||(_=0),typeof _=="number")for(ne=I;ne<$;++ne)this[ne]=_;else{var ie=c.isBuffer(_)?_:te(new c(_,K).toString()),ue=ie.length;for(ne=0;ne<$-I;++ne)this[ne+I]=ie[ne%ue]}return this};var Q=/[^+\/0-9A-Za-z-_]/g;function ee(_){return _<16?"0"+_.toString(16):_.toString(16)}function te(_,I){var $;I=I||1/0;for(var K=_.length,Y=null,ne=[],ie=0;ie<K;++ie){if(($=_.charCodeAt(ie))>55295&&$<57344){if(!Y){if($>56319){(I-=3)>-1&&ne.push(239,191,189);continue}if(ie+1===K){(I-=3)>-1&&ne.push(239,191,189);continue}Y=$;continue}if($<56320){(I-=3)>-1&&ne.push(239,191,189),Y=$;continue}$=65536+(Y-55296<<10|$-56320)}else Y&&(I-=3)>-1&&ne.push(239,191,189);if(Y=null,$<128){if((I-=1)<0)break;ne.push($)}else if($<2048){if((I-=2)<0)break;ne.push($>>6|192,63&$|128)}else if($<65536){if((I-=3)<0)break;ne.push($>>12|224,$>>6&63|128,63&$|128)}else{if(!($<1114112))throw new Error("Invalid code point");if((I-=4)<0)break;ne.push($>>18|240,$>>12&63|128,$>>6&63|128,63&$|128)}}return ne}function k(_){return o.toByteArray(function(I){if((I=function($){return $.trim?$.trim():$.replace(/^\s+|\s+$/g,"")}(I).replace(Q,"")).length<2)return"";for(;I.length%4!=0;)I+="=";return I}(_))}function x(_,I,$,K){for(var Y=0;Y<K&&!(Y+$>=I.length||Y>=_.length);++Y)I[Y+$]=_[Y];return Y}}).call(this,n(6))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){r&&(n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(n,r){if(r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}}},function(e,t,n){function r(v){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y})(v)}function o(v,y){if(y&&(r(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(v)}function l(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function u(v){var y=typeof Map=="function"?new Map:void 0;return(u=function(f){if(f===null||(p=f,Function.toString.call(p).indexOf("[native code]")===-1))return f;var p;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(y!==void 0){if(y.has(f))return y.get(f);y.set(f,S)}function S(){return s(f,arguments,d(this).constructor)}return S.prototype=Object.create(f.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),c(S,f)})(v)}function s(v,y,f){return(s=g()?Reflect.construct.bind():function(p,S,N){var B=[null];B.push.apply(B,S);var E=new(Function.bind.apply(p,B));return N&&c(E,N.prototype),E}).apply(null,arguments)}function g(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c(v,y){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,p){return f.__proto__=p,f})(v,y)}function d(v){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(y){return y.__proto__||Object.getPrototypeOf(y)})(v)}var w=function(v){(function(B,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(E&&E.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),E&&c(B,E)})(N,v);var y,f,p,S=(y=N,f=g(),function(){var B,E=d(y);if(f){var T=d(this).constructor;B=Reflect.construct(E,arguments,T)}else B=E.apply(this,arguments);return o(this,B)});function N(B){var E;return function(T,h){if(!(T instanceof h))throw new TypeError("Cannot call a class as a function")}(this,N),E=S.call(this,`Format functions must be synchronous taking a two arguments: (info, opts)
3
+ Found: `.concat(B.toString().split(`
4
+ `)[0],`
5
+ `)),Error.captureStackTrace(l(E),N),E}return p=N,Object.defineProperty(p,"prototype",{writable:!1}),p}(u(Error));e.exports=function(v){if(v.length>2)throw new w(v);function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=p}function f(p){return new y(p)}return y.prototype.transform=v,f.Format=y,f}},function(e,t,n){n.d(t,"a",function(){return r});const r=o=>new Promise(l=>setTimeout(l,o||0))},function(e,t,n){var r=n(99),o=r,l=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||l!==void 0&&l||typeof self<"u"&&self||(function(){return this}).call(null)||Function("return this")(),u=n(98);o.object.extend(proto,u),o.exportSymbol("proto.v1.signaling.api.CreatePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.CreatePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.DeletePeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetHealthResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetIceServersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetPeersResponse",null,l),o.exportSymbol("proto.v1.signaling.api.GetSessionsRequest",null,l),o.exportSymbol("proto.v1.signaling.api.GetSessionsResponse",null,l),o.exportSymbol("proto.v1.signaling.api.Peer",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamRequest",null,l),o.exportSymbol("proto.v1.signaling.api.ReceiveSignalStreamResponse",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerRequest",null,l),o.exportSymbol("proto.v1.signaling.api.RefreshPeerResponse",null,l),o.exportSymbol("proto.v1.signaling.api.RtcSession",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalRequest",null,l),o.exportSymbol("proto.v1.signaling.api.SendSignalResponse",null,l),o.exportSymbol("proto.v1.signaling.api.SessionType",null,l),o.exportSymbol("proto.v1.signaling.api.Signal",null,l),proto.v1.signaling.api.Peer=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.Peer.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.Peer,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Peer.displayName="proto.v1.signaling.api.Peer"),proto.v1.signaling.api.Signal=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.Signal,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.Signal.displayName="proto.v1.signaling.api.Signal"),proto.v1.signaling.api.RtcSession=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RtcSession,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RtcSession.displayName="proto.v1.signaling.api.RtcSession"),proto.v1.signaling.api.GetSessionsRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetSessionsRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetSessionsRequest.displayName="proto.v1.signaling.api.GetSessionsRequest"),proto.v1.signaling.api.GetSessionsResponse=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.GetSessionsResponse.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.GetSessionsResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetSessionsResponse.displayName="proto.v1.signaling.api.GetSessionsResponse"),proto.v1.signaling.api.GetHealthRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthRequest.displayName="proto.v1.signaling.api.GetHealthRequest"),proto.v1.signaling.api.GetHealthResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetHealthResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetHealthResponse.displayName="proto.v1.signaling.api.GetHealthResponse"),proto.v1.signaling.api.CreatePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerRequest.displayName="proto.v1.signaling.api.CreatePeerRequest"),proto.v1.signaling.api.CreatePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.CreatePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.CreatePeerResponse.displayName="proto.v1.signaling.api.CreatePeerResponse"),proto.v1.signaling.api.DeletePeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerRequest.displayName="proto.v1.signaling.api.DeletePeerRequest"),proto.v1.signaling.api.DeletePeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.DeletePeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.DeletePeerResponse.displayName="proto.v1.signaling.api.DeletePeerResponse"),proto.v1.signaling.api.RefreshPeerRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerRequest.displayName="proto.v1.signaling.api.RefreshPeerRequest"),proto.v1.signaling.api.RefreshPeerResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.RefreshPeerResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.RefreshPeerResponse.displayName="proto.v1.signaling.api.RefreshPeerResponse"),proto.v1.signaling.api.GetPeersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetPeersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersRequest.displayName="proto.v1.signaling.api.GetPeersRequest"),proto.v1.signaling.api.GetPeersResponse=function(s){r.Message.initialize(this,s,0,-1,proto.v1.signaling.api.GetPeersResponse.repeatedFields_,null)},o.inherits(proto.v1.signaling.api.GetPeersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetPeersResponse.displayName="proto.v1.signaling.api.GetPeersResponse"),proto.v1.signaling.api.GetIceServersRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersRequest.displayName="proto.v1.signaling.api.GetIceServersRequest"),proto.v1.signaling.api.GetIceServersResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.GetIceServersResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.GetIceServersResponse.displayName="proto.v1.signaling.api.GetIceServersResponse"),proto.v1.signaling.api.SendSignalRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalRequest.displayName="proto.v1.signaling.api.SendSignalRequest"),proto.v1.signaling.api.SendSignalResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.SendSignalResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.SendSignalResponse.displayName="proto.v1.signaling.api.SendSignalResponse"),proto.v1.signaling.api.ReceiveSignalStreamRequest=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamRequest,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.displayName="proto.v1.signaling.api.ReceiveSignalStreamRequest"),proto.v1.signaling.api.ReceiveSignalStreamResponse=function(s){r.Message.initialize(this,s,0,-1,null,null)},o.inherits(proto.v1.signaling.api.ReceiveSignalStreamResponse,r.Message),o.DEBUG&&!COMPILED&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.displayName="proto.v1.signaling.api.ReceiveSignalStreamResponse"),proto.v1.signaling.api.Peer.repeatedFields_=[5],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Peer.prototype.toObject=function(s){return proto.v1.signaling.api.Peer.toObject(s,this)},proto.v1.signaling.api.Peer.toObject=function(s,g){var c,d={peerId:r.Message.getFieldWithDefault(g,1,""),organizationId:r.Message.getFieldWithDefault(g,2,""),userId:(c=g.getUserId())&&u.StringValue.toObject(s,c),deviceId:(c=g.getDeviceId())&&u.StringValue.toObject(s,c),sessionIdsList:(c=r.Message.getRepeatedField(g,5))==null?void 0:c,peerCreatedTimestamp:(c=g.getPeerCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.Peer.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Peer;return proto.v1.signaling.api.Peer.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Peer.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;case 2:c=g.readString(),s.setOrganizationId(c);break;case 3:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setUserId(c);break;case 4:c=new u.StringValue,g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setDeviceId(c);break;case 5:c=g.readString(),s.addSessionIds(c);break;case 6:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setPeerCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Peer.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Peer.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Peer.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getPeerId()).length>0&&g.writeString(1,c),(c=s.getOrganizationId()).length>0&&g.writeString(2,c),(c=s.getUserId())!=null&&g.writeMessage(3,c,u.StringValue.serializeBinaryToWriter),(c=s.getDeviceId())!=null&&g.writeMessage(4,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionIdsList()).length>0&&g.writeRepeatedString(5,c),(c=s.getPeerCreatedTimestamp())!=null&&g.writeMessage(6,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.Peer.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.Peer.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},proto.v1.signaling.api.Peer.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.Peer.prototype.setOrganizationId=function(s){return r.Message.setProto3StringField(this,2,s)},proto.v1.signaling.api.Peer.prototype.getUserId=function(){return r.Message.getWrapperField(this,u.StringValue,3)},proto.v1.signaling.api.Peer.prototype.setUserId=function(s){return r.Message.setWrapperField(this,3,s)},proto.v1.signaling.api.Peer.prototype.clearUserId=function(){return this.setUserId(void 0)},proto.v1.signaling.api.Peer.prototype.hasUserId=function(){return r.Message.getField(this,3)!=null},proto.v1.signaling.api.Peer.prototype.getDeviceId=function(){return r.Message.getWrapperField(this,u.StringValue,4)},proto.v1.signaling.api.Peer.prototype.setDeviceId=function(s){return r.Message.setWrapperField(this,4,s)},proto.v1.signaling.api.Peer.prototype.clearDeviceId=function(){return this.setDeviceId(void 0)},proto.v1.signaling.api.Peer.prototype.hasDeviceId=function(){return r.Message.getField(this,4)!=null},proto.v1.signaling.api.Peer.prototype.getSessionIdsList=function(){return r.Message.getRepeatedField(this,5)},proto.v1.signaling.api.Peer.prototype.setSessionIdsList=function(s){return r.Message.setField(this,5,s||[])},proto.v1.signaling.api.Peer.prototype.addSessionIds=function(s,g){return r.Message.addToRepeatedField(this,5,s,g)},proto.v1.signaling.api.Peer.prototype.clearSessionIdsList=function(){return this.setSessionIdsList([])},proto.v1.signaling.api.Peer.prototype.getPeerCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,6)},proto.v1.signaling.api.Peer.prototype.setPeerCreatedTimestamp=function(s){return r.Message.setWrapperField(this,6,s)},proto.v1.signaling.api.Peer.prototype.clearPeerCreatedTimestamp=function(){return this.setPeerCreatedTimestamp(void 0)},proto.v1.signaling.api.Peer.prototype.hasPeerCreatedTimestamp=function(){return r.Message.getField(this,6)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.Signal.prototype.toObject=function(s){return proto.v1.signaling.api.Signal.toObject(s,this)},proto.v1.signaling.api.Signal.toObject=function(s,g){var c,d={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c),senderId:r.Message.getFieldWithDefault(g,3,""),receiverId:r.Message.getFieldWithDefault(g,4,""),payload:r.Message.getFieldWithDefault(g,5,""),iceServers:r.Message.getFieldWithDefault(g,6,""),iceTransportPolicy:r.Message.getFieldWithDefault(g,7,""),sessionType:r.Message.getFieldWithDefault(g,8,0)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.Signal.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.Signal;return proto.v1.signaling.api.Signal.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.Signal.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;case 3:c=g.readString(),s.setSenderId(c);break;case 4:c=g.readString(),s.setReceiverId(c);break;case 5:c=g.readString(),s.setPayload(c);break;case 6:c=g.readString(),s.setIceServers(c);break;case 7:c=g.readString(),s.setIceTransportPolicy(c);break;case 8:c=g.readEnum(),s.setSessionType(c);break;default:g.skipField()}return s},proto.v1.signaling.api.Signal.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.Signal.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.Signal.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter),(c=s.getSenderId()).length>0&&g.writeString(3,c),(c=s.getReceiverId()).length>0&&g.writeString(4,c),(c=s.getPayload()).length>0&&g.writeString(5,c),(c=s.getIceServers()).length>0&&g.writeString(6,c),(c=s.getIceTransportPolicy()).length>0&&g.writeString(7,c),(c=s.getSessionType())!==0&&g.writeEnum(8,c)},proto.v1.signaling.api.Signal.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.Signal.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.Signal.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.Signal.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.Signal.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.Signal.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.Signal.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},proto.v1.signaling.api.Signal.prototype.getSenderId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.Signal.prototype.setSenderId=function(s){return r.Message.setProto3StringField(this,3,s)},proto.v1.signaling.api.Signal.prototype.getReceiverId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.Signal.prototype.setReceiverId=function(s){return r.Message.setProto3StringField(this,4,s)},proto.v1.signaling.api.Signal.prototype.getPayload=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.Signal.prototype.setPayload=function(s){return r.Message.setProto3StringField(this,5,s)},proto.v1.signaling.api.Signal.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,6,"")},proto.v1.signaling.api.Signal.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,6,s)},proto.v1.signaling.api.Signal.prototype.getIceTransportPolicy=function(){return r.Message.getFieldWithDefault(this,7,"")},proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy=function(s){return r.Message.setProto3StringField(this,7,s)},proto.v1.signaling.api.Signal.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,8,0)},proto.v1.signaling.api.Signal.prototype.setSessionType=function(s){return r.Message.setProto3EnumField(this,8,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RtcSession.prototype.toObject=function(s){return proto.v1.signaling.api.RtcSession.toObject(s,this)},proto.v1.signaling.api.RtcSession.toObject=function(s,g){var c={sessionId:r.Message.getFieldWithDefault(g,1,""),offerPeerId:r.Message.getFieldWithDefault(g,2,""),answerPeerId:r.Message.getFieldWithDefault(g,3,""),organizationId:r.Message.getFieldWithDefault(g,4,""),sessionType:r.Message.getFieldWithDefault(g,5,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.RtcSession.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RtcSession;return proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setSessionId(c);break;case 2:c=g.readString(),s.setOfferPeerId(c);break;case 3:c=g.readString(),s.setAnswerPeerId(c);break;case 4:c=g.readString(),s.setOrganizationId(c);break;case 5:c=g.readString(),s.setSessionType(c);break;default:g.skipField()}return s},proto.v1.signaling.api.RtcSession.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RtcSession.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RtcSession.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId()).length>0&&g.writeString(1,c),(c=s.getOfferPeerId()).length>0&&g.writeString(2,c),(c=s.getAnswerPeerId()).length>0&&g.writeString(3,c),(c=s.getOrganizationId()).length>0&&g.writeString(4,c),(c=s.getSessionType()).length>0&&g.writeString(5,c)},proto.v1.signaling.api.RtcSession.prototype.getSessionId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.RtcSession.prototype.setSessionId=function(s){return r.Message.setProto3StringField(this,1,s)},proto.v1.signaling.api.RtcSession.prototype.getOfferPeerId=function(){return r.Message.getFieldWithDefault(this,2,"")},proto.v1.signaling.api.RtcSession.prototype.setOfferPeerId=function(s){return r.Message.setProto3StringField(this,2,s)},proto.v1.signaling.api.RtcSession.prototype.getAnswerPeerId=function(){return r.Message.getFieldWithDefault(this,3,"")},proto.v1.signaling.api.RtcSession.prototype.setAnswerPeerId=function(s){return r.Message.setProto3StringField(this,3,s)},proto.v1.signaling.api.RtcSession.prototype.getOrganizationId=function(){return r.Message.getFieldWithDefault(this,4,"")},proto.v1.signaling.api.RtcSession.prototype.setOrganizationId=function(s){return r.Message.setProto3StringField(this,4,s)},proto.v1.signaling.api.RtcSession.prototype.getSessionType=function(){return r.Message.getFieldWithDefault(this,5,"")},proto.v1.signaling.api.RtcSession.prototype.setSessionType=function(s){return r.Message.setProto3StringField(this,5,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetSessionsRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetSessionsRequest.toObject(s,this)},proto.v1.signaling.api.GetSessionsRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetSessionsRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetSessionsRequest;return proto.v1.signaling.api.GetSessionsRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetSessionsRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetSessionsRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetSessionsRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetSessionsRequest.serializeBinaryToWriter=function(s,g){},proto.v1.signaling.api.GetSessionsResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetSessionsResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetSessionsResponse.toObject(s,this)},proto.v1.signaling.api.GetSessionsResponse.toObject=function(s,g){var c={sessionsList:r.Message.toObjectList(g.getSessionsList(),proto.v1.signaling.api.RtcSession.toObject,s)};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetSessionsResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetSessionsResponse;return proto.v1.signaling.api.GetSessionsResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetSessionsResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.RtcSession;g.readMessage(c,proto.v1.signaling.api.RtcSession.deserializeBinaryFromReader),s.addSessions(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetSessionsResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetSessionsResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetSessionsResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getSessionsList()).length>0&&g.writeRepeatedMessage(1,c,proto.v1.signaling.api.RtcSession.serializeBinaryToWriter)},proto.v1.signaling.api.GetSessionsResponse.prototype.getSessionsList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.RtcSession,1)},proto.v1.signaling.api.GetSessionsResponse.prototype.setSessionsList=function(s){return r.Message.setRepeatedWrapperField(this,1,s)},proto.v1.signaling.api.GetSessionsResponse.prototype.addSessions=function(s,g){return r.Message.addToRepeatedWrapperField(this,1,s,proto.v1.signaling.api.RtcSession,g)},proto.v1.signaling.api.GetSessionsResponse.prototype.clearSessionsList=function(){return this.setSessionsList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthRequest.toObject(s,this)},proto.v1.signaling.api.GetHealthRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthRequest;return proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetHealthRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetHealthResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetHealthResponse.toObject(s,this)},proto.v1.signaling.api.GetHealthResponse.toObject=function(s,g){var c={version:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetHealthResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetHealthResponse;return proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetHealthResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setVersion(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetHealthResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetHealthResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getVersion()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetHealthResponse.prototype.getVersion=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetHealthResponse.prototype.setVersion=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerRequest.toObject(s,this)},proto.v1.signaling.api.CreatePeerRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.CreatePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerRequest;return proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.CreatePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.CreatePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.CreatePeerResponse.toObject(s,this)},proto.v1.signaling.api.CreatePeerResponse.toObject=function(s,g){var c,d={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.CreatePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.CreatePeerResponse;return proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.CreatePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.CreatePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.CreatePeerResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.CreatePeerResponse.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.CreatePeerResponse.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.CreatePeerResponse.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.CreatePeerResponse.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerRequest.toObject(s,this)},proto.v1.signaling.api.DeletePeerRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerRequest;return proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.DeletePeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.DeletePeerRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.DeletePeerRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.DeletePeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.DeletePeerResponse.toObject(s,this)},proto.v1.signaling.api.DeletePeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.DeletePeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.DeletePeerResponse;return proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.DeletePeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.DeletePeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.DeletePeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerRequest.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerRequest.toObject(s,this)},proto.v1.signaling.api.RefreshPeerRequest.toObject=function(s,g){var c,d={peer:(c=g.getPeer())&&proto.v1.signaling.api.Peer.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.RefreshPeerRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerRequest;return proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.setPeer(c);break;default:g.skipField()}return s},proto.v1.signaling.api.RefreshPeerRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeer())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.RefreshPeerRequest.prototype.getPeer=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.RefreshPeerRequest.prototype.setPeer=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.RefreshPeerRequest.prototype.clearPeer=function(){return this.setPeer(void 0)},proto.v1.signaling.api.RefreshPeerRequest.prototype.hasPeer=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.RefreshPeerResponse.prototype.toObject=function(s){return proto.v1.signaling.api.RefreshPeerResponse.toObject(s,this)},proto.v1.signaling.api.RefreshPeerResponse.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.RefreshPeerResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.RefreshPeerResponse;return proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.RefreshPeerResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.RefreshPeerResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.RefreshPeerResponse.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersRequest.toObject(s,this)},proto.v1.signaling.api.GetPeersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersRequest;return proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetPeersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersRequest.serializeBinaryToWriter=function(s,g){},proto.v1.signaling.api.GetPeersResponse.repeatedFields_=[1],r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetPeersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetPeersResponse.toObject(s,this)},proto.v1.signaling.api.GetPeersResponse.toObject=function(s,g){var c={peersList:r.Message.toObjectList(g.getPeersList(),proto.v1.signaling.api.Peer.toObject,s)};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetPeersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetPeersResponse;return proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetPeersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Peer;g.readMessage(c,proto.v1.signaling.api.Peer.deserializeBinaryFromReader),s.addPeers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetPeersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetPeersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeersList()).length>0&&g.writeRepeatedMessage(1,c,proto.v1.signaling.api.Peer.serializeBinaryToWriter)},proto.v1.signaling.api.GetPeersResponse.prototype.getPeersList=function(){return r.Message.getRepeatedWrapperField(this,proto.v1.signaling.api.Peer,1)},proto.v1.signaling.api.GetPeersResponse.prototype.setPeersList=function(s){return r.Message.setRepeatedWrapperField(this,1,s)},proto.v1.signaling.api.GetPeersResponse.prototype.addPeers=function(s,g){return r.Message.addToRepeatedWrapperField(this,1,s,proto.v1.signaling.api.Peer,g)},proto.v1.signaling.api.GetPeersResponse.prototype.clearPeersList=function(){return this.setPeersList([])},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersRequest.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersRequest.toObject(s,this)},proto.v1.signaling.api.GetIceServersRequest.toObject=function(s,g){var c={};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersRequest;return proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)g.getFieldNumber(),g.skipField();return s},proto.v1.signaling.api.GetIceServersRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersRequest.serializeBinaryToWriter=function(s,g){},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.GetIceServersResponse.prototype.toObject=function(s){return proto.v1.signaling.api.GetIceServersResponse.toObject(s,this)},proto.v1.signaling.api.GetIceServersResponse.toObject=function(s,g){var c={iceServers:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.GetIceServersResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.GetIceServersResponse;return proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.GetIceServersResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setIceServers(c);break;default:g.skipField()}return s},proto.v1.signaling.api.GetIceServersResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.GetIceServersResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getIceServers()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.GetIceServersResponse.prototype.getIceServers=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.GetIceServersResponse.prototype.setIceServers=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalRequest.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalRequest.toObject(s,this)},proto.v1.signaling.api.SendSignalRequest.toObject=function(s,g){var c,d={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.SendSignalRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalRequest;return proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalRequest.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.SendSignalRequest.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalRequest.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.SendSignalRequest.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.SendSignalResponse.prototype.toObject=function(s){return proto.v1.signaling.api.SendSignalResponse.toObject(s,this)},proto.v1.signaling.api.SendSignalResponse.toObject=function(s,g){var c,d={sessionId:(c=g.getSessionId())&&u.StringValue.toObject(s,c),sessionCreatedTimestamp:(c=g.getSessionCreatedTimestamp())&&u.Int64Value.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.SendSignalResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.SendSignalResponse;return proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.SendSignalResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new u.StringValue;g.readMessage(c,u.StringValue.deserializeBinaryFromReader),s.setSessionId(c);break;case 2:c=new u.Int64Value,g.readMessage(c,u.Int64Value.deserializeBinaryFromReader),s.setSessionCreatedTimestamp(c);break;default:g.skipField()}return s},proto.v1.signaling.api.SendSignalResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.SendSignalResponse.serializeBinaryToWriter=function(s,g){var c=void 0;(c=s.getSessionId())!=null&&g.writeMessage(1,c,u.StringValue.serializeBinaryToWriter),(c=s.getSessionCreatedTimestamp())!=null&&g.writeMessage(2,c,u.Int64Value.serializeBinaryToWriter)},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionId=function(){return r.Message.getWrapperField(this,u.StringValue,1)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionId=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionId=function(){return this.setSessionId(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionId=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SendSignalResponse.prototype.getSessionCreatedTimestamp=function(){return r.Message.getWrapperField(this,u.Int64Value,2)},proto.v1.signaling.api.SendSignalResponse.prototype.setSessionCreatedTimestamp=function(s){return r.Message.setWrapperField(this,2,s)},proto.v1.signaling.api.SendSignalResponse.prototype.clearSessionCreatedTimestamp=function(){return this.setSessionCreatedTimestamp(void 0)},proto.v1.signaling.api.SendSignalResponse.prototype.hasSessionCreatedTimestamp=function(){return r.Message.getField(this,2)!=null},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamRequest.toObject=function(s,g){var c={peerId:r.Message.getFieldWithDefault(g,1,"")};return s&&(c.$jspbMessageInstance=g),c}),proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamRequest;return proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamRequest.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=g.readString();s.setPeerId(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamRequest.serializeBinaryToWriter=function(s,g){var c;(c=s.getPeerId()).length>0&&g.writeString(1,c)},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.getPeerId=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.v1.signaling.api.ReceiveSignalStreamRequest.prototype.setPeerId=function(s){return r.Message.setProto3StringField(this,1,s)},r.Message.GENERATE_TO_OBJECT&&(proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.toObject=function(s){return proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject(s,this)},proto.v1.signaling.api.ReceiveSignalStreamResponse.toObject=function(s,g){var c,d={signal:(c=g.getSignal())&&proto.v1.signaling.api.Signal.toObject(s,c)};return s&&(d.$jspbMessageInstance=g),d}),proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary=function(s){var g=new r.BinaryReader(s),c=new proto.v1.signaling.api.ReceiveSignalStreamResponse;return proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader(c,g)},proto.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinaryFromReader=function(s,g){for(;g.nextField()&&!g.isEndGroup();)switch(g.getFieldNumber()){case 1:var c=new proto.v1.signaling.api.Signal;g.readMessage(c,proto.v1.signaling.api.Signal.deserializeBinaryFromReader),s.setSignal(c);break;default:g.skipField()}return s},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.serializeBinary=function(){var s=new r.BinaryWriter;return proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter(this,s),s.getResultBuffer()},proto.v1.signaling.api.ReceiveSignalStreamResponse.serializeBinaryToWriter=function(s,g){var c;(c=s.getSignal())!=null&&g.writeMessage(1,c,proto.v1.signaling.api.Signal.serializeBinaryToWriter)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.getSignal=function(){return r.Message.getWrapperField(this,proto.v1.signaling.api.Signal,1)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.setSignal=function(s){return r.Message.setWrapperField(this,1,s)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.clearSignal=function(){return this.setSignal(void 0)},proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal=function(){return r.Message.getField(this,1)!=null},proto.v1.signaling.api.SessionType={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3,HEADLESS:4},o.object.extend(t,proto.v1.signaling.api)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(28);class o extends Error{constructor(u,s,g,c,d,w,v={}){super(`Response error ${JSON.stringify({method:u,url:s,requestBody:Object(r.a)(g),statusCode:c,responseHeaders:d?Object(r.a)([...d.entries()].reduce((y,[f,p])=>(y[f]=p,y),{})):{},responseBody:Object(r.a)(w)})}`),this.method=u,this.url=s,this.requestBody=g,this.statusCode=c,this.headers=d,this.body=w,this.validationErrors=v,this.name="ResponseError",Object.setPrototypeOf(this,new.target.prototype)}}},function(e,t,n){function r(o,l,u=()=>!0){if(function(s,g,c=()=>!0){return s instanceof g&&c(s)}(o,l,u))return o;throw o}n.d(t,"a",function(){return r})},function(e,t,n){(function(r){var o=Object.getOwnPropertyDescriptors||function(D){for(var O=Object.keys(D),L={},U=0;U<O.length;U++)L[O[U]]=Object.getOwnPropertyDescriptor(D,O[U]);return L},l=/%[sdj%]/g;t.format=function(D){if(!B(D)){for(var O=[],L=0;L<arguments.length;L++)O.push(g(arguments[L]));return O.join(" ")}L=1;for(var U=arguments,A=U.length,V=String(D).replace(l,function(Q){if(Q==="%%")return"%";if(L>=A)return Q;switch(Q){case"%s":return String(U[L++]);case"%d":return Number(U[L++]);case"%j":try{return JSON.stringify(U[L++])}catch{return"[Circular]"}default:return Q}}),q=U[L];L<A;q=U[++L])S(q)||!h(q)?V+=" "+q:V+=" "+g(q);return V},t.deprecate=function(D,O){if(r!==void 0&&r.noDeprecation===!0)return D;if(r===void 0)return function(){return t.deprecate(D,O).apply(this,arguments)};var L=!1;return function(){if(!L){if(r.throwDeprecation)throw new Error(O);r.traceDeprecation?console.trace(O):console.error(O),L=!0}return D.apply(this,arguments)}};var u,s={};function g(D,O){var L={seen:[],stylize:d};return arguments.length>=3&&(L.depth=arguments[2]),arguments.length>=4&&(L.colors=arguments[3]),p(O)?L.showHidden=O:O&&t._extend(L,O),E(L.showHidden)&&(L.showHidden=!1),E(L.depth)&&(L.depth=2),E(L.colors)&&(L.colors=!1),E(L.customInspect)&&(L.customInspect=!0),L.colors&&(L.stylize=c),w(L,D,L.depth)}function c(D,O){var L=g.styles[O];return L?"\x1B["+g.colors[L][0]+"m"+D+"\x1B["+g.colors[L][1]+"m":D}function d(D,O){return D}function w(D,O,L){if(D.customInspect&&O&&X(O.inspect)&&O.inspect!==t.inspect&&(!O.constructor||O.constructor.prototype!==O)){var U=O.inspect(L,D);return B(U)||(U=w(D,U,L)),U}var A=function(_,I){if(E(I))return _.stylize("undefined","undefined");if(B(I)){var $="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return _.stylize($,"string")}if(N(I))return _.stylize(""+I,"number");if(p(I))return _.stylize(""+I,"boolean");if(S(I))return _.stylize("null","null")}(D,O);if(A)return A;var V=Object.keys(O),q=function(_){var I={};return _.forEach(function($,K){I[$]=!0}),I}(V);if(D.showHidden&&(V=Object.getOwnPropertyNames(O)),W(O)&&(V.indexOf("message")>=0||V.indexOf("description")>=0))return v(O);if(V.length===0){if(X(O)){var Q=O.name?": "+O.name:"";return D.stylize("[Function"+Q+"]","special")}if(T(O))return D.stylize(RegExp.prototype.toString.call(O),"regexp");if(R(O))return D.stylize(Date.prototype.toString.call(O),"date");if(W(O))return v(O)}var ee,te="",k=!1,x=["{","}"];return f(O)&&(k=!0,x=["[","]"]),X(O)&&(te=" [Function"+(O.name?": "+O.name:"")+"]"),T(O)&&(te=" "+RegExp.prototype.toString.call(O)),R(O)&&(te=" "+Date.prototype.toUTCString.call(O)),W(O)&&(te=" "+v(O)),V.length!==0||k&&O.length!=0?L<0?T(O)?D.stylize(RegExp.prototype.toString.call(O),"regexp"):D.stylize("[Object]","special"):(D.seen.push(O),ee=k?function(_,I,$,K,Y){for(var ne=[],ie=0,ue=I.length;ie<ue;++ie)C(I,String(ie))?ne.push(y(_,I,$,K,String(ie),!0)):ne.push("");return Y.forEach(function(we){we.match(/^\d+$/)||ne.push(y(_,I,$,K,we,!0))}),ne}(D,O,L,q,V):V.map(function(_){return y(D,O,L,q,_,k)}),D.seen.pop(),function(_,I,$){return _.reduce(function(K,Y){return Y.indexOf(`
6
+ `)>=0,K+Y.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?$[0]+(I===""?"":I+`
7
+ `)+" "+_.join(`,
8
+ `)+" "+$[1]:$[0]+I+" "+_.join(", ")+" "+$[1]}(ee,te,x)):x[0]+te+x[1]}function v(D){return"["+Error.prototype.toString.call(D)+"]"}function y(D,O,L,U,A,V){var q,Q,ee;if((ee=Object.getOwnPropertyDescriptor(O,A)||{value:O[A]}).get?Q=ee.set?D.stylize("[Getter/Setter]","special"):D.stylize("[Getter]","special"):ee.set&&(Q=D.stylize("[Setter]","special")),C(U,A)||(q="["+A+"]"),Q||(D.seen.indexOf(ee.value)<0?(Q=S(L)?w(D,ee.value,null):w(D,ee.value,L-1)).indexOf(`
9
+ `)>-1&&(Q=V?Q.split(`
10
+ `).map(function(te){return" "+te}).join(`
11
+ `).substr(2):`
12
+ `+Q.split(`
13
+ `).map(function(te){return" "+te}).join(`
14
+ `)):Q=D.stylize("[Circular]","special")),E(q)){if(V&&A.match(/^\d+$/))return Q;(q=JSON.stringify(""+A)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(q=q.substr(1,q.length-2),q=D.stylize(q,"name")):(q=q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),q=D.stylize(q,"string"))}return q+": "+Q}function f(D){return Array.isArray(D)}function p(D){return typeof D=="boolean"}function S(D){return D===null}function N(D){return typeof D=="number"}function B(D){return typeof D=="string"}function E(D){return D===void 0}function T(D){return h(D)&&m(D)==="[object RegExp]"}function h(D){return typeof D=="object"&&D!==null}function R(D){return h(D)&&m(D)==="[object Date]"}function W(D){return h(D)&&(m(D)==="[object Error]"||D instanceof Error)}function X(D){return typeof D=="function"}function m(D){return Object.prototype.toString.call(D)}function b(D){return D<10?"0"+D.toString(10):D.toString(10)}t.debuglog=function(D){if(E(u)&&(u=r.env.NODE_DEBUG||""),D=D.toUpperCase(),!s[D])if(new RegExp("\\b"+D+"\\b","i").test(u)){var O=r.pid;s[D]=function(){var L=t.format.apply(t,arguments);console.error("%s %d: %s",D,O,L)}}else s[D]=function(){};return s[D]},t.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=f,t.isBoolean=p,t.isNull=S,t.isNullOrUndefined=function(D){return D==null},t.isNumber=N,t.isString=B,t.isSymbol=function(D){return typeof D=="symbol"},t.isUndefined=E,t.isRegExp=T,t.isObject=h,t.isDate=R,t.isError=W,t.isFunction=X,t.isPrimitive=function(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||D===void 0},t.isBuffer=n(105);var G=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(){var D=new Date,O=[b(D.getHours()),b(D.getMinutes()),b(D.getSeconds())].join(":");return[D.getDate(),G[D.getMonth()],O].join(" ")}function C(D,O){return Object.prototype.hasOwnProperty.call(D,O)}t.log=function(){console.log("%s - %s",j(),t.format.apply(t,arguments))},t.inherits=n(106),t._extend=function(D,O){if(!O||!h(O))return D;for(var L=Object.keys(O),U=L.length;U--;)D[L[U]]=O[L[U]];return D};var z=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function P(D,O){if(!D){var L=new Error("Promise was rejected with a falsy value");L.reason=D,D=L}return O(D)}t.promisify=function(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');if(z&&D[z]){var O;if(typeof(O=D[z])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(O,z,{value:O,enumerable:!1,writable:!1,configurable:!0}),O}function O(){for(var L,U,A=new Promise(function(Q,ee){L=Q,U=ee}),V=[],q=0;q<arguments.length;q++)V.push(arguments[q]);V.push(function(Q,ee){Q?U(Q):L(ee)});try{D.apply(this,V)}catch(Q){U(Q)}return A}return Object.setPrototypeOf(O,Object.getPrototypeOf(D)),z&&Object.defineProperty(O,z,{value:O,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(O,o(D))},t.promisify.custom=z,t.callbackify=function(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function O(){for(var L=[],U=0;U<arguments.length;U++)L.push(arguments[U]);var A=L.pop();if(typeof A!="function")throw new TypeError("The last argument must be of type Function");var V=this,q=function(){return A.apply(V,arguments)};D.apply(this,L).then(function(Q){r.nextTick(q,null,Q)},function(Q){r.nextTick(P,Q,q)})}return Object.setPrototypeOf(O,Object.getPrototypeOf(D)),Object.defineProperties(O,o(D)),O}}).call(this,n(2))},function(e,t,n){var r=n(13),o=n(61),l=n(3).LEVEL,u=e.exports=function(){var s=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.call(this,{objectMode:!0,highWaterMark:g.highWaterMark}),this.format=g.format,this.level=g.level,this.handleExceptions=g.handleExceptions,this.handleRejections=g.handleRejections,this.silent=g.silent,g.log&&(this.log=g.log),g.logv&&(this.logv=g.logv),g.close&&(this.close=g.close),this.once("pipe",function(c){s.levels=c.levels,s.parent=c}),this.once("unpipe",function(c){c===s.parent&&(s.parent=null,s.close&&s.close())})};r.inherits(u,o),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);var d=this.level||this.parent&&this.parent.level;if(!d||this.levels[d]>=this.levels[s[l]]){if(s&&!this.format)return this.log(s,c);var w=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s),this.format.options)}catch(y){w=y}if(w||!v){if(c(),w)throw w;return}return this.log(v,c)}return this._writableState.sync=!1,c(null)},u.prototype._writev=function(s,g){if(this.logv){var c=s.filter(this._accept,this);return c.length?this.logv(c,g):g(null)}for(var d=0;d<s.length;d++)if(this._accept(s[d]))if(!s[d].chunk||this.format){var w=void 0,v=void 0;try{v=this.format.transform(Object.assign({},s[d].chunk),this.format.options)}catch(y){w=y}if(w||!v){if(s[d].callback(),w)throw g(null),w}else this.log(v,s[d].callback)}else this.log(s[d].chunk,s[d].callback);return g(null)},u.prototype._accept=function(s){var g=s.chunk;if(this.silent)return!1;var c=this.level||this.parent&&this.parent.level;return!(g.exception!==!0&&c&&!(this.levels[c]>=this.levels[g[l]])||!this.handleExceptions&&g.exception===!0)},u.prototype._nop=function(){},e.exports.LegacyTransportStream=n(151)},function(e,t,n){e.exports=function(r,o){o||(o={}),typeof o=="function"&&(o={cmp:o});var l,u=typeof o.cycles=="boolean"&&o.cycles,s=o.cmp&&(l=o.cmp,function(c){return function(d,w){var v={key:d,value:c[d]},y={key:w,value:c[w]};return l(v,y)}}),g=[];return function c(d){if(d&&d.toJSON&&typeof d.toJSON=="function"&&(d=d.toJSON()),d!==void 0){if(typeof d=="number")return isFinite(d)?""+d:"null";if(typeof d!="object")return JSON.stringify(d);var w,v;if(Array.isArray(d)){for(v="[",w=0;w<d.length;w++)w&&(v+=","),v+=c(d[w])||"null";return v+"]"}if(d===null)return"null";if(g.indexOf(d)!==-1){if(u)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var y=g.push(d)-1,f=Object.keys(d).sort(s&&s(d));for(v="",w=0;w<f.length;w++){var p=f[w],S=c(d[p]);S&&(v&&(v+=","),v+=JSON.stringify(p)+":"+S)}return g.splice(y,1),"{"+v+"}"}}(r)}},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return typeof location<"u"?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return typeof navigator<"u"?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL=`
15
+ `,t.homedir=function(){return"/"}},function(e,t,n){(function(r){var o;function l(M){var Z=0;return function(){return Z<M.length?{done:!1,value:M[Z++]}:{done:!0}}}var u=typeof Object.defineProperties=="function"?Object.defineProperty:function(M,Z,re){M!=Array.prototype&&M!=Object.prototype&&(M[Z]=re.value)},s=function(M){M=[typeof window=="object"&&window,typeof self=="object"&&self,typeof r=="object"&&r,M];for(var Z=0;Z<M.length;++Z){var re=M[Z];if(re&&re.Math==Math)return re}throw Error("Cannot find global object")}(this);function g(){g=function(){},s.Symbol||(s.Symbol=w)}function c(M,Z){this.a=M,u(this,"description",{configurable:!0,writable:!0,value:Z})}c.prototype.toString=function(){return this.a};var d,w=(d=0,function M(Z){if(this instanceof M)throw new TypeError("Symbol is not a constructor");return new c("jscomp_symbol_"+(Z||"")+"_"+d++,Z)});function v(){g();var M=s.Symbol.iterator;M||(M=s.Symbol.iterator=s.Symbol("Symbol.iterator")),typeof Array.prototype[M]!="function"&&u(Array.prototype,M,{configurable:!0,writable:!0,value:function(){return function(Z){return v(),(Z={next:Z})[s.Symbol.iterator]=function(){return this},Z}(l(this))}}),v=function(){}}function y(M){var Z=typeof Symbol<"u"&&Symbol.iterator&&M[Symbol.iterator];return Z?Z.call(M):{next:l(M)}}var f,p=typeof Object.create=="function"?Object.create:function(M){function Z(){}return Z.prototype=M,new Z};if(typeof Object.setPrototypeOf=="function")f=Object.setPrototypeOf;else{var S;e:{var N={};try{N.__proto__={V:!0},S=N.V;break e}catch{}S=!1}f=S?function(M,Z){if(M.__proto__=Z,M.__proto__!==Z)throw new TypeError(M+" is not extensible");return M}:null}var B=f;function E(M,Z){if(M.prototype=p(Z.prototype),M.prototype.constructor=M,B)B(M,Z);else for(var re in Z)if(re!="prototype")if(Object.defineProperties){var ae=Object.getOwnPropertyDescriptor(Z,re);ae&&Object.defineProperty(M,re,ae)}else M[re]=Z[re];M.O=Z.prototype}function T(M,Z){if(Z){var re=s;M=M.split(".");for(var ae=0;ae<M.length-1;ae++){var de=M[ae];de in re||(re[de]={}),re=re[de]}(Z=Z(ae=re[M=M[M.length-1]]))!=ae&&Z!=null&&u(re,M,{configurable:!0,writable:!0,value:Z})}}T("Array.prototype.keys",function(M){return M||function(){return function(Z,re){v(),Z instanceof String&&(Z+="");var ae=0,de={next:function(){if(ae<Z.length){var me=ae++;return{value:re(me,Z[me]),done:!1}}return de.next=function(){return{done:!0,value:void 0}},de.next()}};return de[Symbol.iterator]=function(){return de},de}(this,function(Z){return Z})}}),T("Array.prototype.find",function(M){return M||function(Z,re){e:{var ae=this;ae instanceof String&&(ae=String(ae));for(var de=ae.length,me=0;me<de;me++){var ge=ae[me];if(Z.call(re,ge,me,ae)){Z=ge;break e}}Z=void 0}return Z}}),T("Object.is",function(M){return M||function(Z,re){return Z===re?Z!==0||1/Z==1/re:Z!=Z&&re!=re}}),T("Array.prototype.includes",function(M){return M||function(Z,re){var ae=this;ae instanceof String&&(ae=String(ae));var de=ae.length;for(0>(re=re||0)&&(re=Math.max(re+de,0));re<de;re++){var me=ae[re];if(me===Z||Object.is(me,Z))return!0}return!1}}),T("Promise",function(M){function Z(ge){this.b=0,this.c=void 0,this.a=[];var ye=this.f();try{ge(ye.resolve,ye.reject)}catch(ve){ye.reject(ve)}}function re(){this.a=null}function ae(ge){return ge instanceof Z?ge:new Z(function(ye){ye(ge)})}if(M)return M;re.prototype.b=function(ge){if(this.a==null){this.a=[];var ye=this;this.c(function(){ye.g()})}this.a.push(ge)};var de=s.setTimeout;re.prototype.c=function(ge){de(ge,0)},re.prototype.g=function(){for(;this.a&&this.a.length;){var ge=this.a;this.a=[];for(var ye=0;ye<ge.length;++ye){var ve=ge[ye];ge[ye]=null;try{ve()}catch(Re){this.f(Re)}}}this.a=null},re.prototype.f=function(ge){this.c(function(){throw ge})},Z.prototype.f=function(){function ge(Re){return function(Ce){ve||(ve=!0,Re.call(ye,Ce))}}var ye=this,ve=!1;return{resolve:ge(this.s),reject:ge(this.g)}},Z.prototype.s=function(ge){if(ge===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(ge instanceof Z)this.v(ge);else{e:switch(typeof ge){case"object":var ye=ge!=null;break e;case"function":ye=!0;break e;default:ye=!1}ye?this.m(ge):this.h(ge)}},Z.prototype.m=function(ge){var ye=void 0;try{ye=ge.then}catch(ve){return void this.g(ve)}typeof ye=="function"?this.w(ye,ge):this.h(ge)},Z.prototype.g=function(ge){this.i(2,ge)},Z.prototype.h=function(ge){this.i(1,ge)},Z.prototype.i=function(ge,ye){if(this.b!=0)throw Error("Cannot settle("+ge+", "+ye+"): Promise already settled in state"+this.b);this.b=ge,this.c=ye,this.l()},Z.prototype.l=function(){if(this.a!=null){for(var ge=0;ge<this.a.length;++ge)me.b(this.a[ge]);this.a=null}};var me=new re;return Z.prototype.v=function(ge){var ye=this.f();ge.F(ye.resolve,ye.reject)},Z.prototype.w=function(ge,ye){var ve=this.f();try{ge.call(ye,ve.resolve,ve.reject)}catch(Re){ve.reject(Re)}},Z.prototype.then=function(ge,ye){function ve(Le,He){return typeof Le=="function"?function(We){try{Re(Le(We))}catch(je){Ce(je)}}:He}var Re,Ce,Pe=new Z(function(Le,He){Re=Le,Ce=He});return this.F(ve(ge,Re),ve(ye,Ce)),Pe},Z.prototype.catch=function(ge){return this.then(void 0,ge)},Z.prototype.F=function(ge,ye){function ve(){switch(Re.b){case 1:ge(Re.c);break;case 2:ye(Re.c);break;default:throw Error("Unexpected state: "+Re.b)}}var Re=this;this.a==null?me.b(ve):this.a.push(ve)},Z.resolve=ae,Z.reject=function(ge){return new Z(function(ye,ve){ve(ge)})},Z.race=function(ge){return new Z(function(ye,ve){for(var Re=y(ge),Ce=Re.next();!Ce.done;Ce=Re.next())ae(Ce.value).F(ye,ve)})},Z.all=function(ge){var ye=y(ge),ve=ye.next();return ve.done?ae([]):new Z(function(Re,Ce){function Pe(We){return function(je){Le[We]=je,--He==0&&Re(Le)}}var Le=[],He=0;do Le.push(void 0),He++,ae(ve.value).F(Pe(Le.length-1),Ce),ve=ye.next();while(!ve.done)})},Z});var h=h||{},R=this||self;function W(M,Z){M=M.split("."),Z=Z||R;for(var re=0;re<M.length;re++)if((Z=Z[M[re]])==null)return null;return Z}function X(){}function m(M){var Z=typeof M;return Z=="object"&&M!=null||Z=="function"}function b(M,Z,re){return M.call.apply(M.bind,arguments)}function G(M,Z,re){if(!M)throw Error();if(2<arguments.length){var ae=Array.prototype.slice.call(arguments,2);return function(){var de=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(de,ae),M.apply(Z,de)}}return function(){return M.apply(Z,arguments)}}function j(M,Z,re){return(j=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?b:G).apply(null,arguments)}function C(M,Z){function re(){}re.prototype=Z.prototype,M.O=Z.prototype,M.prototype=new re,M.prototype.constructor=M}function z(M){this.a=M||{}}function P(M,Z,re,ae){this.f=M,this.c=Z,this.b=re,this.a=ae}function D(M,Z,re,ae){re=re===void 0?{}:re,this.c=M,this.a=re,this.b=Z,this.f=ae===void 0?null:ae}function O(M,Z,re,ae,de,me){this.name=M,this.a=de,this.b=me}function L(M,Z,re){re=re===void 0?{}:re;var ae=ae===void 0?new z:ae;return new P(Z,M,re,ae)}function U(M,Z,re){re=re===void 0?{}:re,Z=Error.call(this,Z),this.message=Z.message,"stack"in Z&&(this.stack=Z.stack),this.code=M,this.metadata=re}function A(M){this.a=M}function V(M){if(Error.captureStackTrace)Error.captureStackTrace(this,V);else{var Z=Error().stack;Z&&(this.stack=Z)}M&&(this.message=String(M))}function q(M,Z){for(var re="",ae=(M=M.split("%s")).length-1,de=0;de<ae;de++)re+=M[de]+(de<Z.length?Z[de]:"%s");V.call(this,re+M[ae])}function Q(){this.l=null,this.i=[],this.m=0,this.b=ee,this.f=this.a=this.h=0,this.c=null,this.g=0}z.prototype.get=function(M){return this.a[M]},z.prototype.G=function(){return Object.keys(this.a)},P.prototype.getRequestMessage=function(){return this.f},P.prototype.getMethodDescriptor=function(){return this.c},P.prototype.getMetadata=function(){return this.b},P.prototype.getCallOptions=function(){return this.a},D.prototype.getResponseMessage=function(){return this.c},D.prototype.getMetadata=function(){return this.a},D.prototype.getMethodDescriptor=function(){return this.b},D.prototype.getStatus=function(){return this.f},O.prototype.getName=function(){return this.name},O.prototype.getName=O.prototype.getName,E(U,Error),U.prototype.name="RpcError",A.prototype.on=function(M,Z){return M=="data"||M=="error"?this:this.a.on(M,Z)},A.prototype.removeListener=function(M,Z){return this.a.removeListener(M,Z)},A.prototype.cancel=function(){this.a.cancel()},C(V,Error),V.prototype.name="CustomError",C(q,V),q.prototype.name="AssertionError";var ee=0,te=1,k=2,x=3,_=0,I=128;function $(M,Z,re,ae){throw M.b=x,M.l="The stream is broken @"+M.m+"/"+re+". Error: "+ae+`. With input:
16
+ `+Z,Error(M.l)}var K,Y=Array.prototype.indexOf?function(M,Z){return Array.prototype.indexOf.call(M,Z,void 0)}:function(M,Z){if(typeof M=="string")return typeof Z!="string"||Z.length!=1?-1:M.indexOf(Z,0);for(var re=0;re<M.length;re++)if(re in M&&M[re]===Z)return re;return-1},ne=String.prototype.trim?function(M){return M.trim()}:function(M){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(M)[1]};function ie(M,Z){return M.indexOf(Z)!=-1}function ue(M,Z){return M<Z?-1:M>Z?1:0}e:{var we=R.navigator;if(we){var Oe=we.userAgent;if(Oe){K=Oe;break e}}K=""}var Ee="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function De(M){var Z=1;M=M.split(":");for(var re=[];0<Z&&M.length;)re.push(M.shift()),Z--;return M.length&&re.push(M.join(":")),re}function Te(M){return Te[" "](M),M}Te[" "]=X;var Ae,Ie,ze=ie(K,"Opera"),$e=ie(K,"Trident")||ie(K,"MSIE"),nt=ie(K,"Edge"),_t=ie(K,"Gecko")&&!(ie(K.toLowerCase(),"webkit")&&!ie(K,"Edge"))&&!(ie(K,"Trident")||ie(K,"MSIE"))&&!ie(K,"Edge"),vt=ie(K.toLowerCase(),"webkit")&&!ie(K,"Edge");e:{var Rt="",st=(Ie=K,_t?/rv:([^\);]+)(\)|;)/.exec(Ie):nt?/Edge\/([\d\.]+)/.exec(Ie):$e?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Ie):vt?/WebKit\/(\S+)/.exec(Ie):ze?/(?:Version)[ \/]?(\S+)/.exec(Ie):void 0);if(st&&(Rt=st?st[1]:""),$e){var pt,gt=R.document;if((pt=gt?gt.documentMode:void 0)!=null&&pt>parseFloat(Rt)){Ae=String(pt);break e}}Ae=Rt}var Pt={};function xt(){return function(M){var Z=Pt;return Object.prototype.hasOwnProperty.call(Z,9)?Z[9]:Z[9]=M(9)}(function(){for(var M=0,Z=ne(String(Ae)).split("."),re=ne("9").split("."),ae=Math.max(Z.length,re.length),de=0;M==0&&de<ae;de++){var me=Z[de]||"",ge=re[de]||"";do{if(me=/(\d*)(\D*)(.*)/.exec(me)||["","","",""],ge=/(\d*)(\D*)(.*)/.exec(ge)||["","","",""],me[0].length==0&&ge[0].length==0)break;M=ue(me[1].length==0?0:parseInt(me[1],10),ge[1].length==0?0:parseInt(ge[1],10))||ue(me[2].length==0,ge[2].length==0)||ue(me[2],ge[2]),me=me[3],ge=ge[3]}while(M==0)}return 0<=M})}function Ot(){this.K=this.K}Ot.prototype.K=!1;var Be=Object.freeze||function(M){return M};function ft(M,Z){this.type=M,this.a=this.target=Z,this.defaultPrevented=!1}ft.prototype.b=function(){this.defaultPrevented=!0};var zt=function(){if(!R.addEventListener||!Object.defineProperty)return!1;var M=!1,Z=Object.defineProperty({},"passive",{get:function(){M=!0}});try{R.addEventListener("test",X,Z),R.removeEventListener("test",X,Z)}catch{}return M}();function rt(M,Z){if(ft.call(this,M?M.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,M){var re=this.type=M.type,ae=M.changedTouches&&M.changedTouches.length?M.changedTouches[0]:null;if(this.target=M.target||M.srcElement,this.a=Z,Z=M.relatedTarget){if(_t){e:{try{Te(Z.nodeName);var de=!0;break e}catch{}de=!1}de||(Z=null)}}else re=="mouseover"?Z=M.fromElement:re=="mouseout"&&(Z=M.toElement);this.relatedTarget=Z,ae?(this.clientX=ae.clientX!==void 0?ae.clientX:ae.pageX,this.clientY=ae.clientY!==void 0?ae.clientY:ae.pageY,this.screenX=ae.screenX||0,this.screenY=ae.screenY||0):(this.clientX=M.clientX!==void 0?M.clientX:M.pageX,this.clientY=M.clientY!==void 0?M.clientY:M.pageY,this.screenX=M.screenX||0,this.screenY=M.screenY||0),this.button=M.button,this.key=M.key||"",this.ctrlKey=M.ctrlKey,this.altKey=M.altKey,this.shiftKey=M.shiftKey,this.metaKey=M.metaKey,this.pointerId=M.pointerId||0,this.pointerType=typeof M.pointerType=="string"?M.pointerType:mt[M.pointerType]||"",this.c=M,M.defaultPrevented&&rt.O.b.call(this)}}C(rt,ft);var mt=Be({2:"touch",3:"pen",4:"mouse"});rt.prototype.b=function(){rt.O.b.call(this);var M=this.c;M.preventDefault?M.preventDefault():M.returnValue=!1};var wt="closure_listenable_"+(1e6*Math.random()|0),Ht=0;function Lt(M,Z,re,ae,de){this.listener=M,this.proxy=null,this.src=Z,this.type=re,this.capture=!!ae,this.H=de,this.key=++Ht,this.A=this.D=!1}function it(M){M.A=!0,M.listener=null,M.proxy=null,M.src=null,M.H=null}function St(M){this.src=M,this.a={},this.b=0}function Fe(M,Z){var re=Z.type;if(re in M.a){var ae,de=M.a[re],me=Y(de,Z);(ae=0<=me)&&Array.prototype.splice.call(de,me,1),ae&&(it(Z),M.a[re].length==0&&(delete M.a[re],M.b--))}}function jt(M,Z,re,ae){for(var de=0;de<M.length;++de){var me=M[de];if(!me.A&&me.listener==Z&&me.capture==!!re&&me.H==ae)return de}return-1}St.prototype.add=function(M,Z,re,ae,de){var me=M.toString();(M=this.a[me])||(M=this.a[me]=[],this.b++);var ge=jt(M,Z,ae,de);return-1<ge?(Z=M[ge],re||(Z.D=!1)):((Z=new Lt(Z,this.src,me,!!ae,de)).D=re,M.push(Z)),Z},St.prototype.remove=function(M,Z,re,ae){if(!((M=M.toString())in this.a))return!1;var de=this.a[M];return-1<(Z=jt(de,Z,re,ae))&&(it(de[Z]),Array.prototype.splice.call(de,Z,1),de.length==0&&(delete this.a[M],this.b--),!0)};var _e="closure_lm_"+(1e6*Math.random()|0),F={};function H(M,Z,re,ae,de){if(ae&&ae.once)(function ge(ye,ve,Re,Ce,Pe){if(Array.isArray(ve))for(var Le=0;Le<ve.length;Le++)ge(ye,ve[Le],Re,Ce,Pe);else Re=fe(Re),ye&&ye[wt]?ye.f.add(String(ve),Re,!0,m(Ce)?!!Ce.capture:!!Ce,Pe):J(ye,ve,Re,!0,Ce,Pe)})(M,Z,re,ae,de);else if(Array.isArray(Z))for(var me=0;me<Z.length;me++)H(M,Z[me],re,ae,de);else re=fe(re),M&&M[wt]?M.f.add(String(Z),re,!1,m(ae)?!!ae.capture:!!ae,de):J(M,Z,re,!1,ae,de)}function J(M,Z,re,ae,de,me){if(!Z)throw Error("Invalid event type");var ge=m(de)?!!de.capture:!!de,ye=he(M);if(ye||(M[_e]=ye=new St(M)),!(re=ye.add(Z,re,ae,ge,me)).proxy)if(ae=function(){var ve=ce;return function Re(Ce){return ve.call(Re.src,Re.listener,Ce)}}(),re.proxy=ae,ae.src=M,ae.listener=re,M.addEventListener)zt||(de=ge),de===void 0&&(de=!1),M.addEventListener(Z.toString(),ae,de);else if(M.attachEvent)M.attachEvent(se(Z.toString()),ae);else{if(!M.addListener||!M.removeListener)throw Error("addEventListener and attachEvent are unavailable.");M.addListener(ae)}}function oe(M){if(typeof M!="number"&&M&&!M.A){var Z=M.src;if(Z&&Z[wt])Fe(Z.f,M);else{var re=M.type,ae=M.proxy;Z.removeEventListener?Z.removeEventListener(re,ae,M.capture):Z.detachEvent?Z.detachEvent(se(re),ae):Z.addListener&&Z.removeListener&&Z.removeListener(ae),(re=he(Z))?(Fe(re,M),re.b==0&&(re.src=null,Z[_e]=null)):it(M)}}}function se(M){return M in F?F[M]:F[M]="on"+M}function ce(M,Z){if(M.A)M=!0;else{Z=new rt(Z,this);var re=M.listener,ae=M.H||M.src;M.D&&oe(M),M=re.call(ae,Z)}return M}function he(M){return(M=M[_e])instanceof St?M:null}var pe="__closure_events_fn_"+(1e9*Math.random()>>>0);function fe(M){return typeof M=="function"?M:(M[pe]||(M[pe]=function(Z){return M.handleEvent(Z)}),M[pe])}function le(){Ot.call(this),this.f=new St(this),this.U=this}function Se(M,Z){M=M.U;var re=Z.type||Z;if(typeof Z=="string")Z=new ft(Z,M);else if(Z instanceof ft)Z.target=Z.target||M;else{var ae=Z;(function(de,me){for(var ge,ye,ve=1;ve<arguments.length;ve++){for(ge in ye=arguments[ve])de[ge]=ye[ge];for(var Re=0;Re<Ee.length;Re++)ge=Ee[Re],Object.prototype.hasOwnProperty.call(ye,ge)&&(de[ge]=ye[ge])}})(Z=new ft(re,M),ae)}Ne(M=Z.a=M,re,!0,Z),Ne(M,re,!1,Z)}function Ne(M,Z,re,ae){if(Z=M.f.a[String(Z)]){Z=Z.concat();for(var de=!0,me=0;me<Z.length;++me){var ge=Z[me];if(ge&&!ge.A&&ge.capture==re){var ye=ge.listener,ve=ge.H||ge.src;ge.D&&Fe(M.f,ge),de=ye.call(ve,ae)!==!1&&de}}}}C(le,Ot),le.prototype[wt]=!0,le.prototype.addEventListener=function(M,Z,re,ae){H(this,M,Z,re,ae)},le.prototype.removeEventListener=function(M,Z,re,ae){(function de(me,ge,ye,ve,Re){if(Array.isArray(ge))for(var Ce=0;Ce<ge.length;Ce++)de(me,ge[Ce],ye,ve,Re);else ve=m(ve)?!!ve.capture:!!ve,ye=fe(ye),me&&me[wt]?me.f.remove(String(ge),ye,ve,Re):me&&(me=he(me))&&(ge=me.a[ge.toString()],me=-1,ge&&(me=jt(ge,ye,ve,Re)),(ye=-1<me?ge[me]:null)&&oe(ye))})(this,M,Z,re,ae)};var xe=R;function Ve(M,Z,re){if(typeof M=="function")re&&(M=j(M,re));else{if(!M||typeof M.handleEvent!="function")throw Error("Invalid listener argument");M=j(M.handleEvent,M)}return 2147483647<Number(Z)?-1:xe.setTimeout(M,Z||0)}function qe(M,Z){this.name=M,this.value=Z}qe.prototype.toString=function(){return this.name};var Xe,et,ke,Ue=new qe("OFF",1/0),Ze=new qe("SEVERE",1e3),Ke=new qe("CONFIG",700),Je=new qe("FINE",500);function Qe(){this.clear()}function ut(M,Z,re){this.reset(M||Ue,Z,re,void 0,void 0)}function lt(M,Z){this.a=null,this.f=[],this.b=(Z===void 0?null:Z)||null,this.c=[],this.g={getName:function(){return M}}}function yt(M){return M.a?M.a:M.b?yt(M.b):(function(Z,re){throw new q("Failure"+(Z?": "+Z:""),Array.prototype.slice.call(arguments,1))}("Root logger has no level set."),Ue)}function kt(){this.entries={};var M=new lt("");M.a=Ke,this.entries[""]=M}function Ct(M,Z,re){var ae=M.entries[Z];if(ae)return re!==void 0&&(ae.a=re),ae;ae=Ct(M,Z.substr(0,Z.lastIndexOf(".")));var de=new lt(Z,ae);return M.entries[Z]=de,ae.c.push(de),re!==void 0&&(de.a=re),de}function Wt(){return et||(et=new kt),et}function Vt(M,Z,re){var ae;(ae=M)&&(ae=M&&Z)&&(ae=(ae=Z.value)>=(M?yt(Ct(Wt(),M.getName())):Ue).value),ae&&(Z=Z||Ue,ae=Ct(Wt(),M.getName()),typeof re=="function"&&(re=re()),Xe||(Xe=new Qe),function(de,me){for(;de;)de.f.forEach(function(ge){ge(me)}),de=de.b}(ae,M=new ut(Z,re,M=M.getName())))}function ot(M,Z){M&&Vt(M,Je,Z)}function Kt(){}function Xt(M){var Z;return(Z=M.a)||(Z={},en(M)&&(Z[0]=!0,Z[1]=!0),Z=M.a=Z),Z}function Jt(){}function Qt(M){return(M=en(M))?new ActiveXObject(M):new XMLHttpRequest}function en(M){if(!M.b&&typeof XMLHttpRequest>"u"&&typeof ActiveXObject<"u"){for(var Z=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],re=0;re<Z.length;re++){var ae=Z[re];try{return new ActiveXObject(ae),M.b=ae}catch{}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return M.b}function Gt(M,Z){this.b=M[R.Symbol.iterator](),this.c=Z,this.f=0}Qe.prototype.clear=function(){},ut.prototype.reset=function(){},Kt.prototype.a=null,C(Jt,Kt),ke=new Jt,g(),v(),Gt.prototype[Symbol.iterator]=function(){return this},Gt.prototype.next=function(){var M=this.b.next();return{value:M.done?void 0:this.c.call(void 0,M.value,this.f++),done:M.done}},g(),v(),g(),v();var Bt="StopIteration"in R?R.StopIteration:{message:"StopIteration",stack:""};function Et(){}function tn(M){if(M instanceof dt||M instanceof bt||M instanceof Tt)return M;if(typeof M.next=="function")return new dt(function(){return nn(M)});if(g(),v(),typeof M[Symbol.iterator]=="function")return g(),v(),new dt(function(){return M[Symbol.iterator]()});if(typeof M.u=="function")return new dt(function(){return nn(M.u())});throw Error("Not an iterator or iterable.")}function nn(M){if(!(M instanceof Et))return M;var Z=!1;return{next:function(){for(var re;!Z;)try{re=M.a();break}catch(ae){if(ae!==Bt)throw ae;Z=!0}return{value:re,done:Z}}}}function dt(M){this.b=M}function bt(M){this.b=M}function Tt(M){dt.call(this,function(){return M}),this.f=M}function Ut(M,Z){this.o={},this.j=[],this.B=this.size=0;var re=arguments.length;if(1<re){if(re%2)throw Error("Uneven number of arguments");for(var ae=0;ae<re;ae+=2)this.set(arguments[ae],arguments[ae+1])}else M&&this.addAll(M)}function $t(M){if(M.size!=M.j.length){for(var Z=0,re=0;Z<M.j.length;){var ae=M.j[Z];It(M.o,ae)&&(M.j[re++]=ae),Z++}M.j.length=re}if(M.size!=M.j.length){var de={};for(re=Z=0;Z<M.j.length;)It(de,ae=M.j[Z])||(M.j[re++]=ae,de[ae]=1),Z++;M.j.length=re}}function It(M,Z){return Object.prototype.hasOwnProperty.call(M,Z)}Et.prototype.next=function(){return Et.prototype.a.call(this)},Et.prototype.a=function(){throw Bt},Et.prototype.u=function(){return this},g(),v(),dt.prototype.u=function(){return new bt(this.b())},dt.prototype[Symbol.iterator]=function(){return new Tt(this.b())},dt.prototype.c=function(){return new Tt(this.b())},g(),v(),E(bt,Et),bt.prototype.a=function(){var M=this.b.next();if(M.done)throw Bt;return M.value},bt.prototype.next=function(){return bt.prototype.a.call(this)},bt.prototype[Symbol.iterator]=function(){return new Tt(this.b)},bt.prototype.c=function(){return new Tt(this.b)},E(Tt,dt),Tt.prototype.next=function(){return this.f.next()},(o=Ut.prototype).G=function(){return $t(this),this.j.concat()},o.has=function(M){return It(this.o,M)},o.clear=function(){this.o={},this.B=this.size=this.j.length=0},o.remove=function(M){return this.delete(M)},o.delete=function(M){return!!It(this.o,M)&&(delete this.o[M],--this.size,this.B++,this.j.length>2*this.size&&$t(this),!0)},o.get=function(M,Z){return It(this.o,M)?this.o[M]:Z},o.set=function(M,Z){It(this.o,M)||(this.size+=1,this.j.push(M),this.B++),this.o[M]=Z},o.addAll=function(M){if(M instanceof Ut)for(var Z=M.G(),re=0;re<Z.length;re++)this.set(Z[re],M.get(Z[re]));else for(Z in M)this.set(Z,M[Z])},o.forEach=function(M,Z){for(var re=this.G(),ae=0;ae<re.length;ae++){var de=re[ae],me=this.get(de);M.call(Z,me,de,this)}},o.clone=function(){return new Ut(this)},o.keys=function(){return tn(this.u(!0)).c()},o.values=function(){return tn(this.u(!1)).c()},o.entries=function(){var M=this;return function(Z,re){return new Gt(Z,re)}(this.keys(),function(Z){return[Z,M.get(Z)]})},o.u=function(M){$t(this);var Z=0,re=this.B,ae=this,de=new Et;return de.a=function(){if(re!=ae.B)throw Error("The map has changed since the iterator was created");if(Z>=ae.j.length)throw Bt;var me=ae.j[Z++];return M?me:ae.o[me]},de.next=de.a.bind(de),de};var dn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ft(M){le.call(this),this.headers=new Ut,this.C=M||null,this.c=!1,this.J=this.a=null,this.P=this.v="",this.g=0,this.l="",this.i=this.N=this.s=this.L=!1,this.h=0,this.w=null,this.m=rn,this.I=this.M=!1}C(Ft,le);var rn="";Ft.prototype.b=Ct(Wt(),"goog.net.XhrIo",void 0).g;var hn=/^https?$/i,pn=["POST","PUT"];function mn(M,Z,re){if(M.a)throw Error("[goog.net.XhrIo] Object is active with another request="+M.v+"; newUri="+Z);M.v=Z,M.l="",M.g=0,M.P="POST",M.L=!1,M.c=!0,M.a=M.C?Qt(M.C):Qt(ke),M.J=M.C?Xt(M.C):Xt(ke),M.a.onreadystatechange=j(M.R,M);try{ot(M.b,ht(M,"Opening Xhr")),M.N=!0,M.a.open("POST",String(Z),!0),M.N=!1}catch(me){return ot(M.b,ht(M,"Error opening Xhr: "+me.message)),void on(M,me)}Z=re||"";var ae=(re=M.headers.clone()).G().find(function(me){return me.toLowerCase()=="content-type"}),de=R.FormData&&Z instanceof R.FormData;!(0<=Y(pn,"POST"))||ae||de||re.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),re.forEach(function(me,ge){this.a.setRequestHeader(ge,me)},M),M.m&&(M.a.responseType=M.m),"withCredentials"in M.a&&M.a.withCredentials!==M.M&&(M.a.withCredentials=M.M);try{ln(M),0<M.h&&(M.I=function(me){return $e&&xt()&&typeof me.timeout=="number"&&me.ontimeout!==void 0}(M.a),ot(M.b,ht(M,"Will abort after "+M.h+"ms if incomplete, xhr2 "+M.I)),M.I?(M.a.timeout=M.h,M.a.ontimeout=j(M.T,M)):M.w=Ve(M.T,M.h,M)),ot(M.b,ht(M,"Sending request")),M.s=!0,M.a.send(Z),M.s=!1}catch(me){ot(M.b,ht(M,"Send error: "+me.message)),on(M,me)}}function on(M,Z){M.c=!1,M.a&&(M.i=!0,M.a.abort(),M.i=!1),M.l=Z,M.g=5,an(M),qt(M)}function an(M){M.L||(M.L=!0,Se(M,"complete"),Se(M,"error"))}function sn(M){if(M.c&&h!==void 0){if(M.J[1]&&At(M)==4&&M.getStatus()==2)ot(M.b,ht(M,"Local request error detected and ignored"));else if(M.s&&At(M)==4)Ve(M.R,0,M);else if(Se(M,"readystatechange"),At(M)==4){ot(M.b,ht(M,"Request complete")),M.c=!1;try{var Z,re=M.getStatus();e:switch(re){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var ae=!0;break e;default:ae=!1}if(!(Z=ae)){var de;if(de=re===0){var me=String(M.v).match(dn)[1]||null;if(!me&&R.self&&R.self.location){var ge=R.self.location.protocol;me=ge.substr(0,ge.length-1)}de=!hn.test(me?me.toLowerCase():"")}Z=de}if(Z)Se(M,"complete"),Se(M,"success");else{M.g=6;try{var ye=2<At(M)?M.a.statusText:""}catch(ve){ot(M.b,"Can not get status: "+ve.message),ye=""}M.l=ye+" ["+M.getStatus()+"]",an(M)}}finally{qt(M)}}}}function qt(M){if(M.a){ln(M);var Z=M.a,re=M.J[0]?X:null;M.a=null,M.J=null,Se(M,"ready");try{Z.onreadystatechange=re}catch(ae){(M=M.b)&&Vt(M,Ze,"Problem encountered resetting onreadystatechange: "+ae.message)}}}function ln(M){M.a&&M.I&&(M.a.ontimeout=null),M.w&&(xe.clearTimeout(M.w),M.w=null)}function At(M){return M.a?M.a.readyState:0}function un(M,Z){if(M.a&&At(M)==4)return(M=M.a.getResponseHeader(Z))===null?void 0:M}function ht(M,Z){return Z+" ["+M.P+" "+M.v+" "+M.getStatus()+"]"}(o=Ft.prototype).T=function(){h!==void 0&&this.a&&(this.l="Timed out after "+this.h+"ms, aborting",this.g=8,ot(this.b,ht(this,this.l)),Se(this,"timeout"),this.abort(8))},o.abort=function(M){this.a&&this.c&&(ot(this.b,ht(this,"Aborting")),this.c=!1,this.i=!0,this.a.abort(),this.i=!1,this.g=M||7,Se(this,"complete"),Se(this,"abort"),qt(this))},o.R=function(){this.K||(this.N||this.s||this.i?sn(this):this.W())},o.W=function(){sn(this)},o.getStatus=function(){try{return 2<At(this)?this.a.status:-1}catch{return-1}};var cn={},Nt=null;function yn(M){var Z=M.length,re=3*Z/4;re%3?re=Math.floor(re):ie("=.",M[Z-1])&&(re=ie("=.",M[Z-2])?re-2:re-1);var ae=new Uint8Array(re),de=0;return function(me,ge){function ye(He){for(;ve<me.length;){var We=me.charAt(ve++),je=Nt[We];if(je!=null)return je;if(!/^[\s\xa0]*$/.test(We))throw Error("Unknown base64 encoding at char: "+We)}return He}gn();for(var ve=0;;){var Re=ye(-1),Ce=ye(0),Pe=ye(64),Le=ye(64);if(Le===64&&Re===-1)break;ge(Re<<2|Ce>>4),Pe!=64&&(ge(Ce<<4&240|Pe>>2),Le!=64&&ge(Pe<<6&192|Le))}}(M,function(me){ae[de++]=me}),ae.subarray(0,de)}function gn(){if(!Nt){Nt={};for(var M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Z=["+/=","+/","-_=","-_.","-_"],re=0;5>re;re++){var ae=M.concat(Z[re].split(""));cn[re]=ae;for(var de=0;de<ae.length;de++){var me=ae[de];Nt[me]===void 0&&(Nt[me]=de)}}}}var bn=["content-type","grpc-status","grpc-message"];function ct(M){this.a=M.Z,this.m=null,this.b=[],this.h=[],this.g=[],this.f=[],this.c=[],this.l=!1,this.i=0,this.s=new Q;var Z=this;H(this.a,"readystatechange",function(){var re=Z.a;if(re=re.a?re.a.getResponseHeader("Content-Type"):null){if((re=re.toLowerCase()).lastIndexOf("application/grpc-web-text",0)==0){re=Z.a;try{var ae=re.a?re.a.responseText:""}catch(ve){ot(re.b,"Can not get responseText: "+ve.message),ae=""}if(ae=(re=ae||"").length-re.length%4,(re=re.substr(Z.i,ae-Z.i)).length==0)return;Z.i=ae,re=yn(re)}else{if(re.lastIndexOf("application/grpc",0)!=0)return void Mt(Z,new U(2,"Unknown Content-type received."));re=new Uint8Array(function(ve){try{if(!ve.a)return null;if("response"in ve.a)return ve.a.response;switch(ve.m){case rn:case"text":return ve.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in ve.a)return ve.a.mozResponseArrayBuffer}var Re=ve.b;return Re&&Vt(Re,Ze,"Response type "+ve.m+" is not supported on this browser"),null}catch(Ce){return ot(ve.b,"Can not get response: "+Ce.message),null}}(Z.a))}ae=null;try{ae=function(ve,Re){function Ce(at){je.f++,je.a=(je.a<<8)+at,je.f==4&&(je.b=k,je.g=0,typeof Uint8Array<"u"?je.c=new Uint8Array(je.a):je.c=Array(je.a),je.a==0&&Le())}function Pe(at){je.c[je.g++]=at,je.g==je.a&&Le()}function Le(){var at={};at[je.h]=je.c,je.i.push(at),je.b=ee}var He,We,je=ve,Ye=0;for(He=Re instanceof Uint8Array||Re instanceof Array?Re:new Uint8Array(Re);Ye<He.length;){switch(je.b){case x:$(je,He,Ye,"stream already broken");break;case ee:(We=He[Ye])==_||We==I?je.h=We:$(je,He,Ye,"invalid frame byte"),je.b=te,je.a=0,je.f=0;break;case te:Ce(He[Ye]);break;case k:Pe(He[Ye]);break;default:throw Error("unexpected parser state: "+je.b)}je.m++,Ye++}return ve=je.i,je.i=[],0<ve.length?ve:null}(Z.s,re)}catch{Mt(Z,new U(2,"Error in parsing response body"))}if(ae)for(re=0;re<ae.length;re++){if(_ in ae[re]){var de=ae[re][_];if(de){var me=!1,ge=void 0;try{ge=Z.m(de),me=!0}catch(ve){Mt(Z,new U(13,"Error when deserializing response data; error: "+ve+", response: "+ge))}if(me)for(de=ge,me=0;me<Z.b.length;me++)Z.b[me](de)}}if(I in ae[re]&&0<ae[re][I].length){for(de="",me=0;me<ae[re][I].length;me++)de+=String.fromCharCode(ae[re][I][me]);for(de=de.trim().split(`\r
17
+ `),me={},ge=0;ge<de.length;ge++){var ye=de[ge].indexOf(":");me[de[ge].substring(0,ye).trim()]=de[ge].substring(ye+1).trim()}de=me,me=0,ge="","grpc-status"in de&&(me=Number(de["grpc-status"]),delete de["grpc-status"]),"grpc-message"in de&&(ge=de["grpc-message"],delete de["grpc-message"]),Mt(Z,new U(me,ge,de))}}}}),H(this.a,"complete",function(){var re=Z.a.g,ae=2,de="",me={},ge=function(ve){var Re={};ve=(ve.a&&At(ve)==4&&ve.a.getAllResponseHeaders()||"").split(`\r
18
+ `);for(var Ce=0;Ce<ve.length;Ce++)if(!/^[\s\xa0]*$/.test(ve[Ce])){var Pe=De(ve[Ce]),Le=Pe[0];if(typeof(Pe=Pe[1])=="string"){Pe=Pe.trim();var He=Re[Le]||[];Re[Le]=He,He.push(Pe)}}return function(We,je){var Ye,at={};for(Ye in We)at[Ye]=je.call(void 0,We[Ye],Ye,We);return at}(Re,function(We){return We.join(", ")})}(Z.a);Object.keys(ge).forEach(function(ve){bn.includes(ve)||(me[ve]=ge[ve])}),function(ve,Re){for(var Ce=0;Ce<ve.g.length;Ce++)ve.g[Ce](Re)}(Z,me);var ye=-1;if(re!=0){switch(re){case 7:ae=10;break;case 8:ae=4;break;case 6:ae=function(ve){switch(ve){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}}(ye=Z.a.getStatus());break;default:ae=14}ae==10&&Z.l||(de=function(ve){switch(ve){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}}(re),ye!=-1&&(de+=", http status code: "+ye),Mt(Z,new U(ae,de)))}else ye=!1,"grpc-status"in ge&&(ae=Number(un(Z.a,"grpc-status")),"grpc-message"in ge&&(de=un(Z.a,"grpc-message")),ae!=0&&(Mt(Z,new U(ae,de||"",ge)),ye=!0)),ye||function(ve){for(var Re=0;Re<ve.c.length;Re++)ve.c[Re]()}(Z)})}function Dt(M,Z){-1<(Z=M.indexOf(Z))&&M.splice(Z,1)}function Mt(M,Z){if(Z.code!=0)for(var re=new U(Z.code,decodeURIComponent(Z.message||""),Z.metadata),ae=0;ae<M.f.length;ae++)M.f[ae](re);for(Z={code:Z.code,details:decodeURIComponent(Z.message||""),metadata:Z.metadata},re=0;re<M.h.length;re++)M.h[re](Z)}function tt(M,Z){M=M===void 0?{}:M,this.a=M.format||W("format",M)||"text",this.g=M.aa||W("suppressCorsPreflight",M)||!1,this.f=M.withCredentials||W("withCredentials",M)||!1,this.b=M.$||W("streamInterceptors",M)||[],this.h=M.ba||W("unaryInterceptors",M)||[],this.c=Z||null}function Zt(M,Z,re){var ae=Z.getMethodDescriptor(),de=re+ae.getName();(re=M.c?M.c:new Ft).M=M.f;var me=new ct({Z:re});me.m=ae.b;var ge=Z.getMetadata();for(ye in ge)re.headers.set(ye,ge[ye]);if(M.a=="text"?(re.headers.set("Content-Type","application/grpc-web-text"),re.headers.set("Accept","application/grpc-web-text")):re.headers.set("Content-Type","application/grpc-web+proto"),re.headers.set("X-User-Agent","grpc-web-javascript/0.1"),re.headers.set("X-Grpc-Web","1"),re.headers.has("deadline")){var ye=Number(re.headers.get("deadline"));ye=Math.ceil(ye-new Date().getTime()),re.headers.delete("deadline"),1/0===ye&&(ye=0),0<ye&&(re.headers.set("grpc-timeout",ye+"m"),re.h=Math.max(0,Math.max(1e3,Math.ceil(1.1*ye))))}if(M.g){ye={};for(var ve=y((ge=re.headers).keys()),Re=ve.next();!Re.done;Re=ve.next())ye[Re=Re.value]=ge.get(Re);re.headers.clear();e:{for(Ce in ye){var Ce=!1;break e}Ce=!0}Ce||(ye=function(He){var We="";return function(je,Ye){for(var at in je)Ye.call(void 0,je[at],at,je)}(He,function(je,Ye){We+=Ye,We+=":",We+=je,We+=`\r
19
+ `}),We}(ye),typeof de=="string"?(Ce=encodeURIComponent("$httpHeaders"),(Ce+=ye=ye!=null?"="+encodeURIComponent(String(ye)):"")&&(0>(ye=de.indexOf("#"))&&(ye=de.length),0>(ge=de.indexOf("?"))||ge>ye?(ge=ye,ve=""):ve=de.substring(ge+1,ye),ye=(de=[de.substr(0,ge),ve,de.substr(ye)])[1],de[1]=Ce?ye?ye+"&"+Ce:Ce:ye,de=de[0]+(de[1]?"?"+de[1]:"")+de[2])):de.a("$httpHeaders",ye))}for(ae=(Z=(0,ae.a)(Z.getRequestMessage())).length,Ce=[0,0,0,0],ye=new Uint8Array(5+ae),ge=3;0<=ge;ge--)Ce[ge]=ae%256,ae>>>=8;if(ye.set(new Uint8Array(Ce),1),ye.set(Z,5),Z=ye,M.a=="text"){var Pe;for(M=Z,Pe===void 0&&(Pe=0),gn(),Pe=cn[Pe],Z=Array(Math.floor(M.length/3)),ae=Pe[64]||"",Ce=ye=0;ye<M.length-2;ye+=3){Re=M[ye];var Le=M[ye+1];ve=M[ye+2],ge=Pe[Re>>2],Re=Pe[(3&Re)<<4|Le>>4],Le=Pe[(15&Le)<<2|ve>>6],ve=Pe[63&ve],Z[Ce++]=ge+Re+Le+ve}switch(ge=0,ve=ae,M.length-ye){case 2:ve=Pe[(15&(ge=M[ye+1]))<<2]||ae;case 1:M=M[ye],Z[Ce]=Pe[M>>2]+Pe[(3&M)<<4|ge>>4]+ve+ae}Z=Z.join("")}else M.a=="binary"&&(re.m="arraybuffer");return mn(re,de,Z),me}function fn(M,Z,re){var ae=!1,de=null,me=!1;M.on("data",function(ge){ae=!0,de=ge}),M.on("error",function(ge){ge.code==0||me||(me=!0,Z(ge,null))}),M.on("status",function(ge){ge.code==0||me?re&&Z(null,null,ge):(me=!0,Z({code:ge.code,message:ge.details,metadata:ge.metadata},null))}),re&&M.on("metadata",function(ge){Z(null,null,null,ge)}),M.on("end",function(){me||(ae?re?Z(null,de,null,null,!0):Z(null,de):Z({code:2,message:"Incomplete response"})),re&&Z(null,null)})}function Yt(M,Z){var re=M;return Z.forEach(function(ae){var de=re;re=function(me){return ae.intercept(me,de)}}),re}ct.prototype.on=function(M,Z){return M=="data"?this.b.push(Z):M=="status"?this.h.push(Z):M=="metadata"?this.g.push(Z):M=="end"?this.c.push(Z):M=="error"&&this.f.push(Z),this},ct.prototype.removeListener=function(M,Z){return M=="data"?Dt(this.b,Z):M=="status"?Dt(this.h,Z):M=="metadata"?Dt(this.g,Z):M=="end"?Dt(this.c,Z):M=="error"&&Dt(this.f,Z),this},ct.prototype.cancel=function(){this.l=!0,this.a.abort()},ct.prototype.cancel=ct.prototype.cancel,ct.prototype.removeListener=ct.prototype.removeListener,ct.prototype.on=ct.prototype.on,tt.prototype.X=function(M,Z,re,ae,de){var me=this,ge=M.substr(0,M.length-ae.name.length);return fn(M=Yt(function(ye){return Zt(me,ye,ge)},this.b).call(this,L(ae,Z,re)),de,!1),new A(M)},tt.prototype.S=function(M,Z,re,ae){var de=this,me=M.substr(0,M.length-ae.name.length);return Yt(function(ge){return new Promise(function(ye,ve){var Re,Ce,Pe;fn(Zt(de,ge,me),function(Le,He,We,je,Ye){Le?ve(Le):Ye?Pe=He:We?Ce=We:je?Re=je:(Le=ge.getMethodDescriptor(),ye(new D(Pe,Le,He=(He=Re)===void 0?{}:He,Ce===void 0?null:Ce)))},!0)})},this.h).call(this,L(ae,Z,re)).then(function(ge){return ge.getResponseMessage()})},tt.prototype.unaryCall=function(M,Z,re,ae){return this.S(M,Z,re,ae)},tt.prototype.Y=function(M,Z,re,ae){var de=this,me=M.substr(0,M.length-ae.name.length);return Yt(function(ge){return Zt(de,ge,me)},this.b).call(this,L(ae,Z,re))},tt.prototype.serverStreaming=tt.prototype.Y,tt.prototype.unaryCall=tt.prototype.unaryCall,tt.prototype.thenableCall=tt.prototype.S,tt.prototype.rpcCall=tt.prototype.X,e.exports.CallOptions=z,e.exports.MethodDescriptor=O,e.exports.GrpcWebClientBase=tt,e.exports.RpcError=U,e.exports.StatusCode={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,UNAUTHENTICATED:16,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15},e.exports.MethodType={UNARY:"unary",SERVER_STREAMING:"server_streaming",BIDI_STREAMING:"bidi_streaming"},xe=typeof globalThis<"u"&&globalThis||self}).call(this,n(6))},function(e,t,n){var r=n(57),o=n(60).warn;t.version=n(137).version,t.transports=n(138),t.config=n(49),t.addColors=r.levels,t.format=r.format,t.createLogger=n(88),t.ExceptionHandler=n(89),t.RejectionHandler=n(93),t.Container=n(214),t.Transport=n(14),t.loggers=new t.Container;var l=t.createLogger();Object.keys(t.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(function(u){return t[u]=function(){return l[u].apply(l,arguments)}}),Object.defineProperty(t,"level",{get:function(){return l.level},set:function(u){l.level=u}}),Object.defineProperty(t,"exceptions",{get:function(){return l.exceptions}}),["exitOnError"].forEach(function(u){Object.defineProperty(t,u,{get:function(){return l[u]},set:function(s){l[u]=s}})}),Object.defineProperty(t,"default",{get:function(){return{exceptionHandlers:l.exceptionHandlers,rejectionHandlers:l.rejectionHandlers,transports:l.transports}}}),o.deprecated(t,"setLevels"),o.forFunctions(t,"useFormat",["cli"]),o.forProperties(t,"useFormat",["padLevels","stripColors"]),o.forFunctions(t,"deprecated",["addRewriter","addFilter","clone","extend"]),o.forProperties(t,"deprecated",["emitErrs","levelLength"]),o.moved(t,"createLogger","Logger")},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,l=Function.prototype.apply;function u(s,g){this._id=s,this._clearFn=g}t.setTimeout=function(){return new u(l.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new u(l.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(s){s&&s.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(s,g){clearTimeout(s._idleTimeoutId),s._idleTimeout=g},t.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},t._unrefActive=t.active=function(s){clearTimeout(s._idleTimeoutId);var g=s._idleTimeout;g>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},g))},n(140),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){var r,o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(S,N,B){return Function.prototype.apply.call(S,N,B)};r=o&&typeof o.ownKeys=="function"?o.ownKeys:Object.getOwnPropertySymbols?function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:function(S){return Object.getOwnPropertyNames(S)};var u=Number.isNaN||function(S){return S!=S};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var g=10;function c(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}function d(S,N,B,E){var T,h,R,W;if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B);if((h=S._events)===void 0?(h=S._events=Object.create(null),S._eventsCount=0):(h.newListener!==void 0&&(S.emit("newListener",N,B.listener?B.listener:B),h=S._events),R=h[N]),R===void 0)R=h[N]=B,++S._eventsCount;else if(typeof R=="function"?R=h[N]=E?[B,R]:[R,B]:E?R.unshift(B):R.push(B),(T=c(S))>0&&R.length>T&&!R.warned){R.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=S,X.type=N,X.count=R.length,W=X,console&&console.warn&&console.warn(W)}return S}function w(){for(var S=[],N=0;N<arguments.length;N++)S.push(arguments[N]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,l(this.listener,this.target,S))}function v(S,N,B){var E={fired:!1,wrapFn:void 0,target:S,type:N,listener:B},T=w.bind(E);return T.listener=B,E.wrapFn=T,T}function y(S,N,B){var E=S._events;if(E===void 0)return[];var T=E[N];return T===void 0?[]:typeof T=="function"?B?[T.listener||T]:[T]:B?function(h){for(var R=new Array(h.length),W=0;W<R.length;++W)R[W]=h[W].listener||h[W];return R}(T):p(T,T.length)}function f(S){var N=this._events;if(N!==void 0){var B=N[S];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}function p(S,N){for(var B=new Array(N),E=0;E<N;++E)B[E]=S[E];return B}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");g=S}}),s.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||u(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(S){for(var N=[],B=1;B<arguments.length;B++)N.push(arguments[B]);var E=S==="error",T=this._events;if(T!==void 0)E=E&&T.error===void 0;else if(!E)return!1;if(E){var h;if(N.length>0&&(h=N[0]),h instanceof Error)throw h;var R=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw R.context=h,R}var W=T[S];if(W===void 0)return!1;if(typeof W=="function")l(W,this,N);else{var X=W.length,m=p(W,X);for(B=0;B<X;++B)l(m[B],this,N)}return!0},s.prototype.addListener=function(S,N){return d(this,S,N,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,N){return d(this,S,N,!0)},s.prototype.once=function(S,N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);return this.on(S,v(this,S,N)),this},s.prototype.prependOnceListener=function(S,N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);return this.prependListener(S,v(this,S,N)),this},s.prototype.removeListener=function(S,N){var B,E,T,h,R;if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N);if((E=this._events)===void 0)return this;if((B=E[S])===void 0)return this;if(B===N||B.listener===N)--this._eventsCount==0?this._events=Object.create(null):(delete E[S],E.removeListener&&this.emit("removeListener",S,B.listener||N));else if(typeof B!="function"){for(T=-1,h=B.length-1;h>=0;h--)if(B[h]===N||B[h].listener===N){R=B[h].listener,T=h;break}if(T<0)return this;T===0?B.shift():function(W,X){for(;X+1<W.length;X++)W[X]=W[X+1];W.pop()}(B,T),B.length===1&&(E[S]=B[0]),E.removeListener!==void 0&&this.emit("removeListener",S,R||N)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var N,B,E;if((B=this._events)===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[S]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete B[S]),this;if(arguments.length===0){var T,h=Object.keys(B);for(E=0;E<h.length;++E)(T=h[E])!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(N=B[S])=="function")this.removeListener(S,N);else if(N!==void 0)for(E=N.length-1;E>=0;E--)this.removeListener(S,N[E]);return this},s.prototype.listeners=function(S){return y(this,S,!0)},s.prototype.rawListeners=function(S){return y(this,S,!1)},s.listenerCount=function(S,N){return typeof S.listenerCount=="function"?S.listenerCount(N):f.call(S,N)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(147).Buffer,o=r.isEncoding||function(f){switch((f=""+f)&&f.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function l(f){var p;switch(this.encoding=function(S){var N=function(B){if(!B)return"utf8";for(var E;;)switch(B){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return B;default:if(E)return;B=(""+B).toLowerCase(),E=!0}}(S);if(typeof N!="string"&&(r.isEncoding===o||!o(S)))throw new Error("Unknown encoding: "+S);return N||S}(f),this.encoding){case"utf16le":this.text=g,this.end=c,p=4;break;case"utf8":this.fillLast=s,p=4;break;case"base64":this.text=d,this.end=w,p=3;break;default:return this.write=v,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(p)}function u(f){return f<=127?0:f>>5==6?2:f>>4==14?3:f>>3==30?4:f>>6==2?-1:-2}function s(f){var p=this.lastTotal-this.lastNeed,S=function(N,B,E){if((192&B[0])!=128)return N.lastNeed=0,"�";if(N.lastNeed>1&&B.length>1){if((192&B[1])!=128)return N.lastNeed=1,"�";if(N.lastNeed>2&&B.length>2&&(192&B[2])!=128)return N.lastNeed=2,"�"}}(this,f);return S!==void 0?S:this.lastNeed<=f.length?(f.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(f.copy(this.lastChar,p,0,f.length),void(this.lastNeed-=f.length))}function g(f,p){if((f.length-p)%2==0){var S=f.toString("utf16le",p);if(S){var N=S.charCodeAt(S.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=f[f.length-1],f.toString("utf16le",p,f.length-1)}function c(f){var p=f&&f.length?this.write(f):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,S)}return p}function d(f,p){var S=(f.length-p)%3;return S===0?f.toString("base64",p):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=f[f.length-1]:(this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1]),f.toString("base64",p,f.length-S))}function w(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function v(f){return f.toString(this.encoding)}function y(f){return f&&f.length?this.write(f):""}t.StringDecoder=l,l.prototype.write=function(f){if(f.length===0)return"";var p,S;if(this.lastNeed){if((p=this.fillLast(f))===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<f.length?p?p+this.text(f,S):this.text(f,S):p||""},l.prototype.end=function(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+"�":p},l.prototype.text=function(f,p){var S=function(B,E,T){var h=E.length-1;if(h<T)return 0;var R=u(E[h]);return R>=0?(R>0&&(B.lastNeed=R-1),R):--h<T||R===-2?0:(R=u(E[h]))>=0?(R>0&&(B.lastNeed=R-2),R):--h<T||R===-2?0:(R=u(E[h]))>=0?(R>0&&(R===2?R=0:B.lastNeed=R-3),R):0}(this,f,p);if(!this.lastNeed)return f.toString("utf8",p);this.lastTotal=S;var N=f.length-(S-this.lastNeed);return f.copy(this.lastChar,0,N),f.toString("utf8",p,N)},l.prototype.fillLast=function(f){if(this.lastNeed<=f.length)return f.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);f.copy(this.lastChar,this.lastTotal-this.lastNeed,0,f.length),this.lastNeed-=f.length}},function(e,t,n){var r=n(37),o=Object.keys||function(f){var p=[];for(var S in f)p.push(S);return p};e.exports=w;var l=Object.create(n(32));l.inherits=n(7);var u=n(70),s=n(47);l.inherits(w,u);for(var g=o(s.prototype),c=0;c<g.length;c++){var d=g[c];w.prototype[d]||(w.prototype[d]=s.prototype[d])}function w(f){if(!(this instanceof w))return new w(f);u.call(this,f),s.call(this,f),f&&f.readable===!1&&(this.readable=!1),f&&f.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,f&&f.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}function v(){this.allowHalfOpen||this._writableState.ended||r.nextTick(y,this)}function y(f){f.end()}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),w.prototype._destroy=function(f,p){this.push(null),this.end(),r.nextTick(p,f)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,o=n(155),l=(r=o)&&r.__esModule?r:{default:r};function u(s){return s[Symbol.toStringTag]==="AsyncFunction"}t.default=function(s){if(typeof s!="function")throw new Error("expected a function");return u(s)?(0,l.default)(s):s},t.isAsync=u,t.isAsyncGenerator=function(s){return s[Symbol.toStringTag]==="AsyncGenerator"},t.isAsyncIterable=function(s){return typeof s[Symbol.asyncIterator]=="function"}},function(e,t,n){var r={};function o(u,s,g){g||(g=Error);var c=function(d){var w,v;function y(f,p,S){return d.call(this,function(N,B,E){return typeof s=="string"?s:s(N,B,E)}(f,p,S))||this}return v=d,(w=y).prototype=Object.create(v.prototype),w.prototype.constructor=w,w.__proto__=v,y}(g);c.prototype.name=g.name,c.prototype.code=u,r[u]=c}function l(u,s){if(Array.isArray(u)){var g=u.length;return u=u.map(function(c){return String(c)}),g>2?"one of ".concat(s," ").concat(u.slice(0,g-1).join(", "),", or ")+u[g-1]:g===2?"one of ".concat(s," ").concat(u[0]," or ").concat(u[1]):"of ".concat(s," ").concat(u[0])}return"of ".concat(s," ").concat(String(u))}o("ERR_INVALID_OPT_VALUE",function(u,s){return'The value "'+s+'" is invalid for option "'+u+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(u,s,g){var c,d,w;if(typeof s=="string"&&(d="not ",s.substr(0,d.length)===d)?(c="must not be",s=s.replace(/^not /,"")):c="must be",function(y,f,p){return(p===void 0||p>y.length)&&(p=y.length),y.substring(p-f.length,p)===f}(u," argument"))w="The ".concat(u," ").concat(c," ").concat(l(s,"type"));else{var v=function(y,f,p){return typeof p!="number"&&(p=0),!(p+f.length>y.length)&&y.indexOf(f,p)!==-1}(u,".")?"property":"argument";w='The "'.concat(u,'" ').concat(v," ").concat(c," ").concat(l(s,"type"))}return w+=". Received type ".concat(typeof g)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var o=Object.keys||function(y){var f=[];for(var p in y)f.push(p);return f};e.exports=d;var l=n(77),u=n(81);n(7)(d,l);for(var s=o(u.prototype),g=0;g<s.length;g++){var c=s[g];d.prototype[c]||(d.prototype[c]=u.prototype[c])}function d(y){if(!(this instanceof d))return new d(y);l.call(this,y),u.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",w)))}function w(){this._writableState.ended||r.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,n(2))},function(e,t,n){n.d(t,"a",function(){return u});var r=n(41),o=n(4);const l={"app-id":["app-id must match formant/*"]};class u extends r.a{constructor(g,c={}){super(g,Object.assign({validateHeaders:d=>`${d.get("app-id")}`.startsWith("formant/")?{}:l},c)),this.endpoint=g}getHeaders(){return Object.assign(Object.assign({},u.headers),{"App-ID":`formant/${o.a}`,"App-Version":o.j})}}u.headers={}},function(e,t,n){n(231),e.exports={encode:r=>new TextEncoder().encode(r),decode:r=>new TextDecoder().decode(r)}},function(e,t,n){n.d(t,"a",function(){return l});const r=["password","secret","token","key","buffer","authorization"],o=u=>r.some(s=>u.toLowerCase().includes(s.toLowerCase()));function l(u,s=new WeakSet){return s.has(u)?"[ RECURSIVE ]":Array.isArray(u)?(s.add(u),u.map(c=>l(c,s))):!(g=u)||typeof g!="object"&&typeof g!="function"?typeof u=="string"&&o(u)?"[ REDACTED ]":u:(s.add(u),Object.keys(u).reduce((c,d)=>(c[d]=o(d)?"[ REDACTED ]":l(u[d],s),c),{}));var g}},function(e,t,n){const{hasOwnProperty:r}=Object.prototype,o=B();o.configure=B,o.stringify=o,o.default=o,t.stringify=o,t.configure=B,e.exports=o;const l=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/,u=new RegExp(l,"g"),s=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\"];function g(E){if(E.length===2){const h=E.charCodeAt(1);return`${E[0]}\\u${h.toString(16)}`}const T=E.charCodeAt(0);return s.length>T?s[T]:`\\u${T.toString(16)}`}function c(E){if(E.length<5e3&&!l.test(E))return E;if(E.length>100)return E.replace(u,g);let T="",h=0;for(let R=0;R<E.length;R++){const W=E.charCodeAt(R);if(W===34||W===92||W<32)T+=`${E.slice(h,R)}${s[W]}`,h=R+1;else if(W>=55296&&W<=57343){if(W<=56319&&R+1<E.length){const X=E.charCodeAt(R+1);if(X>=56320&&X<=57343){R++;continue}}T+=`${E.slice(h,R)}\\u${W.toString(16)}`,h=R+1}}return T+=E.slice(h),T}function d(E){if(E.length>200)return E.sort();for(let T=1;T<E.length;T++){const h=E[T];let R=T;for(;R!==0&&E[R-1]>h;)E[R]=E[R-1],R--;E[R]=h}return E}const w=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function v(E){return w.call(E)!==void 0&&E.length!==0}function y(E,T,h){E.length<h&&(h=E.length);const R=T===","?"":" ";let W=`"0":${R}${E[0]}`;for(let X=1;X<h;X++)W+=`${T}"${X}":${R}${E[X]}`;return W}function f(E,T){let h;if(r.call(E,T)&&(h=E[T],typeof h!="boolean"))throw new TypeError(`The "${T}" argument must be of type boolean`);return h===void 0||h}function p(E,T){let h;if(r.call(E,T)){if(h=E[T],typeof h!="number")throw new TypeError(`The "${T}" argument must be of type number`);if(!Number.isInteger(h))throw new TypeError(`The "${T}" argument must be an integer`);if(h<1)throw new RangeError(`The "${T}" argument must be >= 1`)}return h===void 0?1/0:h}function S(E){return E===1?"1 item":`${E} items`}function N(E){const T=new Set;for(const h of E)typeof h!="string"&&typeof h!="number"||T.add(String(h));return T}function B(E){const T=function(z){if(r.call(z,"strict")){const P=z.strict;if(typeof P!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(P)return D=>{let O=`Object can not safely be stringified. Received type ${typeof D}`;throw typeof D!="function"&&(O+=` (${D.toString()})`),new Error(O)}}}(E={...E});T&&(E.bigint===void 0&&(E.bigint=!1),"circularValue"in E||(E.circularValue=Error));const h=function(z){if(r.call(z,"circularValue")){const P=z.circularValue;if(typeof P=="string")return`"${P}"`;if(P==null)return P;if(P===Error||P===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}(E),R=f(E,"bigint"),W=f(E,"deterministic"),X=p(E,"maximumDepth"),m=p(E,"maximumBreadth");function b(z,P,D,O,L,U){let A=P[z];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(z)),A=O.call(P,z,A),typeof A){case"string":return`"${c(A)}"`;case"object":{if(A===null)return"null";if(D.indexOf(A)!==-1)return h;let V="",q=",";const Q=U;if(Array.isArray(A)){if(A.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(A),L!==""&&(V+=`
20
+ ${U+=L}`,q=`,
21
+ ${U}`);const I=Math.min(A.length,m);let $=0;for(;$<I-1;$++){const Y=b($,A,D,O,L,U);V+=Y!==void 0?Y:"null",V+=q}const K=b($,A,D,O,L,U);return V+=K!==void 0?K:"null",A.length-1>m&&(V+=`${q}"... ${S(A.length-m-1)} not stringified"`),L!==""&&(V+=`
22
+ ${Q}`),D.pop(),`[${V}]`}let ee=Object.keys(A);const te=ee.length;if(te===0)return"{}";if(X<D.length+1)return'"[Object]"';let k="",x="";L!==""&&(q=`,
23
+ ${U+=L}`,k=" ");let _=Math.min(te,m);v(A)&&(V+=y(A,q,m),ee=ee.slice(A.length),_-=A.length,x=q),W&&(ee=d(ee)),D.push(A);for(let I=0;I<_;I++){const $=ee[I],K=b($,A,D,O,L,U);K!==void 0&&(V+=`${x}"${c($)}":${k}${K}`,x=q)}return te>m&&(V+=`${x}"...":${k}"${S(te-m)} not stringified"`,x=q),L!==""&&x.length>1&&(V=`
24
+ ${U}${V}
25
+ ${Q}`),D.pop(),`{${V}}`}case"number":return isFinite(A)?String(A):T?T(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(A);default:return T?T(A):void 0}}function G(z,P,D,O,L,U){switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(z)),typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(D.indexOf(P)!==-1)return h;const A=U;let V="",q=",";if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P),L!==""&&(V+=`
26
+ ${U+=L}`,q=`,
27
+ ${U}`);const te=Math.min(P.length,m);let k=0;for(;k<te-1;k++){const _=G(k,P[k],D,O,L,U);V+=_!==void 0?_:"null",V+=q}const x=G(k,P[k],D,O,L,U);return V+=x!==void 0?x:"null",P.length-1>m&&(V+=`${q}"... ${S(P.length-m-1)} not stringified"`),L!==""&&(V+=`
28
+ ${A}`),D.pop(),`[${V}]`}D.push(P);let Q="";L!==""&&(q=`,
29
+ ${U+=L}`,Q=" ");let ee="";for(const te of O){const k=G(te,P[te],D,O,L,U);k!==void 0&&(V+=`${ee}"${c(te)}":${Q}${k}`,ee=q)}return L!==""&&ee.length>1&&(V=`
30
+ ${U}${V}
31
+ ${A}`),D.pop(),`{${V}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}function j(z,P,D,O,L){switch(typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(typeof(P=P.toJSON(z))!="object")return j(z,P,D,O,L);if(P===null)return"null"}if(D.indexOf(P)!==-1)return h;const U=L;if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P);let k=`
32
+ ${L+=O}`;const x=`,
33
+ ${L}`,_=Math.min(P.length,m);let I=0;for(;I<_-1;I++){const K=j(I,P[I],D,O,L);k+=K!==void 0?K:"null",k+=x}const $=j(I,P[I],D,O,L);return k+=$!==void 0?$:"null",P.length-1>m&&(k+=`${x}"... ${S(P.length-m-1)} not stringified"`),k+=`
34
+ ${U}`,D.pop(),`[${k}]`}let A=Object.keys(P);const V=A.length;if(V===0)return"{}";if(X<D.length+1)return'"[Object]"';const q=`,
35
+ ${L+=O}`;let Q="",ee="",te=Math.min(V,m);v(P)&&(Q+=y(P,q,m),A=A.slice(P.length),te-=P.length,ee=q),W&&(A=d(A)),D.push(P);for(let k=0;k<te;k++){const x=A[k],_=j(x,P[x],D,O,L);_!==void 0&&(Q+=`${ee}"${c(x)}": ${_}`,ee=q)}return V>m&&(Q+=`${ee}"...": "${S(V-m)} not stringified"`,ee=q),ee!==""&&(Q=`
36
+ ${L}${Q}
37
+ ${U}`),D.pop(),`{${Q}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}function C(z,P,D){switch(typeof P){case"string":return`"${c(P)}"`;case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(typeof(P=P.toJSON(z))!="object")return C(z,P,D);if(P===null)return"null"}if(D.indexOf(P)!==-1)return h;let O="";if(Array.isArray(P)){if(P.length===0)return"[]";if(X<D.length+1)return'"[Array]"';D.push(P);const q=Math.min(P.length,m);let Q=0;for(;Q<q-1;Q++){const te=C(Q,P[Q],D);O+=te!==void 0?te:"null",O+=","}const ee=C(Q,P[Q],D);return O+=ee!==void 0?ee:"null",P.length-1>m&&(O+=`,"... ${S(P.length-m-1)} not stringified"`),D.pop(),`[${O}]`}let L=Object.keys(P);const U=L.length;if(U===0)return"{}";if(X<D.length+1)return'"[Object]"';let A="",V=Math.min(U,m);v(P)&&(O+=y(P,",",m),L=L.slice(P.length),V-=P.length,A=","),W&&(L=d(L)),D.push(P);for(let q=0;q<V;q++){const Q=L[q],ee=C(Q,P[Q],D);ee!==void 0&&(O+=`${A}"${c(Q)}":${ee}`,A=",")}return U>m&&(O+=`${A}"...":"${S(U-m)} not stringified"`),D.pop(),`{${O}}`}case"number":return isFinite(P)?String(P):T?T(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(R)return String(P);default:return T?T(P):void 0}}return function(z,P,D){if(arguments.length>1){let O="";if(typeof D=="number"?O=" ".repeat(Math.min(D,10)):typeof D=="string"&&(O=D.slice(0,10)),P!=null){if(typeof P=="function")return b("",{"":z},[],P,O,"");if(Array.isArray(P))return G("",z,[],N(P),O,"")}if(O.length!==0)return j("",z,[],O,"")}return C("",z,[])}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r,o=r.length){if(!o)throw new Error("arity is undefined");return function(...l){return typeof l[o-1]=="function"?r.apply(this,l):new Promise((u,s)=>{l[o-1]=(g,...c)=>{if(g)return s(g);u(c.length>1?c:c[0])},r.apply(this,l)})}},e.exports=t.default},function(e,t,n){(t=e.exports=n(70)).Stream=t,t.Readable=t,t.Writable=n(47),t.Duplex=n(22),t.Transform=n(73),t.PassThrough=n(168)},function(e,t,n){(function(r){function o(l){return Object.prototype.toString.call(l)}t.isArray=function(l){return Array.isArray?Array.isArray(l):o(l)==="[object Array]"},t.isBoolean=function(l){return typeof l=="boolean"},t.isNull=function(l){return l===null},t.isNullOrUndefined=function(l){return l==null},t.isNumber=function(l){return typeof l=="number"},t.isString=function(l){return typeof l=="string"},t.isSymbol=function(l){return typeof l=="symbol"},t.isUndefined=function(l){return l===void 0},t.isRegExp=function(l){return o(l)==="[object RegExp]"},t.isObject=function(l){return typeof l=="object"&&l!==null},t.isDate=function(l){return o(l)==="[object Date]"},t.isError=function(l){return o(l)==="[object Error]"||l instanceof Error},t.isFunction=function(l){return typeof l=="function"},t.isPrimitive=function(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||typeof l=="symbol"||l===void 0},t.isBuffer=r.isBuffer}).call(this,n(5).Buffer)},function(e,t,n){(t=e.exports=n(77)).Stream=t,t.Readable=t,t.Writable=n(81),t.Duplex=n(25),t.Transform=n(82),t.PassThrough=n(188),t.finished=n(48),t.pipeline=n(189)},function(e,t,n){e.exports=function(r){return r}},function(e,t,n){var r={};function o(u,s,g){g||(g=Error);var c=function(d){var w,v;function y(f,p,S){return d.call(this,function(N,B,E){return typeof s=="string"?s:s(N,B,E)}(f,p,S))||this}return v=d,(w=y).prototype=Object.create(v.prototype),w.prototype.constructor=w,w.__proto__=v,y}(g);c.prototype.name=g.name,c.prototype.code=u,r[u]=c}function l(u,s){if(Array.isArray(u)){var g=u.length;return u=u.map(function(c){return String(c)}),g>2?"one of ".concat(s," ").concat(u.slice(0,g-1).join(", "),", or ")+u[g-1]:g===2?"one of ".concat(s," ").concat(u[0]," or ").concat(u[1]):"of ".concat(s," ").concat(u[0])}return"of ".concat(s," ").concat(String(u))}o("ERR_INVALID_OPT_VALUE",function(u,s){return'The value "'+s+'" is invalid for option "'+u+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(u,s,g){var c,d,w;if(typeof s=="string"&&(d="not ",s.substr(0,d.length)===d)?(c="must not be",s=s.replace(/^not /,"")):c="must be",function(y,f,p){return(p===void 0||p>y.length)&&(p=y.length),y.substring(p-f.length,p)===f}(u," argument"))w="The ".concat(u," ").concat(c," ").concat(l(s,"type"));else{var v=function(y,f,p){return typeof p!="number"&&(p=0),!(p+f.length>y.length)&&y.indexOf(f,p)!==-1}(u,".")?"property":"argument";w='The "'.concat(u,'" ').concat(v," ").concat(c," ").concat(l(s,"type"))}return w+=". Received type ".concat(typeof g)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){(function(r){var o=Object.keys||function(y){var f=[];for(var p in y)f.push(p);return f};e.exports=d;var l=n(143),u=n(61);n(7)(d,l);for(var s=o(u.prototype),g=0;g<s.length;g++){var c=s[g];d.prototype[c]||(d.prototype[c]=u.prototype[c])}function d(y){if(!(this instanceof d))return new d(y);l.call(this,y),u.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",w)))}function w(){this._writableState.ended||r.nextTick(v,this)}function v(y){y.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,n(2))},function(e,t,n){(function(r){r===void 0||!r.version||r.version.indexOf("v0.")===0||r.version.indexOf("v1.")===0&&r.version.indexOf("v1.8.")!==0?e.exports={nextTick:function(o,l,u,s){if(typeof o!="function")throw new TypeError('"callback" argument must be a function');var g,c,d=arguments.length;switch(d){case 0:case 1:return r.nextTick(o);case 2:return r.nextTick(function(){o.call(null,l)});case 3:return r.nextTick(function(){o.call(null,l,u)});case 4:return r.nextTick(function(){o.call(null,l,u,s)});default:for(g=new Array(d-1),c=0;c<g.length;)g[c++]=arguments[c];return r.nextTick(function(){o.apply(null,g)})}}}:e.exports=r}).call(this,n(2))},function(e,t,n){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function o(s,g){return Object.prototype.hasOwnProperty.call(s,g)}t.assign=function(s){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var c=g.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var d in c)o(c,d)&&(s[d]=c[d])}}return s},t.shrinkBuf=function(s,g){return s.length===g?s:s.subarray?s.subarray(0,g):(s.length=g,s)};var l={arraySet:function(s,g,c,d,w){if(g.subarray&&s.subarray)s.set(g.subarray(c,c+d),w);else for(var v=0;v<d;v++)s[w+v]=g[c+v]},flattenChunks:function(s){var g,c,d,w,v,y;for(d=0,g=0,c=s.length;g<c;g++)d+=s[g].length;for(y=new Uint8Array(d),w=0,g=0,c=s.length;g<c;g++)v=s[g],y.set(v,w),w+=v.length;return y}},u={arraySet:function(s,g,c,d,w){for(var v=0;v<d;v++)s[w+v]=g[c+v]},flattenChunks:function(s){return[].concat.apply([],s)}};t.setTyped=function(s){s?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,l)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,u))},t.setTyped(r)},function(e,t,n){e.exports=n(190)},function(e,t,n){n.d(t,"a",function(){return o});var r=n(233);const o=Object(r.a)()},function(e,t,n){n.d(t,"a",function(){return p});var r=n(100),o=n.n(r),l=n(1);class u extends Error{constructor(N,B,E){super(`Connection failure: ${N.message}`),this.cause=N,this.url=B,this.retryable=E,this.name="ConnectionError",Object.setPrototypeOf(this,new.target.prototype)}}var s=n(9),g=n(0),c=n(12),d=n(11);class w extends Error{constructor(N,B){super(`Invalid headers (${JSON.stringify(N)}) for response: ${B.message}`),this.validationErrors=N,this.responseError=B}}var v=function(S,N,B,E){return new(B||(B=Promise))(function(T,h){function R(m){try{X(E.next(m))}catch(b){h(b)}}function W(m){try{X(E.throw(m))}catch(b){h(b)}}function X(m){var b;m.done?T(m.value):(b=m.value,b instanceof B?b:new B(function(G){G(b)})).then(R,W)}X((E=E.apply(S,N||[])).next())})},y=function(S,N){var B={};for(var E in S)Object.prototype.hasOwnProperty.call(S,E)&&N.indexOf(E)<0&&(B[E]=S[E]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(E=Object.getOwnPropertySymbols(S);T<E.length;T++)N.indexOf(E[T])<0&&Object.prototype.propertyIsEnumerable.call(S,E[T])&&(B[E[T]]=S[E[T]])}return B};const f=new Set(["GET","HEAD","PUT","QUERY","DELETE","OPTIONS","TRACE"]);class p{constructor(N,B={}){if(this.endpoint=N,this.validateHeaders=E=>B.validateHeaders?B.validateHeaders(E):{},this.verbose=B.verbose!==!1,B.retries!==void 0&&!(B.retries>=0))throw new Error("retries must be positive or zero");if(this.configuredRetries=B.retries,B.timeoutMs!==void 0&&!(B.timeoutMs>0))throw new Error("timeoutMs must be positive");if(this.timeoutMs=B.timeoutMs,B.maxBackoffDelayMs!==void 0&&!(B.maxBackoffDelayMs>0))throw new Error("maxBackoffDelayMs must be positive");this.maxBackoffDelayMs=B.maxBackoffDelayMs||30*l.a.second,this.json=B.json!==!1}getRetries(){return this.configuredRetries!==void 0?this.configuredRetries:this.getConstructor().retries}getHeaders(){return{}}fetch(N,B={}){return v(this,void 0,void 0,function*(){return(yield this.fetchVerbose(N,B)).body})}fetchVerbose(N,B={}){return v(this,void 0,void 0,function*(){let E=100*l.a.millisecond,T=0;const h=this.timeoutMs!==void 0?new Date().getTime()+this.timeoutMs:void 0,R=h?()=>Math.max(h-new Date().getTime(),0):void 0;for(;;)try{return yield this.doFetch(N,B,R)}catch(W){const X=W,m=Object(c.a)(X,u);if((R==null?void 0:R())===0||T===this.getRetries()||!m.retryable)throw m;T++,E=Math.min(...R?[R()]:[],E*(2+.1*(Math.random()-.5)),this.maxBackoffDelayMs),yield Object(s.a)(E),this.verbose&&g.a.warn(`Connection failure, retrying. Error: ${X.cause.message}`,{url:X.url,error:X.cause,attempt:T})}})}doFetch(N,B,E){return v(this,void 0,void 0,function*(){const{token:T,json:h=this.json,allowUnsafeRetries:R}=B,W=y(B,["token","json","allowUnsafeRetries"]),X=(W.method||"GET").toUpperCase(),m=this.endpoint!==void 0?`${this.endpoint}${N?`/${N}`:""}`:N,b=new AbortController;let G;if(E){const j=E();j>0?G=setTimeout(()=>{b.abort()},j):b.abort()}try{let j;yield Promise.race([this.getConstructor().waitForConnectivity(),new Promise(U=>{j=setTimeout(U,E?Math.min(l.a.minute,E()):l.a.minute)})]),j&&clearTimeout(j);const C=yield o()(m,Object.assign(Object.assign(Object.assign({},W),W.body!==void 0?{body:h!==!1?JSON.stringify(W.body):W.body}:{}),{headers:Object.assign(Object.assign(Object.assign(Object.assign({},h!==!1?{"Content-Type":"application/json"}:{}),this.getHeaders()),W.headers||{}),T!==void 0?{Authorization:`Bearer ${T}`}:{}),signal:b.signal})),z=C.headers.get("content-type")||"",P=z&&z.startsWith("application/json"),D=P?yield C.json():yield C.text(),O=()=>new d.a(X,m,W.body,C.status,C.headers,D,D&&D.validationErrors||{});if(!C.ok)throw this.verbose&&g.a[C.status>=500?"warn":"info"]("Response error",{method:X,url:m,statusCode:C.status}),O();const L=this.validateHeaders(C.headers);if(Object.keys(L).length!==0)throw new w(L,O());if(C.status===204)return{body:void 0,headers:C.headers};if(h&&!P)throw new Error(`Response is not JSON: ${JSON.stringify(D)}`);return{body:D,headers:C.headers}}catch(j){const C=j,z=R||f.has(X);if(C.message==="Network request failed")throw new u(C,m,z);if(C.type==="system"&&["EAI_AGAIN","ECONNREFUSED","EHOSTUNREACH","ENOTFOUND"].find(L=>L===C.code))throw new u(C,m,!0);if(C.type==="system"&&["ETIMEDOUT","ECONNRESET","ESOCKETTIMEDOUT","EPIPE"].find(L=>L===C.code))throw new u(C,m,z);if(C.name==="AbortError")throw new u(C,m,z);const P=Object(c.a)(C,d.a),{statusCode:D}=P;if(D===408||D===429||D===502||D===503||D===504)throw this.verbose&&!z&&g.a.warn("Potentially unsafe retry"),new u(C,m,!0);const O=this.validateHeaders(P.headers);throw Object.keys(O).length!==0?new w(O,P):(yield this.getConstructor().onResponseError(P),C)}finally{G&&clearTimeout(G)}})}getConstructor(){return Object.getPrototypeOf(this).constructor}}p.retries=8,p.waitForConnectivity=()=>v(void 0,void 0,void 0,function*(){}),p.onResponseError=()=>v(void 0,void 0,void 0,function*(){})},function(e,t,n){function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(58),u=n(3),s=u.LEVEL,g=u.MESSAGE;l.enabled=!0;var c=/\s+/,d=function(){function w(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,w),p.colors&&this.addColors(p.colors),this.options=p}var v,y,f;return v=w,f=[{key:"addColors",value:function(p){var S=Object.keys(p).reduce(function(N,B){return N[B]=c.test(p[B])?p[B].split(c):p[B],N},{});return w.allColors=Object.assign({},w.allColors||{},S),w.allColors}}],(y=[{key:"addColors",value:function(p){return w.addColors(p)}},{key:"colorize",value:function(p,S,N){if(N===void 0&&(N=S),!Array.isArray(w.allColors[p]))return l[w.allColors[p]](N);for(var B=0,E=w.allColors[p].length;B<E;B++)N=l[w.allColors[p][B]](N);return N}},{key:"transform",value:function(p,S){return S.all&&typeof p[g]=="string"&&(p[g]=this.colorize(p[s],p.level,p[g])),(S.level||S.all||!S.message)&&(p.level=this.colorize(p[s],p.level)),(S.all||S.message)&&(p.message=this.colorize(p[s],p.level,p.message)),p}}])&&o(v.prototype,y),f&&o(v,f),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)},e.exports.Colorizer=e.exports.Format=d},function(e,t,n){(function(r){function o(l){try{if(!r.localStorage)return!1}catch{return!1}var u=r.localStorage[l];return u!=null&&String(u).toLowerCase()==="true"}e.exports=function(l,u){if(o("noDeprecation"))return l;var s=!1;return function(){if(!s){if(o("throwDeprecation"))throw new Error(u);o("traceDeprecation")?console.trace(u):console.warn(u),s=!0}return l.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1==0},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var d=o(s);return g!==void 0?typeof c=="string"?d.fill(g,c):d.fill(g):d.fill(0),d},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){(function(r,o,l){var u=n(37);function s(b){var G=this;this.next=null,this.entry=null,this.finish=function(){(function(j,C,z){var P=j.entry;for(j.entry=null;P;){var D=P.callback;C.pendingcb--,D(z),P=P.next}C.corkedRequestsFree?C.corkedRequestsFree.next=j:C.corkedRequestsFree=j})(G,b)}}e.exports=E;var g,c=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?o:u.nextTick;E.WritableState=B;var d=Object.create(n(32));d.inherits=n(7);var w={deprecate:n(43)},v=n(71),y=n(46).Buffer,f=l.Uint8Array||function(){},p,S=n(72);function N(){}function B(b,G){g=g||n(22),b=b||{};var j=G instanceof g;this.objectMode=!!b.objectMode,j&&(this.objectMode=this.objectMode||!!b.writableObjectMode);var C=b.highWaterMark,z=b.writableHighWaterMark,P=this.objectMode?16:16384;this.highWaterMark=C||C===0?C:j&&(z||z===0)?z:P,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=b.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=b.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(O){(function(L,U){var A=L._writableState,V=A.sync,q=A.writecb;if(function(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}(A),U)(function(ee,te,k,x,_){--te.pendingcb,k?(u.nextTick(_,x),u.nextTick(m,ee,te),ee._writableState.errorEmitted=!0,ee.emit("error",x)):(_(x),ee._writableState.errorEmitted=!0,ee.emit("error",x),m(ee,te))})(L,A,V,U,q);else{var Q=W(A);Q||A.corked||A.bufferProcessing||!A.bufferedRequest||R(L,A),V?c(h,L,A,Q,q):h(L,A,Q,q)}})(G,O)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function E(b){if(g=g||n(22),!(p.call(E,this)||this instanceof g))return new E(b);this._writableState=new B(b,this),this.writable=!0,b&&(typeof b.write=="function"&&(this._write=b.write),typeof b.writev=="function"&&(this._writev=b.writev),typeof b.destroy=="function"&&(this._destroy=b.destroy),typeof b.final=="function"&&(this._final=b.final)),v.call(this)}function T(b,G,j,C,z,P,D){G.writelen=C,G.writecb=D,G.writing=!0,G.sync=!0,j?b._writev(z,G.onwrite):b._write(z,P,G.onwrite),G.sync=!1}function h(b,G,j,C){j||function(z,P){P.length===0&&P.needDrain&&(P.needDrain=!1,z.emit("drain"))}(b,G),G.pendingcb--,C(),m(b,G)}function R(b,G){G.bufferProcessing=!0;var j=G.bufferedRequest;if(b._writev&&j&&j.next){var C=G.bufferedRequestCount,z=new Array(C),P=G.corkedRequestsFree;P.entry=j;for(var D=0,O=!0;j;)z[D]=j,j.isBuf||(O=!1),j=j.next,D+=1;z.allBuffers=O,T(b,G,!0,G.length,z,"",P.finish),G.pendingcb++,G.lastBufferedRequest=null,P.next?(G.corkedRequestsFree=P.next,P.next=null):G.corkedRequestsFree=new s(G),G.bufferedRequestCount=0}else{for(;j;){var L=j.chunk,U=j.encoding,A=j.callback;if(T(b,G,!1,G.objectMode?1:L.length,L,U,A),j=j.next,G.bufferedRequestCount--,G.writing)break}j===null&&(G.lastBufferedRequest=null)}G.bufferedRequest=j,G.bufferProcessing=!1}function W(b){return b.ending&&b.length===0&&b.bufferedRequest===null&&!b.finished&&!b.writing}function X(b,G){b._final(function(j){G.pendingcb--,j&&b.emit("error",j),G.prefinished=!0,b.emit("prefinish"),m(b,G)})}function m(b,G){var j=W(G);return j&&(function(C,z){z.prefinished||z.finalCalled||(typeof C._final=="function"?(z.pendingcb++,z.finalCalled=!0,u.nextTick(X,C,z)):(z.prefinished=!0,C.emit("prefinish")))}(b,G),G.pendingcb===0&&(G.finished=!0,b.emit("finish"))),j}d.inherits(E,v),B.prototype.getBuffer=function(){for(var b=this.bufferedRequest,G=[];b;)G.push(b),b=b.next;return G},function(){try{Object.defineProperty(B.prototype,"buffer",{get:w.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(b){return!!p.call(this,b)||this===E&&b&&b._writableState instanceof B}})):p=function(b){return b instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(b,G,j){var C,z=this._writableState,P=!1,D=!z.objectMode&&(C=b,y.isBuffer(C)||C instanceof f);return D&&!y.isBuffer(b)&&(b=function(O){return y.from(O)}(b)),typeof G=="function"&&(j=G,G=null),D?G="buffer":G||(G=z.defaultEncoding),typeof j!="function"&&(j=N),z.ended?function(O,L){var U=new Error("write after end");O.emit("error",U),u.nextTick(L,U)}(this,j):(D||function(O,L,U,A){var V=!0,q=!1;return U===null?q=new TypeError("May not write null values to stream"):typeof U=="string"||U===void 0||L.objectMode||(q=new TypeError("Invalid non-string/buffer chunk")),q&&(O.emit("error",q),u.nextTick(A,q),V=!1),V}(this,z,b,j))&&(z.pendingcb++,P=function(O,L,U,A,V,q){if(!U){var Q=function(x,_,I){return x.objectMode||x.decodeStrings===!1||typeof _!="string"||(_=y.from(_,I)),_}(L,A,V);A!==Q&&(U=!0,V="buffer",A=Q)}var ee=L.objectMode?1:A.length;L.length+=ee;var te=L.length<L.highWaterMark;if(te||(L.needDrain=!0),L.writing||L.corked){var k=L.lastBufferedRequest;L.lastBufferedRequest={chunk:A,encoding:V,isBuf:U,callback:q,next:null},k?k.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else T(O,L,!1,ee,A,V,q);return te}(this,z,D,b,G,j)),P},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var b=this._writableState;b.corked&&(b.corked--,b.writing||b.corked||b.finished||b.bufferProcessing||!b.bufferedRequest||R(this,b))},E.prototype.setDefaultEncoding=function(b){if(typeof b=="string"&&(b=b.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((b+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+b);return this._writableState.defaultEncoding=b,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(b,G,j){j(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(b,G,j){var C=this._writableState;typeof b=="function"?(j=b,b=null,G=null):typeof G=="function"&&(j=G,G=null),b!=null&&this.write(b,G),C.corked&&(C.corked=1,this.uncork()),C.ending||C.finished||function(z,P,D){P.ending=!0,m(z,P),D&&(P.finished?u.nextTick(D):z.once("finish",D)),P.ended=!0,z.writable=!1}(this,C,j)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(b){this._writableState&&(this._writableState.destroyed=b)}}),E.prototype.destroy=S.destroy,E.prototype._undestroy=S.undestroy,E.prototype._destroy=function(b,G){this.end(),G(b)}}).call(this,n(2),n(19).setImmediate,n(6))},function(e,t,n){var r=n(24).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function l(u,s,g){if(typeof s=="function")return l(u,null,s);s||(s={}),g=function(E){var T=!1;return function(){if(!T){T=!0;for(var h=arguments.length,R=new Array(h),W=0;W<h;W++)R[W]=arguments[W];E.apply(this,R)}}}(g||o);var c=s.readable||s.readable!==!1&&u.readable,d=s.writable||s.writable!==!1&&u.writable,w=function(){u.writable||y()},v=u._writableState&&u._writableState.finished,y=function(){d=!1,v=!0,c||g.call(u)},f=u._readableState&&u._readableState.endEmitted,p=function(){c=!1,f=!0,d||g.call(u)},S=function(E){g.call(u,E)},N=function(){var E;return c&&!f?(u._readableState&&u._readableState.ended||(E=new r),g.call(u,E)):d&&!v?(u._writableState&&u._writableState.ended||(E=new r),g.call(u,E)):void 0},B=function(){u.req.on("finish",y)};return function(E){return E.setHeader&&typeof E.abort=="function"}(u)?(u.on("complete",y),u.on("abort",N),u.req?B():u.on("request",B)):d&&!u._writableState&&(u.on("end",w),u.on("close",w)),u.on("end",p),u.on("finish",y),s.error!==!1&&u.on("error",S),u.on("close",N),function(){u.removeListener("complete",y),u.removeListener("abort",N),u.removeListener("request",B),u.req&&u.req.removeListener("finish",y),u.removeListener("end",w),u.removeListener("close",w),u.removeListener("finish",y),u.removeListener("end",p),u.removeListener("error",S),u.removeListener("close",N)}}},function(e,t,n){var r=n(57),o=n(3).configs;t.cli=r.levels(o.cli),t.npm=r.levels(o.npm),t.syslog=r.levels(o.syslog),t.addColors=r.levels},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(207)),o=s(n(208)),l=s(n(23)),u=s(n(30));function s(g){return g&&g.__esModule?g:{default:g}}t.default=(0,u.default)(function(g,c,d){return(0,r.default)(g,(0,o.default)((0,l.default)(c)),d)},3),e.exports=t.default},function(e,t,n){class r extends Error{constructor(l,...u){super(`env-var: ${l}`,...u),Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="EnvVarError"}}e.exports=r},function(e,t,n){e.exports=function(r){const o=parseInt(r,10);if(isNaN(o)||o.toString(10)!==r)throw new Error("should be a valid integer");return o}},function(e,t,n){e.exports=function(r){const o=parseFloat(r);if(isNaN(o)||isNaN(r))throw new Error("should be a valid float");return o}},function(e,t,n){e.exports=function(r){try{return JSON.parse(r)}catch{throw new Error("should be valid (parseable) JSON")}}},function(e,t,n){(function(r){function o(s,g){for(var c=0,d=s.length-1;d>=0;d--){var w=s[d];w==="."?s.splice(d,1):w===".."?(s.splice(d,1),c++):c&&(s.splice(d,1),c--)}if(g)for(;c--;c)s.unshift("..");return s}function l(s,g){if(s.filter)return s.filter(g);for(var c=[],d=0;d<s.length;d++)g(s[d],d,s)&&c.push(s[d]);return c}t.resolve=function(){for(var s="",g=!1,c=arguments.length-1;c>=-1&&!g;c--){var d=c>=0?arguments[c]:r.cwd();if(typeof d!="string")throw new TypeError("Arguments to path.resolve must be strings");d&&(s=d+"/"+s,g=d.charAt(0)==="/")}return(g?"/":"")+(s=o(l(s.split("/"),function(w){return!!w}),!g).join("/"))||"."},t.normalize=function(s){var g=t.isAbsolute(s),c=u(s,-1)==="/";return(s=o(l(s.split("/"),function(d){return!!d}),!g).join("/"))||g||(s="."),s&&c&&(s+="/"),(g?"/":"")+s},t.isAbsolute=function(s){return s.charAt(0)==="/"},t.join=function(){var s=Array.prototype.slice.call(arguments,0);return t.normalize(l(s,function(g,c){if(typeof g!="string")throw new TypeError("Arguments to path.join must be strings");return g}).join("/"))},t.relative=function(s,g){function c(S){for(var N=0;N<S.length&&S[N]==="";N++);for(var B=S.length-1;B>=0&&S[B]==="";B--);return N>B?[]:S.slice(N,B-N+1)}s=t.resolve(s).substr(1),g=t.resolve(g).substr(1);for(var d=c(s.split("/")),w=c(g.split("/")),v=Math.min(d.length,w.length),y=v,f=0;f<v;f++)if(d[f]!==w[f]){y=f;break}var p=[];for(f=y;f<d.length;f++)p.push("..");return(p=p.concat(w.slice(y))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(s){if(typeof s!="string"&&(s+=""),s.length===0)return".";for(var g=s.charCodeAt(0),c=g===47,d=-1,w=!0,v=s.length-1;v>=1;--v)if((g=s.charCodeAt(v))===47){if(!w){d=v;break}}else w=!1;return d===-1?c?"/":".":c&&d===1?"/":s.slice(0,d)},t.basename=function(s,g){var c=function(d){typeof d!="string"&&(d+="");var w,v=0,y=-1,f=!0;for(w=d.length-1;w>=0;--w)if(d.charCodeAt(w)===47){if(!f){v=w+1;break}}else y===-1&&(f=!1,y=w+1);return y===-1?"":d.slice(v,y)}(s);return g&&c.substr(-1*g.length)===g&&(c=c.substr(0,c.length-g.length)),c},t.extname=function(s){typeof s!="string"&&(s+="");for(var g=-1,c=0,d=-1,w=!0,v=0,y=s.length-1;y>=0;--y){var f=s.charCodeAt(y);if(f!==47)d===-1&&(w=!1,d=y+1),f===46?g===-1?g=y:v!==1&&(v=1):g!==-1&&(v=-1);else if(!w){c=y+1;break}}return g===-1||d===-1||v===0||v===1&&g===d-1&&g===c+1?"":s.slice(g,d)};var u="ab".substr(-1)==="b"?function(s,g,c){return s.substr(g,c)}:function(s,g,c){return g<0&&(g=s.length+g),s.substr(g,c)}}).call(this,n(2))},,function(e,t,n){var r=t.format=n(8);t.levels=n(103),Object.defineProperty(r,"align",{value:n(120)}),Object.defineProperty(r,"cli",{value:n(121)}),Object.defineProperty(r,"colorize",{value:n(42)}),Object.defineProperty(r,"combine",{value:n(122)}),Object.defineProperty(r,"errors",{value:n(123)}),Object.defineProperty(r,"json",{value:n(124)}),Object.defineProperty(r,"label",{value:n(125)}),Object.defineProperty(r,"logstash",{value:n(126)}),Object.defineProperty(r,"metadata",{value:n(127)}),Object.defineProperty(r,"ms",{value:n(128)}),Object.defineProperty(r,"padLevels",{value:n(59)}),Object.defineProperty(r,"prettyPrint",{value:n(130)}),Object.defineProperty(r,"printf",{value:n(131)}),Object.defineProperty(r,"simple",{value:n(132)}),Object.defineProperty(r,"splat",{value:n(133)}),Object.defineProperty(r,"timestamp",{value:n(134)}),Object.defineProperty(r,"uncolorize",{value:n(136)})},function(e,t,n){var r=n(104);e.exports=r},function(e,t,n){function r(v){return function(y){if(Array.isArray(y))return o(y)}(v)||function(y){if(typeof Symbol<"u"&&y[Symbol.iterator]!=null||y["@@iterator"]!=null)return Array.from(y)}(v)||function(y,f){if(y){if(typeof y=="string")return o(y,f);var p=Object.prototype.toString.call(y).slice(8,-1);if(p==="Object"&&y.constructor&&(p=y.constructor.name),p==="Map"||p==="Set")return Array.from(y);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return o(y,f)}}(v)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(v,y){(y==null||y>v.length)&&(y=v.length);for(var f=0,p=new Array(y);f<y;f++)p[f]=v[f];return p}function l(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function u(v,y){for(var f=0;f<y.length;f++){var p=y[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}var s=n(3),g=s.configs,c=s.LEVEL,d=s.MESSAGE,w=function(){function v(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{levels:g.npm.levels};l(this,v),this.paddings=v.paddingForLevels(S.levels,S.filler),this.options=S}var y,f,p;return y=v,p=[{key:"getLongestLevel",value:function(S){var N=Object.keys(S).map(function(B){return B.length});return Math.max.apply(Math,r(N))}},{key:"paddingForLevel",value:function(S,N,B){var E=B+1-S.length,T=Math.floor(E/N.length);return"".concat(N).concat(N.repeat(T)).slice(0,E)}},{key:"paddingForLevels",value:function(S){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ",B=v.getLongestLevel(S);return Object.keys(S).reduce(function(E,T){return E[T]=v.paddingForLevel(T,N,B),E},{})}}],(f=[{key:"transform",value:function(S,N){return S.message="".concat(this.paddings[S[c]]).concat(S.message),S[d]&&(S[d]="".concat(this.paddings[S[c]]).concat(S[d])),S}}])&&u(y.prototype,f),p&&u(y,p),Object.defineProperty(y,"prototype",{writable:!1}),v}();e.exports=function(v){return new w(v)},e.exports.Padder=e.exports.Format=w},function(e,t,n){var r=n(13).format;t.warn={deprecated:function(o){return function(){throw new Error(r("{ %s } was removed in winston@3.0.0.",o))}},useFormat:function(o){return function(){throw new Error([r("{ %s } was removed in winston@3.0.0.",o),"Use a custom winston.format = winston.format(function) instead."].join(`
39
+ `))}},forFunctions:function(o,l,u){u.forEach(function(s){o[s]=t.warn[l](s)})},moved:function(o,l,u){function s(){return function(){throw new Error([r("winston.%s was moved in winston@3.0.0.",u),r("Use a winston.%s instead.",l)].join(`
40
+ `))}}Object.defineProperty(o,u,{get:s,set:s})},forProperties:function(o,l,u){u.forEach(function(s){var g=t.warn[l](s);Object.defineProperty(o,s,{get:g,set:g})})}}},function(e,t,n){(function(r,o){function l(O){var L=this;this.next=null,this.entry=null,this.finish=function(){(function(U,A,V){var q=U.entry;for(U.entry=null;q;){var Q=q.callback;A.pendingcb--,Q(V),q=q.next}A.corkedRequestsFree.next=U})(L,O)}}var u;e.exports=b,b.WritableState=m;var s={deprecate:n(43)},g=n(62),c=n(5).Buffer,d=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w,v=n(64),y=n(65).getHighWaterMark,f=n(35).codes,p=f.ERR_INVALID_ARG_TYPE,S=f.ERR_METHOD_NOT_IMPLEMENTED,N=f.ERR_MULTIPLE_CALLBACK,B=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,T=f.ERR_STREAM_NULL_VALUES,h=f.ERR_STREAM_WRITE_AFTER_END,R=f.ERR_UNKNOWN_ENCODING,W=v.errorOrDestroy;function X(){}function m(O,L,U){u=u||n(36),O=O||{},typeof U!="boolean"&&(U=L instanceof u),this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.writableObjectMode),this.highWaterMark=y(this,O,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var A=O.decodeStrings===!1;this.decodeStrings=!A,this.defaultEncoding=O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){(function(q,Q){var ee=q._writableState,te=ee.sync,k=ee.writecb;if(typeof k!="function")throw new N;if(function(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}(ee),Q)(function(_,I,$,K,Y){--I.pendingcb,$?(o.nextTick(Y,K),o.nextTick(D,_,I),_._writableState.errorEmitted=!0,W(_,K)):(Y(K),_._writableState.errorEmitted=!0,W(_,K),D(_,I))})(q,ee,te,Q,k);else{var x=z(ee)||q.destroyed;x||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||C(q,ee),te?o.nextTick(j,q,ee,x,k):j(q,ee,x,k)}})(L,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function b(O){var L=this instanceof(u=u||n(36));if(!L&&!w.call(b,this))return new b(O);this._writableState=new m(O,this,L),this.writable=!0,O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final)),g.call(this)}function G(O,L,U,A,V,q,Q){L.writelen=A,L.writecb=Q,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new E("write")):U?O._writev(V,L.onwrite):O._write(V,q,L.onwrite),L.sync=!1}function j(O,L,U,A){U||function(V,q){q.length===0&&q.needDrain&&(q.needDrain=!1,V.emit("drain"))}(O,L),L.pendingcb--,A(),D(O,L)}function C(O,L){L.bufferProcessing=!0;var U=L.bufferedRequest;if(O._writev&&U&&U.next){var A=L.bufferedRequestCount,V=new Array(A),q=L.corkedRequestsFree;q.entry=U;for(var Q=0,ee=!0;U;)V[Q]=U,U.isBuf||(ee=!1),U=U.next,Q+=1;V.allBuffers=ee,G(O,L,!0,L.length,V,"",q.finish),L.pendingcb++,L.lastBufferedRequest=null,q.next?(L.corkedRequestsFree=q.next,q.next=null):L.corkedRequestsFree=new l(L),L.bufferedRequestCount=0}else{for(;U;){var te=U.chunk,k=U.encoding,x=U.callback;if(G(O,L,!1,L.objectMode?1:te.length,te,k,x),U=U.next,L.bufferedRequestCount--,L.writing)break}U===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=U,L.bufferProcessing=!1}function z(O){return O.ending&&O.length===0&&O.bufferedRequest===null&&!O.finished&&!O.writing}function P(O,L){O._final(function(U){L.pendingcb--,U&&W(O,U),L.prefinished=!0,O.emit("prefinish"),D(O,L)})}function D(O,L){var U=z(L);if(U&&(function(V,q){q.prefinished||q.finalCalled||(typeof V._final!="function"||q.destroyed?(q.prefinished=!0,V.emit("prefinish")):(q.pendingcb++,q.finalCalled=!0,o.nextTick(P,V,q)))}(O,L),L.pendingcb===0&&(L.finished=!0,O.emit("finish"),L.autoDestroy))){var A=O._readableState;(!A||A.autoDestroy&&A.endEmitted)&&O.destroy()}return U}n(7)(b,g),m.prototype.getBuffer=function(){for(var O=this.bufferedRequest,L=[];O;)L.push(O),O=O.next;return L},function(){try{Object.defineProperty(m.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(O){return!!w.call(this,O)||this===b&&O&&O._writableState instanceof m}})):w=function(O){return O instanceof this},b.prototype.pipe=function(){W(this,new B)},b.prototype.write=function(O,L,U){var A,V=this._writableState,q=!1,Q=!V.objectMode&&(A=O,c.isBuffer(A)||A instanceof d);return Q&&!c.isBuffer(O)&&(O=function(ee){return c.from(ee)}(O)),typeof L=="function"&&(U=L,L=null),Q?L="buffer":L||(L=V.defaultEncoding),typeof U!="function"&&(U=X),V.ending?function(ee,te){var k=new h;W(ee,k),o.nextTick(te,k)}(this,U):(Q||function(ee,te,k,x){var _;return k===null?_=new T:typeof k=="string"||te.objectMode||(_=new p("chunk",["string","Buffer"],k)),!_||(W(ee,_),o.nextTick(x,_),!1)}(this,V,O,U))&&(V.pendingcb++,q=function(ee,te,k,x,_,I){if(!k){var $=function(ie,ue,we){return ie.objectMode||ie.decodeStrings===!1||typeof ue!="string"||(ue=c.from(ue,we)),ue}(te,x,_);x!==$&&(k=!0,_="buffer",x=$)}var K=te.objectMode?1:x.length;te.length+=K;var Y=te.length<te.highWaterMark;if(Y||(te.needDrain=!0),te.writing||te.corked){var ne=te.lastBufferedRequest;te.lastBufferedRequest={chunk:x,encoding:_,isBuf:k,callback:I,next:null},ne?ne.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else G(ee,te,!1,K,x,_,I);return Y}(this,V,Q,O,L,U)),q},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var O=this._writableState;O.corked&&(O.corked--,O.writing||O.corked||O.bufferProcessing||!O.bufferedRequest||C(this,O))},b.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new R(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(b.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(O,L,U){U(new S("_write()"))},b.prototype._writev=null,b.prototype.end=function(O,L,U){var A=this._writableState;return typeof O=="function"?(U=O,O=null,L=null):typeof L=="function"&&(U=L,L=null),O!=null&&this.write(O,L),A.corked&&(A.corked=1,this.uncork()),A.ending||function(V,q,Q){q.ending=!0,D(V,q),Q&&(q.finished?o.nextTick(Q):V.once("finish",Q)),q.ended=!0,V.writable=!1}(this,A,U),this},Object.defineProperty(b.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(O,L){L(O)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t){var n={}.toString;e.exports=Array.isArray||function(r){return n.call(r)=="[object Array]"}},function(e,t,n){(function(r){function o(s,g){u(s,g),l(s)}function l(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(s,g){s.emit("error",g)}e.exports={destroy:function(s,g){var c=this,d=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return d||w?(g?g(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(u,this,s)):r.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(v){!g&&v?c._writableState?c._writableState.errorEmitted?r.nextTick(l,c):(c._writableState.errorEmitted=!0,r.nextTick(o,c,v)):r.nextTick(o,c,v):g?(r.nextTick(l,c),g(v)):r.nextTick(l,c)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(s,g){var c=s._readableState,d=s._writableState;c&&c.autoDestroy||d&&d.autoDestroy?s.destroy(g):s.emit("error",g)}}}).call(this,n(2))},function(e,t,n){var r=n(35).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(o,l,u,s){var g=function(c,d,w){return c.highWaterMark!=null?c.highWaterMark:d?c[w]:null}(l,s,u);if(g!=null){if(!isFinite(g)||Math.floor(g)!==g||g<0)throw new r(s?u:"highWaterMark",g);return Math.floor(g)}return o.objectMode?16:16384}}},function(e,t){},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(159)),o=u(n(23)),l=u(n(30));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)(function(s,g,c,d){return(0,r.default)(g)(s,(0,o.default)(c),d)},4),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){function o(...l){if(r!==null){var u=r;r=null,u.apply(this,l)}}return Object.assign(o,r),o},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){if(r===null)throw new Error("Callback was already called.");var l=r;r=null,l.apply(this,o)}},e.exports=t.default},function(e,t,n){(function(r,o){var l=n(37);e.exports=T;var u,s=n(63);T.ReadableState=E,n(20).EventEmitter;var g=function(U,A){return U.listeners(A).length},c=n(71),d=n(46).Buffer,w=r.Uint8Array||function(){},v=Object.create(n(32));v.inherits=n(7);var y=n(165),f=void 0;f=y&&y.debuglog?y.debuglog("stream"):function(){};var p,S=n(166),N=n(72);v.inherits(T,c);var B=["error","close","destroy","pause","resume"];function E(U,A){U=U||{};var V=A instanceof(u=u||n(22));this.objectMode=!!U.objectMode,V&&(this.objectMode=this.objectMode||!!U.readableObjectMode);var q=U.highWaterMark,Q=U.readableHighWaterMark,ee=this.objectMode?16:16384;this.highWaterMark=q||q===0?q:V&&(Q||Q===0)?Q:ee,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=U.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,U.encoding&&(p||(p=n(21).StringDecoder),this.decoder=new p(U.encoding),this.encoding=U.encoding)}function T(U){if(u=u||n(22),!(this instanceof T))return new T(U);this._readableState=new E(U,this),this.readable=!0,U&&(typeof U.read=="function"&&(this._read=U.read),typeof U.destroy=="function"&&(this._destroy=U.destroy)),c.call(this)}function h(U,A,V,q,Q){var ee,te=U._readableState;return A===null?(te.reading=!1,function(k,x){if(!x.ended){if(x.decoder){var _=x.decoder.end();_&&_.length&&(x.buffer.push(_),x.length+=x.objectMode?1:_.length)}x.ended=!0,X(k)}}(U,te)):(Q||(ee=function(k,x){var _;I=x,d.isBuffer(I)||I instanceof w||typeof x=="string"||x===void 0||k.objectMode||(_=new TypeError("Invalid non-string/buffer chunk"));var I;return _}(te,A)),ee?U.emit("error",ee):te.objectMode||A&&A.length>0?(typeof A=="string"||te.objectMode||Object.getPrototypeOf(A)===d.prototype||(A=function(k){return d.from(k)}(A)),q?te.endEmitted?U.emit("error",new Error("stream.unshift() after end event")):R(U,te,A,!0):te.ended?U.emit("error",new Error("stream.push() after EOF")):(te.reading=!1,te.decoder&&!V?(A=te.decoder.write(A),te.objectMode||A.length!==0?R(U,te,A,!1):b(U,te)):R(U,te,A,!1))):q||(te.reading=!1)),function(k){return!k.ended&&(k.needReadable||k.length<k.highWaterMark||k.length===0)}(te)}function R(U,A,V,q){A.flowing&&A.length===0&&!A.sync?(U.emit("data",V),U.read(0)):(A.length+=A.objectMode?1:V.length,q?A.buffer.unshift(V):A.buffer.push(V),A.needReadable&&X(U)),b(U,A)}Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(U){this._readableState&&(this._readableState.destroyed=U)}}),T.prototype.destroy=N.destroy,T.prototype._undestroy=N.undestroy,T.prototype._destroy=function(U,A){this.push(null),A(U)},T.prototype.push=function(U,A){var V,q=this._readableState;return q.objectMode?V=!0:typeof U=="string"&&((A=A||q.defaultEncoding)!==q.encoding&&(U=d.from(U,A),A=""),V=!0),h(this,U,A,!1,V)},T.prototype.unshift=function(U){return h(this,U,null,!0,!1)},T.prototype.isPaused=function(){return this._readableState.flowing===!1},T.prototype.setEncoding=function(U){return p||(p=n(21).StringDecoder),this._readableState.decoder=new p(U),this._readableState.encoding=U,this};function W(U,A){return U<=0||A.length===0&&A.ended?0:A.objectMode?1:U!=U?A.flowing&&A.length?A.buffer.head.data.length:A.length:(U>A.highWaterMark&&(A.highWaterMark=function(V){return V>=8388608?V=8388608:(V--,V|=V>>>1,V|=V>>>2,V|=V>>>4,V|=V>>>8,V|=V>>>16,V++),V}(U)),U<=A.length?U:A.ended?A.length:(A.needReadable=!0,0))}function X(U){var A=U._readableState;A.needReadable=!1,A.emittedReadable||(f("emitReadable",A.flowing),A.emittedReadable=!0,A.sync?l.nextTick(m,U):m(U))}function m(U){f("emit readable"),U.emit("readable"),z(U)}function b(U,A){A.readingMore||(A.readingMore=!0,l.nextTick(G,U,A))}function G(U,A){for(var V=A.length;!A.reading&&!A.flowing&&!A.ended&&A.length<A.highWaterMark&&(f("maybeReadMore read 0"),U.read(0),V!==A.length);)V=A.length;A.readingMore=!1}function j(U){f("readable nexttick read 0"),U.read(0)}function C(U,A){A.reading||(f("resume read 0"),U.read(0)),A.resumeScheduled=!1,A.awaitDrain=0,U.emit("resume"),z(U),A.flowing&&!A.reading&&U.read(0)}function z(U){var A=U._readableState;for(f("flow",A.flowing);A.flowing&&U.read()!==null;);}function P(U,A){return A.length===0?null:(A.objectMode?V=A.buffer.shift():!U||U>=A.length?(V=A.decoder?A.buffer.join(""):A.buffer.length===1?A.buffer.head.data:A.buffer.concat(A.length),A.buffer.clear()):V=function(q,Q,ee){var te;return q<Q.head.data.length?(te=Q.head.data.slice(0,q),Q.head.data=Q.head.data.slice(q)):te=q===Q.head.data.length?Q.shift():ee?function(k,x){var _=x.head,I=1,$=_.data;for(k-=$.length;_=_.next;){var K=_.data,Y=k>K.length?K.length:k;if(Y===K.length?$+=K:$+=K.slice(0,k),(k-=Y)===0){Y===K.length?(++I,_.next?x.head=_.next:x.head=x.tail=null):(x.head=_,_.data=K.slice(Y));break}++I}return x.length-=I,$}(q,Q):function(k,x){var _=d.allocUnsafe(k),I=x.head,$=1;for(I.data.copy(_),k-=I.data.length;I=I.next;){var K=I.data,Y=k>K.length?K.length:k;if(K.copy(_,_.length-k,0,Y),(k-=Y)===0){Y===K.length?(++$,I.next?x.head=I.next:x.head=x.tail=null):(x.head=I,I.data=K.slice(Y));break}++$}return x.length-=$,_}(q,Q),te}(U,A.buffer,A.decoder),V);var V}function D(U){var A=U._readableState;if(A.length>0)throw new Error('"endReadable()" called on non-empty stream');A.endEmitted||(A.ended=!0,l.nextTick(O,A,U))}function O(U,A){U.endEmitted||U.length!==0||(U.endEmitted=!0,A.readable=!1,A.emit("end"))}function L(U,A){for(var V=0,q=U.length;V<q;V++)if(U[V]===A)return V;return-1}T.prototype.read=function(U){f("read",U),U=parseInt(U,10);var A=this._readableState,V=U;if(U!==0&&(A.emittedReadable=!1),U===0&&A.needReadable&&(A.length>=A.highWaterMark||A.ended))return f("read: emitReadable",A.length,A.ended),A.length===0&&A.ended?D(this):X(this),null;if((U=W(U,A))===0&&A.ended)return A.length===0&&D(this),null;var q,Q=A.needReadable;return f("need readable",Q),(A.length===0||A.length-U<A.highWaterMark)&&f("length less than watermark",Q=!0),A.ended||A.reading?f("reading or ended",Q=!1):Q&&(f("do read"),A.reading=!0,A.sync=!0,A.length===0&&(A.needReadable=!0),this._read(A.highWaterMark),A.sync=!1,A.reading||(U=W(V,A))),(q=U>0?P(U,A):null)===null?(A.needReadable=!0,U=0):A.length-=U,A.length===0&&(A.ended||(A.needReadable=!0),V!==U&&A.ended&&D(this)),q!==null&&this.emit("data",q),q},T.prototype._read=function(U){this.emit("error",new Error("_read() is not implemented"))},T.prototype.pipe=function(U,A){var V=this,q=this._readableState;switch(q.pipesCount){case 0:q.pipes=U;break;case 1:q.pipes=[q.pipes,U];break;default:q.pipes.push(U)}q.pipesCount+=1,f("pipe count=%d opts=%j",q.pipesCount,A);var Q=(!A||A.end!==!1)&&U!==o.stdout&&U!==o.stderr?te:ne;function ee(ie,ue){f("onunpipe"),ie===V&&ue&&ue.hasUnpiped===!1&&(ue.hasUnpiped=!0,f("cleanup"),U.removeListener("close",K),U.removeListener("finish",Y),U.removeListener("drain",k),U.removeListener("error",$),U.removeListener("unpipe",ee),V.removeListener("end",te),V.removeListener("end",ne),V.removeListener("data",I),x=!0,!q.awaitDrain||U._writableState&&!U._writableState.needDrain||k())}function te(){f("onend"),U.end()}q.endEmitted?l.nextTick(Q):V.once("end",Q),U.on("unpipe",ee);var k=function(ie){return function(){var ue=ie._readableState;f("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&g(ie,"data")&&(ue.flowing=!0,z(ie))}}(V);U.on("drain",k);var x=!1,_=!1;function I(ie){f("ondata"),_=!1,U.write(ie)!==!1||_||((q.pipesCount===1&&q.pipes===U||q.pipesCount>1&&L(q.pipes,U)!==-1)&&!x&&(f("false write response, pause",V._readableState.awaitDrain),V._readableState.awaitDrain++,_=!0),V.pause())}function $(ie){f("onerror",ie),ne(),U.removeListener("error",$),g(U,"error")===0&&U.emit("error",ie)}function K(){U.removeListener("finish",Y),ne()}function Y(){f("onfinish"),U.removeListener("close",K),ne()}function ne(){f("unpipe"),V.unpipe(U)}return V.on("data",I),function(ie,ue,we){if(typeof ie.prependListener=="function")return ie.prependListener(ue,we);ie._events&&ie._events[ue]?s(ie._events[ue])?ie._events[ue].unshift(we):ie._events[ue]=[we,ie._events[ue]]:ie.on(ue,we)}(U,"error",$),U.once("close",K),U.once("finish",Y),U.emit("pipe",V),q.flowing||(f("pipe resume"),V.resume()),U},T.prototype.unpipe=function(U){var A=this._readableState,V={hasUnpiped:!1};if(A.pipesCount===0)return this;if(A.pipesCount===1)return U&&U!==A.pipes||(U||(U=A.pipes),A.pipes=null,A.pipesCount=0,A.flowing=!1,U&&U.emit("unpipe",this,V)),this;if(!U){var q=A.pipes,Q=A.pipesCount;A.pipes=null,A.pipesCount=0,A.flowing=!1;for(var ee=0;ee<Q;ee++)q[ee].emit("unpipe",this,V);return this}var te=L(A.pipes,U);return te===-1||(A.pipes.splice(te,1),A.pipesCount-=1,A.pipesCount===1&&(A.pipes=A.pipes[0]),U.emit("unpipe",this,V)),this},T.prototype.on=function(U,A){var V=c.prototype.on.call(this,U,A);if(U==="data")this._readableState.flowing!==!1&&this.resume();else if(U==="readable"){var q=this._readableState;q.endEmitted||q.readableListening||(q.readableListening=q.needReadable=!0,q.emittedReadable=!1,q.reading?q.length&&X(this):l.nextTick(j,this))}return V},T.prototype.addListener=T.prototype.on,T.prototype.resume=function(){var U=this._readableState;return U.flowing||(f("resume"),U.flowing=!0,function(A,V){V.resumeScheduled||(V.resumeScheduled=!0,l.nextTick(C,A,V))}(this,U)),this},T.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},T.prototype.wrap=function(U){var A=this,V=this._readableState,q=!1;for(var Q in U.on("end",function(){if(f("wrapped end"),V.decoder&&!V.ended){var te=V.decoder.end();te&&te.length&&A.push(te)}A.push(null)}),U.on("data",function(te){f("wrapped data"),V.decoder&&(te=V.decoder.write(te)),V.objectMode&&te==null||(V.objectMode||te&&te.length)&&(A.push(te)||(q=!0,U.pause()))}),U)this[Q]===void 0&&typeof U[Q]=="function"&&(this[Q]=function(te){return function(){return U[te].apply(U,arguments)}}(Q));for(var ee=0;ee<B.length;ee++)U.on(B[ee],this.emit.bind(this,B[ee]));return this._read=function(te){f("wrapped _read",te),q&&(q=!1,U.resume())},this},Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),T._fromList=P}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t,n){var r=n(37);function o(l,u){l.emit("error",u)}e.exports={destroy:function(l,u){var s=this,g=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return g||c?(u?u(l):!l||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,l),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(d){!u&&d?(r.nextTick(o,s,d),s._writableState&&(s._writableState.errorEmitted=!0)):u&&u(d)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){e.exports=u;var r=n(22),o=Object.create(n(32));function l(c,d){var w=this._transformState;w.transforming=!1;var v=w.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));w.writechunk=null,w.writecb=null,d!=null&&this.push(d),v(c);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function u(c){if(!(this instanceof u))return new u(c);r.call(this,c),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",s)}function s(){var c=this;typeof this._flush=="function"?this._flush(function(d,w){g(c,d,w)}):g(this,null,null)}function g(c,d,w){if(d)return c.emit("error",d);if(w!=null&&c.push(w),c._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(c._transformState.transforming)throw new Error("Calling transform done when still transforming");return c.push(null)}o.inherits=n(7),o.inherits(u,r),u.prototype.push=function(c,d){return this._transformState.needTransform=!1,r.prototype.push.call(this,c,d)},u.prototype._transform=function(c,d,w){throw new Error("_transform() is not implemented")},u.prototype._write=function(c,d,w){var v=this._transformState;if(v.writecb=w,v.writechunk=c,v.writeencoding=d,!v.transforming){var y=this._readableState;(v.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},u.prototype._read=function(c){var d=this._transformState;d.writechunk!==null&&d.writecb&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},u.prototype._destroy=function(c,d){var w=this;r.prototype._destroy.call(this,c,function(v){d(v),w.emit("close")})}},function(e,t,n){(function(r){var o=n(174);function l(m,b){if(m===b)return 0;for(var G=m.length,j=b.length,C=0,z=Math.min(G,j);C<z;++C)if(m[C]!==b[C]){G=m[C],j=b[C];break}return G<j?-1:j<G?1:0}function u(m){return r.Buffer&&typeof r.Buffer.isBuffer=="function"?r.Buffer.isBuffer(m):!(m==null||!m._isBuffer)}var s=n(13),g=Object.prototype.hasOwnProperty,c=Array.prototype.slice,d=(function(){}).name==="foo";function w(m){return Object.prototype.toString.call(m)}function v(m){return!u(m)&&typeof r.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(m):!!m&&(m instanceof DataView||!!(m.buffer&&m.buffer instanceof ArrayBuffer)))}var y=e.exports=E,f=/\s*function\s+([^\(\s]*)\s*/;function p(m){if(s.isFunction(m)){if(d)return m.name;var b=m.toString().match(f);return b&&b[1]}}function S(m,b){return typeof m=="string"?m.length<b?m:m.slice(0,b):m}function N(m){if(d||!s.isFunction(m))return s.inspect(m);var b=p(m);return"[Function"+(b?": "+b:"")+"]"}function B(m,b,G,j,C){throw new y.AssertionError({message:G,actual:m,expected:b,operator:j,stackStartFunction:C})}function E(m,b){m||B(m,!0,b,"==",y.ok)}function T(m,b,G,j){if(m===b)return!0;if(u(m)&&u(b))return l(m,b)===0;if(s.isDate(m)&&s.isDate(b))return m.getTime()===b.getTime();if(s.isRegExp(m)&&s.isRegExp(b))return m.source===b.source&&m.global===b.global&&m.multiline===b.multiline&&m.lastIndex===b.lastIndex&&m.ignoreCase===b.ignoreCase;if(m!==null&&typeof m=="object"||b!==null&&typeof b=="object"){if(v(m)&&v(b)&&w(m)===w(b)&&!(m instanceof Float32Array||m instanceof Float64Array))return l(new Uint8Array(m.buffer),new Uint8Array(b.buffer))===0;if(u(m)!==u(b))return!1;var C=(j=j||{actual:[],expected:[]}).actual.indexOf(m);return C!==-1&&C===j.expected.indexOf(b)||(j.actual.push(m),j.expected.push(b),function(z,P,D,O){if(z==null||P==null)return!1;if(s.isPrimitive(z)||s.isPrimitive(P))return z===P;if(D&&Object.getPrototypeOf(z)!==Object.getPrototypeOf(P))return!1;var L=h(z),U=h(P);if(L&&!U||!L&&U)return!1;if(L)return z=c.call(z),P=c.call(P),T(z,P,D);var A,V,q=X(z),Q=X(P);if(q.length!==Q.length)return!1;for(q.sort(),Q.sort(),V=q.length-1;V>=0;V--)if(q[V]!==Q[V])return!1;for(V=q.length-1;V>=0;V--)if(A=q[V],!T(z[A],P[A],D,O))return!1;return!0}(m,b,G,j))}return G?m===b:m==b}function h(m){return Object.prototype.toString.call(m)=="[object Arguments]"}function R(m,b){if(!m||!b)return!1;if(Object.prototype.toString.call(b)=="[object RegExp]")return b.test(m);try{if(m instanceof b)return!0}catch{}return!Error.isPrototypeOf(b)&&b.call({},m)===!0}function W(m,b,G,j){var C;if(typeof b!="function")throw new TypeError('"block" argument must be a function');typeof G=="string"&&(j=G,G=null),C=function(D){var O;try{D()}catch(L){O=L}return O}(b),j=(G&&G.name?" ("+G.name+").":".")+(j?" "+j:"."),m&&!C&&B(C,G,"Missing expected exception"+j);var z=typeof j=="string",P=!m&&C&&!G;if((!m&&s.isError(C)&&z&&R(C,G)||P)&&B(C,G,"Got unwanted exception"+j),m&&C&&G&&!R(C,G)||!m&&C)throw C}y.AssertionError=function(m){this.name="AssertionError",this.actual=m.actual,this.expected=m.expected,this.operator=m.operator,m.message?(this.message=m.message,this.generatedMessage=!1):(this.message=function(D){return S(N(D.actual),128)+" "+D.operator+" "+S(N(D.expected),128)}(this),this.generatedMessage=!0);var b=m.stackStartFunction||B;if(Error.captureStackTrace)Error.captureStackTrace(this,b);else{var G=new Error;if(G.stack){var j=G.stack,C=p(b),z=j.indexOf(`
41
+ `+C);if(z>=0){var P=j.indexOf(`
42
+ `,z+1);j=j.substring(P+1)}this.stack=j}}},s.inherits(y.AssertionError,Error),y.fail=B,y.ok=E,y.equal=function(m,b,G){m!=b&&B(m,b,G,"==",y.equal)},y.notEqual=function(m,b,G){m==b&&B(m,b,G,"!=",y.notEqual)},y.deepEqual=function(m,b,G){T(m,b,!1)||B(m,b,G,"deepEqual",y.deepEqual)},y.deepStrictEqual=function(m,b,G){T(m,b,!0)||B(m,b,G,"deepStrictEqual",y.deepStrictEqual)},y.notDeepEqual=function(m,b,G){T(m,b,!1)&&B(m,b,G,"notDeepEqual",y.notDeepEqual)},y.notDeepStrictEqual=function m(b,G,j){T(b,G,!0)&&B(b,G,j,"notDeepStrictEqual",m)},y.strictEqual=function(m,b,G){m!==b&&B(m,b,G,"===",y.strictEqual)},y.notStrictEqual=function(m,b,G){m===b&&B(m,b,G,"!==",y.notStrictEqual)},y.throws=function(m,b,G){W(!0,m,b,G)},y.doesNotThrow=function(m,b,G){W(!1,m,b,G)},y.ifError=function(m){if(m)throw m},y.strict=o(function m(b,G){b||B(b,!0,G,"==",m)},y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict;var X=Object.keys||function(m){var b=[];for(var G in m)g.call(m,G)&&b.push(G);return b}}).call(this,n(6))},function(e,t,n){e.exports=function(r,o,l,u){for(var s=65535&r|0,g=r>>>16&65535|0,c=0;l!==0;){l-=c=l>2e3?2e3:l;do g=g+(s=s+o[u++]|0)|0;while(--c);s%=65521,g%=65521}return s|g<<16|0}},function(e,t,n){var r=function(){for(var o,l=[],u=0;u<256;u++){o=u;for(var s=0;s<8;s++)o=1&o?3988292384^o>>>1:o>>>1;l[u]=o}return l}();e.exports=function(o,l,u,s){var g=r,c=s+u;o^=-1;for(var d=s;d<c;d++)o=o>>>8^g[255&(o^l[d])];return-1^o}},function(e,t,n){(function(r,o){var l;e.exports=b,b.ReadableState=m,n(20).EventEmitter;var u=function(k,x){return k.listeners(x).length},s=n(78),g=n(5).Buffer,c=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},d,w=n(183);d=w&&w.debuglog?w.debuglog("stream"):function(){};var v,y,f,p=n(184),S=n(79),N=n(80).getHighWaterMark,B=n(24).codes,E=B.ERR_INVALID_ARG_TYPE,T=B.ERR_STREAM_PUSH_AFTER_EOF,h=B.ERR_METHOD_NOT_IMPLEMENTED,R=B.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(b,s);var W=S.errorOrDestroy,X=["error","close","destroy","pause","resume"];function m(k,x,_){l=l||n(25),k=k||{},typeof _!="boolean"&&(_=x instanceof l),this.objectMode=!!k.objectMode,_&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=N(this,k,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(v||(v=n(21).StringDecoder),this.decoder=new v(k.encoding),this.encoding=k.encoding)}function b(k){if(l=l||n(25),!(this instanceof b))return new b(k);var x=this instanceof l;this._readableState=new m(k,this,x),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),s.call(this)}function G(k,x,_,I,$){d("readableAddChunk",x);var K,Y=k._readableState;if(x===null)Y.reading=!1,function(ne,ie){if(d("onEofChunk"),!ie.ended){if(ie.decoder){var ue=ie.decoder.end();ue&&ue.length&&(ie.buffer.push(ue),ie.length+=ie.objectMode?1:ue.length)}ie.ended=!0,ie.sync?z(ne):(ie.needReadable=!1,ie.emittedReadable||(ie.emittedReadable=!0,P(ne)))}}(k,Y);else if($||(K=function(ne,ie){var ue;we=ie,g.isBuffer(we)||we instanceof c||typeof ie=="string"||ie===void 0||ne.objectMode||(ue=new E("chunk",["string","Buffer","Uint8Array"],ie));var we;return ue}(Y,x)),K)W(k,K);else if(Y.objectMode||x&&x.length>0)if(typeof x=="string"||Y.objectMode||Object.getPrototypeOf(x)===g.prototype||(x=function(ne){return g.from(ne)}(x)),I)Y.endEmitted?W(k,new R):j(k,Y,x,!0);else if(Y.ended)W(k,new T);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!_?(x=Y.decoder.write(x),Y.objectMode||x.length!==0?j(k,Y,x,!1):D(k,Y)):j(k,Y,x,!1)}else I||(Y.reading=!1,D(k,Y));return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function j(k,x,_,I){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,k.emit("data",_)):(x.length+=x.objectMode?1:_.length,I?x.buffer.unshift(_):x.buffer.push(_),x.needReadable&&z(k)),D(k,x)}Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(k){this._readableState&&(this._readableState.destroyed=k)}}),b.prototype.destroy=S.destroy,b.prototype._undestroy=S.undestroy,b.prototype._destroy=function(k,x){x(k)},b.prototype.push=function(k,x){var _,I=this._readableState;return I.objectMode?_=!0:typeof k=="string"&&((x=x||I.defaultEncoding)!==I.encoding&&(k=g.from(k,x),x=""),_=!0),G(this,k,x,!1,_)},b.prototype.unshift=function(k){return G(this,k,null,!0,!1)},b.prototype.isPaused=function(){return this._readableState.flowing===!1},b.prototype.setEncoding=function(k){v||(v=n(21).StringDecoder);var x=new v(k);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,I="";_!==null;)I+=x.write(_.data),_=_.next;return this._readableState.buffer.clear(),I!==""&&this._readableState.buffer.push(I),this._readableState.length=I.length,this};function C(k,x){return k<=0||x.length===0&&x.ended?0:x.objectMode?1:k!=k?x.flowing&&x.length?x.buffer.head.data.length:x.length:(k>x.highWaterMark&&(x.highWaterMark=function(_){return _>=1073741824?_=1073741824:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}(k)),k<=x.length?k:x.ended?x.length:(x.needReadable=!0,0))}function z(k){var x=k._readableState;d("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(d("emitReadable",x.flowing),x.emittedReadable=!0,o.nextTick(P,k))}function P(k){var x=k._readableState;d("emitReadable_",x.destroyed,x.length,x.ended),x.destroyed||!x.length&&!x.ended||(k.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,V(k)}function D(k,x){x.readingMore||(x.readingMore=!0,o.nextTick(O,k,x))}function O(k,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var _=x.length;if(d("maybeReadMore read 0"),k.read(0),_===x.length)break}x.readingMore=!1}function L(k){var x=k._readableState;x.readableListening=k.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:k.listenerCount("data")>0&&k.resume()}function U(k){d("readable nexttick read 0"),k.read(0)}function A(k,x){d("resume",x.reading),x.reading||k.read(0),x.resumeScheduled=!1,k.emit("resume"),V(k),x.flowing&&!x.reading&&k.read(0)}function V(k){var x=k._readableState;for(d("flow",x.flowing);x.flowing&&k.read()!==null;);}function q(k,x){return x.length===0?null:(x.objectMode?_=x.buffer.shift():!k||k>=x.length?(_=x.decoder?x.buffer.join(""):x.buffer.length===1?x.buffer.first():x.buffer.concat(x.length),x.buffer.clear()):_=x.buffer.consume(k,x.decoder),_);var _}function Q(k){var x=k._readableState;d("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,o.nextTick(ee,x,k))}function ee(k,x){if(d("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,x.readable=!1,x.emit("end"),k.autoDestroy)){var _=x._writableState;(!_||_.autoDestroy&&_.finished)&&x.destroy()}}function te(k,x){for(var _=0,I=k.length;_<I;_++)if(k[_]===x)return _;return-1}b.prototype.read=function(k){d("read",k),k=parseInt(k,10);var x=this._readableState,_=k;if(k!==0&&(x.emittedReadable=!1),k===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return d("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Q(this):z(this),null;if((k=C(k,x))===0&&x.ended)return x.length===0&&Q(this),null;var I,$=x.needReadable;return d("need readable",$),(x.length===0||x.length-k<x.highWaterMark)&&d("length less than watermark",$=!0),x.ended||x.reading?d("reading or ended",$=!1):$&&(d("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(k=C(_,x))),(I=k>0?q(k,x):null)===null?(x.needReadable=x.length<=x.highWaterMark,k=0):(x.length-=k,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),_!==k&&x.ended&&Q(this)),I!==null&&this.emit("data",I),I},b.prototype._read=function(k){W(this,new h("_read()"))},b.prototype.pipe=function(k,x){var _=this,I=this._readableState;switch(I.pipesCount){case 0:I.pipes=k;break;case 1:I.pipes=[I.pipes,k];break;default:I.pipes.push(k)}I.pipesCount+=1,d("pipe count=%d opts=%j",I.pipesCount,x);var $=(!x||x.end!==!1)&&k!==o.stdout&&k!==o.stderr?Y:De;function K(Te,Ae){d("onunpipe"),Te===_&&Ae&&Ae.hasUnpiped===!1&&(Ae.hasUnpiped=!0,d("cleanup"),k.removeListener("close",Oe),k.removeListener("finish",Ee),k.removeListener("drain",ne),k.removeListener("error",we),k.removeListener("unpipe",K),_.removeListener("end",Y),_.removeListener("end",De),_.removeListener("data",ue),ie=!0,!I.awaitDrain||k._writableState&&!k._writableState.needDrain||ne())}function Y(){d("onend"),k.end()}I.endEmitted?o.nextTick($):_.once("end",$),k.on("unpipe",K);var ne=function(Te){return function(){var Ae=Te._readableState;d("pipeOnDrain",Ae.awaitDrain),Ae.awaitDrain&&Ae.awaitDrain--,Ae.awaitDrain===0&&u(Te,"data")&&(Ae.flowing=!0,V(Te))}}(_);k.on("drain",ne);var ie=!1;function ue(Te){d("ondata");var Ae=k.write(Te);d("dest.write",Ae),Ae===!1&&((I.pipesCount===1&&I.pipes===k||I.pipesCount>1&&te(I.pipes,k)!==-1)&&!ie&&(d("false write response, pause",I.awaitDrain),I.awaitDrain++),_.pause())}function we(Te){d("onerror",Te),De(),k.removeListener("error",we),u(k,"error")===0&&W(k,Te)}function Oe(){k.removeListener("finish",Ee),De()}function Ee(){d("onfinish"),k.removeListener("close",Oe),De()}function De(){d("unpipe"),_.unpipe(k)}return _.on("data",ue),function(Te,Ae,Ie){if(typeof Te.prependListener=="function")return Te.prependListener(Ae,Ie);Te._events&&Te._events[Ae]?Array.isArray(Te._events[Ae])?Te._events[Ae].unshift(Ie):Te._events[Ae]=[Ie,Te._events[Ae]]:Te.on(Ae,Ie)}(k,"error",we),k.once("close",Oe),k.once("finish",Ee),k.emit("pipe",_),I.flowing||(d("pipe resume"),_.resume()),k},b.prototype.unpipe=function(k){var x=this._readableState,_={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return k&&k!==x.pipes||(k||(k=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,k&&k.emit("unpipe",this,_)),this;if(!k){var I=x.pipes,$=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var K=0;K<$;K++)I[K].emit("unpipe",this,{hasUnpiped:!1});return this}var Y=te(x.pipes,k);return Y===-1||(x.pipes.splice(Y,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),k.emit("unpipe",this,_)),this},b.prototype.on=function(k,x){var _=s.prototype.on.call(this,k,x),I=this._readableState;return k==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):k==="readable"&&(I.endEmitted||I.readableListening||(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,d("on readable",I.length,I.reading),I.length?z(this):I.reading||o.nextTick(U,this))),_},b.prototype.addListener=b.prototype.on,b.prototype.removeListener=function(k,x){var _=s.prototype.removeListener.call(this,k,x);return k==="readable"&&o.nextTick(L,this),_},b.prototype.removeAllListeners=function(k){var x=s.prototype.removeAllListeners.apply(this,arguments);return k!=="readable"&&k!==void 0||o.nextTick(L,this),x},b.prototype.resume=function(){var k=this._readableState;return k.flowing||(d("resume"),k.flowing=!k.readableListening,function(x,_){_.resumeScheduled||(_.resumeScheduled=!0,o.nextTick(A,x,_))}(this,k)),k.paused=!1,this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},b.prototype.wrap=function(k){var x=this,_=this._readableState,I=!1;for(var $ in k.on("end",function(){if(d("wrapped end"),_.decoder&&!_.ended){var Y=_.decoder.end();Y&&Y.length&&x.push(Y)}x.push(null)}),k.on("data",function(Y){d("wrapped data"),_.decoder&&(Y=_.decoder.write(Y)),_.objectMode&&Y==null||(_.objectMode||Y&&Y.length)&&(x.push(Y)||(I=!0,k.pause()))}),k)this[$]===void 0&&typeof k[$]=="function"&&(this[$]=function(Y){return function(){return k[Y].apply(k,arguments)}}($));for(var K=0;K<X.length;K++)k.on(X[K],this.emit.bind(this,X[K]));return this._read=function(Y){d("wrapped _read",Y),I&&(I=!1,k.resume())},this},typeof Symbol=="function"&&(b.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=n(186)),y(this)}),Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(b.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(b.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(k){this._readableState&&(this._readableState.flowing=k)}}),b._fromList=q,Object.defineProperty(b.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(b.from=function(k,x){return f===void 0&&(f=n(187)),f(b,k,x)})}).call(this,n(6),n(2))},function(e,t,n){e.exports=n(20).EventEmitter},function(e,t,n){(function(r){function o(s,g){u(s,g),l(s)}function l(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function u(s,g){s.emit("error",g)}e.exports={destroy:function(s,g){var c=this,d=this._readableState&&this._readableState.destroyed,w=this._writableState&&this._writableState.destroyed;return d||w?(g?g(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(u,this,s)):r.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(v){!g&&v?c._writableState?c._writableState.errorEmitted?r.nextTick(l,c):(c._writableState.errorEmitted=!0,r.nextTick(o,c,v)):r.nextTick(o,c,v):g?(r.nextTick(l,c),g(v)):r.nextTick(l,c)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(s,g){var c=s._readableState,d=s._writableState;c&&c.autoDestroy||d&&d.autoDestroy?s.destroy(g):s.emit("error",g)}}}).call(this,n(2))},function(e,t,n){var r=n(24).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(o,l,u,s){var g=function(c,d,w){return c.highWaterMark!=null?c.highWaterMark:d?c[w]:null}(l,s,u);if(g!=null){if(!isFinite(g)||Math.floor(g)!==g||g<0)throw new r(s?u:"highWaterMark",g);return Math.floor(g)}return o.objectMode?16:16384}}},function(e,t,n){(function(r,o){function l(O){var L=this;this.next=null,this.entry=null,this.finish=function(){(function(U,A,V){var q=U.entry;for(U.entry=null;q;){var Q=q.callback;A.pendingcb--,Q(V),q=q.next}A.corkedRequestsFree.next=U})(L,O)}}var u;e.exports=b,b.WritableState=m;var s={deprecate:n(43)},g=n(78),c=n(5).Buffer,d=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w,v=n(79),y=n(80).getHighWaterMark,f=n(24).codes,p=f.ERR_INVALID_ARG_TYPE,S=f.ERR_METHOD_NOT_IMPLEMENTED,N=f.ERR_MULTIPLE_CALLBACK,B=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,T=f.ERR_STREAM_NULL_VALUES,h=f.ERR_STREAM_WRITE_AFTER_END,R=f.ERR_UNKNOWN_ENCODING,W=v.errorOrDestroy;function X(){}function m(O,L,U){u=u||n(25),O=O||{},typeof U!="boolean"&&(U=L instanceof u),this.objectMode=!!O.objectMode,U&&(this.objectMode=this.objectMode||!!O.writableObjectMode),this.highWaterMark=y(this,O,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var A=O.decodeStrings===!1;this.decodeStrings=!A,this.defaultEncoding=O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){(function(q,Q){var ee=q._writableState,te=ee.sync,k=ee.writecb;if(typeof k!="function")throw new N;if(function(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}(ee),Q)(function(_,I,$,K,Y){--I.pendingcb,$?(o.nextTick(Y,K),o.nextTick(D,_,I),_._writableState.errorEmitted=!0,W(_,K)):(Y(K),_._writableState.errorEmitted=!0,W(_,K),D(_,I))})(q,ee,te,Q,k);else{var x=z(ee)||q.destroyed;x||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||C(q,ee),te?o.nextTick(j,q,ee,x,k):j(q,ee,x,k)}})(L,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new l(this)}function b(O){var L=this instanceof(u=u||n(25));if(!L&&!w.call(b,this))return new b(O);this._writableState=new m(O,this,L),this.writable=!0,O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final)),g.call(this)}function G(O,L,U,A,V,q,Q){L.writelen=A,L.writecb=Q,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new E("write")):U?O._writev(V,L.onwrite):O._write(V,q,L.onwrite),L.sync=!1}function j(O,L,U,A){U||function(V,q){q.length===0&&q.needDrain&&(q.needDrain=!1,V.emit("drain"))}(O,L),L.pendingcb--,A(),D(O,L)}function C(O,L){L.bufferProcessing=!0;var U=L.bufferedRequest;if(O._writev&&U&&U.next){var A=L.bufferedRequestCount,V=new Array(A),q=L.corkedRequestsFree;q.entry=U;for(var Q=0,ee=!0;U;)V[Q]=U,U.isBuf||(ee=!1),U=U.next,Q+=1;V.allBuffers=ee,G(O,L,!0,L.length,V,"",q.finish),L.pendingcb++,L.lastBufferedRequest=null,q.next?(L.corkedRequestsFree=q.next,q.next=null):L.corkedRequestsFree=new l(L),L.bufferedRequestCount=0}else{for(;U;){var te=U.chunk,k=U.encoding,x=U.callback;if(G(O,L,!1,L.objectMode?1:te.length,te,k,x),U=U.next,L.bufferedRequestCount--,L.writing)break}U===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=U,L.bufferProcessing=!1}function z(O){return O.ending&&O.length===0&&O.bufferedRequest===null&&!O.finished&&!O.writing}function P(O,L){O._final(function(U){L.pendingcb--,U&&W(O,U),L.prefinished=!0,O.emit("prefinish"),D(O,L)})}function D(O,L){var U=z(L);if(U&&(function(V,q){q.prefinished||q.finalCalled||(typeof V._final!="function"||q.destroyed?(q.prefinished=!0,V.emit("prefinish")):(q.pendingcb++,q.finalCalled=!0,o.nextTick(P,V,q)))}(O,L),L.pendingcb===0&&(L.finished=!0,O.emit("finish"),L.autoDestroy))){var A=O._readableState;(!A||A.autoDestroy&&A.endEmitted)&&O.destroy()}return U}n(7)(b,g),m.prototype.getBuffer=function(){for(var O=this.bufferedRequest,L=[];O;)L.push(O),O=O.next;return L},function(){try{Object.defineProperty(m.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(O){return!!w.call(this,O)||this===b&&O&&O._writableState instanceof m}})):w=function(O){return O instanceof this},b.prototype.pipe=function(){W(this,new B)},b.prototype.write=function(O,L,U){var A,V=this._writableState,q=!1,Q=!V.objectMode&&(A=O,c.isBuffer(A)||A instanceof d);return Q&&!c.isBuffer(O)&&(O=function(ee){return c.from(ee)}(O)),typeof L=="function"&&(U=L,L=null),Q?L="buffer":L||(L=V.defaultEncoding),typeof U!="function"&&(U=X),V.ending?function(ee,te){var k=new h;W(ee,k),o.nextTick(te,k)}(this,U):(Q||function(ee,te,k,x){var _;return k===null?_=new T:typeof k=="string"||te.objectMode||(_=new p("chunk",["string","Buffer"],k)),!_||(W(ee,_),o.nextTick(x,_),!1)}(this,V,O,U))&&(V.pendingcb++,q=function(ee,te,k,x,_,I){if(!k){var $=function(ie,ue,we){return ie.objectMode||ie.decodeStrings===!1||typeof ue!="string"||(ue=c.from(ue,we)),ue}(te,x,_);x!==$&&(k=!0,_="buffer",x=$)}var K=te.objectMode?1:x.length;te.length+=K;var Y=te.length<te.highWaterMark;if(Y||(te.needDrain=!0),te.writing||te.corked){var ne=te.lastBufferedRequest;te.lastBufferedRequest={chunk:x,encoding:_,isBuf:k,callback:I,next:null},ne?ne.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else G(ee,te,!1,K,x,_,I);return Y}(this,V,Q,O,L,U)),q},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var O=this._writableState;O.corked&&(O.corked--,O.writing||O.corked||O.bufferProcessing||!O.bufferedRequest||C(this,O))},b.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new R(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(b.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(O,L,U){U(new S("_write()"))},b.prototype._writev=null,b.prototype.end=function(O,L,U){var A=this._writableState;return typeof O=="function"?(U=O,O=null,L=null):typeof L=="function"&&(U=L,L=null),O!=null&&this.write(O,L),A.corked&&(A.corked=1,this.uncork()),A.ending||function(V,q,Q){q.ending=!0,D(V,q),Q&&(q.finished?o.nextTick(Q):V.once("finish",Q)),q.ended=!0,V.writable=!1}(this,A,U),this},Object.defineProperty(b.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(O,L){L(O)}}).call(this,n(6),n(2))},function(e,t,n){e.exports=d;var r=n(24).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,l=r.ERR_MULTIPLE_CALLBACK,u=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,g=n(25);function c(y,f){var p=this._transformState;p.transforming=!1;var S=p.writecb;if(S===null)return this.emit("error",new l);p.writechunk=null,p.writecb=null,f!=null&&this.push(f),S(y);var N=this._readableState;N.reading=!1,(N.needReadable||N.length<N.highWaterMark)&&this._read(N.highWaterMark)}function d(y){if(!(this instanceof d))return new d(y);g.call(this,y),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",w)}function w(){var y=this;typeof this._flush!="function"||this._readableState.destroyed?v(this,null,null):this._flush(function(f,p){v(y,f,p)})}function v(y,f,p){if(f)return y.emit("error",f);if(p!=null&&y.push(p),y._writableState.length)throw new s;if(y._transformState.transforming)throw new u;return y.push(null)}n(7)(d,g),d.prototype.push=function(y,f){return this._transformState.needTransform=!1,g.prototype.push.call(this,y,f)},d.prototype._transform=function(y,f,p){p(new o("_transform()"))},d.prototype._write=function(y,f,p){var S=this._transformState;if(S.writecb=p,S.writechunk=y,S.writeencoding=f,!S.transforming){var N=this._readableState;(S.needTransform||N.needReadable||N.length<N.highWaterMark)&&this._read(N.highWaterMark)}},d.prototype._read=function(y){var f=this._transformState;f.writechunk===null||f.transforming?f.needTransform=!0:(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform))},d.prototype._destroy=function(y,f){g.prototype._destroy.call(this,y,function(p){f(p)})}},function(e,t,n){(function(r){var o=n(194),l=n(85),u=n(196),s=n(197),g=n(86),c=t;c.request=function(d,w){d=typeof d=="string"?g.parse(d):u(d);var v=r.location.protocol.search(/^https?:$/)===-1?"http:":"",y=d.protocol||v,f=d.hostname||d.host,p=d.port,S=d.path||"/";f&&f.indexOf(":")!==-1&&(f="["+f+"]"),d.url=(f?y+"//"+f:"")+(p?":"+p:"")+S,d.method=(d.method||"GET").toUpperCase(),d.headers=d.headers||{};var N=new o(d);return w&&N.on("response",w),N},c.get=function(d,w){var v=c.request(d,w);return v.end(),v},c.ClientRequest=o,c.IncomingMessage=l.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=s,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(6))},function(e,t,n){(function(r){t.fetch=c(r.fetch)&&c(r.ReadableStream),t.writableStream=c(r.WritableStream),t.abortController=c(r.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch{}var o;function l(){if(o!==void 0)return o;if(r.XMLHttpRequest){o=new r.XMLHttpRequest;try{o.open("GET",r.XDomainRequest?"/":"https://example.com")}catch{o=null}}else o=null;return o}function u(d){var w=l();if(!w)return!1;try{return w.responseType=d,w.responseType===d}catch{}return!1}var s=r.ArrayBuffer!==void 0,g=s&&c(r.ArrayBuffer.prototype.slice);function c(d){return typeof d=="function"}t.arraybuffer=t.fetch||s&&u("arraybuffer"),t.msstream=!t.fetch&&g&&u("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&s&&u("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!l()&&c(l().overrideMimeType),t.vbArray=c(r.VBArray),o=null}).call(this,n(6))},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(31),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},d=t.IncomingMessage=function(w,v,y,f){var p=this;if(g.Readable.call(p),p._mode=y,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){r.nextTick(function(){p.emit("close")})}),y==="fetch"){if(p._fetchResponse=v,p.url=v.url,p.statusCode=v.status,p.statusMessage=v.statusText,v.headers.forEach(function(T,h){p.headers[h.toLowerCase()]=T,p.rawHeaders.push(h,T)}),u.writableStream){var S=new WritableStream({write:function(T){return new Promise(function(h,R){p._destroyed?R():p.push(new o(T))?h():p._resumeFetch=h})},close:function(){l.clearTimeout(f),p._destroyed||p.push(null)},abort:function(T){p._destroyed||p.emit("error",T)}});try{return void v.body.pipeTo(S).catch(function(T){l.clearTimeout(f),p._destroyed||p.emit("error",T)})}catch{}}var N=v.body.getReader();(function T(){N.read().then(function(h){if(!p._destroyed){if(h.done)return l.clearTimeout(f),void p.push(null);p.push(new o(h.value)),T()}}).catch(function(h){l.clearTimeout(f),p._destroyed||p.emit("error",h)})})()}else if(p._xhr=w,p._pos=0,p.url=w.responseURL,p.statusCode=w.status,p.statusMessage=w.statusText,w.getAllResponseHeaders().split(/\r?\n/).forEach(function(T){var h=T.match(/^([^:]+):\s*(.*)/);if(h){var R=h[1].toLowerCase();R==="set-cookie"?(p.headers[R]===void 0&&(p.headers[R]=[]),p.headers[R].push(h[2])):p.headers[R]!==void 0?p.headers[R]+=", "+h[2]:p.headers[R]=h[2],p.rawHeaders.push(h[1],h[2])}}),p._charset="x-user-defined",!u.overrideMimeType){var B=p.rawHeaders["mime-type"];if(B){var E=B.match(/;\s*charset=([^;])(;|$)/);E&&(p._charset=E[1].toLowerCase())}p._charset||(p._charset="utf-8")}};s(d,g.Readable),d.prototype._read=function(){var w=this._resumeFetch;w&&(this._resumeFetch=null,w())},d.prototype._onXHRProgress=function(){var w=this,v=w._xhr,y=null;switch(w._mode){case"text:vbarray":if(v.readyState!==c.DONE)break;try{y=new l.VBArray(v.responseBody).toArray()}catch{}if(y!==null){w.push(new o(y));break}case"text":try{y=v.responseText}catch{w._mode="text:vbarray";break}if(y.length>w._pos){var f=y.substr(w._pos);if(w._charset==="x-user-defined"){for(var p=new o(f.length),S=0;S<f.length;S++)p[S]=255&f.charCodeAt(S);w.push(p)}else w.push(f,w._charset);w._pos=y.length}break;case"arraybuffer":if(v.readyState!==c.DONE||!v.response)break;y=v.response,w.push(new o(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=v.response,v.readyState!==c.LOADING||!y)break;w.push(new o(new Uint8Array(y)));break;case"ms-stream":if(y=v.response,v.readyState!==c.LOADING)break;var N=new l.MSStreamReader;N.onprogress=function(){N.result.byteLength>w._pos&&(w.push(new o(new Uint8Array(N.result.slice(w._pos)))),w._pos=N.result.byteLength)},N.onload=function(){w.push(null)},N.readAsArrayBuffer(y)}w._xhr.readyState===c.DONE&&w._mode!=="ms-stream"&&w.push(null)}}).call(this,n(2),n(5).Buffer,n(6))},function(e,t,n){var r=n(198),o=n(200);function l(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=E,t.resolve=function(T,h){return E(T,!1,!0).resolve(h)},t.resolveObject=function(T,h){return T?E(T,!1,!0).resolveObject(h):h},t.format=function(T){return o.isString(T)&&(T=E(T)),T instanceof l?T.format():l.prototype.format.call(T)},t.Url=l;var u=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,g=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
43
+ `," "]),d=["'"].concat(c),w=["%","/","?",";","#"].concat(d),v=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},N={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},B=n(201);function E(T,h,R){if(T&&o.isObject(T)&&T instanceof l)return T;var W=new l;return W.parse(T,h,R),W}l.prototype.parse=function(T,h,R){if(!o.isString(T))throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var W=T.indexOf("?"),X=W!==-1&&W<T.indexOf("#")?"?":"#",m=T.split(X);m[0]=m[0].replace(/\\/g,"/");var b=T=m.join(X);if(b=b.trim(),!R&&T.split("#").length===1){var G=g.exec(b);if(G)return this.path=b,this.href=b,this.pathname=G[1],G[2]?(this.search=G[2],this.query=h?B.parse(this.search.substr(1)):this.search.substr(1)):h&&(this.search="",this.query={}),this}var j=u.exec(b);if(j){var C=(j=j[0]).toLowerCase();this.protocol=C,b=b.substr(j.length)}if(R||j||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var z=b.substr(0,2)==="//";!z||j&&S[j]||(b=b.substr(2),this.slashes=!0)}if(!S[j]&&(z||j&&!N[j])){for(var P,D,O=-1,L=0;L<v.length;L++)(U=b.indexOf(v[L]))!==-1&&(O===-1||U<O)&&(O=U);for((D=O===-1?b.lastIndexOf("@"):b.lastIndexOf("@",O))!==-1&&(P=b.slice(0,D),b=b.slice(D+1),this.auth=decodeURIComponent(P)),O=-1,L=0;L<w.length;L++){var U;(U=b.indexOf(w[L]))!==-1&&(O===-1||U<O)&&(O=U)}O===-1&&(O=b.length),this.host=b.slice(0,O),b=b.slice(O),this.parseHost(),this.hostname=this.hostname||"";var A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A)for(var V=this.hostname.split(/\./),q=(L=0,V.length);L<q;L++){var Q=V[L];if(Q&&!Q.match(y)){for(var ee="",te=0,k=Q.length;te<k;te++)Q.charCodeAt(te)>127?ee+="x":ee+=Q[te];if(!ee.match(y)){var x=V.slice(0,L),_=V.slice(L+1),I=Q.match(f);I&&(x.push(I[1]),_.unshift(I[2])),_.length&&(b="/"+_.join(".")+b),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var $=this.port?":"+this.port:"",K=this.hostname||"";this.host=K+$,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!=="/"&&(b="/"+b))}if(!p[C])for(L=0,q=d.length;L<q;L++){var Y=d[L];if(b.indexOf(Y)!==-1){var ne=encodeURIComponent(Y);ne===Y&&(ne=escape(Y)),b=b.split(Y).join(ne)}}var ie=b.indexOf("#");ie!==-1&&(this.hash=b.substr(ie),b=b.slice(0,ie));var ue=b.indexOf("?");if(ue!==-1?(this.search=b.substr(ue),this.query=b.substr(ue+1),h&&(this.query=B.parse(this.query)),b=b.slice(0,ue)):h&&(this.search="",this.query={}),b&&(this.pathname=b),N[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){$=this.pathname||"";var we=this.search||"";this.path=$+we}return this.href=this.format(),this},l.prototype.format=function(){var T=this.auth||"";T&&(T=(T=encodeURIComponent(T)).replace(/%3A/i,":"),T+="@");var h=this.protocol||"",R=this.pathname||"",W=this.hash||"",X=!1,m="";this.host?X=T+this.host:this.hostname&&(X=T+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(X+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(m=B.stringify(this.query));var b=this.search||m&&"?"+m||"";return h&&h.substr(-1)!==":"&&(h+=":"),this.slashes||(!h||N[h])&&X!==!1?(X="//"+(X||""),R&&R.charAt(0)!=="/"&&(R="/"+R)):X||(X=""),W&&W.charAt(0)!=="#"&&(W="#"+W),b&&b.charAt(0)!=="?"&&(b="?"+b),h+X+(R=R.replace(/[?#]/g,function(G){return encodeURIComponent(G)}))+(b=b.replace("#","%23"))+W},l.prototype.resolve=function(T){return this.resolveObject(E(T,!1,!0)).format()},l.prototype.resolveObject=function(T){if(o.isString(T)){var h=new l;h.parse(T,!1,!0),T=h}for(var R=new l,W=Object.keys(this),X=0;X<W.length;X++){var m=W[X];R[m]=this[m]}if(R.hash=T.hash,T.href==="")return R.href=R.format(),R;if(T.slashes&&!T.protocol){for(var b=Object.keys(T),G=0;G<b.length;G++){var j=b[G];j!=="protocol"&&(R[j]=T[j])}return N[R.protocol]&&R.hostname&&!R.pathname&&(R.path=R.pathname="/"),R.href=R.format(),R}if(T.protocol&&T.protocol!==R.protocol){if(!N[T.protocol]){for(var C=Object.keys(T),z=0;z<C.length;z++){var P=C[z];R[P]=T[P]}return R.href=R.format(),R}if(R.protocol=T.protocol,T.host||S[T.protocol])R.pathname=T.pathname;else{for(var D=(T.pathname||"").split("/");D.length&&!(T.host=D.shift()););T.host||(T.host=""),T.hostname||(T.hostname=""),D[0]!==""&&D.unshift(""),D.length<2&&D.unshift(""),R.pathname=D.join("/")}if(R.search=T.search,R.query=T.query,R.host=T.host||"",R.auth=T.auth,R.hostname=T.hostname||T.host,R.port=T.port,R.pathname||R.search){var O=R.pathname||"",L=R.search||"";R.path=O+L}return R.slashes=R.slashes||T.slashes,R.href=R.format(),R}var U=R.pathname&&R.pathname.charAt(0)==="/",A=T.host||T.pathname&&T.pathname.charAt(0)==="/",V=A||U||R.host&&T.pathname,q=V,Q=R.pathname&&R.pathname.split("/")||[],ee=(D=T.pathname&&T.pathname.split("/")||[],R.protocol&&!N[R.protocol]);if(ee&&(R.hostname="",R.port=null,R.host&&(Q[0]===""?Q[0]=R.host:Q.unshift(R.host)),R.host="",T.protocol&&(T.hostname=null,T.port=null,T.host&&(D[0]===""?D[0]=T.host:D.unshift(T.host)),T.host=null),V=V&&(D[0]===""||Q[0]==="")),A)R.host=T.host||T.host===""?T.host:R.host,R.hostname=T.hostname||T.hostname===""?T.hostname:R.hostname,R.search=T.search,R.query=T.query,Q=D;else if(D.length)Q||(Q=[]),Q.pop(),Q=Q.concat(D),R.search=T.search,R.query=T.query;else if(!o.isNullOrUndefined(T.search))return ee&&(R.hostname=R.host=Q.shift(),(I=!!(R.host&&R.host.indexOf("@")>0)&&R.host.split("@"))&&(R.auth=I.shift(),R.host=R.hostname=I.shift())),R.search=T.search,R.query=T.query,o.isNull(R.pathname)&&o.isNull(R.search)||(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.href=R.format(),R;if(!Q.length)return R.pathname=null,R.search?R.path="/"+R.search:R.path=null,R.href=R.format(),R;for(var te=Q.slice(-1)[0],k=(R.host||T.host||Q.length>1)&&(te==="."||te==="..")||te==="",x=0,_=Q.length;_>=0;_--)(te=Q[_])==="."?Q.splice(_,1):te===".."?(Q.splice(_,1),x++):x&&(Q.splice(_,1),x--);if(!V&&!q)for(;x--;x)Q.unshift("..");!V||Q[0]===""||Q[0]&&Q[0].charAt(0)==="/"||Q.unshift(""),k&&Q.join("/").substr(-1)!=="/"&&Q.push("");var I,$=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";return ee&&(R.hostname=R.host=$?"":Q.length?Q.shift():"",(I=!!(R.host&&R.host.indexOf("@")>0)&&R.host.split("@"))&&(R.auth=I.shift(),R.host=R.hostname=I.shift())),(V=V||R.host&&Q.length)&&!$&&Q.unshift(""),Q.length?R.pathname=Q.join("/"):(R.pathname=null,R.path=null),o.isNull(R.pathname)&&o.isNull(R.search)||(R.path=(R.pathname?R.pathname:"")+(R.search?R.search:"")),R.auth=T.auth||R.auth,R.slashes=R.slashes||T.slashes,R.href=R.format(),R},l.prototype.parseHost=function(){var T=this.host,h=s.exec(T);h&&((h=h[0])!==":"&&(this.port=h.substr(1)),T=T.substr(0,T.length-h.length)),T&&(this.hostname=T)}},function(e,t,n){const r=o=>o!==null&&typeof o=="object"&&typeof o.pipe=="function";r.writable=o=>r(o)&&o.writable!==!1&&typeof o._write=="function"&&typeof o._writableState=="object",r.readable=o=>r(o)&&o.readable!==!1&&typeof o._read=="function"&&typeof o._readableState=="object",r.duplex=o=>r.writable(o)&&r.readable(o),r.transform=o=>r.duplex(o)&&typeof o._transform=="function"&&typeof o._transformState=="object",e.exports=r},function(e,t,n){function r(N){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B})(N)}function o(N,B){for(var E=0;E<B.length;E++){var T=B[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(N,T.key,T)}}function l(N,B,E){return B&&o(N.prototype,B),E&&o(N,E),Object.defineProperty(N,"prototype",{writable:!1}),N}function u(N,B){if(!(N instanceof B))throw new TypeError("Cannot call a class as a function")}function s(N,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(B&&B.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),B&&g(N,B)}function g(N,B){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E})(N,B)}function c(N){var B=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var E,T=w(N);if(B){var h=w(this).constructor;E=Reflect.construct(T,arguments,h)}else E=T.apply(this,arguments);return d(this,E)}}function d(N,B){if(B&&(r(B)==="object"||typeof B=="function"))return B;if(B!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(N)}function w(N){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(B){return B.__proto__||Object.getPrototypeOf(B)})(N)}var v=n(3).LEVEL,y=n(49),f=n(206),p=n(39)("winston:create-logger");function S(N){return"is"+N.charAt(0).toUpperCase()+N.slice(1)+"Enabled"}e.exports=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};N.levels=N.levels||y.npm.levels;var B=function(T){s(R,T);var h=c(R);function R(W){return u(this,R),h.call(this,W)}return l(R)}(f),E=new B(N);return Object.keys(N.levels).forEach(function(T){p('Define prototype method for "%s"',T),T!=="log"?(B.prototype[T]=function(){for(var h=this||E,R=arguments.length,W=new Array(R),X=0;X<R;X++)W[X]=arguments[X];if(W.length===1){var m=W[0],b=m&&m.message&&m||{message:m};return b.level=b[v]=T,h._addDefaultMeta(b),h.write(b),this||E}return W.length===0?(h.log(T,""),h):h.log.apply(h,[T].concat(W))},B.prototype[S(T)]=function(){return(this||E).isLevelEnabled(T)}):console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.')}),E}},function(e,t,n){(function(r){function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(16),u=n(50),s=n(39)("winston:exception"),g=n(90),c=n(91),d=n(92);e.exports=function(){function w(f){if(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}(this,w),!f)throw new Error("Logger is required to handle exceptions");this.logger=f,this.handlers=new Map}var v,y;return v=w,(y=[{key:"handle",value:function(){for(var f=this,p=arguments.length,S=new Array(p),N=0;N<p;N++)S[N]=arguments[N];S.forEach(function(B){if(Array.isArray(B))return B.forEach(function(E){return f._addHandler(E)});f._addHandler(B)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),r.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var f=this;this.catcher&&(r.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(p){return f.logger.unpipe(p)}))}},{key:"getAllInfo",value:function(f){var p=f.message;return p||typeof f!="string"||(p=f),{error:f,level:"error",message:["uncaughtException: ".concat(p||"(no error message)"),f.stack||" No stack trace"].join(`
44
+ `),stack:f.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(f)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(f){return(f?c.parse(f):c.get()).map(function(p){return{column:p.getColumnNumber(),file:p.getFileName(),function:p.getFunctionName(),line:p.getLineNumber(),method:p.getMethodName(),native:p.isNative()}})}},{key:"_addHandler",value:function(f){if(!this.handlers.has(f)){f.handleExceptions=!0;var p=new d(f);this.handlers.set(f,p),this.logger.pipe(p)}}},{key:"_uncaughtException",value:function(f){var p,S=this.getAllInfo(f),N=this._getExceptionHandlers(),B=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(f):this.logger.exitOnError;function E(){s("doExit",B),s("process._exiting",r._exiting),B&&!r._exiting&&(p&&clearTimeout(p),r.exit(1))}if(!N.length&&B&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),B=!1),!N||N.length===0)return r.nextTick(E);u(N,function(T,h){var R=g(h),W=T.transport||T;function X(m){return function(){s(m),R()}}W._ending=!0,W.once("finish",X("finished")),W.once("error",X("error"))},function(){return B&&E()}),this.logger.log(S),B&&(p=setTimeout(E,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(f){return(f.transport||f).handleExceptions})}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()}).call(this,n(2))},function(e,t,n){var r=n(209);e.exports=function(o){var l,u=0;function s(){return u||(u=1,l=o.apply(this,arguments),o=null),l}return s.displayName=r(o),s}},function(e,t){function n(r){for(var o in r)this[o]=r[o]}t.get=function(r){var o=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var l={},u=Error.prepareStackTrace;Error.prepareStackTrace=function(g,c){return c},Error.captureStackTrace(l,r||t.get);var s=l.stack;return Error.prepareStackTrace=u,Error.stackTraceLimit=o,s},t.parse=function(r){if(!r.stack)return[];var o=this;return r.stack.split(`
45
+ `).slice(1).map(function(l){if(l.match(/^\s*[-]{4,}$/))return o._createParsedCallSite({fileName:l,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var u=l.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(u){var s=null,g=null,c=null,d=null,w=null,v=u[5]==="native";if(u[1]){var y=(c=u[1]).lastIndexOf(".");if(c[y-1]=="."&&y--,y>0){s=c.substr(0,y),g=c.substr(y+1);var f=s.indexOf(".Module");f>0&&(c=c.substr(f+1),s=s.substr(0,f))}d=null}g&&(d=s,w=g),g==="<anonymous>"&&(w=null,c=null);var p={fileName:u[2]||null,lineNumber:parseInt(u[3],10)||null,functionName:c,typeName:d,methodName:w,columnNumber:parseInt(u[4],10)||null,native:v};return o._createParsedCallSite(p)}}).filter(function(l){return!!l})},["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"].forEach(function(r){n.prototype[r]=null,n.prototype["get"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),["topLevel","eval","native","constructor"].forEach(function(r){n.prototype[r]=!1,n.prototype["is"+r[0].toUpperCase()+r.substr(1)]=function(){return this[r]}}),t._createParsedCallSite=function(r){return new n(r)}},function(e,t,n){function r(d){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w})(d)}function o(d,w){for(var v=0;v<w.length;v++){var y=w[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(d,y.key,y)}}function l(d,w){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,y){return v.__proto__=y,v})(d,w)}function u(d){var w=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var v,y=g(d);if(w){var f=g(this).constructor;v=Reflect.construct(y,arguments,f)}else v=y.apply(this,arguments);return s(this,v)}}function s(d,w){if(w&&(r(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(d)}function g(d){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)})(d)}var c=n(33).Writable;e.exports=function(d){(function(p,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(S&&S.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),Object.defineProperty(p,"prototype",{writable:!1}),S&&l(p,S)})(f,d);var w,v,y=u(f);function f(p){var S;if(function(N,B){if(!(N instanceof B))throw new TypeError("Cannot call a class as a function")}(this,f),S=y.call(this,{objectMode:!0}),!p)throw new Error("ExceptionStream requires a TransportStream instance.");return S.handleExceptions=!0,S.transport=p,S}return w=f,(v=[{key:"_write",value:function(p,S,N){return p.exception?this.transport.log(p,N):(N(),!0)}}])&&o(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),f}(c)},function(e,t,n){(function(r){function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(16),u=n(50),s=n(39)("winston:rejection"),g=n(90),c=n(91),d=n(92);e.exports=function(){function w(f){if(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}(this,w),!f)throw new Error("Logger is required to handle rejections");this.logger=f,this.handlers=new Map}var v,y;return v=w,(y=[{key:"handle",value:function(){for(var f=this,p=arguments.length,S=new Array(p),N=0;N<p;N++)S[N]=arguments[N];S.forEach(function(B){if(Array.isArray(B))return B.forEach(function(E){return f._addHandler(E)});f._addHandler(B)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),r.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var f=this;this.catcher&&(r.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(p){return f.logger.unpipe(p)}))}},{key:"getAllInfo",value:function(f){var p=null;return f&&(p=typeof f=="string"?f:f.message),{error:f,level:"error",message:["unhandledRejection: ".concat(p||"(no error message)"),f&&f.stack||" No stack trace"].join(`
46
+ `),stack:f&&f.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(f)}}},{key:"getProcessInfo",value:function(){return{pid:r.pid,uid:r.getuid?r.getuid():null,gid:r.getgid?r.getgid():null,cwd:r.cwd(),execPath:r.execPath,version:r.version,argv:r.argv,memoryUsage:r.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:l.loadavg(),uptime:l.uptime()}}},{key:"getTrace",value:function(f){return(f?c.parse(f):c.get()).map(function(p){return{column:p.getColumnNumber(),file:p.getFileName(),function:p.getFunctionName(),line:p.getLineNumber(),method:p.getMethodName(),native:p.isNative()}})}},{key:"_addHandler",value:function(f){if(!this.handlers.has(f)){f.handleRejections=!0;var p=new d(f);this.handlers.set(f,p),this.logger.pipe(p)}}},{key:"_unhandledRejection",value:function(f){var p,S=this.getAllInfo(f),N=this._getRejectionHandlers(),B=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(f):this.logger.exitOnError;function E(){s("doExit",B),s("process._exiting",r._exiting),B&&!r._exiting&&(p&&clearTimeout(p),r.exit(1))}if(!N.length&&B&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),B=!1),!N||N.length===0)return r.nextTick(E);u(N,function(T,h){var R=g(h),W=T.transport||T;function X(m){return function(){s(m),R()}}W._ending=!0,W.once("finish",X("finished")),W.once("error",X("error"))},function(){return B&&E()}),this.logger.log(S),B&&(p=setTimeout(E,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(f){return(f.transport||f).handleRejections})}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()}).call(this,n(2))},function(e,t,n){e.exports={asArray:n(216),asBoolStrict:n(217),asBool:n(218),asPortNumber:n(219),asEnum:n(220),asFloatNegative:n(221),asFloatPositive:n(222),asFloat:n(53),asIntNegative:n(223),asIntPositive:n(95),asInt:n(52),asJsonArray:n(224),asJsonObject:n(225),asJson:n(54),asRegExp:n(226),asString:n(34),asUrlObject:n(96),asUrlString:n(227),asEmailString:n(228)}},function(e,t,n){const r=n(52);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive integer");return l}},function(e,t,n){const r=n(34);e.exports=function(o){const l=r(o);try{return new URL(l)}catch{throw new Error("should be a valid URL")}}},function(e,t,n){const r={};r.web=n(17),n(98);const o={v1:{}};o.v1.signaling={},o.v1.signaling.api=n(10),o.v1.signaling.api.SignalingClient=function(f,p,S){S||(S={}),S.format="text",this.client_=new r.web.GrpcWebClientBase(S),this.hostname_=f.replace(/\/+$/,"")},o.v1.signaling.api.SignalingPromiseClient=function(f,p,S){S||(S={}),S.format="text",this.client_=new r.web.GrpcWebClientBase(S),this.hostname_=f.replace(/\/+$/,"")};const l=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetHealth",r.web.MethodType.UNARY,o.v1.signaling.api.GetHealthRequest,o.v1.signaling.api.GetHealthResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetHealthResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getHealth=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",f,p||{},l,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getHealth=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetHealth",f,p||{},l)};const u=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/CreatePeer",r.web.MethodType.UNARY,o.v1.signaling.api.CreatePeerRequest,o.v1.signaling.api.CreatePeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.CreatePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.createPeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",f,p||{},u,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.createPeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/CreatePeer",f,p||{},u)};const s=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/DeletePeer",r.web.MethodType.UNARY,o.v1.signaling.api.DeletePeerRequest,o.v1.signaling.api.DeletePeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.DeletePeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.deletePeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",f,p||{},s,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.deletePeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/DeletePeer",f,p||{},s)};const g=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/RefreshPeer",r.web.MethodType.UNARY,o.v1.signaling.api.RefreshPeerRequest,o.v1.signaling.api.RefreshPeerResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.RefreshPeerResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.refreshPeer=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",f,p||{},g,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.refreshPeer=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/RefreshPeer",f,p||{},g)};const c=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetPeers",r.web.MethodType.UNARY,o.v1.signaling.api.GetPeersRequest,o.v1.signaling.api.GetPeersResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetPeersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getPeers=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",f,p||{},c,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getPeers=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetPeers",f,p||{},c)};const d=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetIceServers",r.web.MethodType.UNARY,o.v1.signaling.api.GetIceServersRequest,o.v1.signaling.api.GetIceServersResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetIceServersResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getIceServers=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",f,p||{},d,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getIceServers=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetIceServers",f,p||{},d)};const w=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/SendSignal",r.web.MethodType.UNARY,o.v1.signaling.api.SendSignalRequest,o.v1.signaling.api.SendSignalResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.SendSignalResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.sendSignal=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",f,p||{},w,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.sendSignal=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/SendSignal",f,p||{},w)};const v=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/ReceiveSignalStream",r.web.MethodType.SERVER_STREAMING,o.v1.signaling.api.ReceiveSignalStreamRequest,o.v1.signaling.api.ReceiveSignalStreamResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.ReceiveSignalStreamResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.receiveSignalStream=function(f,p){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",f,p||{},v)},o.v1.signaling.api.SignalingPromiseClient.prototype.receiveSignalStream=function(f,p){return this.client_.serverStreaming(this.hostname_+"/v1.signaling.api.Signaling/ReceiveSignalStream",f,p||{},v)};const y=new r.web.MethodDescriptor("/v1.signaling.api.Signaling/GetSessions",r.web.MethodType.UNARY,o.v1.signaling.api.GetSessionsRequest,o.v1.signaling.api.GetSessionsResponse,function(f){return f.serializeBinary()},o.v1.signaling.api.GetSessionsResponse.deserializeBinary);o.v1.signaling.api.SignalingClient.prototype.getSessions=function(f,p,S){return this.client_.rpcCall(this.hostname_+"/v1.signaling.api.Signaling/GetSessions",f,p||{},y,S)},o.v1.signaling.api.SignalingPromiseClient.prototype.getSessions=function(f,p){return this.client_.unaryCall(this.hostname_+"/v1.signaling.api.Signaling/GetSessions",f,p||{},y)},e.exports=o.v1.signaling.api},function(e,t,n){var r=n(99),o=r,l=Function("return this")();o.exportSymbol("proto.google.protobuf.BoolValue",null,l),o.exportSymbol("proto.google.protobuf.BytesValue",null,l),o.exportSymbol("proto.google.protobuf.DoubleValue",null,l),o.exportSymbol("proto.google.protobuf.FloatValue",null,l),o.exportSymbol("proto.google.protobuf.Int32Value",null,l),o.exportSymbol("proto.google.protobuf.Int64Value",null,l),o.exportSymbol("proto.google.protobuf.StringValue",null,l),o.exportSymbol("proto.google.protobuf.UInt32Value",null,l),o.exportSymbol("proto.google.protobuf.UInt64Value",null,l),proto.google.protobuf.DoubleValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.DoubleValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.DoubleValue.displayName="proto.google.protobuf.DoubleValue"),proto.google.protobuf.FloatValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.FloatValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.FloatValue.displayName="proto.google.protobuf.FloatValue"),proto.google.protobuf.Int64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int64Value.displayName="proto.google.protobuf.Int64Value"),proto.google.protobuf.UInt64Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt64Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt64Value.displayName="proto.google.protobuf.UInt64Value"),proto.google.protobuf.Int32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.Int32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.Int32Value.displayName="proto.google.protobuf.Int32Value"),proto.google.protobuf.UInt32Value=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.UInt32Value,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.UInt32Value.displayName="proto.google.protobuf.UInt32Value"),proto.google.protobuf.BoolValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BoolValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BoolValue.displayName="proto.google.protobuf.BoolValue"),proto.google.protobuf.StringValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.StringValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.StringValue.displayName="proto.google.protobuf.StringValue"),proto.google.protobuf.BytesValue=function(u){r.Message.initialize(this,u,0,-1,null,null)},o.inherits(proto.google.protobuf.BytesValue,r.Message),o.DEBUG&&!COMPILED&&(proto.google.protobuf.BytesValue.displayName="proto.google.protobuf.BytesValue"),r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.DoubleValue.prototype.toObject=function(u){return proto.google.protobuf.DoubleValue.toObject(u,this)},proto.google.protobuf.DoubleValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.DoubleValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.DoubleValue;return proto.google.protobuf.DoubleValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.DoubleValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readDouble();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.DoubleValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.DoubleValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.DoubleValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeDouble(1,g)},proto.google.protobuf.DoubleValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.DoubleValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.FloatValue.prototype.toObject=function(u){return proto.google.protobuf.FloatValue.toObject(u,this)},proto.google.protobuf.FloatValue.toObject=function(u,s){var g={value:r.Message.getFloatingPointFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.FloatValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.FloatValue;return proto.google.protobuf.FloatValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.FloatValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readFloat();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.FloatValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.FloatValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.FloatValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeFloat(1,g)},proto.google.protobuf.FloatValue.prototype.getValue=function(){return r.Message.getFloatingPointFieldWithDefault(this,1,0)},proto.google.protobuf.FloatValue.prototype.setValue=function(u){return r.Message.setProto3FloatField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int64Value.prototype.toObject=function(u){return proto.google.protobuf.Int64Value.toObject(u,this)},proto.google.protobuf.Int64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int64Value;return proto.google.protobuf.Int64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt64(1,g)},proto.google.protobuf.Int64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt64Value.prototype.toObject=function(u){return proto.google.protobuf.UInt64Value.toObject(u,this)},proto.google.protobuf.UInt64Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt64Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt64Value;return proto.google.protobuf.UInt64Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt64Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint64();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt64Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt64Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt64Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint64(1,g)},proto.google.protobuf.UInt64Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt64Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.Int32Value.prototype.toObject=function(u){return proto.google.protobuf.Int32Value.toObject(u,this)},proto.google.protobuf.Int32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.Int32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.Int32Value;return proto.google.protobuf.Int32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.Int32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readInt32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.Int32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.Int32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.Int32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeInt32(1,g)},proto.google.protobuf.Int32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.Int32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.UInt32Value.prototype.toObject=function(u){return proto.google.protobuf.UInt32Value.toObject(u,this)},proto.google.protobuf.UInt32Value.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,0)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.UInt32Value.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.UInt32Value;return proto.google.protobuf.UInt32Value.deserializeBinaryFromReader(g,s)},proto.google.protobuf.UInt32Value.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readUint32();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.UInt32Value.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.UInt32Value.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.UInt32Value.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())!==0&&s.writeUint32(1,g)},proto.google.protobuf.UInt32Value.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,0)},proto.google.protobuf.UInt32Value.prototype.setValue=function(u){return r.Message.setProto3IntField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BoolValue.prototype.toObject=function(u){return proto.google.protobuf.BoolValue.toObject(u,this)},proto.google.protobuf.BoolValue.toObject=function(u,s){var g={value:r.Message.getBooleanFieldWithDefault(s,1,!1)};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BoolValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BoolValue;return proto.google.protobuf.BoolValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BoolValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBool();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BoolValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BoolValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BoolValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue())&&s.writeBool(1,g)},proto.google.protobuf.BoolValue.prototype.getValue=function(){return r.Message.getBooleanFieldWithDefault(this,1,!1)},proto.google.protobuf.BoolValue.prototype.setValue=function(u){return r.Message.setProto3BooleanField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.StringValue.prototype.toObject=function(u){return proto.google.protobuf.StringValue.toObject(u,this)},proto.google.protobuf.StringValue.toObject=function(u,s){var g={value:r.Message.getFieldWithDefault(s,1,"")};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.StringValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.StringValue;return proto.google.protobuf.StringValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.StringValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readString();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.StringValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.StringValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.StringValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue()).length>0&&s.writeString(1,g)},proto.google.protobuf.StringValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.StringValue.prototype.setValue=function(u){return r.Message.setProto3StringField(this,1,u)},r.Message.GENERATE_TO_OBJECT&&(proto.google.protobuf.BytesValue.prototype.toObject=function(u){return proto.google.protobuf.BytesValue.toObject(u,this)},proto.google.protobuf.BytesValue.toObject=function(u,s){var g={value:s.getValue_asB64()};return u&&(g.$jspbMessageInstance=s),g}),proto.google.protobuf.BytesValue.deserializeBinary=function(u){var s=new r.BinaryReader(u),g=new proto.google.protobuf.BytesValue;return proto.google.protobuf.BytesValue.deserializeBinaryFromReader(g,s)},proto.google.protobuf.BytesValue.deserializeBinaryFromReader=function(u,s){for(;s.nextField()&&!s.isEndGroup();)switch(s.getFieldNumber()){case 1:var g=s.readBytes();u.setValue(g);break;default:s.skipField()}return u},proto.google.protobuf.BytesValue.prototype.serializeBinary=function(){var u=new r.BinaryWriter;return proto.google.protobuf.BytesValue.serializeBinaryToWriter(this,u),u.getResultBuffer()},proto.google.protobuf.BytesValue.serializeBinaryToWriter=function(u,s){var g;(g=u.getValue_asU8()).length>0&&s.writeBytes(1,g)},proto.google.protobuf.BytesValue.prototype.getValue=function(){return r.Message.getFieldWithDefault(this,1,"")},proto.google.protobuf.BytesValue.prototype.getValue_asB64=function(){return r.Message.bytesAsB64(this.getValue())},proto.google.protobuf.BytesValue.prototype.getValue_asU8=function(){return r.Message.bytesAsU8(this.getValue())},proto.google.protobuf.BytesValue.prototype.setValue=function(u){return r.Message.setProto3BytesField(this,1,u)},o.object.extend(t,proto.google.protobuf)},function(module,exports,__webpack_require__){(function(global,Buffer){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var l=e[o];if(t.call(n,l,o,e))return{i:o,v:l}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return typeof window<"u"&&window===e?e:global!==void 0&&global!=null?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];o in n||(n[o]={}),n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&t!=null&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).i}},"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(e==null)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"endsWith");t+="",n===void 0&&(n=r.length),n=Math.max(0,Math.min(0|n,r.length));for(var o=t.length;0<o&&0<n;)if(r[--n]!=t[--o])return!1;return 0>=o}},"es6","es3"),$jscomp.polyfill("Array.prototype.find",function(e){return e||function(t,n){return $jscomp.findInternal(this,t,n).v}},"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",function(e){return e||function(t,n){var r=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var o=r.length,l=t.length;n=Math.max(0,Math.min(0|n,r.length));for(var u=0;u<l&&n<o;)if(r[n++]!=t[u++])return!1;return u>=l}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(e){return e||function(t){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var r="";t;)1&t&&(r+=n),(t>>>=1)&&(n+=n);return r}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return e!==void 0},goog.isString=function(e){return typeof e=="string"},goog.isBoolean=function(e){return typeof e=="boolean"},goog.isNumber=function(e){return typeof e=="number"},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||n.execScript===void 0||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||e.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=e},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&typeof e.getCurrentModulePath=="function"&&!!e.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+`
47
+ ;})();
48
+ `},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var n=e.call(void 0,{});else{if(!goog.isString(e))throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),n=goog.loadModuleFromSource_.call(void 0,e)}var r=goog.moduleLoaderState_.moduleName;if(!goog.isString(r)||!r)throw Error('Invalid module name "'+r+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(r,n):goog.SEAL_MODULE_EXPORTS&&Object.seal&&typeof n=="object"&&n!=null&&Object.seal(n),goog.loadedModules_[r]={exports:n,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)e[t]=="."?e.splice(t,1):t&&e[t]==".."&&e[t-1]&&e[t-1]!=".."?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),t.status==0||t.status==200?t.responseText:null}catch{return null}},goog.transpile_=function(e,t,n){var r=goog.global.$jscomp;r||(goog.global.$jscomp=r={});var o=r.transpile;if(!o){var l=goog.basePath+goog.TRANSPILER,u=goog.loadFileSync_(l);if(u){if((function(){(0,eval)(u+`
49
+ //# sourceURL=`+l)}).call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(r=goog.global.$jscomp).transpile}}return o||(o=r.transpile=function(s,g){return goog.logToConsole_(g+" requires transpilation but no transpiler was found."),s}),o(e,t,n)},goog.typeOf=function(e){var t=typeof e;if(t=="object"){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if(n=="[object Window]")return"object";if(n=="[object Array]"||typeof e.length=="number"&&e.splice!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("splice"))return"array";if(n=="[object Function]"||e.call!==void 0&&e.propertyIsEnumerable!==void 0&&!e.propertyIsEnumerable("call"))return"function"}else if(t=="function"&&e.call===void 0)return"object";return t},goog.isNull=function(e){return e===null},goog.isDefAndNotNull=function(e){return e!=null},goog.isArray=function(e){return goog.typeOf(e)=="array"},goog.isArrayLike=function(e){var t=goog.typeOf(e);return t=="array"||t=="object"&&typeof e.length=="number"},goog.isDateLike=function(e){return goog.isObject(e)&&typeof e.getFullYear=="function"},goog.isFunction=function(e){return goog.typeOf(e)=="function"},goog.isObject=function(e){var t=typeof e;return t=="object"&&e!=null||t=="function"},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){e!==null&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch{}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(typeof e.clone=="function")return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var o=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(o,r),e.apply(t,o)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments),e.apply(this,r)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(goog.global._evalTest_!==void 0){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,n=t.createElement("SCRIPT");n.type="text/javascript",n.defer=!1,n.appendChild(t.createTextNode(e)),t.head.appendChild(n),t.head.removeChild(n)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if(String(e).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(o){return goog.cssNameMapping_[o]||o},r=function(o){o=o.split("-");for(var l=[],u=0;u<o.length;u++)l.push(n(o[u]));return l.join("-")};return r=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?n:r:function(o){return o},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"&lt;")),t&&(e=e.replace(/\{\$([^}]+)}/g,function(r,o){return t!=null&&o in t?t[o]:r})),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(r,o,l){for(var u=Array(arguments.length-2),s=2;s<arguments.length;s++)u[s-2]=arguments[s];return t.prototype[o].apply(r,u)}},goog.base=function(e,t,n){var r=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!r)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(r.superClass_!==void 0){for(var o=Array(arguments.length-1),l=1;l<arguments.length;l++)o[l-1]=arguments[l];return r.superClass_.constructor.apply(e,o)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),l=2;l<arguments.length;l++)o[l-2]=arguments[l];l=!1;for(var u=e.constructor.prototype;u;u=Object.getPrototypeOf(u))if(u[t]===r)l=!0;else if(l)return u[t].apply(e,o);if(e[t]===r)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),r!=null&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var n=!goog.defineClass.isUnsealable_(t),r=function(){var o=e.apply(this,arguments)||this;return o[goog.UID_PROPERTY_]=o[goog.UID_PROPERTY_],this.constructor===r&&n&&Object.seal instanceof Function&&Object.seal(o),o};return r},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.tagUnsealableClass=function(e){},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if(typeof TrustedTypes>"u"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(n){goog.logToConsole_(n.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,n=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return n.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return n.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return n.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return n.FIXED32;default:return n.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=9223372036854776e3,jspb.BinaryConstants.TWO_TO_64=18446744073709552e3,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,o=0;o<r;o++)n+=e[o]+(o<t.length?t[o]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var o="Assertion failed";if(n){o+=": "+n;var l=r}else e&&(o+=": "+e,l=t);e=new goog.asserts.AssertionError(""+o,l||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&e==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||typeof e=="number"&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):e===null?"null":typeof e},goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=n==null?0:0>n?Math.max(0,e.length+n):n,goog.isString(e))return goog.isString(t)&&t.length==1?e.indexOf(t,n):-1;for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.lastIndexOf.call(e,t,n??e.length-1)}:function(e,t,n){if(0>(n=n??e.length-1)&&(n=Math.max(0,e.length+n)),goog.isString(e))return goog.isString(t)&&t.length==1?e.lastIndexOf(t,n):-1;for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(e.length!=null),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)l in o&&t.call(n,o[l],l,e)},goog.array.forEachRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;--r)r in o&&t.call(n,o[r],r,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=[],l=0,u=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in u){var g=u[s];t.call(n,g,s,e)&&(o[l++]=g)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=Array(r),l=goog.isString(e)?e.split(""):e,u=0;u<r;u++)u in l&&(o[u]=t.call(n,l[u],u,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEach(e,function(l,u){o=t.call(r,o,l,u,e)}),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(e.length!=null),goog.asserts.assert(t!=null),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEachRight(e,function(l,u){o=t.call(r,o,l,u,e)}),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&t.call(n,o[l],l,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(e.length!=null),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&!t.call(n,o[l],l,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return goog.array.forEach(e,function(o,l,u){t.call(n,o,l,u)&&++r},n),r},goog.array.find=function(e,t,n){return 0>(t=goog.array.findIndex(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,l=0;l<r;l++)if(l in o&&t.call(n,o[l],l,e))return l;return-1},goog.array.findRight=function(e,t,n){return 0>(t=goog.array.findIndexRight(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;r--)if(r in o&&t.call(n,o[r],r,e))return r;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return e.length==0},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,n){goog.array.splice(e,n,0,t)},goog.array.insertArrayAt=function(e,t,n){goog.partial(goog.array.splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;arguments.length==2||0>(r=goog.array.indexOf(e,n))?e.push(t):goog.array.insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(e.length!=null),Array.prototype.splice.call(e,t,1).length==1},goog.array.removeIf=function(e,t,n){return 0<=(t=goog.array.findIndex(e,t,n))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return goog.array.forEachRight(e,function(o,l){t.call(n,o,l,e)&&goog.array.removeAt(e,l)&&r++}),r},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var o=e.length||0,l=r.length||0;e.length=o+l;for(var u=0;u<l;u++)e[o+u]=r[u]}else e.push(r)}},goog.array.splice=function(e,t,n,r){return goog.asserts.assert(e.length!=null),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,n){return goog.asserts.assert(e.length!=null),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)},goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(g){return goog.isObject(g)?"o"+goog.getUid(g):(typeof g).charAt(0)+g};n=n||r,r={};for(var o=0,l=0;l<e.length;){var u=e[l++],s=n(u);Object.prototype.hasOwnProperty.call(r,s)||(r[s]=!0,t[o++]=u)}t.length=o},goog.array.binarySearch=function(e,t,n){return goog.array.binarySearch_(e,n||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,n){return goog.array.binarySearch_(e,t,!0,void 0,n)},goog.array.binarySearch_=function(e,t,n,r,o){for(var l,u=0,s=e.length;u<s;){var g=u+s>>1,c=n?t.call(o,e[g],g,e):t(r,e[g]);0<c?u=g+1:(s=g,l=!c)}return l?u:~u},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var o=t||goog.array.defaultCompare;for(goog.array.sort(n,function(l,u){return o(l.value,u.value)||l.index-u.index}),r=0;r<e.length;r++)e[r]=n[r].value},goog.array.sortByKey=function(e,t,n){var r=n||goog.array.defaultCompare;goog.array.sort(e,function(o,l){return r(t(o),t(l))})},goog.array.sortObjectsByKey=function(e,t,n){goog.array.sortByKey(e,function(r){return r[t]},n)},goog.array.isSorted=function(e,t,n){t=t||goog.array.defaultCompare;for(var r=1;r<e.length;r++){var o=t(e[r-1],e[r]);if(0<o||o==0&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||goog.array.defaultCompareEquality;for(var o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||goog.array.defaultCompare;for(var r=Math.min(e.length,t.length),o=0;o<r;o++){var l=n(e[o],t[o]);if(l!=0)return l}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,n){return 0>(n=goog.array.binarySearch(e,t,n))&&(goog.array.insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=goog.array.binarySearch(e,t,n))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},o=0;o<e.length;o++){var l=e[o],u=t.call(n,l,o,e);goog.isDef(u)&&(r[u]||(r[u]=[])).push(l)}return r},goog.array.toObject=function(e,t,n){var r={};return goog.array.forEach(e,function(o,l){r[t.call(n,o,l,e)]=o}),r},goog.array.range=function(e,t,n){var r=[],o=0,l=e;if(t!==void 0&&(o=e,l=t),0>(n=n||1)*(l-o))return[];if(0<n)for(e=o;e<l;e+=n)r.push(e);else for(e=o;e>l;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=function(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(goog.isArray(r))for(var o=0;o<r.length;o+=8192){var l=goog.array.slice(r,o,o+8192);l=goog.array.flatten.apply(null,l);for(var u=0;u<l.length;u++)t.push(l[u])}else t.push(r)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(e.length!=null),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var o=[],l=0;l<arguments.length;l++)o.push(arguments[l][r]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),o=e[n];e[n]=e[r],e[r]=o}},goog.array.copyByIndex=function(e,t){var n=[];return goog.array.forEach(t,function(r){n.push(e[r])}),n},goog.array.concatMap=function(e,t,n){return goog.array.concat.apply([],goog.array.map(e,t,n))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);255<o&&(t[n++]=255&o,o>>=8),t[n++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=goog.array.slice(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,function(n){return 1<(n=n.toString(16)).length?n:"0"+n}).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(e.length%2==0,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);128>o?t[n++]=o:(2048>o?t[n++]=o>>6|192:((64512&o)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128):t[n++]=o>>12|224,t[n++]=o>>6&63|128),t[n++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var o=e[n++];if(128>o)t[r++]=String.fromCharCode(o);else if(191<o&&224>o){var l=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&l)}else if(239<o&&365>o){l=e[n++];var u=e[n++];o=((7&o)<<18|(63&l)<<12|(63&u)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else l=e[n++],u=e[n++],t[r++]=String.fromCharCode((15&o)<<12|(63&l)<<6|63&u)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.string={},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return e.lastIndexOf(t,0)==0},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))==0},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))==0},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test(e))return e;e.indexOf("&")!=-1&&(e=e.replace(goog.string.internal.AMP_RE_,"&amp;")),e.indexOf("<")!=-1&&(e=e.replace(goog.string.internal.LT_RE_,"&lt;")),e.indexOf(">")!=-1&&(e=e.replace(goog.string.internal.GT_RE_,"&gt;")),e.indexOf('"')!=-1&&(e=e.replace(goog.string.internal.QUOT_RE_,"&quot;")),e.indexOf("'")!=-1&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;")),e.indexOf("\0")!=-1&&(e=e.replace(goog.string.internal.NULL_RE_,"&#0;"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.internal.contains=function(e,t){return e.indexOf(t)!=-1},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),o=0;n==0&&o<r;o++){var l=e[o]||"",u=t[o]||"";do{if(l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],u=/(\d*)(\D*)(.*)/.exec(u)||["","","",""],l[0].length==0&&u[0].length==0)break;n=l[1].length==0?0:parseInt(l[1],10);var s=u[1].length==0?0:parseInt(u[1],10);n=goog.string.internal.compareElements_(n,s)||goog.string.internal.compareElements_(l[2].length==0,u[2].length==0)||goog.string.internal.compareElements_(l[2],u[2]),l=l[3],u=u[3]}while(n==0)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(e!=null)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa"),goog.i18n.bidi.Format={LRE:"‪",RLE:"‫",PDF:"‬",LRM:"‎",RLM:"‏"},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return typeof e=="number"?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:e==null?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ऀ-῿‎Ⰰ-\uD801\uD804-\uD839\uD83C-\uDBFF豈-﬜︀-﹯﻽-￿",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ‏\uD802-\uD803\uD83A-\uD83Bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=rtl"):`
50
+ <span dir=rtl>`+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return e.charAt(0)=="<"?e.replace(/<\w+/,"$& dir=ltr"):`
51
+ <span dir=ltr>`+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var l=e[t];goog.i18n.bidi.startsWithRtl(l)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(l)?o=!0:goog.i18n.bidi.hasAnyLtr(l)?r++:goog.i18n.bidi.hasNumeralsRe_.test(l)&&(o=!0)}return r==0?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(r,o){if(!Object.prototype.hasOwnProperty.call(t,o))throw Error('Found marker, "'+o+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(r=t[o])instanceof goog.string.Const?goog.string.Const.unwrap(r):encodeURIComponent(String(r))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(n==null)return t;if(goog.isString(n))return n?e+encodeURIComponent(n):"";for(var r in n){var o=n[r];o=goog.isArray(o)?o:[o];for(var l=0;l<o.length;l++){var u=o[l];u!=null&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(u)))}}return t},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch{return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map(function(r){return goog.string.Const.unwrap(r)})).indexOf(e)==-1&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e=typeof e=="object"&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),`Style string must contain at least one ':', to specify a "name: value" pair: `+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,n="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];r!=null&&(n+=t+":"+(r=goog.isArray(r)?goog.array.map(r,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(r))+";")}return n?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,n=!0,r=0;r<e.length;r++){var o=e.charAt(r);o=="'"&&n?t=!t:o=='"'&&t&&(n=!n)}return t&&n},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var o=e.charAt(r);if(o=="]"){if(t)return!1;t=!0}else if(o=="["){if(!t)return!1;t=!1}else if(!t&&!n.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_=`[-,."'%_!# a-zA-Z0-9\\[\\]]`,goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,function(t,n,r,o){var l="";return r=r.replace(/^(['"])(.*)\1$/,function(u,s,g){return l=s,g}),t=goog.html.SafeUrl.sanitize(r).getTypedStringValue(),n+l+t+l+o})},goog.html.SafeStyle.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyle.unwrap(r)};return goog.array.forEach(arguments,n),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(goog.html.SafeScript.stringify_(arguments[r]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+n.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.object={},goog.object.is=function(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.filter=function(e,t,n){var r,o={};for(r in e)t.call(n,e[r],r,e)&&(o[r]=e[r]);return o},goog.object.map=function(e,t,n){var r,o={};for(r in e)o[r]=t.call(n,e[r],r,e);return o},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.getKeys=function(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(e==null)return;e=e[r[n]]}return e},goog.object.containsKey=function(e,t){return e!==null&&t in e},goog.object.containsValue=function(e,t){for(var n in e)if(e[n]==t)return!0;return!1},goog.object.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},goog.object.findValue=function(e,t,n){return(t=goog.object.findKey(e,t,n))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.add=function(e,t,n){if(e!==null&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,n)},goog.object.get=function(e,t,n){return e!==null&&t in e?e[t]:n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if(t=="object"||t=="array"){if(goog.isFunction(e.clone))return e.clone();for(var n in t=t=="array"?[]:{},e)t[n]=goog.object.unsafeClone(e[n]);return t}return e},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var n,r,o=1;o<arguments.length;o++){for(n in r=arguments[o])e[n]=r[n];for(var l=0;l<goog.object.PROTOTYPE_FIELDS_.length;l++)n=goog.object.PROTOTYPE_FIELDS_[l],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.create=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n},goog.object.createSet=function(e){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var o=Object.getOwnPropertyNames(e),l=0;l<o.length;l++)r[o[l]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(r)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var o=e[r];if(t[o])n.push(t[o]);else if(goog.object.contains(t,o)&&n.pop()!=o)return!1}return n.length==0},goog.html.SafeStyleSheet.concat=function(e){var t="",n=function(r){goog.isArray(r)?goog.array.forEach(r,n):t+=goog.html.SafeStyleSheet.unwrap(r)};return goog.array.forEach(arguments,n),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return(e=goog.string.Const.unwrap(e)).length===0?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return goog.dom.tags.VOID_TAGS_[e]===!0},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,n=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(o){return o=goog.array.find(o,r),n[o]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var n={};goog.array.forEach(t,function(o){n[o[0]]=o[1]});var r=goog.partial(goog.object.containsKey,n);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),n[1]=="7.0")if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t=typeof e=="object",n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),n)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,n){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.createSandboxIframe=function(e,t,n,r){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var n in t){var r=n.toLowerCase();if(r=="language"||r=="src"||r=="text"||r=="type")throw Error('Cannot set "'+r+'" attribute')}for(n="",e=goog.array.concat(e),r=0;r<e.length;r++)n+=goog.html.SafeScript.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=goog.array.concat(e);for(var r=0;r<e.length;r++)n+=goog.html.SafeStyleSheet.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,n){if(n instanceof goog.string.Const)n=goog.string.Const.unwrap(n);else if(t.toLowerCase()=="style")n=goog.html.SafeHtml.getStyleValue_(n);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+n+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(n instanceof goog.html.TrustedResourceUrl)n=goog.html.TrustedResourceUrl.unwrap(n);else if(n instanceof goog.html.SafeUrl)n=goog.html.SafeUrl.unwrap(n);else{if(!goog.isString(n))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+n+'" given.');n=goog.html.SafeUrl.sanitize(n).getTypedStringValue()}}return n.implementsGoogStringTypedString&&(n=n.getTypedStringValue()),goog.asserts.assert(goog.isString(n)||goog.isNumber(n),"String or number value expected, got "+typeof n+" with value: "+n),t+'="'+goog.string.internal.htmlEscape(String(n))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,n,r){return(t=goog.html.SafeHtml.create(t,n,r)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var n=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),r=[],o=function(l){goog.isArray(l)?goog.array.forEach(l,o):(l=goog.html.SafeHtml.htmlEscape(l),r.push(goog.html.SafeHtml.unwrap(l)),l=l.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=l:l!=goog.i18n.bidi.Dir.NEUTRAL&&n!=l&&(n=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(goog.html.SafeHtml.unwrap(e)),n)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var n=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return n.dir_=e,n},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(n)?goog.isArray(n)||(n=[n]):n=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),o+=">"):(r=goog.html.SafeHtml.concat(n),o+=">"+goog.html.SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,r)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(r))throw Error('Invalid attribute name "'+r+'".');var o=t[r];goog.isDefAndNotNull(o)&&(n+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,r,o))}return n},goog.html.SafeHtml.combineAttributes=function(e,t,n){var r,o={};for(r in e)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=e[r];for(r in t)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=t[r];for(r in n){var l=r.toLowerCase();if(l in e)throw Error('Cannot override "'+l+'" attribute, got "'+r+'" with value "'+n[r]+'"');l in t&&delete o[l],o[r]=n[r]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&n[t]!==void 0&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return e===void 0?"undefined":e===null?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch{return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch{}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var r=Array.prototype.slice.call(arguments);return r.push.apply(r,n),e.apply(this,r)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var o;r&&(o=n[r-1].apply(this,arguments));for(var l=r-2;0<=l;l--)o=n[l].call(this,o);return o}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var r,o=0;o<n;o++)r=t[o].apply(this,arguments);return r}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(!t[r].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var r=0;r<n;r++)if(t[r].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var n=t;t=null,n()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(o){goog.global.clearTimeout(r);var l=arguments;r=goog.global.setTimeout(function(){e.apply(n,l)},t)}},goog.functions.throttle=function(e,t,n){var r=0,o=!1,l=[],u=function(){r=0,o&&(o=!1,s())},s=function(){r=goog.global.setTimeout(u,t),e.apply(n,l)};return function(g){l=arguments,r?o=!0:s()}},goog.functions.rateLimit=function(e,t,n){var r=0,o=function(){r=0};return function(l){r||(r=goog.global.setTimeout(o,t),e.apply(n,arguments))}},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&typeof document>"u")return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)}),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[n])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,n,r,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),n?goog.string.Const.unwrap(n):"",r,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",o=Array.prototype.slice.call(arguments,1);o.length&&1<n.length;)r+=n.shift()+o.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return e.length==0},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return e==" "},goog.string.isUnicodeChar=function(e){return e.length==1&&" "<=e&&"~">=e||"€"<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,`
52
+ `)},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),l=Math.min(r.length,o.length),u=0;u<l;u++){n=r[u];var s=o[u];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"&#101;")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,function(o,l){var u=n[o];return u||(l.charAt(0)=="#"&&(l=+("0"+l.substr(1)),isNaN(l)||(u=String.fromCharCode(l))),u||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),o+" ")),u=r.firstChild.nodeValue.slice(0,-1)),n[o]=u)})},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,function(t,n){switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return n.charAt(0)!="#"||(n=+("0"+n.substr(1)),isNaN(n))?t:String.fromCharCode(n)}})},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g," &#160;"),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=n==1?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var o=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(o)}else e.length>t&&(r=Math.floor(t/2),o=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(o));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))==-1&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return e==null?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return t==0&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,function(t,n){return n.toUpperCase()})},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(n,r,o){return r+o.toUpperCase()})},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;typeof t=="string"&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(t[r]!=""){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return n==-1?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var l=0;l<t.length;l++)r[l+1]=Math.min(r[l]+1,n[l+1]+1,n[l]+ +(e[o]!=t[l]));for(l=0;l<n.length;l++)n[l]=r[l]}return r[t.length]},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch{}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return n[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if(n[0]=="Edge")return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,function(n){return t==n[0]}))&&e[1]||""},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_())!=null&&t>parseFloat(e)?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)})},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={},goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function",goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function",goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var o=e[r],l=r+1<e.length,u=l?e[r+1]:0,s=r+2<e.length,g=s?e[r+2]:0,c=o>>2;o=(3&o)<<4|u>>4,u=(15&u)<<2|g>>6,g&=63,s||(g=64,l||(u=64)),n.push(t[c],t[o],t[u]||"",t[g]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,function(r){n+=String.fromCharCode(r)}),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,function(r){n.push(r)}),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,function(l){r[o++]=l}),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(g){for(;r<e.length;){var c=e.charAt(r++),d=goog.crypt.base64.charToByteMap_[c];if(d!=null)return d;if(!goog.string.isEmptyOrWhitespace(c))throw Error("Unknown base64 encoding at char: "+c)}return g}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),l=n(0),u=n(64),s=n(64);if(s===64&&o===-1)break;t(o<<2|l>>4),u!=64&&(t(l<<4&240|u>>2),s!=64&&t(u<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var l=r[o],u=goog.crypt.base64.charToByteMap_[l];u===void 0?goog.crypt.base64.charToByteMap_[l]=o:goog.asserts.assert(u===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(e==0?n==0?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if((e=t?-e:e)===0)jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),l=e.charCodeAt(4),u=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(o<<24)>>>0,jspb.utils.split64High=l+(u<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,r==2047?e?NaN:1/0*n:r==0?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(o,l){return o=o?String(o):"",l?"0000000".slice(o.length)+o:o}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+e);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+((e=1+~e>>>0)==0?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(l,u){for(var s=0;8>s&&(l!==1||0<u);s++)u=l*r[s]+u,r[s]=255&u,u>>>=8}goog.asserts.assert(0<e.length);var n=!1;e[0]==="-"&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var l=0;8>l;l++)r[l]=255&~r[l]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(e.length==18),goog.asserts.assert(e[0]=="0"),goog.asserts.assert(e[1]=="x");for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,o=t;o<n;o++)r+=e[o]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var o=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(o++;;){var l=e[t++];if(!(128&l))break}else for(;t<n;){for(l=r;128<l;){if(e[t]!=(127&l|128))return o;t++,l>>=7}if(e[t++]!=l)break;for(o++;128&(l=e[t++]););}return o},jspb.utils.countFixedFields_=function(e,t,n,r,o){var l=0;if(128>r)for(;t<n&&e[t++]==r;)l++,t+=o;else for(;t<n;){for(var u=r;128<u;){if(e[t++]!=(127&u|128))return l;u>>=7}if(e[t++]!=u)break;l++,t+=o}return l},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var o=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var l=r;128<l;){if(e[t++]!=(127&l|128))return o;l>>=7}if(e[t++]!=l)break;o++;for(var u=0,s=1;u+=(127&(l=e[t++]))*s,s*=128,(128&l)!=0;);t+=u}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return typeof e=="string"?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||Buffer!==void 0&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=t!==void 0?t:0,this.end_=n!==void 0?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,o=0,l=n+7;l>=n;l--)r=r<<8|t[l],o=o<<8|t[l+4];return e(r,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],o="";n<e;){var l=t[n++];if(128>l)r.push(l);else{if(192>l)continue;if(224>l){var u=t[n++];r.push((31&l)<<6|63&u)}else if(240>l){u=t[n++];var s=t[n++];r.push((15&l)<<12|(63&u)<<6|63&s)}else 248>l&&(l=(7&l)<<18|(63&(u=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++],l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))}8192<=r.length&&(o+=String.fromCharCode.apply(null,r),r.length=0)}return o+=goog.crypt.byteArrayToString(r),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],o=e[t+2],l=e[t+3],u=e[t+4],s=e[t+5],g=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,o,l,u,s,g,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(this.readCallbacks_!==null),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,n){return jspb.utils.fromZigzag64(t,n,e)})},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],o=0;o<n.length;o++){var l=this.map_[n[o][0].toString()];this.wrapEntry_(l);var u=l.valueWrapper;u?(goog.asserts.assert(t),r.push([l.key,t(e,u)])):r.push([l.key,l.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var o=e[r][0],l=n(e[r][1]);t.set(o,l)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map_[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,o){var l=this.stringKeys_();l.sort();for(var u=0;u<l.length;u++){var s=this.map_[l[u]];t.beginSubMessage(e),n.call(t,1,s.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(s),o):r.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,o,l,u){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();s==1?l=n.call(t):s==2&&(e.valueCtor_?(goog.asserts.assert(o),u||(u=new e.valueCtor_),r.call(t,u,o)):u=r.call(t))}goog.asserts.assert(l!=null),goog.asserts.assert(u!=null),e.set(l,u)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,o,l){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=o,this.isPacked=l},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function",jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,o,l){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=n===0?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(n=o[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(l&&l.length)for(t=0;t<l.length;t++)jspb.Message.computeOneofCase(e,l[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(e===null||typeof e!="object"||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],o=0;o<e.length;o++)r[o]=t.call(e[o],n,e[o]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,o){for(var l in n){var u=n[l],s=r.call(e,u);if(s!=null){for(var g in u.fieldName)if(u.fieldName.hasOwnProperty(g))break;t[g]=u.toObjectFn?u.isRepeated?jspb.Message.toObjectList(s,u.toObjectFn,o):u.toObjectFn(o,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var o in n){var l=n[o],u=l.fieldInfo;if(!l.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=r.call(e,u);if(s!=null)if(u.isMessageType()){if(!l.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");l.binaryWriterFn.call(t,u.fieldIndex,s,l.binaryMessageSerializeFn)}else l.binaryWriterFn.call(t,u.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,n,r,o){var l=n[t.getFieldNumber()];if(l){if(n=l.fieldInfo,!l.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var u=new n.ctor;l.binaryReaderFn.call(t,u,l.binaryMessageDeserializeFn)}else u=l.binaryReaderFn.call(t);n.isRepeated&&!l.isPacked?(t=r.call(e,n))?t.push(u):o.call(e,n,[u]):o.call(e,n,u)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:+e},jspb.Message.getBooleanField=function(e,t){return(e=jspb.Message.getField(e,t))==null?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return e==null||typeof e=="string"?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return e==null||e instanceof Uint8Array?e:typeof e=="string"?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&typeof e[0]!="string"?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,function(n){goog.typeOf(n)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(n)+" expected "+t)})}},jspb.Message.getFieldWithDefault=function(e,t,n){return(e=jspb.Message.getField(e,t))==null?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return(e=jspb.Message.getBooleanField(e,t))==null?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return(e=jspb.Message.getOptionalFloatingPointField(e,t))==null?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(n)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),r!=null?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&r!==void 0&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,o=0;o<t.length;o++){var l=t[o],u=jspb.Message.getField(e,l);u!=null&&(n=l,r=u,jspb.Message.setField(e,l,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var o=jspb.Message.getField(e,n);(r||o)&&(e.wrappers_[n]=new t(o))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),o=[],l=0;l<r.length;l++)o[l]=new t(r[l]);e.wrappers_[n]=o}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n&&n.toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=r&&r.toArray();return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,o)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],o=0;o<n.length;o++)r[o]=n[o].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,o){jspb.Message.wrapRepeatedField_(e,r,t);var l=e.wrappers_[t];return l||(l=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),o!=null?(l.splice(o,0,n),e.splice(o,0,n.toArray())):(l.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var o={},l=0;l<e.length;l++)o[t.call(e[l])]=n?n.call(e[l],r,e[l]):e[l];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(n){return new e.ctor(n)})),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,function(r){return r.toArray()})):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t&&t.toArray()):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],o=0,l=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<l;o++)jspb.Message.compareFields(n[o],t[o])||(r[o]=t[o]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!(typeof e=="number"&&isNaN(e)||typeof t=="number"&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,o=void 0,l=Math.max(e.length,t.length);for(n=0;n<l;n++){var u=e[n],s=t[n];if(u&&u.constructor==Object&&(goog.asserts.assert(r===void 0),goog.asserts.assert(n===e.length-1),r=u,u=void 0),s&&s.constructor==Object&&(goog.asserts.assert(o===void 0),goog.asserts.assert(n===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(u,s))return!1}return!r&&!o||(r=r||{},o=o||{},jspb.Message.compareExtensions(r,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),o=n.length=0;o<r.length;o++)n[o]=r[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];r!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)(r=e[n])!=null&&(t[n]=typeof r=="object"?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(e==0)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return e==""&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var o=parseInt(e[r],10);n.lo=o,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=(2147483648&this.hi)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&e[0]=="-";return t&&(e=e.substring(1)),(e=jspb.arith.UInt64.fromString(e))===null?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(n,r){t.writeSplitVarint64(n>>>0,r>>>0)})},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert(typeof e=="boolean"||typeof e=="number"),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var o=e.charCodeAt(n+1);56320<=o&&57343>=o&&(r=1024*(r-55296)+o-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){e!=null&&t!=null&&n!=null&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var l=t[o];e.set(l,r),r+=l.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){t!=null&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){t!=null&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){t!=null&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){t!=null&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){t!=null&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,function(o,l){r.writeSplitVarint64(o>>>0,l>>>0)})},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(t!=null)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(t!=null)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(t!=null)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(t!=null){e=this.beginDelimited_(e);for(var o=this.encoder_,l=0;l<t.length;l++)jspb.utils.toZigzag64(n(t[l]),r(t[l]),function(u,s){o.writeSplitVarint64(u>>>0,s>>>0)});this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(t!=null&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(t!=null&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf}).call(this,__webpack_require__(6),__webpack_require__(5).Buffer)},function(e,t){var n=typeof self<"u"?self:this,r=function(){function l(){this.fetch=!1,this.DOMException=n.DOMException}return l.prototype=n,new l}();(function(l){(function(u){var s="URLSearchParams"in l,g="Symbol"in l&&"iterator"in Symbol,c="FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),d="FormData"in l,w="ArrayBuffer"in l;if(w)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(C){return C&&v.indexOf(Object.prototype.toString.call(C))>-1};function f(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(C))throw new TypeError("Invalid character in header field name");return C.toLowerCase()}function p(C){return typeof C!="string"&&(C=String(C)),C}function S(C){var z={next:function(){var P=C.shift();return{done:P===void 0,value:P}}};return g&&(z[Symbol.iterator]=function(){return z}),z}function N(C){this.map={},C instanceof N?C.forEach(function(z,P){this.append(P,z)},this):Array.isArray(C)?C.forEach(function(z){this.append(z[0],z[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(z){this.append(z,C[z])},this)}function B(C){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}function E(C){return new Promise(function(z,P){C.onload=function(){z(C.result)},C.onerror=function(){P(C.error)}})}function T(C){var z=new FileReader,P=E(z);return z.readAsArrayBuffer(C),P}function h(C){if(C.slice)return C.slice(0);var z=new Uint8Array(C.byteLength);return z.set(new Uint8Array(C)),z.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(C){var z;this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:c&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:d&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:s&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():w&&c&&(z=C)&&DataView.prototype.isPrototypeOf(z)?(this._bodyArrayBuffer=h(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):w&&(ArrayBuffer.prototype.isPrototypeOf(C)||y(C))?this._bodyArrayBuffer=h(C):this._bodyText=C=Object.prototype.toString.call(C):this._bodyText="",this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c&&(this.blob=function(){var C=B(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(T)}),this.text=function(){var C,z,P,D=B(this);if(D)return D;if(this._bodyBlob)return C=this._bodyBlob,z=new FileReader,P=E(z),z.readAsText(C),P;if(this._bodyArrayBuffer)return Promise.resolve(function(O){for(var L=new Uint8Array(O),U=new Array(L.length),A=0;A<L.length;A++)U[A]=String.fromCharCode(L[A]);return U.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},d&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}N.prototype.append=function(C,z){C=f(C),z=p(z);var P=this.map[C];this.map[C]=P?P+", "+z:z},N.prototype.delete=function(C){delete this.map[f(C)]},N.prototype.get=function(C){return C=f(C),this.has(C)?this.map[C]:null},N.prototype.has=function(C){return this.map.hasOwnProperty(f(C))},N.prototype.set=function(C,z){this.map[f(C)]=p(z)},N.prototype.forEach=function(C,z){for(var P in this.map)this.map.hasOwnProperty(P)&&C.call(z,this.map[P],P,this)},N.prototype.keys=function(){var C=[];return this.forEach(function(z,P){C.push(P)}),S(C)},N.prototype.values=function(){var C=[];return this.forEach(function(z){C.push(z)}),S(C)},N.prototype.entries=function(){var C=[];return this.forEach(function(z,P){C.push([P,z])}),S(C)},g&&(N.prototype[Symbol.iterator]=N.prototype.entries);var W=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function X(C,z){var P,D,O=(z=z||{}).body;if(C instanceof X){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,z.headers||(this.headers=new N(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,O||C._bodyInit==null||(O=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=z.credentials||this.credentials||"same-origin",!z.headers&&this.headers||(this.headers=new N(z.headers)),this.method=(P=z.method||this.method||"GET",D=P.toUpperCase(),W.indexOf(D)>-1?D:P),this.mode=z.mode||this.mode||null,this.signal=z.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(O)}function m(C){var z=new FormData;return C.trim().split("&").forEach(function(P){if(P){var D=P.split("="),O=D.shift().replace(/\+/g," "),L=D.join("=").replace(/\+/g," ");z.append(decodeURIComponent(O),decodeURIComponent(L))}}),z}function b(C,z){z||(z={}),this.type="default",this.status=z.status===void 0?200:z.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in z?z.statusText:"OK",this.headers=new N(z.headers),this.url=z.url||"",this._initBody(C)}X.prototype.clone=function(){return new X(this,{body:this._bodyInit})},R.call(X.prototype),R.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},b.error=function(){var C=new b(null,{status:0,statusText:""});return C.type="error",C};var G=[301,302,303,307,308];b.redirect=function(C,z){if(G.indexOf(z)===-1)throw new RangeError("Invalid status code");return new b(null,{status:z,headers:{location:C}})},u.DOMException=l.DOMException;try{new u.DOMException}catch{u.DOMException=function(z,P){this.message=z,this.name=P;var D=Error(z);this.stack=D.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function j(C,z){return new Promise(function(P,D){var O=new X(C,z);if(O.signal&&O.signal.aborted)return D(new u.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function U(){L.abort()}L.onload=function(){var A,V,q={status:L.status,statusText:L.statusText,headers:(A=L.getAllResponseHeaders()||"",V=new N,A.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(ee){var te=ee.split(":"),k=te.shift().trim();if(k){var x=te.join(":").trim();V.append(k,x)}}),V)};q.url="responseURL"in L?L.responseURL:q.headers.get("X-Request-URL");var Q="response"in L?L.response:L.responseText;P(new b(Q,q))},L.onerror=function(){D(new TypeError("Network request failed"))},L.ontimeout=function(){D(new TypeError("Network request failed"))},L.onabort=function(){D(new u.DOMException("Aborted","AbortError"))},L.open(O.method,O.url,!0),O.credentials==="include"?L.withCredentials=!0:O.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&c&&(L.responseType="blob"),O.headers.forEach(function(A,V){L.setRequestHeader(V,A)}),O.signal&&(O.signal.addEventListener("abort",U),L.onreadystatechange=function(){L.readyState===4&&O.signal.removeEventListener("abort",U)}),L.send(O._bodyInit===void 0?null:O._bodyInit)})}j.polyfill=!0,l.fetch||(l.fetch=j,l.Headers=N,l.Request=X,l.Response=b),u.Headers=N,u.Request=X,u.Response=b,u.fetch=j,Object.defineProperty(u,"__esModule",{value:!0})})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},function(e,t,n){(function(r){const o=n(215),l=n(51),u=(s,g,c)=>({from:u,EnvVarError:n(51),get:function(d){if(!d)return s;if(arguments.length>1)throw new l("It looks like you passed more than one argument to env.get(). Since env-var@6.0.0 this is no longer supported. To set a default value use env.get(TARGET).default(DEFAULT)");return o(s,d,g||{},c||function(){})},accessors:n(94),logger:n(229)(console.log,s.NODE_ENV)});e.exports=u(r.env)}).call(this,n(2))},function(e,t,n){(function(r){const o=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,l=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(){this.signal.dispatchEvent("abort")}},u=typeof AbortSignal=="function",s=typeof l.AbortSignal=="function",g=u?AbortSignal:s?l.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(T){if(T==="abort"){this.aborted=!0;const h={type:T,target:this};this.onabort(h),this._listeners.forEach(R=>R(h),this)}}onabort(){}addEventListener(T,h){T==="abort"&&this._listeners.push(h)}removeEventListener(T,h){T==="abort"&&(this._listeners=this._listeners.filter(R=>R!==h))}},c=new Set,d=(T,h)=>{const R=`LRU_CACHE_OPTION_${T}`;y(R)&&f(R,`${T} option`,`options.${h}`,E)},w=(T,h)=>{const R=`LRU_CACHE_METHOD_${T}`;if(y(R)){const{prototype:W}=E,{get:X}=Object.getOwnPropertyDescriptor(W,T);f(R,`${T} method`,`cache.${h}()`,X)}},v=(...T)=>{typeof r=="object"&&r&&typeof r.emitWarning=="function"?r.emitWarning(...T):console.error(...T)},y=T=>!c.has(T),f=(T,h,R,W)=>{c.add(T),v(`The ${h} is deprecated. Please use ${R} instead.`,"DeprecationWarning",T,W)},p=T=>T&&T===Math.floor(T)&&T>0&&isFinite(T),S=T=>p(T)?T<=Math.pow(2,8)?Uint8Array:T<=Math.pow(2,16)?Uint16Array:T<=Math.pow(2,32)?Uint32Array:T<=Number.MAX_SAFE_INTEGER?N:null:null;class N extends Array{constructor(h){super(h),this.fill(0)}}class B{constructor(h){if(h===0)return[];const R=S(h);this.heap=new R(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class E{constructor(h={}){const{max:R=0,ttl:W,ttlResolution:X=1,ttlAutopurge:m,updateAgeOnGet:b,updateAgeOnHas:G,allowStale:j,dispose:C,disposeAfter:z,noDisposeOnSet:P,noUpdateTTL:D,maxSize:O=0,maxEntrySize:L=0,sizeCalculation:U,fetchMethod:A,fetchContext:V,noDeleteOnFetchRejection:q,noDeleteOnStaleGet:Q}=h,{length:ee,maxAge:te,stale:k}=h instanceof E?{}:h;if(R!==0&&!p(R))throw new TypeError("max option must be a nonnegative integer");const x=R?S(R):Array;if(!x)throw new Error("invalid max value: "+R);if(this.max=R,this.maxSize=O,this.maxEntrySize=L||this.maxSize,this.sizeCalculation=U||ee,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=A||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=V,!this.fetchMethod&&V!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(R).fill(null),this.valList=new Array(R).fill(null),this.next=new x(R),this.prev=new x(R),this.head=0,this.tail=0,this.free=new B(R),this.initialFill=1,this.size=0,typeof C=="function"&&(this.dispose=C),typeof z=="function"?(this.disposeAfter=z,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!P,this.noUpdateTTL=!!D,this.noDeleteOnFetchRejection=!!q,this.maxEntrySize!==0){if(this.maxSize!==0&&!p(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!p(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!j||!!k,this.noDeleteOnStaleGet=!!Q,this.updateAgeOnGet=!!b,this.updateAgeOnHas=!!G,this.ttlResolution=p(X)||X===0?X:1,this.ttlAutopurge=!!m,this.ttl=W||te||0,this.ttl){if(!p(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const _="LRU_CACHE_UNBOUNDED";y(_)&&(c.add(_),v("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",_,E))}k&&d("stale","allowStale"),te&&d("maxAge","ttl"),ee&&d("length","sizeCalculation")}getRemainingTTL(h){return this.has(h,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new N(this.max),this.starts=new N(this.max),this.setItemTTL=(W,X,m=o.now())=>{if(this.starts[W]=X!==0?m:0,this.ttls[W]=X,X!==0&&this.ttlAutopurge){const b=setTimeout(()=>{this.isStale(W)&&this.delete(this.keyList[W])},X+1);b.unref&&b.unref()}},this.updateItemAge=W=>{this.starts[W]=this.ttls[W]!==0?o.now():0};let h=0;const R=()=>{const W=o.now();if(this.ttlResolution>0){h=W;const X=setTimeout(()=>h=0,this.ttlResolution);X.unref&&X.unref()}return W};this.getRemainingTTL=W=>{const X=this.keyMap.get(W);return X===void 0?0:this.ttls[X]===0||this.starts[X]===0?1/0:this.starts[X]+this.ttls[X]-(h||R())},this.isStale=W=>this.ttls[W]!==0&&this.starts[W]!==0&&(h||R())-this.starts[W]>this.ttls[W]}updateItemAge(h){}setItemTTL(h,R,W){}isStale(h){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new N(this.max),this.removeItemSize=h=>{this.calculatedSize-=this.sizes[h],this.sizes[h]=0},this.requireSize=(h,R,W,X)=>{if(!p(W)){if(!X)throw new TypeError("invalid size value (must be positive integer)");if(typeof X!="function")throw new TypeError("sizeCalculation must be a function");if(W=X(R,h),!p(W))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return W},this.addItemSize=(h,R)=>{this.sizes[h]=R;const W=this.maxSize-this.sizes[h];for(;this.calculatedSize>W;)this.evict(!0);this.calculatedSize+=this.sizes[h]}}removeItemSize(h){}addItemSize(h,R){}requireSize(h,R,W,X){if(W||X)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:h=this.allowStale}={}){if(this.size)for(let R=this.tail;this.isValidIndex(R)&&(!h&&this.isStale(R)||(yield R),R!==this.head);)R=this.prev[R]}*rindexes({allowStale:h=this.allowStale}={}){if(this.size)for(let R=this.head;this.isValidIndex(R)&&(!h&&this.isStale(R)||(yield R),R!==this.tail);)R=this.next[R]}isValidIndex(h){return this.keyMap.get(this.keyList[h])===h}*entries(){for(const h of this.indexes())yield[this.keyList[h],this.valList[h]]}*rentries(){for(const h of this.rindexes())yield[this.keyList[h],this.valList[h]]}*keys(){for(const h of this.indexes())yield this.keyList[h]}*rkeys(){for(const h of this.rindexes())yield this.keyList[h]}*values(){for(const h of this.indexes())yield this.valList[h]}*rvalues(){for(const h of this.rindexes())yield this.valList[h]}[Symbol.iterator](){return this.entries()}find(h,R={}){for(const W of this.indexes())if(h(this.valList[W],this.keyList[W],this))return this.get(this.keyList[W],R)}forEach(h,R=this){for(const W of this.indexes())h.call(R,this.valList[W],this.keyList[W],this)}rforEach(h,R=this){for(const W of this.rindexes())h.call(R,this.valList[W],this.keyList[W],this)}get prune(){return w("prune","purgeStale"),this.purgeStale}purgeStale(){let h=!1;for(const R of this.rindexes({allowStale:!0}))this.isStale(R)&&(this.delete(this.keyList[R]),h=!0);return h}dump(){const h=[];for(const R of this.indexes({allowStale:!0})){const W=this.keyList[R],X=this.valList[R],m={value:this.isBackgroundFetch(X)?X.__staleWhileFetching:X};if(this.ttls){m.ttl=this.ttls[R];const b=o.now()-this.starts[R];m.start=Math.floor(Date.now()-b)}this.sizes&&(m.size=this.sizes[R]),h.unshift([W,m])}return h}load(h){this.clear();for(const[R,W]of h){if(W.start){const X=Date.now()-W.start;W.start=o.now()-X}this.set(R,W.value,W)}}dispose(h,R,W){}set(h,R,{ttl:W=this.ttl,start:X,noDisposeOnSet:m=this.noDisposeOnSet,size:b=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:j=this.noUpdateTTL}={}){if(b=this.requireSize(h,R,b,G),this.maxEntrySize&&b>this.maxEntrySize)return this;let C=this.size===0?void 0:this.keyMap.get(h);if(C===void 0)C=this.newIndex(),this.keyList[C]=h,this.valList[C]=R,this.keyMap.set(h,C),this.next[this.tail]=C,this.prev[C]=this.tail,this.tail=C,this.size++,this.addItemSize(C,b),j=!1;else{const z=this.valList[C];R!==z&&(this.isBackgroundFetch(z)?z.__abortController.abort():m||(this.dispose(z,h,"set"),this.disposeAfter&&this.disposed.push([z,h,"set"])),this.removeItemSize(C),this.valList[C]=R,this.addItemSize(C,b)),this.moveToTail(C)}if(W===0||this.ttl!==0||this.ttls||this.initializeTTLTracking(),j||this.setItemTTL(C,W,X),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const h=this.valList[this.head];return this.evict(!0),h}}evict(h){const R=this.head,W=this.keyList[R],X=this.valList[R];return this.isBackgroundFetch(X)?X.__abortController.abort():(this.dispose(X,W,"evict"),this.disposeAfter&&this.disposed.push([X,W,"evict"])),this.removeItemSize(R),h&&(this.keyList[R]=null,this.valList[R]=null,this.free.push(R)),this.head=this.next[R],this.keyMap.delete(W),this.size--,R}has(h,{updateAgeOnHas:R=this.updateAgeOnHas}={}){const W=this.keyMap.get(h);return W!==void 0&&!this.isStale(W)&&(R&&this.updateItemAge(W),!0)}peek(h,{allowStale:R=this.allowStale}={}){const W=this.keyMap.get(h);if(W!==void 0&&(R||!this.isStale(W))){const X=this.valList[W];return this.isBackgroundFetch(X)?X.__staleWhileFetching:X}}backgroundFetch(h,R,W,X){const m=R===void 0?void 0:this.valList[R];if(this.isBackgroundFetch(m))return m;const b=new l,G={signal:b.signal,options:W,context:X},j=new Promise(C=>C(this.fetchMethod(h,m,G))).then(C=>(b.signal.aborted||this.set(h,C,G.options),C),C=>{if(this.valList[R]===j&&(!W.noDeleteOnFetchRejection||j.__staleWhileFetching===void 0?this.delete(h):this.valList[R]=j.__staleWhileFetching),j.__returned===j)throw C});return j.__abortController=b,j.__staleWhileFetching=m,j.__returned=null,R===void 0?(this.set(h,j,G.options),R=this.keyMap.get(h)):this.valList[R]=j,j}isBackgroundFetch(h){return h&&typeof h=="object"&&typeof h.then=="function"&&Object.prototype.hasOwnProperty.call(h,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(h,"__returned")&&(h.__returned===h||h.__returned===null)}async fetch(h,{allowStale:R=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:X=this.noDeleteOnStaleGet,ttl:m=this.ttl,noDisposeOnSet:b=this.noDisposeOnSet,size:G=0,sizeCalculation:j=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:z=this.noDeleteOnFetchRejection,fetchContext:P=this.fetchContext,forceRefresh:D=!1}={}){if(!this.fetchMethod)return this.get(h,{allowStale:R,updateAgeOnGet:W,noDeleteOnStaleGet:X});const O={allowStale:R,updateAgeOnGet:W,noDeleteOnStaleGet:X,ttl:m,noDisposeOnSet:b,size:G,sizeCalculation:j,noUpdateTTL:C,noDeleteOnFetchRejection:z};let L=this.keyMap.get(h);if(L===void 0){const U=this.backgroundFetch(h,L,O,P);return U.__returned=U}{const U=this.valList[L];if(this.isBackgroundFetch(U))return R&&U.__staleWhileFetching!==void 0?U.__staleWhileFetching:U.__returned=U;if(!D&&!this.isStale(L))return this.moveToTail(L),W&&this.updateItemAge(L),U;const A=this.backgroundFetch(h,L,O,P);return R&&A.__staleWhileFetching!==void 0?A.__staleWhileFetching:A.__returned=A}}get(h,{allowStale:R=this.allowStale,updateAgeOnGet:W=this.updateAgeOnGet,noDeleteOnStaleGet:X=this.noDeleteOnStaleGet}={}){const m=this.keyMap.get(h);if(m!==void 0){const b=this.valList[m],G=this.isBackgroundFetch(b);return this.isStale(m)?G?R?b.__staleWhileFetching:void 0:(X||this.delete(h),R?b:void 0):G?void 0:(this.moveToTail(m),W&&this.updateItemAge(m),b)}}connect(h,R){this.prev[R]=h,this.next[h]=R}moveToTail(h){h!==this.tail&&(h===this.head?this.head=this.next[h]:this.connect(this.prev[h],this.next[h]),this.connect(this.tail,h),this.tail=h)}get del(){return w("del","delete"),this.delete}delete(h){let R=!1;if(this.size!==0){const W=this.keyMap.get(h);if(W!==void 0)if(R=!0,this.size===1)this.clear();else{this.removeItemSize(W);const X=this.valList[W];this.isBackgroundFetch(X)?X.__abortController.abort():(this.dispose(X,h,"delete"),this.disposeAfter&&this.disposed.push([X,h,"delete"])),this.keyMap.delete(h),this.keyList[W]=null,this.valList[W]=null,W===this.tail?this.tail=this.prev[W]:W===this.head?this.head=this.next[W]:(this.next[this.prev[W]]=this.next[W],this.prev[this.next[W]]=this.prev[W]),this.size--,this.free.push(W)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return R}clear(){for(const h of this.rindexes({allowStale:!0})){const R=this.valList[h];if(this.isBackgroundFetch(R))R.__abortController.abort();else{const W=this.keyList[h];this.dispose(R,W,"delete"),this.disposeAfter&&this.disposed.push([R,W,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return w("reset","clear"),this.clear}get length(){return((h,R)=>{const W=`LRU_CACHE_PROPERTY_${h}`;if(y(W)){const{prototype:X}=E,{get:m}=Object.getOwnPropertyDescriptor(X,h);f(W,`${h} property`,`cache.${R}`,m)}})("length","size"),this.size}static get AbortController(){return l}static get AbortSignal(){return g}}e.exports=E}).call(this,n(2))},function(e,t,n){var r=n(42).Colorizer;e.exports=function(o){return r.addColors(o.colors||o),o}},function(e,t,n){var r={};e.exports=r,r.themes={};var o=n(13),l=r.styles=n(107),u=Object.defineProperties,s=new RegExp(/[\r\n]+/g);r.supportsColor=n(108).supportsColor,r.enabled===void 0&&(r.enabled=r.supportsColor()!==!1),r.enable=function(){r.enabled=!0},r.disable=function(){r.enabled=!1},r.stripColors=r.strip=function(S){return(""+S).replace(/\x1B\[\d+m/g,"")},r.stylize=function(S,N){if(!r.enabled)return S+"";var B=l[N];return!B&&N in r?r[N](S):B.open+S+B.close};var g=/[|\\{}()[\]^$+*?.]/g;function c(S){var N=function B(){return y.apply(B,arguments)};return N._styles=S,N.__proto__=v,N}var d,w=(d={},l.grey=l.gray,Object.keys(l).forEach(function(S){l[S].closeRe=new RegExp(function(N){if(typeof N!="string")throw new TypeError("Expected a string");return N.replace(g,"\\$&")}(l[S].close),"g"),d[S]={get:function(){return c(this._styles.concat(S))}}}),d),v=u(function(){},w);function y(){var S=Array.prototype.slice.call(arguments),N=S.map(function(R){return R!=null&&R.constructor===String?R:o.inspect(R)}).join(" ");if(!r.enabled||!N)return N;for(var B=N.indexOf(`
53
+ `)!=-1,E=this._styles,T=E.length;T--;){var h=l[E[T]];N=h.open+N.replace(h.closeRe,h.open)+h.close,B&&(N=N.replace(s,function(R){return h.close+R+h.open}))}return N}r.setTheme=function(S){if(typeof S!="string")for(var N in S)(function(B){r[B]=function(E){if(typeof S[B]=="object"){var T=E;for(var h in S[B])T=r[S[B][h]](T);return T}return r[S[B]](E)}})(N);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var f=function(S,N){var B=N.split("");return(B=B.map(S)).join("")};for(var p in r.trap=n(110),r.zalgo=n(111),r.maps={},r.maps.america=n(112)(r),r.maps.zebra=n(113)(r),r.maps.rainbow=n(114)(r),r.maps.random=n(115)(r),r.maps)(function(S){r[S]=function(N){return f(r.maps[S],N)}})(p);u(r,function(){var S={};return Object.keys(w).forEach(function(N){S[N]={get:function(){return c([N])}}}),S}())},function(e,t){e.exports=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"}},function(e,t){typeof Object.create=="function"?e.exports=function(n,r){n.super_=r,n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(n,r){n.super_=r;var o=function(){};o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n}},function(e,t){var n={};e.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(o){var l=r[o],u=n[o]=[];u.open="\x1B["+l[0]+"m",u.close="\x1B["+l[1]+"m"})},function(e,t,n){(function(r){var o=n(16),l=n(109),u=r.env,s=void 0;function g(c){return function(d){return d!==0&&{level:d,hasBasic:!0,has256:d>=2,has16m:d>=3}}(function(d){if(s===!1)return 0;if(l("color=16m")||l("color=full")||l("color=truecolor"))return 3;if(l("color=256"))return 2;if(d&&!d.isTTY&&s!==!0)return 0;var w=s?1:0;if(r.platform==="win32"){var v=o.release().split(".");return Number(r.versions.node.split(".")[0])>=8&&Number(v[0])>=10&&Number(v[2])>=10586?Number(v[2])>=14931?3:2:1}return"CI"in u?["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(y){return y in u})||u.CI_NAME==="codeship"?1:w:"TEAMCITY_VERSION"in u?/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0:"TERM_PROGRAM"in u?parseInt("3.4.20".split(".")[0],10)>=3?3:2:/-256(color)?$/i.test("xterm-256color")?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test("xterm-256color")||"COLORTERM"in u?1:w}(c))}l("no-color")||l("no-colors")||l("color=false")?s=!1:(l("color")||l("colors")||l("color=true")||l("color=always"))&&(s=!0),"FORCE_COLOR"in u&&(s=u.FORCE_COLOR.length===0||parseInt(u.FORCE_COLOR,10)!==0),e.exports={supportsColor:g,stdout:g(r.stdout),stderr:g(r.stderr)}}).call(this,n(2))},function(e,t,n){(function(r){e.exports=function(o,l){var u=(l=l||r.argv).indexOf("--"),s=/^-{1,2}/.test(o)?"":"--",g=l.indexOf(s+o);return g!==-1&&(u===-1||g<u)}}).call(this,n(2))},function(e,t){e.exports=function(n,r){var o="";n=(n=n||"Run the trap, drop the bass").split("");var l={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return n.forEach(function(u){u=u.toLowerCase();var s=l[u]||[" "],g=Math.floor(Math.random()*s.length);o+=l[u]!==void 0?l[u][g]:u}),o}},function(e,t){e.exports=function(n,r){n=n||" he is here ";var o={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},l=[].concat(o.up,o.down,o.mid);function u(g){return Math.floor(Math.random()*g)}function s(g){var c=!1;return l.filter(function(d){c=d===g}),c}return function(g,c){var d,w,v="";for(w in(c=c||{}).up=c.up===void 0||c.up,c.mid=c.mid===void 0||c.mid,c.down=c.down===void 0||c.down,c.size=c.size!==void 0?c.size:"maxi",g=g.split(""))if(!s(w)){switch(v+=g[w],d={up:0,down:0,mid:0},c.size){case"mini":d.up=u(8),d.mid=u(2),d.down=u(8);break;case"maxi":d.up=u(16)+3,d.mid=u(4)+1,d.down=u(64)+3;break;default:d.up=u(8)+1,d.mid=u(6)/2,d.down=u(8)+1}var y=["up","mid","down"];for(var f in y)for(var p=y[f],S=0;S<=d[p];S++)c[p]&&(v+=o[p][u(o[p].length)])}return v}(n,r)}},function(e,t){e.exports=function(n){return function(r,o,l){if(r===" ")return r;switch(o%3){case 0:return n.red(r);case 1:return n.white(r);case 2:return n.blue(r)}}}},function(e,t){e.exports=function(n){return function(r,o,l){return o%2==0?r:n.inverse(r)}}},function(e,t){e.exports=function(n){var r=["red","yellow","green","blue","magenta"];return function(o,l,u){return o===" "?o:n[r[l++%r.length]](o)}}},function(e,t){e.exports=function(n){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(o,l,u){return o===" "?o:n[r[Math.round(Math.random()*(r.length-2))]](o)}}},function(e,t,n){Object.defineProperty(t,"cli",{value:n(117)}),Object.defineProperty(t,"npm",{value:n(118)}),Object.defineProperty(t,"syslog",{value:n(119)})},function(e,t,n){t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},function(e,t,n){t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},function(e,t,n){t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},function(e,t,n){var r=n(8);e.exports=r(function(o){return o.message=" ".concat(o.message),o})},function(e,t,n){function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var l=n(42).Colorizer,u=n(59).Padder,s=n(3),g=s.configs,c=s.MESSAGE,d=function(){function w(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,w),f.levels||(f.levels=g.cli.levels),this.colorizer=new l(f),this.padder=new u(f),this.options=f}var v,y;return v=w,(y=[{key:"transform",value:function(f,p){return this.colorizer.transform(this.padder.transform(f,p),p),f[c]="".concat(f.level,":").concat(f.message),f}}])&&o(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)},e.exports.Format=d},function(e,t,n){var r=n(8);function o(u){if(u.every(l))return function(s){for(var g=s,c=0;c<u.length;c++)if(!(g=u[c].transform(g,u[c].options)))return!1;return g}}function l(u){if(typeof u.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
54
+ `));return!0}e.exports=function(){for(var u=arguments.length,s=new Array(u),g=0;g<u;g++)s[g]=arguments[g];var c=r(o(s)),d=c();return d.Format=c.Format,d},e.exports.cascade=o},function(e,t,n){function r(g,c,d){return c in g?Object.defineProperty(g,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):g[c]=d,g}var o=n(8),l=n(3),u=l.LEVEL,s=l.MESSAGE;e.exports=o(function(g,c){var d=c.stack,w=c.cause;if(g instanceof Error){var v,y=Object.assign({},g,(r(v={level:g.level},u,g[u]||g.level),r(v,"message",g.message),r(v,s,g[s]||g.message),v));return d&&(y.stack=g.stack),w&&(y.cause=g.cause),y}if(!(g.message instanceof Error))return g;var f=g.message;return Object.assign(g,f),g.message=f.message,g[s]=f.message,d&&(g.stack=f.stack),w&&(g.cause=f.cause),g})},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);function u(s,g){return typeof g=="bigint"?g.toString():g}e.exports=r(function(s,g){var c=l.configure(g);return s[o]=c(s,g.replacer||u,g.space),s})},function(e,t,n){var r=n(8);e.exports=r(function(o,l){return l.message?(o.message="[".concat(l.label,"] ").concat(o.message),o):(o.label=l.label,o)})},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);e.exports=r(function(u){var s={};return u.message&&(s["@message"]=u.message,delete u.message),u.timestamp&&(s["@timestamp"]=u.timestamp,delete u.timestamp),s["@fields"]=u,u[o]=l(s),u})},function(e,t,n){var r=n(8);function o(u,s,g){var c,d,w,v=s.reduce(function(f,p){return f[p]=u[p],delete u[p],f},{}),y=Object.keys(u).reduce(function(f,p){return f[p]=u[p],delete u[p],f},{});return Object.assign(u,v,(w=y,(d=g)in(c={})?Object.defineProperty(c,d,{value:w,enumerable:!0,configurable:!0,writable:!0}):c[d]=w,c)),u}function l(u,s,g){return u[g]=s.reduce(function(c,d){return c[d]=u[d],delete u[d],c},{}),u}e.exports=r(function(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g="metadata";s.key&&(g=s.key);var c=[];return s.fillExcept||s.fillWith||(c.push("level"),c.push("message")),s.fillExcept&&(c=s.fillExcept),c.length>0?o(u,c,g):s.fillWith?l(u,s.fillWith,g):u})},function(e,t,n){var r=n(8),o=n(129);e.exports=r(function(l){var u=+new Date;return(void 0).diff=u-((void 0).prevTime||u),(void 0).prevTime=u,l.ms="+".concat(o((void 0).diff)),l})},function(e,t){var n=1e3,r=6e4,o=36e5,l=24*o;function u(s,g,c,d){var w=g>=1.5*c;return Math.round(s/c)+" "+d+(w?"s":"")}e.exports=function(s,g){g=g||{};var c=typeof s;if(c==="string"&&s.length>0)return function(d){if(!((d=String(d)).length>100)){var w=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(w){var v=parseFloat(w[1]);switch((w[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*v;case"weeks":case"week":case"w":return 6048e5*v;case"days":case"day":case"d":return v*l;case"hours":case"hour":case"hrs":case"hr":case"h":return v*o;case"minutes":case"minute":case"mins":case"min":case"m":return v*r;case"seconds":case"second":case"secs":case"sec":case"s":return v*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}(s);if(c==="number"&&isFinite(s))return g.long?function(d){var w=Math.abs(d);return w>=l?u(d,w,l,"day"):w>=o?u(d,w,o,"hour"):w>=r?u(d,w,r,"minute"):w>=n?u(d,w,n,"second"):d+" ms"}(s):function(d){var w=Math.abs(d);return w>=l?Math.round(d/l)+"d":w>=o?Math.round(d/o)+"h":w>=r?Math.round(d/r)+"m":w>=n?Math.round(d/n)+"s":d+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}},function(e,t,n){var r=n(13).inspect,o=n(8),l=n(3),u=l.LEVEL,s=l.MESSAGE,g=l.SPLAT;e.exports=o(function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=Object.assign({},c);return delete w[u],delete w[s],delete w[g],c[s]=r(w,!1,d.depth||null,d.colorize),c})},function(e,t,n){function r(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var o=n(3).MESSAGE,l=function(){function u(c){(function(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")})(this,u),this.template=c}var s,g;return s=u,(g=[{key:"transform",value:function(c){return c[o]=this.template(c),c}}])&&r(s.prototype,g),Object.defineProperty(s,"prototype",{writable:!1}),u}();e.exports=function(u){return new l(u)},e.exports.Printf=e.exports.Format=l},function(e,t,n){var r=n(8),o=n(3).MESSAGE,l=n(29);e.exports=r(function(u){var s=l(Object.assign({},u,{level:void 0,message:void 0,splat:void 0})),g=u.padding&&u.padding[u.level]||"";return u[o]=s!=="{}"?"".concat(u.level,":").concat(g," ").concat(u.message," ").concat(s):"".concat(u.level,":").concat(g," ").concat(u.message),u})},function(e,t,n){function r(w){return function(v){if(Array.isArray(v))return o(v)}(w)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(w)||function(v,y){if(v){if(typeof v=="string")return o(v,y);var f=Object.prototype.toString.call(v).slice(8,-1);if(f==="Object"&&v.constructor&&(f=v.constructor.name),f==="Map"||f==="Set")return Array.from(v);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return o(v,y)}}(w)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
55
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(w,v){(v==null||v>w.length)&&(v=w.length);for(var y=0,f=new Array(v);y<v;y++)f[y]=w[y];return f}function l(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,f.key,f)}}var u=n(13),s=n(3).SPLAT,g=/%[scdjifoO%]/g,c=/%%/g,d=function(){function w(f){(function(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")})(this,w),this.options=f}var v,y;return v=w,(y=[{key:"_splat",value:function(f,p){var S=f.message,N=f[s]||f.splat||[],B=S.match(c),E=B&&B.length||0,T=p.length-E-N.length,h=T<0?N.splice(T,-1*T):[],R=h.length;if(R)for(var W=0;W<R;W++)Object.assign(f,h[W]);return f.message=u.format.apply(u,[S].concat(r(N))),f}},{key:"transform",value:function(f){var p=f.message,S=f[s]||f.splat;if(!S||!S.length)return f;var N=p&&p.match&&p.match(g);if(!N&&(S||S.length)){var B=S.length>1?S.splice(0):S,E=B.length;if(E)for(var T=0;T<E;T++)Object.assign(f,B[T]);return f}return N?this._splat(f,N):f}}])&&l(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}();e.exports=function(w){return new d(w)}},function(e,t,n){var r=n(135),o=n(8);e.exports=o(function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return u.format&&(l.timestamp=typeof u.format=="function"?u.format():r.format(new Date,u.format)),l.timestamp||(l.timestamp=new Date().toISOString()),u.alias&&(l[u.alias]=l.timestamp),l})},function(e,t,n){n.r(t),n.d(t,"assign",function(){return g}),n.d(t,"format",function(){return b}),n.d(t,"parse",function(){return G}),n.d(t,"defaultI18n",function(){return v}),n.d(t,"setGlobalDateI18n",function(){return f}),n.d(t,"setGlobalDateMasks",function(){return m});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="[^\\s]+",l=/\[([^]*?)\]/gm;function u(C,z){for(var P=[],D=0,O=C.length;D<O;D++)P.push(C[D].substr(0,z));return P}var s=function(C){return function(z,P){var D=P[C].map(function(O){return O.toLowerCase()}).indexOf(z.toLowerCase());return D>-1?D:null}};function g(C){for(var z=[],P=1;P<arguments.length;P++)z[P-1]=arguments[P];for(var D=0,O=z;D<O.length;D++){var L=O[D];for(var U in L)C[U]=L[U]}return C}var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"],w=u(d,3),v={dayNamesShort:u(c,3),dayNames:c,monthNamesShort:w,monthNames:d,amPm:["am","pm"],DoFn:function(C){return C+["th","st","nd","rd"][C%10>3?0:(C-C%10!=10?1:0)*C%10]}},y=g({},v),f=function(C){return y=g(y,C)},p=function(C){return C.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},S=function(C,z){for(z===void 0&&(z=2),C=String(C);C.length<z;)C="0"+C;return C},N={D:function(C){return String(C.getDate())},DD:function(C){return S(C.getDate())},Do:function(C,z){return z.DoFn(C.getDate())},d:function(C){return String(C.getDay())},dd:function(C){return S(C.getDay())},ddd:function(C,z){return z.dayNamesShort[C.getDay()]},dddd:function(C,z){return z.dayNames[C.getDay()]},M:function(C){return String(C.getMonth()+1)},MM:function(C){return S(C.getMonth()+1)},MMM:function(C,z){return z.monthNamesShort[C.getMonth()]},MMMM:function(C,z){return z.monthNames[C.getMonth()]},YY:function(C){return S(String(C.getFullYear()),4).substr(2)},YYYY:function(C){return S(C.getFullYear(),4)},h:function(C){return String(C.getHours()%12||12)},hh:function(C){return S(C.getHours()%12||12)},H:function(C){return String(C.getHours())},HH:function(C){return S(C.getHours())},m:function(C){return String(C.getMinutes())},mm:function(C){return S(C.getMinutes())},s:function(C){return String(C.getSeconds())},ss:function(C){return S(C.getSeconds())},S:function(C){return String(Math.round(C.getMilliseconds()/100))},SS:function(C){return S(Math.round(C.getMilliseconds()/10),2)},SSS:function(C){return S(C.getMilliseconds(),3)},a:function(C,z){return C.getHours()<12?z.amPm[0]:z.amPm[1]},A:function(C,z){return C.getHours()<12?z.amPm[0].toUpperCase():z.amPm[1].toUpperCase()},ZZ:function(C){var z=C.getTimezoneOffset();return(z>0?"-":"+")+S(100*Math.floor(Math.abs(z)/60)+Math.abs(z)%60,4)},Z:function(C){var z=C.getTimezoneOffset();return(z>0?"-":"+")+S(Math.floor(Math.abs(z)/60),2)+":"+S(Math.abs(z)%60,2)}},B=function(C){return+C-1},E=[null,"[1-9]\\d?"],T=[null,o],h=["isPm",o,function(C,z){var P=C.toLowerCase();return P===z.amPm[0]?0:P===z.amPm[1]?1:null}],R=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(C){var z=(C+"").match(/([+-]|\d\d)/gi);if(z){var P=60*+z[1]+parseInt(z[2],10);return z[0]==="+"?P:-P}return 0}],W={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+o,function(C){return parseInt(C,10)}],M:["month","[1-9]\\d?",B],MM:["month","\\d\\d",B],YY:["year","\\d\\d",function(C){var z=+(""+new Date().getFullYear()).substr(0,2);return+(""+(+C>68?z-1:z)+C)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(C){return 100*+C}],SS:["millisecond","\\d\\d",function(C){return 10*+C}],SSS:["millisecond","\\d{3}"],d:E,dd:E,ddd:T,dddd:T,MMM:["month",o,s("monthNamesShort")],MMMM:["month",o,s("monthNames")],a:h,A:h,ZZ:R,Z:R},X={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},m=function(C){return g(X,C)},b=function(C,z,P){if(z===void 0&&(z=X.default),P===void 0&&(P={}),typeof C=="number"&&(C=new Date(C)),Object.prototype.toString.call(C)!=="[object Date]"||isNaN(C.getTime()))throw new Error("Invalid Date pass to format");var D=[];z=(z=X[z]||z).replace(l,function(L,U){return D.push(U),"@@@"});var O=g(g({},y),P);return(z=z.replace(r,function(L){return N[L](C,O)})).replace(/@@@/g,function(){return D.shift()})};function G(C,z,P){if(P===void 0&&(P={}),typeof z!="string")throw new Error("Invalid format in fecha parse");if(z=X[z]||z,C.length>1e3)return null;var D={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},O=[],L=[],U=z.replace(l,function(Y,ne){return L.push(p(ne)),"@@@"}),A={},V={};U=p(U).replace(r,function(Y){var ne=W[Y],ie=ne[0],ue=ne[1],we=ne[3];if(A[ie])throw new Error("Invalid format. "+ie+" specified twice in format");return A[ie]=!0,we&&(V[we]=!0),O.push(ne),"("+ue+")"}),Object.keys(V).forEach(function(Y){if(!A[Y])throw new Error("Invalid format. "+Y+" is required in specified format")}),U=U.replace(/@@@/g,function(){return L.shift()});var q=C.match(new RegExp(U,"i"));if(!q)return null;for(var Q=g(g({},y),P),ee=1;ee<q.length;ee++){var te=O[ee-1],k=te[0],x=te[2],_=x?x(q[ee],Q):+q[ee];if(_==null)return null;D[k]=_}D.isPm===1&&D.hour!=null&&+D.hour!=12?D.hour=+D.hour+12:D.isPm===0&&+D.hour==12&&(D.hour=0);for(var I=new Date(D.year,D.month,D.day,D.hour,D.minute,D.second,D.millisecond),$=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],K=(ee=0,$.length);ee<K;ee++)if(A[$[ee][0]]&&D[$[ee][0]]!==I[$[ee][1]]())return null;return D.timezoneOffset==null?I:new Date(Date.UTC(D.year,D.month,D.day,D.hour,D.minute-D.timezoneOffset,D.second,D.millisecond))}var j={format:b,parse:G,defaultI18n:v,setGlobalDateI18n:f,setGlobalDateMasks:m};t.default=j},function(e,t,n){var r=n(58),o=n(8),l=n(3).MESSAGE;e.exports=o(function(u,s){return s.level!==!1&&(u.level=r.strip(u.level)),s.message!==!1&&(u.message=r.strip(String(u.message))),s.raw!==!1&&u[l]&&(u[l]=r.strip(String(u[l]))),u})},function(e){e.exports=JSON.parse('{"name":"winston","description":"A logger for just about everything.","version":"3.8.2","author":"Charlie Robbins <charlie.robbins@gmail.com>","maintainers":["David Hyde <dabh@alumni.stanford.edu>"],"repository":{"type":"git","url":"https://github.com/winstonjs/winston.git"},"keywords":["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],"dependencies":{"@dabh/diagnostics":"^2.0.2","@colors/colors":"1.5.0","async":"^3.2.3","is-stream":"^2.0.0","logform":"^2.4.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.5.0"},"devDependencies":{"@babel/cli":"^7.17.0","@babel/core":"^7.17.2","@babel/preset-env":"^7.16.7","@dabh/eslint-config-populist":"^5.0.0","@types/node":"^18.0.0","abstract-winston-transport":"^0.5.1","assume":"^2.2.0","cross-spawn-async":"^2.2.5","eslint":"^8.9.0","hock":"^1.4.1","mocha":"8.1.3","nyc":"^15.1.0","rimraf":"^3.0.2","split2":"^4.1.0","std-mocks":"^1.0.1","through2":"^4.0.2","winston-compat":"^0.1.5"},"main":"./lib/winston.js","browser":"./dist/winston","types":"./index.d.ts","scripts":{"lint":"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","test":"mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration","build":"rimraf dist && babel lib -d dist","prepublishOnly":"npm run build"},"engines":{"node":">= 12.0.0"},"license":"MIT"}')},function(e,t,n){Object.defineProperty(t,"Console",{configurable:!0,enumerable:!0,get:function(){return n(139)}}),Object.defineProperty(t,"File",{configurable:!0,enumerable:!0,get:function(){return n(152)}}),Object.defineProperty(t,"Http",{configurable:!0,enumerable:!0,get:function(){return n(193)}}),Object.defineProperty(t,"Stream",{configurable:!0,enumerable:!0,get:function(){return n(205)}})},function(e,t,n){(function(r){function o(S){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N})(S)}function l(S,N){if(!(S instanceof N))throw new TypeError("Cannot call a class as a function")}function u(S,N){for(var B=0;B<N.length;B++){var E=N[B];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}function s(S,N){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,E){return B.__proto__=E,B})(S,N)}function g(S){var N=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var B,E=d(S);if(N){var T=d(this).constructor;B=Reflect.construct(E,arguments,T)}else B=E.apply(this,arguments);return c(this,B)}}function c(S,N){if(N&&(o(N)==="object"||typeof N=="function"))return N;if(N!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}(S)}function d(S){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(N){return N.__proto__||Object.getPrototypeOf(N)})(S)}var w=n(16),v=n(3),y=v.LEVEL,f=v.MESSAGE,p=n(14);e.exports=function(S){(function(h,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(R&&R.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),Object.defineProperty(h,"prototype",{writable:!1}),R&&s(h,R)})(T,S);var N,B,E=g(T);function T(){var h,R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return l(this,T),(h=E.call(this,R)).name=R.name||"console",h.stderrLevels=h._stringArrayToSet(R.stderrLevels),h.consoleWarnLevels=h._stringArrayToSet(R.consoleWarnLevels),h.eol=typeof R.eol=="string"?R.eol:w.EOL,h.setMaxListeners(30),h}return N=T,(B=[{key:"log",value:function(h,R){var W=this;return r(function(){return W.emit("logged",h)}),this.stderrLevels[h[y]]?(console._stderr?console._stderr.write("".concat(h[f]).concat(this.eol)):console.error(h[f]),void(R&&R())):this.consoleWarnLevels[h[y]]?(console._stderr?console._stderr.write("".concat(h[f]).concat(this.eol)):console.warn(h[f]),void(R&&R())):(console._stdout?console._stdout.write("".concat(h[f]).concat(this.eol)):console.log(h[f]),void(R&&R()))}},{key:"_stringArrayToSet",value:function(h,R){if(!h)return{};if(R=R||"Cannot make set from type other than Array of string elements",!Array.isArray(h))throw new Error(R);return h.reduce(function(W,X){if(typeof X!="string")throw new Error(R);return W[X]=!0,W},{})}}])&&u(N.prototype,B),Object.defineProperty(N,"prototype",{writable:!1}),T}(p)}).call(this,n(19).setImmediate)},function(e,t,n){(function(r,o){(function(l,u){if(!l.setImmediate){var s,g,c,d,w,v=1,y={},f=!1,p=l.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(l);S=S&&S.setTimeout?S:l,{}.toString.call(l.process)==="[object process]"?s=function(E){o.nextTick(function(){B(E)})}:function(){if(l.postMessage&&!l.importScripts){var E=!0,T=l.onmessage;return l.onmessage=function(){E=!1},l.postMessage("","*"),l.onmessage=T,E}}()?(d="setImmediate$"+Math.random()+"$",w=function(E){E.source===l&&typeof E.data=="string"&&E.data.indexOf(d)===0&&B(+E.data.slice(d.length))},l.addEventListener?l.addEventListener("message",w,!1):l.attachEvent("onmessage",w),s=function(E){l.postMessage(d+E,"*")}):l.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){B(E.data)},s=function(E){c.port2.postMessage(E)}):p&&"onreadystatechange"in p.createElement("script")?(g=p.documentElement,s=function(E){var T=p.createElement("script");T.onreadystatechange=function(){B(E),T.onreadystatechange=null,g.removeChild(T),T=null},g.appendChild(T)}):s=function(E){setTimeout(B,0,E)},S.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var T=new Array(arguments.length-1),h=0;h<T.length;h++)T[h]=arguments[h+1];var R={callback:E,args:T};return y[v]=R,s(v),v++},S.clearImmediate=N}function N(E){delete y[E]}function B(E){if(f)setTimeout(B,0,E);else{var T=y[E];if(T){f=!0;try{(function(h){var R=h.callback,W=h.args;switch(W.length){case 0:R();break;case 1:R(W[0]);break;case 2:R(W[0],W[1]);break;case 3:R(W[0],W[1],W[2]);break;default:R.apply(void 0,W)}})(T)}finally{N(E),f=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,n(6),n(2))},function(e,t,n){t.byteLength=function(w){var v=c(w),y=v[0],f=v[1];return 3*(y+f)/4-f},t.toByteArray=function(w){for(var v,y=c(w),f=y[0],p=y[1],S=new l(function(T,h,R){return 3*(h+R)/4-R}(0,f,p)),N=0,B=p>0?f-4:f,E=0;E<B;E+=4)v=o[w.charCodeAt(E)]<<18|o[w.charCodeAt(E+1)]<<12|o[w.charCodeAt(E+2)]<<6|o[w.charCodeAt(E+3)],S[N++]=v>>16&255,S[N++]=v>>8&255,S[N++]=255&v;return p===2&&(v=o[w.charCodeAt(E)]<<2|o[w.charCodeAt(E+1)]>>4,S[N++]=255&v),p===1&&(v=o[w.charCodeAt(E)]<<10|o[w.charCodeAt(E+1)]<<4|o[w.charCodeAt(E+2)]>>2,S[N++]=v>>8&255,S[N++]=255&v),S},t.fromByteArray=function(w){for(var v,y=w.length,f=y%3,p=[],S=0,N=y-f;S<N;S+=16383)p.push(d(w,S,S+16383>N?N:S+16383));return f===1?(v=w[y-1],p.push(r[v>>2]+r[v<<4&63]+"==")):f===2&&(v=(w[y-2]<<8)+w[y-1],p.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),p.join("")};for(var r=[],o=[],l=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,g=u.length;s<g;++s)r[s]=u[s],o[u.charCodeAt(s)]=s;function c(w){var v=w.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=w.indexOf("=");return y===-1&&(y=v),[y,y===v?0:4-y%4]}function d(w,v,y){for(var f,p,S=[],N=v;N<y;N+=3)f=(w[N]<<16&16711680)+(w[N+1]<<8&65280)+(255&w[N+2]),S.push(r[(p=f)>>18&63]+r[p>>12&63]+r[p>>6&63]+r[63&p]);return S.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(n,r,o,l,u){var s,g,c=8*u-l-1,d=(1<<c)-1,w=d>>1,v=-7,y=o?u-1:0,f=o?-1:1,p=n[r+y];for(y+=f,s=p&(1<<-v)-1,p>>=-v,v+=c;v>0;s=256*s+n[r+y],y+=f,v-=8);for(g=s&(1<<-v)-1,s>>=-v,v+=l;v>0;g=256*g+n[r+y],y+=f,v-=8);if(s===0)s=1-w;else{if(s===d)return g?NaN:1/0*(p?-1:1);g+=Math.pow(2,l),s-=w}return(p?-1:1)*g*Math.pow(2,s-l)},t.write=function(n,r,o,l,u,s){var g,c,d,w=8*s-u-1,v=(1<<w)-1,y=v>>1,f=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=l?0:s-1,S=l?1:-1,N=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,g=v):(g=Math.floor(Math.log(r)/Math.LN2),r*(d=Math.pow(2,-g))<1&&(g--,d*=2),(r+=g+y>=1?f/d:f*Math.pow(2,1-y))*d>=2&&(g++,d/=2),g+y>=v?(c=0,g=v):g+y>=1?(c=(r*d-1)*Math.pow(2,u),g+=y):(c=r*Math.pow(2,y-1)*Math.pow(2,u),g=0));u>=8;n[o+p]=255&c,p+=S,c/=256,u-=8);for(g=g<<u|c,w+=u;w>0;n[o+p]=255&g,p+=S,g/=256,w-=8);n[o+p-S]|=128*N}},function(e,t,n){(function(r,o){var l;e.exports=b,b.ReadableState=m,n(20).EventEmitter;var u=function(k,x){return k.listeners(x).length},s=n(62),g=n(5).Buffer,c=(r!==void 0?r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},d,w=n(144);d=w&&w.debuglog?w.debuglog("stream"):function(){};var v,y,f,p=n(145),S=n(64),N=n(65).getHighWaterMark,B=n(35).codes,E=B.ERR_INVALID_ARG_TYPE,T=B.ERR_STREAM_PUSH_AFTER_EOF,h=B.ERR_METHOD_NOT_IMPLEMENTED,R=B.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7)(b,s);var W=S.errorOrDestroy,X=["error","close","destroy","pause","resume"];function m(k,x,_){l=l||n(36),k=k||{},typeof _!="boolean"&&(_=x instanceof l),this.objectMode=!!k.objectMode,_&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=N(this,k,"readableHighWaterMark",_),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(v||(v=n(21).StringDecoder),this.decoder=new v(k.encoding),this.encoding=k.encoding)}function b(k){if(l=l||n(36),!(this instanceof b))return new b(k);var x=this instanceof l;this._readableState=new m(k,this,x),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),s.call(this)}function G(k,x,_,I,$){d("readableAddChunk",x);var K,Y=k._readableState;if(x===null)Y.reading=!1,function(ne,ie){if(d("onEofChunk"),!ie.ended){if(ie.decoder){var ue=ie.decoder.end();ue&&ue.length&&(ie.buffer.push(ue),ie.length+=ie.objectMode?1:ue.length)}ie.ended=!0,ie.sync?z(ne):(ie.needReadable=!1,ie.emittedReadable||(ie.emittedReadable=!0,P(ne)))}}(k,Y);else if($||(K=function(ne,ie){var ue;we=ie,g.isBuffer(we)||we instanceof c||typeof ie=="string"||ie===void 0||ne.objectMode||(ue=new E("chunk",["string","Buffer","Uint8Array"],ie));var we;return ue}(Y,x)),K)W(k,K);else if(Y.objectMode||x&&x.length>0)if(typeof x=="string"||Y.objectMode||Object.getPrototypeOf(x)===g.prototype||(x=function(ne){return g.from(ne)}(x)),I)Y.endEmitted?W(k,new R):j(k,Y,x,!0);else if(Y.ended)W(k,new T);else{if(Y.destroyed)return!1;Y.reading=!1,Y.decoder&&!_?(x=Y.decoder.write(x),Y.objectMode||x.length!==0?j(k,Y,x,!1):D(k,Y)):j(k,Y,x,!1)}else I||(Y.reading=!1,D(k,Y));return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function j(k,x,_,I){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,k.emit("data",_)):(x.length+=x.objectMode?1:_.length,I?x.buffer.unshift(_):x.buffer.push(_),x.needReadable&&z(k)),D(k,x)}Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(k){this._readableState&&(this._readableState.destroyed=k)}}),b.prototype.destroy=S.destroy,b.prototype._undestroy=S.undestroy,b.prototype._destroy=function(k,x){x(k)},b.prototype.push=function(k,x){var _,I=this._readableState;return I.objectMode?_=!0:typeof k=="string"&&((x=x||I.defaultEncoding)!==I.encoding&&(k=g.from(k,x),x=""),_=!0),G(this,k,x,!1,_)},b.prototype.unshift=function(k){return G(this,k,null,!0,!1)},b.prototype.isPaused=function(){return this._readableState.flowing===!1},b.prototype.setEncoding=function(k){v||(v=n(21).StringDecoder);var x=new v(k);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var _=this._readableState.buffer.head,I="";_!==null;)I+=x.write(_.data),_=_.next;return this._readableState.buffer.clear(),I!==""&&this._readableState.buffer.push(I),this._readableState.length=I.length,this};function C(k,x){return k<=0||x.length===0&&x.ended?0:x.objectMode?1:k!=k?x.flowing&&x.length?x.buffer.head.data.length:x.length:(k>x.highWaterMark&&(x.highWaterMark=function(_){return _>=1073741824?_=1073741824:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}(k)),k<=x.length?k:x.ended?x.length:(x.needReadable=!0,0))}function z(k){var x=k._readableState;d("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(d("emitReadable",x.flowing),x.emittedReadable=!0,o.nextTick(P,k))}function P(k){var x=k._readableState;d("emitReadable_",x.destroyed,x.length,x.ended),x.destroyed||!x.length&&!x.ended||(k.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,V(k)}function D(k,x){x.readingMore||(x.readingMore=!0,o.nextTick(O,k,x))}function O(k,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var _=x.length;if(d("maybeReadMore read 0"),k.read(0),_===x.length)break}x.readingMore=!1}function L(k){var x=k._readableState;x.readableListening=k.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:k.listenerCount("data")>0&&k.resume()}function U(k){d("readable nexttick read 0"),k.read(0)}function A(k,x){d("resume",x.reading),x.reading||k.read(0),x.resumeScheduled=!1,k.emit("resume"),V(k),x.flowing&&!x.reading&&k.read(0)}function V(k){var x=k._readableState;for(d("flow",x.flowing);x.flowing&&k.read()!==null;);}function q(k,x){return x.length===0?null:(x.objectMode?_=x.buffer.shift():!k||k>=x.length?(_=x.decoder?x.buffer.join(""):x.buffer.length===1?x.buffer.first():x.buffer.concat(x.length),x.buffer.clear()):_=x.buffer.consume(k,x.decoder),_);var _}function Q(k){var x=k._readableState;d("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,o.nextTick(ee,x,k))}function ee(k,x){if(d("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,x.readable=!1,x.emit("end"),k.autoDestroy)){var _=x._writableState;(!_||_.autoDestroy&&_.finished)&&x.destroy()}}function te(k,x){for(var _=0,I=k.length;_<I;_++)if(k[_]===x)return _;return-1}b.prototype.read=function(k){d("read",k),k=parseInt(k,10);var x=this._readableState,_=k;if(k!==0&&(x.emittedReadable=!1),k===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return d("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Q(this):z(this),null;if((k=C(k,x))===0&&x.ended)return x.length===0&&Q(this),null;var I,$=x.needReadable;return d("need readable",$),(x.length===0||x.length-k<x.highWaterMark)&&d("length less than watermark",$=!0),x.ended||x.reading?d("reading or ended",$=!1):$&&(d("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(k=C(_,x))),(I=k>0?q(k,x):null)===null?(x.needReadable=x.length<=x.highWaterMark,k=0):(x.length-=k,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),_!==k&&x.ended&&Q(this)),I!==null&&this.emit("data",I),I},b.prototype._read=function(k){W(this,new h("_read()"))},b.prototype.pipe=function(k,x){var _=this,I=this._readableState;switch(I.pipesCount){case 0:I.pipes=k;break;case 1:I.pipes=[I.pipes,k];break;default:I.pipes.push(k)}I.pipesCount+=1,d("pipe count=%d opts=%j",I.pipesCount,x);var $=(!x||x.end!==!1)&&k!==o.stdout&&k!==o.stderr?Y:De;function K(Te,Ae){d("onunpipe"),Te===_&&Ae&&Ae.hasUnpiped===!1&&(Ae.hasUnpiped=!0,d("cleanup"),k.removeListener("close",Oe),k.removeListener("finish",Ee),k.removeListener("drain",ne),k.removeListener("error",we),k.removeListener("unpipe",K),_.removeListener("end",Y),_.removeListener("end",De),_.removeListener("data",ue),ie=!0,!I.awaitDrain||k._writableState&&!k._writableState.needDrain||ne())}function Y(){d("onend"),k.end()}I.endEmitted?o.nextTick($):_.once("end",$),k.on("unpipe",K);var ne=function(Te){return function(){var Ae=Te._readableState;d("pipeOnDrain",Ae.awaitDrain),Ae.awaitDrain&&Ae.awaitDrain--,Ae.awaitDrain===0&&u(Te,"data")&&(Ae.flowing=!0,V(Te))}}(_);k.on("drain",ne);var ie=!1;function ue(Te){d("ondata");var Ae=k.write(Te);d("dest.write",Ae),Ae===!1&&((I.pipesCount===1&&I.pipes===k||I.pipesCount>1&&te(I.pipes,k)!==-1)&&!ie&&(d("false write response, pause",I.awaitDrain),I.awaitDrain++),_.pause())}function we(Te){d("onerror",Te),De(),k.removeListener("error",we),u(k,"error")===0&&W(k,Te)}function Oe(){k.removeListener("finish",Ee),De()}function Ee(){d("onfinish"),k.removeListener("close",Oe),De()}function De(){d("unpipe"),_.unpipe(k)}return _.on("data",ue),function(Te,Ae,Ie){if(typeof Te.prependListener=="function")return Te.prependListener(Ae,Ie);Te._events&&Te._events[Ae]?Array.isArray(Te._events[Ae])?Te._events[Ae].unshift(Ie):Te._events[Ae]=[Ie,Te._events[Ae]]:Te.on(Ae,Ie)}(k,"error",we),k.once("close",Oe),k.once("finish",Ee),k.emit("pipe",_),I.flowing||(d("pipe resume"),_.resume()),k},b.prototype.unpipe=function(k){var x=this._readableState,_={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return k&&k!==x.pipes||(k||(k=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,k&&k.emit("unpipe",this,_)),this;if(!k){var I=x.pipes,$=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var K=0;K<$;K++)I[K].emit("unpipe",this,{hasUnpiped:!1});return this}var Y=te(x.pipes,k);return Y===-1||(x.pipes.splice(Y,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),k.emit("unpipe",this,_)),this},b.prototype.on=function(k,x){var _=s.prototype.on.call(this,k,x),I=this._readableState;return k==="data"?(I.readableListening=this.listenerCount("readable")>0,I.flowing!==!1&&this.resume()):k==="readable"&&(I.endEmitted||I.readableListening||(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,d("on readable",I.length,I.reading),I.length?z(this):I.reading||o.nextTick(U,this))),_},b.prototype.addListener=b.prototype.on,b.prototype.removeListener=function(k,x){var _=s.prototype.removeListener.call(this,k,x);return k==="readable"&&o.nextTick(L,this),_},b.prototype.removeAllListeners=function(k){var x=s.prototype.removeAllListeners.apply(this,arguments);return k!=="readable"&&k!==void 0||o.nextTick(L,this),x},b.prototype.resume=function(){var k=this._readableState;return k.flowing||(d("resume"),k.flowing=!k.readableListening,function(x,_){_.resumeScheduled||(_.resumeScheduled=!0,o.nextTick(A,x,_))}(this,k)),k.paused=!1,this},b.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},b.prototype.wrap=function(k){var x=this,_=this._readableState,I=!1;for(var $ in k.on("end",function(){if(d("wrapped end"),_.decoder&&!_.ended){var Y=_.decoder.end();Y&&Y.length&&x.push(Y)}x.push(null)}),k.on("data",function(Y){d("wrapped data"),_.decoder&&(Y=_.decoder.write(Y)),_.objectMode&&Y==null||(_.objectMode||Y&&Y.length)&&(x.push(Y)||(I=!0,k.pause()))}),k)this[$]===void 0&&typeof k[$]=="function"&&(this[$]=function(Y){return function(){return k[Y].apply(k,arguments)}}($));for(var K=0;K<X.length;K++)k.on(X[K],this.emit.bind(this,X[K]));return this._read=function(Y){d("wrapped _read",Y),I&&(I=!1,k.resume())},this},typeof Symbol=="function"&&(b.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=n(148)),y(this)}),Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(b.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(b.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(k){this._readableState&&(this._readableState.flowing=k)}}),b._fromList=q,Object.defineProperty(b.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(b.from=function(k,x){return f===void 0&&(f=n(150)),f(b,k,x)})}).call(this,n(6),n(2))},function(e,t){},function(e,t,n){function r(w,v){var y=Object.keys(w);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(w);v&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(w,p).enumerable})),y.push.apply(y,f)}return y}function o(w){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{};v%2?r(Object(y),!0).forEach(function(f){l(w,f,y[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(f){Object.defineProperty(w,f,Object.getOwnPropertyDescriptor(y,f))})}return w}function l(w,v,y){return(v=s(v))in w?Object.defineProperty(w,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):w[v]=y,w}function u(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,s(f.key),f)}}function s(w){var v=function(y,f){if(typeof y!="object"||y===null)return y;var p=y[Symbol.toPrimitive];if(p!==void 0){var S=p.call(y,f||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}(w,"string");return typeof v=="symbol"?v:String(v)}var g=n(5).Buffer,c=n(146).inspect,d=c&&c.custom||"inspect";e.exports=function(){function w(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,w),this.head=null,this.tail=null,this.length=0}var v,y;return v=w,(y=[{key:"push",value:function(f){var p={data:f,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(f){var p={data:f,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var p=this.head,S=""+p.data;p=p.next;)S+=f+p.data;return S}},{key:"concat",value:function(f){if(this.length===0)return g.alloc(0);for(var p,S,N,B=g.allocUnsafe(f>>>0),E=this.head,T=0;E;)p=E.data,S=B,N=T,g.prototype.copy.call(p,S,N),T+=E.data.length,E=E.next;return B}},{key:"consume",value:function(f,p){var S;return f<this.head.data.length?(S=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):S=f===this.head.data.length?this.shift():p?this._getString(f):this._getBuffer(f),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var p=this.head,S=1,N=p.data;for(f-=N.length;p=p.next;){var B=p.data,E=f>B.length?B.length:f;if(E===B.length?N+=B:N+=B.slice(0,f),(f-=E)==0){E===B.length?(++S,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=B.slice(E));break}++S}return this.length-=S,N}},{key:"_getBuffer",value:function(f){var p=g.allocUnsafe(f),S=this.head,N=1;for(S.data.copy(p),f-=S.data.length;S=S.next;){var B=S.data,E=f>B.length?B.length:f;if(B.copy(p,p.length-f,0,E),(f-=E)==0){E===B.length?(++N,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=B.slice(E));break}++N}return this.length-=N,p}},{key:d,value:function(f,p){return c(this,o(o({},p),{},{depth:0,customInspect:!1}))}}])&&u(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()},function(e,t){},function(e,t,n){var r=n(5),o=r.Buffer;function l(s,g){for(var c in s)g[c]=s[c]}function u(s,g,c){return o(s,g,c)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=u),l(o,u),u.from=function(s,g,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return o(s,g,c)},u.alloc=function(s,g,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var d=o(s);return g!==void 0?typeof c=="string"?d.fill(g,c):d.fill(g):d.fill(0),d},u.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return o(s)},u.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}},function(e,t,n){(function(r){var o;function l(E,T,h){return(T=function(R){var W=function(X,m){if(typeof X!="object"||X===null)return X;var b=X[Symbol.toPrimitive];if(b!==void 0){var G=b.call(X,m||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(X)}(R,"string");return typeof W=="symbol"?W:String(W)}(T))in E?Object.defineProperty(E,T,{value:h,enumerable:!0,configurable:!0,writable:!0}):E[T]=h,E}var u=n(149),s=Symbol("lastResolve"),g=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),w=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function f(E,T){return{value:E,done:T}}function p(E){var T=E[s];if(T!==null){var h=E[y].read();h!==null&&(E[w]=null,E[s]=null,E[g]=null,T(f(h,!1)))}}function S(E){r.nextTick(p,E)}var N=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((l(o={get stream(){return this[y]},next:function(){var E=this,T=this[c];if(T!==null)return Promise.reject(T);if(this[d])return Promise.resolve(f(void 0,!0));if(this[y].destroyed)return new Promise(function(X,m){r.nextTick(function(){E[c]?m(E[c]):X(f(void 0,!0))})});var h,R=this[w];if(R)h=new Promise(function(X,m){return function(b,G){X.then(function(){m[d]?b(f(void 0,!0)):m[v](b,G)},G)}}(R,this));else{var W=this[y].read();if(W!==null)return Promise.resolve(f(W,!1));h=new Promise(this[v])}return this[w]=h,h}},Symbol.asyncIterator,function(){return this}),l(o,"return",function(){var E=this;return new Promise(function(T,h){E[y].destroy(null,function(R){R?h(R):T(f(void 0,!0))})})}),o),N);e.exports=function(E){var T,h=Object.create(B,(l(T={},y,{value:E,writable:!0}),l(T,s,{value:null,writable:!0}),l(T,g,{value:null,writable:!0}),l(T,c,{value:null,writable:!0}),l(T,d,{value:E._readableState.endEmitted,writable:!0}),l(T,v,{value:function(R,W){var X=h[y].read();X?(h[w]=null,h[s]=null,h[g]=null,R(f(X,!1))):(h[s]=R,h[g]=W)},writable:!0}),T));return h[w]=null,u(E,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=h[g];return W!==null&&(h[w]=null,h[s]=null,h[g]=null,W(R)),void(h[c]=R)}var X=h[s];X!==null&&(h[w]=null,h[s]=null,h[g]=null,X(f(void 0,!0))),h[d]=!0}),E.on("readable",S.bind(null,h)),h}}).call(this,n(2))},function(e,t,n){var r=n(35).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function l(u,s,g){if(typeof s=="function")return l(u,null,s);s||(s={}),g=function(E){var T=!1;return function(){if(!T){T=!0;for(var h=arguments.length,R=new Array(h),W=0;W<h;W++)R[W]=arguments[W];E.apply(this,R)}}}(g||o);var c=s.readable||s.readable!==!1&&u.readable,d=s.writable||s.writable!==!1&&u.writable,w=function(){u.writable||y()},v=u._writableState&&u._writableState.finished,y=function(){d=!1,v=!0,c||g.call(u)},f=u._readableState&&u._readableState.endEmitted,p=function(){c=!1,f=!0,d||g.call(u)},S=function(E){g.call(u,E)},N=function(){var E;return c&&!f?(u._readableState&&u._readableState.ended||(E=new r),g.call(u,E)):d&&!v?(u._writableState&&u._writableState.ended||(E=new r),g.call(u,E)):void 0},B=function(){u.req.on("finish",y)};return function(E){return E.setHeader&&typeof E.abort=="function"}(u)?(u.on("complete",y),u.on("abort",N),u.req?B():u.on("request",B)):d&&!u._writableState&&(u.on("end",w),u.on("close",w)),u.on("end",p),u.on("finish",y),s.error!==!1&&u.on("error",S),u.on("close",N),function(){u.removeListener("complete",y),u.removeListener("abort",N),u.removeListener("request",B),u.req&&u.req.removeListener("finish",y),u.removeListener("end",w),u.removeListener("close",w),u.removeListener("finish",y),u.removeListener("end",p),u.removeListener("error",S),u.removeListener("close",N)}}},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){var r=n(13),o=n(3).LEVEL,l=n(14),u=e.exports=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");function g(c){this.emit("error",c,this.transport)}this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=g.bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(var c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([this.transport.name+" is a legacy winston transport. Consider upgrading: ","- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
56
+ `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){(function(r,o){function l(m){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(m)}function u(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}function s(m,b){for(var G=0;G<b.length;G++){var j=b[G];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(m,j.key,j)}}function g(m,b){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(G,j){return G.__proto__=j,G})(m,b)}function c(m){var b=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var G,j=v(m);if(b){var C=v(this).constructor;G=Reflect.construct(j,arguments,C)}else G=j.apply(this,arguments);return d(this,G)}}function d(m,b){if(b&&(l(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(m)}function w(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function v(m){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)})(m)}var y=n(66),f=n(55),p=n(153),S=n(163),N=n(3).MESSAGE,B=n(33),E=B.Stream,T=B.PassThrough,h=n(14),R=n(39)("winston:file"),W=n(16),X=n(192);e.exports=function(m){(function(z,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");z.prototype=Object.create(P&&P.prototype,{constructor:{value:z,writable:!0,configurable:!0}}),Object.defineProperty(z,"prototype",{writable:!1}),P&&g(z,P)})(C,m);var b,G,j=c(C);function C(){var z,P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function D(O){for(var L=arguments.length,U=new Array(L>1?L-1:0),A=1;A<L;A++)U[A-1]=arguments[A];U.slice(1).forEach(function(V){if(P[V])throw new Error("Cannot set ".concat(V," and ").concat(O," together"))})}if(u(this,C),(z=j.call(this,P)).name=P.name||"file",z._stream=new T,z._stream.setMaxListeners(30),z._onError=z._onError.bind(w(z)),P.filename||P.dirname)D("filename or dirname","stream"),z._basename=z.filename=P.filename?f.basename(P.filename):"winston.log",z.dirname=P.dirname||f.dirname(P.filename),z.options=P.options||{flags:"a"};else{if(!P.stream)throw new Error("Cannot log to file without filename or stream.");console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),D("stream","filename","maxsize"),z._dest=z._stream.pipe(z._setupStream(P.stream)),z.dirname=f.dirname(z._dest.path)}return z.maxsize=P.maxsize||null,z.rotationFormat=P.rotationFormat||!1,z.zippedArchive=P.zippedArchive||!1,z.maxFiles=P.maxFiles||null,z.eol=typeof P.eol=="string"?P.eol:W.EOL,z.tailable=P.tailable||!1,z._size=0,z._pendingSize=0,z._created=0,z._drain=!1,z._opening=!1,z._ending=!1,z.dirname&&z._createLogDirIfNotExist(z.dirname),z.open(),z}return b=C,(G=[{key:"finishIfEnding",value:function(){var z=this;this._ending&&(this._opening?this.once("open",function(){z._stream.once("finish",function(){return z.emit("finish")}),r(function(){return z._stream.end()})}):(this._stream.once("finish",function(){return z.emit("finish")}),r(function(){return z._stream.end()})))}},{key:"log",value:function(z){var P=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return D(),!0;if(this._drain)this._stream.once("drain",function(){P._drain=!1,P.log(z,D)});else{if(!this._rotate){var O="".concat(z[N]).concat(this.eol),L=o.byteLength(O);this._pendingSize+=L,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var U=this._stream.write(O,A.bind(this));return U?D():(this._drain=!0,this._stream.once("drain",function(){P._drain=!1,D()})),R("written",U,this._drain),this.finishIfEnding(),U}this._stream.once("rotate",function(){P._rotate=!1,P.log(z,D)})}function A(){var V=this;this._size+=L,this._pendingSize-=L,R("logged %s %s",this._size,O),this.emit("logged",z),this._opening||this._needsNewFile()&&(this._rotate=!0,this._endStream(function(){return V._rotateFile()}))}}},{key:"query",value:function(z,P){typeof z=="function"&&(P=z,z={}),z=function(q){return(q=q||{}).rows=q.rows||q.limit||10,q.start=q.start||0,q.until=q.until||new Date,l(q.until)!=="object"&&(q.until=new Date(q.until)),q.from=q.from||q.until-864e5,l(q.from)!=="object"&&(q.from=new Date(q.from)),q.order=q.order||"desc",q}(z);var D=f.join(this.dirname,this.filename),O="",L=[],U=0,A=y.createReadStream(D,{encoding:"utf8"});function V(q,Q){try{var ee=JSON.parse(q);(function(te){if(te&&l(te)==="object"){var k=new Date(te.timestamp);if(!(z.from&&k<z.from||z.until&&k>z.until||z.level&&z.level!==te.level))return!0}})(ee)&&function(te){z.rows&&L.length>=z.rows&&z.order!=="desc"?A.readable&&A.destroy():(z.fields&&(te=z.fields.reduce(function(k,x){return k[x]=te[x],k},{})),z.order==="desc"&&L.length>=z.rows&&L.shift(),L.push(te))}(ee)}catch(te){Q||A.emit("error",te)}}A.on("error",function(q){if(A.readable&&A.destroy(),P)return q.code!=="ENOENT"?P(q):P(null,L)}),A.on("data",function(q){for(var Q=(q=(O+q).split(/\n+/)).length-1,ee=0;ee<Q;ee++)(!z.start||U>=z.start)&&V(q[ee]),U++;O=q[Q]}),A.on("close",function(){O&&V(O,!0),z.order==="desc"&&(L=L.reverse()),P&&P(null,L)})}},{key:"stream",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},P=f.join(this.dirname,this.filename),D=new E,O={file:P,start:z.start};return D.destroy=X(O,function(L,U){if(L)return D.emit("error",L);try{D.emit("data",U),U=JSON.parse(U),D.emit("log",U)}catch(A){D.emit("error",A)}}),D}},{key:"open",value:function(){var z=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(P,D){if(P)return z.emit("error",P);R("stat done: %s { size: %s }",z.filename,D),z._size=D,z._dest=z._createStream(z._stream),z._opening=!1,z.once("open",function(){z._stream.eventNames().includes("rotate")?z._stream.emit("rotate"):z._rotate=!1})})))}},{key:"stat",value:function(z){var P=this,D=this._getFile(),O=f.join(this.dirname,D);y.stat(O,function(L,U){return L&&L.code==="ENOENT"?(R("ENOENT ok",O),P.filename=D,z(null,0)):L?(R("err ".concat(L.code," ").concat(O)),z(L)):!U||P._needsNewFile(U.size)?P._incFile(function(){return P.stat(z)}):(P.filename=D,void z(null,U.size))})}},{key:"close",value:function(z){var P=this;this._stream&&this._stream.end(function(){z&&z(),P.emit("flush"),P.emit("closed")})}},{key:"_needsNewFile",value:function(z){return z=z||this._size,this.maxsize&&z>=this.maxsize}},{key:"_onError",value:function(z){this.emit("error",z)}},{key:"_setupStream",value:function(z){return z.on("error",this._onError),z}},{key:"_cleanupStream",value:function(z){return z.removeListener("error",this._onError),z}},{key:"_rotateFile",value:function(){var z=this;this._incFile(function(){return z.open()})}},{key:"_endStream",value:function(){var z=this,P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){z._cleanupStream(z._dest),P()})):P()}},{key:"_createStream",value:function(z){var P=this,D=f.join(this.dirname,this.filename);R("create stream start",D,this.options);var O=y.createWriteStream(D,this.options).on("error",function(U){return R(U)}).on("close",function(){return R("close",O.path,O.bytesWritten)}).on("open",function(){R("file open ok",D),P.emit("open",D),z.pipe(O),P.rotatedWhileOpening&&(P._stream=new T,P._stream.setMaxListeners(30),P._rotateFile(),P.rotatedWhileOpening=!1,P._cleanupStream(O),z.end())});if(R("create stream ok",D),this.zippedArchive){var L=S.createGzip();return L.pipe(O),L}return O}},{key:"_incFile",value:function(z){R("_incFile",this.filename);var P=f.extname(this._basename),D=f.basename(this._basename,P);this.tailable?this._checkMaxFilesTailable(P,D,z):(this._created+=1,this._checkMaxFilesIncrementing(P,D,z))}},{key:"_getFile",value:function(){var z=f.extname(this._basename),P=f.basename(this._basename,z),D=this.rotationFormat?this.rotationFormat():this._created,O=!this.tailable&&this._created?"".concat(P).concat(D).concat(z):"".concat(P).concat(z);return this.zippedArchive&&!this.tailable?"".concat(O,".gz"):O}},{key:"_checkMaxFilesIncrementing",value:function(z,P,D){if(!this.maxFiles||this._created<this.maxFiles)return r(D);var O=this._created-this.maxFiles,L=O!==0?O:"",U=this.zippedArchive?".gz":"",A="".concat(P).concat(L).concat(z).concat(U),V=f.join(this.dirname,A);y.unlink(V,D)}},{key:"_checkMaxFilesTailable",value:function(z,P,D){var O=this,L=[];if(this.maxFiles){for(var U=this.zippedArchive?".gz":"",A=this.maxFiles-1;A>1;A--)L.push((function(V,q){var Q=this,ee="".concat(P).concat(V-1).concat(z).concat(U),te=f.join(this.dirname,ee);y.exists(te,function(k){if(!k)return q(null);ee="".concat(P).concat(V).concat(z).concat(U),y.rename(te,f.join(Q.dirname,ee),q)})}).bind(this,A));p(L,function(){y.rename(f.join(O.dirname,"".concat(P).concat(z)),f.join(O.dirname,"".concat(P,"1").concat(z).concat(U)),D)})}}},{key:"_createLogDirIfNotExist",value:function(z){y.existsSync(z)||y.mkdirSync(z,{recursive:!0})}}])&&s(b.prototype,G),Object.defineProperty(b,"prototype",{writable:!1}),C}(h)}).call(this,n(19).setImmediate,n(5).Buffer)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s){return(0,r.default)(o.default,u,s)};var r=l(n(154)),o=l(n(158));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(44)),o=u(n(23)),l=u(n(30));function u(s){return s&&s.__esModule?s:{default:s}}t.default=(0,l.default)((s,g,c)=>{var d=(0,r.default)(g)?[]:{};s(g,(w,v,y)=>{(0,o.default)(w)((f,...p)=>{p.length<2&&([p]=p),d[v]=p,y(f)})},w=>c(w,d))},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(c){return(0,l.isAsync)(c)?function(...d){const w=d.pop();return s(c.apply(this,d),w)}:(0,r.default)(function(d,w){var v;try{v=c.apply(this,d)}catch(y){return w(y)}if(v&&typeof v.then=="function")return s(v,w);w(null,v)})};var r=u(n(156)),o=u(n(157)),l=n(23);function u(c){return c&&c.__esModule?c:{default:c}}function s(c,d){return c.then(w=>{g(d,null,w)},w=>{g(d,w&&w.message?w:new Error(w))})}function g(c,d,w){try{c(d,w)}catch(v){(0,o.default)(y=>{throw y},v)}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return function(...o){var l=o.pop();return r.call(this,o,l)}},e.exports=t.default},function(e,t,n){(function(r,o){Object.defineProperty(t,"__esModule",{value:!0}),t.fallback=c,t.wrap=d;var l,u=t.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,s=t.hasSetImmediate=typeof r=="function"&&r,g=t.hasNextTick=typeof o=="object"&&typeof o.nextTick=="function";function c(w){setTimeout(w,0)}function d(w){return(v,...y)=>w(()=>v(...y))}l=u?queueMicrotask:s?r:g?o.nextTick:c,t.default=d(l)}).call(this,n(19).setImmediate,n(2))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(67)),o=l(n(30));function l(u){return u&&u.__esModule?u:{default:u}}t.default=(0,o.default)(function(u,s,g){return(0,r.default)(u,1,s,g)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(68)),o=c(n(160)),l=c(n(69)),u=n(23),s=c(n(162)),g=c(n(45));function c(d){return d&&d.__esModule?d:{default:d}}t.default=d=>(w,v,y)=>{if(y=(0,r.default)(y),d<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!w)return y(null);if((0,u.isAsyncGenerator)(w))return(0,s.default)(w,d,v,y);if((0,u.isAsyncIterable)(w))return(0,s.default)(w[Symbol.asyncIterator](),d,v,y);var f=(0,o.default)(w),p=!1,S=!1,N=0,B=!1;function E(h,R){if(!S)if(N-=1,h)p=!0,y(h);else if(h===!1)p=!0,S=!0;else{if(R===g.default||p&&N<=0)return p=!0,y(null);B||T()}}function T(){for(B=!0;N<d&&!p;){var h=f();if(h===null)return p=!0,void(N<=0&&y(null));N+=1,v(h.value,h.key,(0,l.default)(E))}B=!1}T()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u){if((0,r.default)(u))return function(v){var y=-1,f=v.length;return function(){return++y<f?{value:v[y],key:y}:null}}(u);var s=(0,o.default)(u);return s?function(v){var y=-1;return function(){var f=v.next();return f.done?null:(y++,{value:f.value,key:y})}}(s):(g=u,c=g?Object.keys(g):[],d=-1,w=c.length,function v(){var y=c[++d];return y==="__proto__"?v():d<w?{value:g[y],key:y}:null});var g,c,d,w};var r=l(n(44)),o=l(n(161));function l(u){return u&&u.__esModule?u:{default:u}}e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()},e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(u,s,g,c){let d=!1,w=!1,v=!1,y=0,f=0;function p(){y>=s||v||d||(v=!0,u.next().then(({value:B,done:E})=>{if(!w&&!d){if(v=!1,E)return d=!0,void(y<=0&&c(null));y++,g(B,f,S),f++,p()}}).catch(N))}function S(B,E){if(y-=1,!w)return B?N(B):B===!1?(d=!0,void(w=!0)):E===l.default||d&&y<=0?(d=!0,c(null)):void p()}function N(B){w||(v=!1,d=!0,c(B))}p()};var r,o=n(45),l=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,n){(function(r){var o=n(5).Buffer,l=n(164).Transform,u=n(173),s=n(13),g=n(74).ok,c=n(5).kMaxLength,d="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";u.Z_MIN_WINDOWBITS=8,u.Z_MAX_WINDOWBITS=15,u.Z_DEFAULT_WINDOWBITS=15,u.Z_MIN_CHUNK=64,u.Z_MAX_CHUNK=1/0,u.Z_DEFAULT_CHUNK=16384,u.Z_MIN_MEMLEVEL=1,u.Z_MAX_MEMLEVEL=9,u.Z_DEFAULT_MEMLEVEL=8,u.Z_MIN_LEVEL=-1,u.Z_MAX_LEVEL=9,u.Z_DEFAULT_LEVEL=u.Z_DEFAULT_COMPRESSION;for(var w=Object.keys(u),v=0;v<w.length;v++){var y=w[v];y.match(/^Z/)&&Object.defineProperty(t,y,{enumerable:!0,value:u[y],writable:!1})}for(var f={Z_OK:u.Z_OK,Z_STREAM_END:u.Z_STREAM_END,Z_NEED_DICT:u.Z_NEED_DICT,Z_ERRNO:u.Z_ERRNO,Z_STREAM_ERROR:u.Z_STREAM_ERROR,Z_DATA_ERROR:u.Z_DATA_ERROR,Z_MEM_ERROR:u.Z_MEM_ERROR,Z_BUF_ERROR:u.Z_BUF_ERROR,Z_VERSION_ERROR:u.Z_VERSION_ERROR},p=Object.keys(f),S=0;S<p.length;S++){var N=p[S];f[f[N]]=N}function B(P,D,O){var L=[],U=0;function A(){for(var q;(q=P.read())!==null;)L.push(q),U+=q.length;P.once("readable",A)}function V(){var q,Q=null;U>=c?Q=new RangeError(d):q=o.concat(L,U),L=[],P.close(),O(Q,q)}P.on("error",function(q){P.removeListener("end",V),P.removeListener("readable",A),O(q)}),P.on("end",V),P.end(D),A()}function E(P,D){if(typeof D=="string"&&(D=o.from(D)),!o.isBuffer(D))throw new TypeError("Not a string or buffer");var O=P._finishFlushFlag;return P._processChunk(D,O)}function T(P){if(!(this instanceof T))return new T(P);j.call(this,P,u.DEFLATE)}function h(P){if(!(this instanceof h))return new h(P);j.call(this,P,u.INFLATE)}function R(P){if(!(this instanceof R))return new R(P);j.call(this,P,u.GZIP)}function W(P){if(!(this instanceof W))return new W(P);j.call(this,P,u.GUNZIP)}function X(P){if(!(this instanceof X))return new X(P);j.call(this,P,u.DEFLATERAW)}function m(P){if(!(this instanceof m))return new m(P);j.call(this,P,u.INFLATERAW)}function b(P){if(!(this instanceof b))return new b(P);j.call(this,P,u.UNZIP)}function G(P){return P===u.Z_NO_FLUSH||P===u.Z_PARTIAL_FLUSH||P===u.Z_SYNC_FLUSH||P===u.Z_FULL_FLUSH||P===u.Z_FINISH||P===u.Z_BLOCK}function j(P,D){var O=this;if(this._opts=P=P||{},this._chunkSize=P.chunkSize||t.Z_DEFAULT_CHUNK,l.call(this,P),P.flush&&!G(P.flush))throw new Error("Invalid flush flag: "+P.flush);if(P.finishFlush&&!G(P.finishFlush))throw new Error("Invalid flush flag: "+P.finishFlush);if(this._flushFlag=P.flush||u.Z_NO_FLUSH,this._finishFlushFlag=P.finishFlush!==void 0?P.finishFlush:u.Z_FINISH,P.chunkSize&&(P.chunkSize<t.Z_MIN_CHUNK||P.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+P.chunkSize);if(P.windowBits&&(P.windowBits<t.Z_MIN_WINDOWBITS||P.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+P.windowBits);if(P.level&&(P.level<t.Z_MIN_LEVEL||P.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+P.level);if(P.memLevel&&(P.memLevel<t.Z_MIN_MEMLEVEL||P.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+P.memLevel);if(P.strategy&&P.strategy!=t.Z_FILTERED&&P.strategy!=t.Z_HUFFMAN_ONLY&&P.strategy!=t.Z_RLE&&P.strategy!=t.Z_FIXED&&P.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+P.strategy);if(P.dictionary&&!o.isBuffer(P.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new u.Zlib(D);var L=this;this._hadError=!1,this._handle.onerror=function(V,q){C(L),L._hadError=!0;var Q=new Error(V);Q.errno=q,Q.code=t.codes[q],L.emit("error",Q)};var U=t.Z_DEFAULT_COMPRESSION;typeof P.level=="number"&&(U=P.level);var A=t.Z_DEFAULT_STRATEGY;typeof P.strategy=="number"&&(A=P.strategy),this._handle.init(P.windowBits||t.Z_DEFAULT_WINDOWBITS,U,P.memLevel||t.Z_DEFAULT_MEMLEVEL,A,P.dictionary),this._buffer=o.allocUnsafe(this._chunkSize),this._offset=0,this._level=U,this._strategy=A,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!O._handle},configurable:!0,enumerable:!0})}function C(P,D){D&&r.nextTick(D),P._handle&&(P._handle.close(),P._handle=null)}function z(P){P.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),t.Deflate=T,t.Inflate=h,t.Gzip=R,t.Gunzip=W,t.DeflateRaw=X,t.InflateRaw=m,t.Unzip=b,t.createDeflate=function(P){return new T(P)},t.createInflate=function(P){return new h(P)},t.createDeflateRaw=function(P){return new X(P)},t.createInflateRaw=function(P){return new m(P)},t.createGzip=function(P){return new R(P)},t.createGunzip=function(P){return new W(P)},t.createUnzip=function(P){return new b(P)},t.deflate=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new T(D),P,O)},t.deflateSync=function(P,D){return E(new T(D),P)},t.gzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new R(D),P,O)},t.gzipSync=function(P,D){return E(new R(D),P)},t.deflateRaw=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new X(D),P,O)},t.deflateRawSync=function(P,D){return E(new X(D),P)},t.unzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new b(D),P,O)},t.unzipSync=function(P,D){return E(new b(D),P)},t.inflate=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new h(D),P,O)},t.inflateSync=function(P,D){return E(new h(D),P)},t.gunzip=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new W(D),P,O)},t.gunzipSync=function(P,D){return E(new W(D),P)},t.inflateRaw=function(P,D,O){return typeof D=="function"&&(O=D,D={}),B(new m(D),P,O)},t.inflateRawSync=function(P,D){return E(new m(D),P)},s.inherits(j,l),j.prototype.params=function(P,D,O){if(P<t.Z_MIN_LEVEL||P>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+P);if(D!=t.Z_FILTERED&&D!=t.Z_HUFFMAN_ONLY&&D!=t.Z_RLE&&D!=t.Z_FIXED&&D!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+D);if(this._level!==P||this._strategy!==D){var L=this;this.flush(u.Z_SYNC_FLUSH,function(){g(L._handle,"zlib binding closed"),L._handle.params(P,D),L._hadError||(L._level=P,L._strategy=D,O&&O())})}else r.nextTick(O)},j.prototype.reset=function(){return g(this._handle,"zlib binding closed"),this._handle.reset()},j.prototype._flush=function(P){this._transform(o.alloc(0),"",P)},j.prototype.flush=function(P,D){var O=this,L=this._writableState;(typeof P=="function"||P===void 0&&!D)&&(D=P,P=u.Z_FULL_FLUSH),L.ended?D&&r.nextTick(D):L.ending?D&&this.once("end",D):L.needDrain?D&&this.once("drain",function(){return O.flush(P,D)}):(this._flushFlag=P,this.write(o.alloc(0),"",D))},j.prototype.close=function(P){C(this,P),r.nextTick(z,this)},j.prototype._transform=function(P,D,O){var L,U=this._writableState,A=(U.ending||U.ended)&&(!P||U.length===P.length);return P===null||o.isBuffer(P)?this._handle?(A?L=this._finishFlushFlag:(L=this._flushFlag,P.length>=U.length&&(this._flushFlag=this._opts.flush||u.Z_NO_FLUSH)),void this._processChunk(P,L,O)):O(new Error("zlib binding closed")):O(new Error("invalid input"))},j.prototype._processChunk=function(P,D,O){var L=P&&P.length,U=this._chunkSize-this._offset,A=0,V=this,q=typeof O=="function";if(!q){var Q,ee=[],te=0;this.on("error",function($){Q=$}),g(this._handle,"zlib binding closed");do var k=this._handle.writeSync(D,P,A,L,this._buffer,this._offset,U);while(!this._hadError&&I(k[0],k[1]));if(this._hadError)throw Q;if(te>=c)throw C(this),new RangeError(d);var x=o.concat(ee,te);return C(this),x}g(this._handle,"zlib binding closed");var _=this._handle.write(D,P,A,L,this._buffer,this._offset,U);function I($,K){if(this&&(this.buffer=null,this.callback=null),!V._hadError){var Y=U-K;if(g(Y>=0,"have should not go down"),Y>0){var ne=V._buffer.slice(V._offset,V._offset+Y);V._offset+=Y,q?V.push(ne):(ee.push(ne),te+=ne.length)}if((K===0||V._offset>=V._chunkSize)&&(U=V._chunkSize,V._offset=0,V._buffer=o.allocUnsafe(V._chunkSize)),K===0){if(A+=L-$,L=$,!q)return!0;var ie=V._handle.write(D,P,A,L,V._buffer,V._offset,V._chunkSize);return ie.callback=I,void(ie.buffer=P)}if(!q)return!1;O()}}_.buffer=P,_.callback=I},s.inherits(T,j),s.inherits(h,j),s.inherits(R,j),s.inherits(W,j),s.inherits(X,j),s.inherits(m,j),s.inherits(b,j)}).call(this,n(2))},function(e,t,n){e.exports=o;var r=n(20).EventEmitter;function o(){r.call(this)}n(7)(o,r),o.Readable=n(31),o.Writable=n(169),o.Duplex=n(170),o.Transform=n(171),o.PassThrough=n(172),o.Stream=o,o.prototype.pipe=function(l,u){var s=this;function g(p){l.writable&&l.write(p)===!1&&s.pause&&s.pause()}function c(){s.readable&&s.resume&&s.resume()}s.on("data",g),l.on("drain",c),l._isStdio||u&&u.end===!1||(s.on("end",w),s.on("close",v));var d=!1;function w(){d||(d=!0,l.end())}function v(){d||(d=!0,typeof l.destroy=="function"&&l.destroy())}function y(p){if(f(),r.listenerCount(this,"error")===0)throw p}function f(){s.removeListener("data",g),l.removeListener("drain",c),s.removeListener("end",w),s.removeListener("close",v),s.removeListener("error",y),l.removeListener("error",y),s.removeListener("end",f),s.removeListener("close",f),l.removeListener("close",f)}return s.on("error",y),l.on("error",y),s.on("end",f),s.on("close",f),l.on("close",f),l.emit("pipe",s),l}},function(e,t){},function(e,t,n){var r=n(46).Buffer,o=n(167);e.exports=function(){function l(){(function(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")})(this,l),this.head=null,this.tail=null,this.length=0}return l.prototype.push=function(u){var s={data:u,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},l.prototype.unshift=function(u){var s={data:u,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},l.prototype.shift=function(){if(this.length!==0){var u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}},l.prototype.clear=function(){this.head=this.tail=null,this.length=0},l.prototype.join=function(u){if(this.length===0)return"";for(var s=this.head,g=""+s.data;s=s.next;)g+=u+s.data;return g},l.prototype.concat=function(u){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var s,g,c,d=r.allocUnsafe(u>>>0),w=this.head,v=0;w;)s=w.data,g=d,c=v,s.copy(g,c),v+=w.data.length,w=w.next;return d},l}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var l=o.inspect({length:this.length});return this.constructor.name+" "+l})},function(e,t){},function(e,t,n){e.exports=l;var r=n(73),o=Object.create(n(32));function l(u){if(!(this instanceof l))return new l(u);r.call(this,u)}o.inherits=n(7),o.inherits(l,r),l.prototype._transform=function(u,s,g){g(null,u)}},function(e,t,n){e.exports=n(47)},function(e,t,n){e.exports=n(22)},function(e,t,n){e.exports=n(31).Transform},function(e,t,n){e.exports=n(31).PassThrough},function(e,t,n){(function(r,o){var l=n(74),u=n(175),s=n(176),g=n(179),c=n(182);for(var d in c)t[d]=c[d];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function w(v){if(typeof v!="number"||v<t.DEFLATE||v>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=v,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}w.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,l(this.init_done,"close before init"),l(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||g.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},w.prototype.write=function(v,y,f,p,S,N,B){return this._write(!0,v,y,f,p,S,N,B)},w.prototype.writeSync=function(v,y,f,p,S,N,B){return this._write(!1,v,y,f,p,S,N,B)},w.prototype._write=function(v,y,f,p,S,N,B,E){if(l.equal(arguments.length,8),l(this.init_done,"write before init"),l(this.mode!==t.NONE,"already finalized"),l.equal(!1,this.write_in_progress,"write already in progress"),l.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,l.equal(!1,y===void 0,"must provide flush value"),this.write_in_progress=!0,y!==t.Z_NO_FLUSH&&y!==t.Z_PARTIAL_FLUSH&&y!==t.Z_SYNC_FLUSH&&y!==t.Z_FULL_FLUSH&&y!==t.Z_FINISH&&y!==t.Z_BLOCK)throw new Error("Invalid flush value");if(f==null&&(f=r.alloc(0),S=0,p=0),this.strm.avail_in=S,this.strm.input=f,this.strm.next_in=p,this.strm.avail_out=E,this.strm.output=N,this.strm.next_out=B,this.flush=y,!v)return this._process(),this._checkError()?this._afterSync():void 0;var T=this;return o.nextTick(function(){T._process(),T._after()}),this},w.prototype._afterSync=function(){var v=this.strm.avail_out,y=this.strm.avail_in;return this.write_in_progress=!1,[y,v]},w.prototype._process=function(){var v=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(v=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(v===null)break;if(this.strm.input[v]!==31){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,v++,this.strm.avail_in===1)break;case 1:if(v===null)break;this.strm.input[v]===139?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=g.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=g.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=g.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=g.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},w.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},w.prototype._after=function(){if(this._checkError()){var v=this.strm.avail_out,y=this.strm.avail_in;this.write_in_progress=!1,this.callback(y,v),this.pending_close&&this.close()}},w.prototype._error=function(v){this.strm.msg&&(v=this.strm.msg),this.onerror(v,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},w.prototype.init=function(v,y,f,p,S){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),l(v>=8&&v<=15,"invalid windowBits"),l(y>=-1&&y<=9,"invalid compression level"),l(f>=1&&f<=9,"invalid memlevel"),l(p===t.Z_FILTERED||p===t.Z_HUFFMAN_ONLY||p===t.Z_RLE||p===t.Z_FIXED||p===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(y,v,f,p,S),this._setDictionary()},w.prototype.params=function(){throw new Error("deflateParams Not supported")},w.prototype.reset=function(){this._reset(),this._setDictionary()},w.prototype._init=function(v,y,f,p,S){switch(this.level=v,this.windowBits=y,this.memLevel=f,this.strategy=p,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new u,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=g.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=S,this.write_in_progress=!1,this.init_done=!0},w.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},w.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=g.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=w}).call(this,n(5).Buffer,n(2))},function(e,t,n){var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function u(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}e.exports=function(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var g={},c=0;c<10;c++)g["_"+String.fromCharCode(c)]=c;if(Object.getOwnPropertyNames(g).map(function(w){return g[w]}).join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(w){d[w]=w}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(s,g){for(var c,d,w=u(s),v=1;v<arguments.length;v++){for(var y in c=Object(arguments[v]))o.call(c,y)&&(w[y]=c[y]);if(r){d=r(c);for(var f=0;f<d.length;f++)l.call(c,d[f])&&(w[d[f]]=c[d[f]])}}return w}},function(e,t,n){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){var r,o=n(38),l=n(177),u=n(75),s=n(76),g=n(178);function c(m,b){return m.msg=g[b],b}function d(m){return(m<<1)-(m>4?9:0)}function w(m){for(var b=m.length;--b>=0;)m[b]=0}function v(m){var b=m.state,G=b.pending;G>m.avail_out&&(G=m.avail_out),G!==0&&(o.arraySet(m.output,b.pending_buf,b.pending_out,G,m.next_out),m.next_out+=G,b.pending_out+=G,m.total_out+=G,m.avail_out-=G,b.pending-=G,b.pending===0&&(b.pending_out=0))}function y(m,b){l._tr_flush_block(m,m.block_start>=0?m.block_start:-1,m.strstart-m.block_start,b),m.block_start=m.strstart,v(m.strm)}function f(m,b){m.pending_buf[m.pending++]=b}function p(m,b){m.pending_buf[m.pending++]=b>>>8&255,m.pending_buf[m.pending++]=255&b}function S(m,b){var G,j,C=m.max_chain_length,z=m.strstart,P=m.prev_length,D=m.nice_match,O=m.strstart>m.w_size-262?m.strstart-(m.w_size-262):0,L=m.window,U=m.w_mask,A=m.prev,V=m.strstart+258,q=L[z+P-1],Q=L[z+P];m.prev_length>=m.good_match&&(C>>=2),D>m.lookahead&&(D=m.lookahead);do if(L[(G=b)+P]===Q&&L[G+P-1]===q&&L[G]===L[z]&&L[++G]===L[z+1]){z+=2,G++;do;while(L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&L[++z]===L[++G]&&z<V);if(j=258-(V-z),z=V-258,j>P){if(m.match_start=b,P=j,j>=D)break;q=L[z+P-1],Q=L[z+P]}}while((b=A[b&U])>O&&--C!=0);return P<=m.lookahead?P:m.lookahead}function N(m){var b,G,j,C,z,P,D,O,L,U,A=m.w_size;do{if(C=m.window_size-m.lookahead-m.strstart,m.strstart>=A+(A-262)){o.arraySet(m.window,m.window,A,A,0),m.match_start-=A,m.strstart-=A,m.block_start-=A,b=G=m.hash_size;do j=m.head[--b],m.head[b]=j>=A?j-A:0;while(--G);b=G=A;do j=m.prev[--b],m.prev[b]=j>=A?j-A:0;while(--G);C+=A}if(m.strm.avail_in===0)break;if(P=m.strm,D=m.window,O=m.strstart+m.lookahead,L=C,U=void 0,(U=P.avail_in)>L&&(U=L),G=U===0?0:(P.avail_in-=U,o.arraySet(D,P.input,P.next_in,U,O),P.state.wrap===1?P.adler=u(P.adler,D,U,O):P.state.wrap===2&&(P.adler=s(P.adler,D,U,O)),P.next_in+=U,P.total_in+=U,U),m.lookahead+=G,m.lookahead+m.insert>=3)for(z=m.strstart-m.insert,m.ins_h=m.window[z],m.ins_h=(m.ins_h<<m.hash_shift^m.window[z+1])&m.hash_mask;m.insert&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[z+3-1])&m.hash_mask,m.prev[z&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=z,z++,m.insert--,!(m.lookahead+m.insert<3)););}while(m.lookahead<262&&m.strm.avail_in!==0)}function B(m,b){for(var G,j;;){if(m.lookahead<262){if(N(m),m.lookahead<262&&b===0)return 1;if(m.lookahead===0)break}if(G=0,m.lookahead>=3&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),G!==0&&m.strstart-G<=m.w_size-262&&(m.match_length=S(m,G)),m.match_length>=3)if(j=l._tr_tally(m,m.strstart-m.match_start,m.match_length-3),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=3){m.match_length--;do m.strstart++,m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart;while(--m.match_length!=0);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+1])&m.hash_mask;else j=l._tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(j&&(y(m,!1),m.strm.avail_out===0))return 1}return m.insert=m.strstart<2?m.strstart:2,b===4?(y(m,!0),m.strm.avail_out===0?3:4):m.last_lit&&(y(m,!1),m.strm.avail_out===0)?1:2}function E(m,b){for(var G,j,C;;){if(m.lookahead<262){if(N(m),m.lookahead<262&&b===0)return 1;if(m.lookahead===0)break}if(G=0,m.lookahead>=3&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=2,G!==0&&m.prev_length<m.max_lazy_match&&m.strstart-G<=m.w_size-262&&(m.match_length=S(m,G),m.match_length<=5&&(m.strategy===1||m.match_length===3&&m.strstart-m.match_start>4096)&&(m.match_length=2)),m.prev_length>=3&&m.match_length<=m.prev_length){C=m.strstart+m.lookahead-3,j=l._tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-3),m.lookahead-=m.prev_length-1,m.prev_length-=2;do++m.strstart<=C&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+3-1])&m.hash_mask,G=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart);while(--m.prev_length!=0);if(m.match_available=0,m.match_length=2,m.strstart++,j&&(y(m,!1),m.strm.avail_out===0))return 1}else if(m.match_available){if((j=l._tr_tally(m,0,m.window[m.strstart-1]))&&y(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return 1}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(j=l._tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<2?m.strstart:2,b===4?(y(m,!0),m.strm.avail_out===0?3:4):m.last_lit&&(y(m,!1),m.strm.avail_out===0)?1:2}function T(m,b,G,j,C){this.good_length=m,this.max_lazy=b,this.nice_length=G,this.max_chain=j,this.func=C}function h(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(1146),this.dyn_dtree=new o.Buf16(122),this.bl_tree=new o.Buf16(78),w(this.dyn_ltree),w(this.dyn_dtree),w(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(16),this.heap=new o.Buf16(573),w(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(573),w(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function R(m){var b;return m&&m.state?(m.total_in=m.total_out=0,m.data_type=2,(b=m.state).pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?42:113,m.adler=b.wrap===2?0:1,b.last_flush=0,l._tr_init(b),0):c(m,-2)}function W(m){var b,G=R(m);return G===0&&((b=m.state).window_size=2*b.w_size,w(b.head),b.max_lazy_match=r[b.level].max_lazy,b.good_match=r[b.level].good_length,b.nice_match=r[b.level].nice_length,b.max_chain_length=r[b.level].max_chain,b.strstart=0,b.block_start=0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=2,b.match_available=0,b.ins_h=0),G}function X(m,b,G,j,C,z){if(!m)return-2;var P=1;if(b===-1&&(b=6),j<0?(P=0,j=-j):j>15&&(P=2,j-=16),C<1||C>9||G!==8||j<8||j>15||b<0||b>9||z<0||z>4)return c(m,-2);j===8&&(j=9);var D=new h;return m.state=D,D.strm=m,D.wrap=P,D.gzhead=null,D.w_bits=j,D.w_size=1<<D.w_bits,D.w_mask=D.w_size-1,D.hash_bits=C+7,D.hash_size=1<<D.hash_bits,D.hash_mask=D.hash_size-1,D.hash_shift=~~((D.hash_bits+3-1)/3),D.window=new o.Buf8(2*D.w_size),D.head=new o.Buf16(D.hash_size),D.prev=new o.Buf16(D.w_size),D.lit_bufsize=1<<C+6,D.pending_buf_size=4*D.lit_bufsize,D.pending_buf=new o.Buf8(D.pending_buf_size),D.d_buf=1*D.lit_bufsize,D.l_buf=3*D.lit_bufsize,D.level=b,D.strategy=z,D.method=G,W(m)}r=[new T(0,0,0,0,function(m,b){var G=65535;for(G>m.pending_buf_size-5&&(G=m.pending_buf_size-5);;){if(m.lookahead<=1){if(N(m),m.lookahead===0&&b===0)return 1;if(m.lookahead===0)break}m.strstart+=m.lookahead,m.lookahead=0;var j=m.block_start+G;if((m.strstart===0||m.strstart>=j)&&(m.lookahead=m.strstart-j,m.strstart=j,y(m,!1),m.strm.avail_out===0)||m.strstart-m.block_start>=m.w_size-262&&(y(m,!1),m.strm.avail_out===0))return 1}return m.insert=0,b===4?(y(m,!0),m.strm.avail_out===0?3:4):(m.strstart>m.block_start&&(y(m,!1),m.strm.avail_out),1)}),new T(4,4,8,4,B),new T(4,5,16,8,B),new T(4,6,32,32,B),new T(4,4,16,16,E),new T(8,16,32,32,E),new T(8,16,128,128,E),new T(8,32,128,256,E),new T(32,128,258,1024,E),new T(32,258,258,4096,E)],t.deflateInit=function(m,b){return X(m,b,8,15,8,0)},t.deflateInit2=X,t.deflateReset=W,t.deflateResetKeep=R,t.deflateSetHeader=function(m,b){return m&&m.state?m.state.wrap!==2?-2:(m.state.gzhead=b,0):-2},t.deflate=function(m,b){var G,j,C,z;if(!m||!m.state||b>5||b<0)return m?c(m,-2):-2;if(j=m.state,!m.output||!m.input&&m.avail_in!==0||j.status===666&&b!==4)return c(m,m.avail_out===0?-5:-2);if(j.strm=m,G=j.last_flush,j.last_flush=b,j.status===42)if(j.wrap===2)m.adler=0,f(j,31),f(j,139),f(j,8),j.gzhead?(f(j,(j.gzhead.text?1:0)+(j.gzhead.hcrc?2:0)+(j.gzhead.extra?4:0)+(j.gzhead.name?8:0)+(j.gzhead.comment?16:0)),f(j,255&j.gzhead.time),f(j,j.gzhead.time>>8&255),f(j,j.gzhead.time>>16&255),f(j,j.gzhead.time>>24&255),f(j,j.level===9?2:j.strategy>=2||j.level<2?4:0),f(j,255&j.gzhead.os),j.gzhead.extra&&j.gzhead.extra.length&&(f(j,255&j.gzhead.extra.length),f(j,j.gzhead.extra.length>>8&255)),j.gzhead.hcrc&&(m.adler=s(m.adler,j.pending_buf,j.pending,0)),j.gzindex=0,j.status=69):(f(j,0),f(j,0),f(j,0),f(j,0),f(j,0),f(j,j.level===9?2:j.strategy>=2||j.level<2?4:0),f(j,3),j.status=113);else{var P=8+(j.w_bits-8<<4)<<8;P|=(j.strategy>=2||j.level<2?0:j.level<6?1:j.level===6?2:3)<<6,j.strstart!==0&&(P|=32),P+=31-P%31,j.status=113,p(j,P),j.strstart!==0&&(p(j,m.adler>>>16),p(j,65535&m.adler)),m.adler=1}if(j.status===69)if(j.gzhead.extra){for(C=j.pending;j.gzindex<(65535&j.gzhead.extra.length)&&(j.pending!==j.pending_buf_size||(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending!==j.pending_buf_size));)f(j,255&j.gzhead.extra[j.gzindex]),j.gzindex++;j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),j.gzindex===j.gzhead.extra.length&&(j.gzindex=0,j.status=73)}else j.status=73;if(j.status===73)if(j.gzhead.name){C=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending===j.pending_buf_size)){z=1;break}z=j.gzindex<j.gzhead.name.length?255&j.gzhead.name.charCodeAt(j.gzindex++):0,f(j,z)}while(z!==0);j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),z===0&&(j.gzindex=0,j.status=91)}else j.status=91;if(j.status===91)if(j.gzhead.comment){C=j.pending;do{if(j.pending===j.pending_buf_size&&(j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),v(m),C=j.pending,j.pending===j.pending_buf_size)){z=1;break}z=j.gzindex<j.gzhead.comment.length?255&j.gzhead.comment.charCodeAt(j.gzindex++):0,f(j,z)}while(z!==0);j.gzhead.hcrc&&j.pending>C&&(m.adler=s(m.adler,j.pending_buf,j.pending-C,C)),z===0&&(j.status=103)}else j.status=103;if(j.status===103&&(j.gzhead.hcrc?(j.pending+2>j.pending_buf_size&&v(m),j.pending+2<=j.pending_buf_size&&(f(j,255&m.adler),f(j,m.adler>>8&255),m.adler=0,j.status=113)):j.status=113),j.pending!==0){if(v(m),m.avail_out===0)return j.last_flush=-1,0}else if(m.avail_in===0&&d(b)<=d(G)&&b!==4)return c(m,-5);if(j.status===666&&m.avail_in!==0)return c(m,-5);if(m.avail_in!==0||j.lookahead!==0||b!==0&&j.status!==666){var D=j.strategy===2?function(O,L){for(var U;;){if(O.lookahead===0&&(N(O),O.lookahead===0)){if(L===0)return 1;break}if(O.match_length=0,U=l._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,U&&(y(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,L===4?(y(O,!0),O.strm.avail_out===0?3:4):O.last_lit&&(y(O,!1),O.strm.avail_out===0)?1:2}(j,b):j.strategy===3?function(O,L){for(var U,A,V,q,Q=O.window;;){if(O.lookahead<=258){if(N(O),O.lookahead<=258&&L===0)return 1;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=3&&O.strstart>0&&(A=Q[V=O.strstart-1])===Q[++V]&&A===Q[++V]&&A===Q[++V]){q=O.strstart+258;do;while(A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&A===Q[++V]&&V<q);O.match_length=258-(q-V),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=3?(U=l._tr_tally(O,1,O.match_length-3),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(U=l._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),U&&(y(O,!1),O.strm.avail_out===0))return 1}return O.insert=0,L===4?(y(O,!0),O.strm.avail_out===0?3:4):O.last_lit&&(y(O,!1),O.strm.avail_out===0)?1:2}(j,b):r[j.level].func(j,b);if(D!==3&&D!==4||(j.status=666),D===1||D===3)return m.avail_out===0&&(j.last_flush=-1),0;if(D===2&&(b===1?l._tr_align(j):b!==5&&(l._tr_stored_block(j,0,0,!1),b===3&&(w(j.head),j.lookahead===0&&(j.strstart=0,j.block_start=0,j.insert=0))),v(m),m.avail_out===0))return j.last_flush=-1,0}return b!==4?0:j.wrap<=0?1:(j.wrap===2?(f(j,255&m.adler),f(j,m.adler>>8&255),f(j,m.adler>>16&255),f(j,m.adler>>24&255),f(j,255&m.total_in),f(j,m.total_in>>8&255),f(j,m.total_in>>16&255),f(j,m.total_in>>24&255)):(p(j,m.adler>>>16),p(j,65535&m.adler)),v(m),j.wrap>0&&(j.wrap=-j.wrap),j.pending!==0?0:1)},t.deflateEnd=function(m){var b;return m&&m.state?(b=m.state.status)!==42&&b!==69&&b!==73&&b!==91&&b!==103&&b!==113&&b!==666?c(m,-2):(m.state=null,b===113?c(m,-3):0):-2},t.deflateSetDictionary=function(m,b){var G,j,C,z,P,D,O,L,U=b.length;if(!m||!m.state||(z=(G=m.state).wrap)===2||z===1&&G.status!==42||G.lookahead)return-2;for(z===1&&(m.adler=u(m.adler,b,U,0)),G.wrap=0,U>=G.w_size&&(z===0&&(w(G.head),G.strstart=0,G.block_start=0,G.insert=0),L=new o.Buf8(G.w_size),o.arraySet(L,b,U-G.w_size,G.w_size,0),b=L,U=G.w_size),P=m.avail_in,D=m.next_in,O=m.input,m.avail_in=U,m.next_in=0,m.input=b,N(G);G.lookahead>=3;){j=G.strstart,C=G.lookahead-2;do G.ins_h=(G.ins_h<<G.hash_shift^G.window[j+3-1])&G.hash_mask,G.prev[j&G.w_mask]=G.head[G.ins_h],G.head[G.ins_h]=j,j++;while(--C);G.strstart=j,G.lookahead=2,N(G)}return G.strstart+=G.lookahead,G.block_start=G.strstart,G.insert=G.lookahead,G.lookahead=0,G.match_length=G.prev_length=2,G.match_available=0,m.next_in=D,m.input=O,m.avail_in=P,G.wrap=z,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,n){var r=n(38);function o(A){for(var V=A.length;--V>=0;)A[V]=0}var l=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],u=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],g=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);o(c);var d=new Array(60);o(d);var w=new Array(512);o(w);var v=new Array(256);o(v);var y=new Array(29);o(y);var f,p,S,N=new Array(30);function B(A,V,q,Q,ee){this.static_tree=A,this.extra_bits=V,this.extra_base=q,this.elems=Q,this.max_length=ee,this.has_stree=A&&A.length}function E(A,V){this.dyn_tree=A,this.max_code=0,this.stat_desc=V}function T(A){return A<256?w[A]:w[256+(A>>>7)]}function h(A,V){A.pending_buf[A.pending++]=255&V,A.pending_buf[A.pending++]=V>>>8&255}function R(A,V,q){A.bi_valid>16-q?(A.bi_buf|=V<<A.bi_valid&65535,h(A,A.bi_buf),A.bi_buf=V>>16-A.bi_valid,A.bi_valid+=q-16):(A.bi_buf|=V<<A.bi_valid&65535,A.bi_valid+=q)}function W(A,V,q){R(A,q[2*V],q[2*V+1])}function X(A,V){var q=0;do q|=1&A,A>>>=1,q<<=1;while(--V>0);return q>>>1}function m(A,V,q){var Q,ee,te=new Array(16),k=0;for(Q=1;Q<=15;Q++)te[Q]=k=k+q[Q-1]<<1;for(ee=0;ee<=V;ee++){var x=A[2*ee+1];x!==0&&(A[2*ee]=X(te[x]++,x))}}function b(A){var V;for(V=0;V<286;V++)A.dyn_ltree[2*V]=0;for(V=0;V<30;V++)A.dyn_dtree[2*V]=0;for(V=0;V<19;V++)A.bl_tree[2*V]=0;A.dyn_ltree[512]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function G(A){A.bi_valid>8?h(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function j(A,V,q,Q){var ee=2*V,te=2*q;return A[ee]<A[te]||A[ee]===A[te]&&Q[V]<=Q[q]}function C(A,V,q){for(var Q=A.heap[q],ee=q<<1;ee<=A.heap_len&&(ee<A.heap_len&&j(V,A.heap[ee+1],A.heap[ee],A.depth)&&ee++,!j(V,Q,A.heap[ee],A.depth));)A.heap[q]=A.heap[ee],q=ee,ee<<=1;A.heap[q]=Q}function z(A,V,q){var Q,ee,te,k,x=0;if(A.last_lit!==0)do Q=A.pending_buf[A.d_buf+2*x]<<8|A.pending_buf[A.d_buf+2*x+1],ee=A.pending_buf[A.l_buf+x],x++,Q===0?W(A,ee,V):(W(A,(te=v[ee])+256+1,V),(k=l[te])!==0&&R(A,ee-=y[te],k),W(A,te=T(--Q),q),(k=u[te])!==0&&R(A,Q-=N[te],k));while(x<A.last_lit);W(A,256,V)}function P(A,V){var q,Q,ee,te=V.dyn_tree,k=V.stat_desc.static_tree,x=V.stat_desc.has_stree,_=V.stat_desc.elems,I=-1;for(A.heap_len=0,A.heap_max=573,q=0;q<_;q++)te[2*q]!==0?(A.heap[++A.heap_len]=I=q,A.depth[q]=0):te[2*q+1]=0;for(;A.heap_len<2;)te[2*(ee=A.heap[++A.heap_len]=I<2?++I:0)]=1,A.depth[ee]=0,A.opt_len--,x&&(A.static_len-=k[2*ee+1]);for(V.max_code=I,q=A.heap_len>>1;q>=1;q--)C(A,te,q);ee=_;do q=A.heap[1],A.heap[1]=A.heap[A.heap_len--],C(A,te,1),Q=A.heap[1],A.heap[--A.heap_max]=q,A.heap[--A.heap_max]=Q,te[2*ee]=te[2*q]+te[2*Q],A.depth[ee]=(A.depth[q]>=A.depth[Q]?A.depth[q]:A.depth[Q])+1,te[2*q+1]=te[2*Q+1]=ee,A.heap[1]=ee++,C(A,te,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],function($,K){var Y,ne,ie,ue,we,Oe,Ee=K.dyn_tree,De=K.max_code,Te=K.stat_desc.static_tree,Ae=K.stat_desc.has_stree,Ie=K.stat_desc.extra_bits,ze=K.stat_desc.extra_base,$e=K.stat_desc.max_length,nt=0;for(ue=0;ue<=15;ue++)$.bl_count[ue]=0;for(Ee[2*$.heap[$.heap_max]+1]=0,Y=$.heap_max+1;Y<573;Y++)(ue=Ee[2*Ee[2*(ne=$.heap[Y])+1]+1]+1)>$e&&(ue=$e,nt++),Ee[2*ne+1]=ue,ne>De||($.bl_count[ue]++,we=0,ne>=ze&&(we=Ie[ne-ze]),Oe=Ee[2*ne],$.opt_len+=Oe*(ue+we),Ae&&($.static_len+=Oe*(Te[2*ne+1]+we)));if(nt!==0){do{for(ue=$e-1;$.bl_count[ue]===0;)ue--;$.bl_count[ue]--,$.bl_count[ue+1]+=2,$.bl_count[$e]--,nt-=2}while(nt>0);for(ue=$e;ue!==0;ue--)for(ne=$.bl_count[ue];ne!==0;)(ie=$.heap[--Y])>De||(Ee[2*ie+1]!==ue&&($.opt_len+=(ue-Ee[2*ie+1])*Ee[2*ie],Ee[2*ie+1]=ue),ne--)}}(A,V),m(te,I,A.bl_count)}function D(A,V,q){var Q,ee,te=-1,k=V[1],x=0,_=7,I=4;for(k===0&&(_=138,I=3),V[2*(q+1)+1]=65535,Q=0;Q<=q;Q++)ee=k,k=V[2*(Q+1)+1],++x<_&&ee===k||(x<I?A.bl_tree[2*ee]+=x:ee!==0?(ee!==te&&A.bl_tree[2*ee]++,A.bl_tree[32]++):x<=10?A.bl_tree[34]++:A.bl_tree[36]++,x=0,te=ee,k===0?(_=138,I=3):ee===k?(_=6,I=3):(_=7,I=4))}function O(A,V,q){var Q,ee,te=-1,k=V[1],x=0,_=7,I=4;for(k===0&&(_=138,I=3),Q=0;Q<=q;Q++)if(ee=k,k=V[2*(Q+1)+1],!(++x<_&&ee===k)){if(x<I)do W(A,ee,A.bl_tree);while(--x!=0);else ee!==0?(ee!==te&&(W(A,ee,A.bl_tree),x--),W(A,16,A.bl_tree),R(A,x-3,2)):x<=10?(W(A,17,A.bl_tree),R(A,x-3,3)):(W(A,18,A.bl_tree),R(A,x-11,7));x=0,te=ee,k===0?(_=138,I=3):ee===k?(_=6,I=3):(_=7,I=4)}}o(N);var L=!1;function U(A,V,q,Q){R(A,0+(Q?1:0),3),function(ee,te,k,x){G(ee),x&&(h(ee,k),h(ee,~k)),r.arraySet(ee.pending_buf,ee.window,te,k,ee.pending),ee.pending+=k}(A,V,q,!0)}t._tr_init=function(A){L||(function(){var V,q,Q,ee,te,k=new Array(16);for(Q=0,ee=0;ee<28;ee++)for(y[ee]=Q,V=0;V<1<<l[ee];V++)v[Q++]=ee;for(v[Q-1]=ee,te=0,ee=0;ee<16;ee++)for(N[ee]=te,V=0;V<1<<u[ee];V++)w[te++]=ee;for(te>>=7;ee<30;ee++)for(N[ee]=te<<7,V=0;V<1<<u[ee]-7;V++)w[256+te++]=ee;for(q=0;q<=15;q++)k[q]=0;for(V=0;V<=143;)c[2*V+1]=8,V++,k[8]++;for(;V<=255;)c[2*V+1]=9,V++,k[9]++;for(;V<=279;)c[2*V+1]=7,V++,k[7]++;for(;V<=287;)c[2*V+1]=8,V++,k[8]++;for(m(c,287,k),V=0;V<30;V++)d[2*V+1]=5,d[2*V]=X(V,5);f=new B(c,l,257,286,15),p=new B(d,u,0,30,15),S=new B(new Array(0),s,0,19,7)}(),L=!0),A.l_desc=new E(A.dyn_ltree,f),A.d_desc=new E(A.dyn_dtree,p),A.bl_desc=new E(A.bl_tree,S),A.bi_buf=0,A.bi_valid=0,b(A)},t._tr_stored_block=U,t._tr_flush_block=function(A,V,q,Q){var ee,te,k=0;A.level>0?(A.strm.data_type===2&&(A.strm.data_type=function(x){var _,I=4093624447;for(_=0;_<=31;_++,I>>>=1)if(1&I&&x.dyn_ltree[2*_]!==0)return 0;if(x.dyn_ltree[18]!==0||x.dyn_ltree[20]!==0||x.dyn_ltree[26]!==0)return 1;for(_=32;_<256;_++)if(x.dyn_ltree[2*_]!==0)return 1;return 0}(A)),P(A,A.l_desc),P(A,A.d_desc),k=function(x){var _;for(D(x,x.dyn_ltree,x.l_desc.max_code),D(x,x.dyn_dtree,x.d_desc.max_code),P(x,x.bl_desc),_=18;_>=3&&x.bl_tree[2*g[_]+1]===0;_--);return x.opt_len+=3*(_+1)+5+5+4,_}(A),ee=A.opt_len+3+7>>>3,(te=A.static_len+3+7>>>3)<=ee&&(ee=te)):ee=te=q+5,q+4<=ee&&V!==-1?U(A,V,q,Q):A.strategy===4||te===ee?(R(A,2+(Q?1:0),3),z(A,c,d)):(R(A,4+(Q?1:0),3),function(x,_,I,$){var K;for(R(x,_-257,5),R(x,I-1,5),R(x,$-4,4),K=0;K<$;K++)R(x,x.bl_tree[2*g[K]+1],3);O(x,x.dyn_ltree,_-1),O(x,x.dyn_dtree,I-1)}(A,A.l_desc.max_code+1,A.d_desc.max_code+1,k+1),z(A,A.dyn_ltree,A.dyn_dtree)),b(A),Q&&G(A)},t._tr_tally=function(A,V,q){return A.pending_buf[A.d_buf+2*A.last_lit]=V>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&V,A.pending_buf[A.l_buf+A.last_lit]=255&q,A.last_lit++,V===0?A.dyn_ltree[2*q]++:(A.matches++,V--,A.dyn_ltree[2*(v[q]+256+1)]++,A.dyn_dtree[2*T(V)]++),A.last_lit===A.lit_bufsize-1},t._tr_align=function(A){R(A,2,3),W(A,256,c),function(V){V.bi_valid===16?(h(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):V.bi_valid>=8&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)}(A)}},function(e,t,n){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,n){var r=n(38),o=n(75),l=n(76),u=n(180),s=n(181);function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(E){var T;return E&&E.state?(T=E.state,E.total_in=E.total_out=T.total=0,E.msg="",T.wrap&&(E.adler=1&T.wrap),T.mode=1,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new r.Buf32(852),T.distcode=T.distdyn=new r.Buf32(592),T.sane=1,T.back=-1,0):-2}function w(E){var T;return E&&E.state?((T=E.state).wsize=0,T.whave=0,T.wnext=0,d(E)):-2}function v(E,T){var h,R;return E&&E.state?(R=E.state,T<0?(h=0,T=-T):(h=1+(T>>4),T<48&&(T&=15)),T&&(T<8||T>15)?-2:(R.window!==null&&R.wbits!==T&&(R.window=null),R.wrap=h,R.wbits=T,w(E))):-2}function y(E,T){var h,R;return E?(R=new c,E.state=R,R.window=null,(h=v(E,T))!==0&&(E.state=null),h):-2}var f,p,S=!0;function N(E){if(S){var T;for(f=new r.Buf32(512),p=new r.Buf32(32),T=0;T<144;)E.lens[T++]=8;for(;T<256;)E.lens[T++]=9;for(;T<280;)E.lens[T++]=7;for(;T<288;)E.lens[T++]=8;for(s(1,E.lens,0,288,f,0,E.work,{bits:9}),T=0;T<32;)E.lens[T++]=5;s(2,E.lens,0,32,p,0,E.work,{bits:5}),S=!1}E.lencode=f,E.lenbits=9,E.distcode=p,E.distbits=5}function B(E,T,h,R){var W,X=E.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new r.Buf8(X.wsize)),R>=X.wsize?(r.arraySet(X.window,T,h-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):((W=X.wsize-X.wnext)>R&&(W=R),r.arraySet(X.window,T,h-R,W,X.wnext),(R-=W)?(r.arraySet(X.window,T,h-R,R,0),X.wnext=R,X.whave=X.wsize):(X.wnext+=W,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=W))),0}t.inflateReset=w,t.inflateReset2=v,t.inflateResetKeep=d,t.inflateInit=function(E){return y(E,15)},t.inflateInit2=y,t.inflate=function(E,T){var h,R,W,X,m,b,G,j,C,z,P,D,O,L,U,A,V,q,Q,ee,te,k,x,_,I=0,$=new r.Buf8(4),K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return-2;(h=E.state).mode===12&&(h.mode=13),m=E.next_out,W=E.output,G=E.avail_out,X=E.next_in,R=E.input,b=E.avail_in,j=h.hold,C=h.bits,z=b,P=G,k=0;e:for(;;)switch(h.mode){case 1:if(h.wrap===0){h.mode=13;break}for(;C<16;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(2&h.wrap&&j===35615){h.check=0,$[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0),j=0,C=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&j)<<8)+(j>>8))%31){E.msg="incorrect header check",h.mode=30;break}if((15&j)!=8){E.msg="unknown compression method",h.mode=30;break}if(C-=4,te=8+(15&(j>>>=4)),h.wbits===0)h.wbits=te;else if(te>h.wbits){E.msg="invalid window size",h.mode=30;break}h.dmax=1<<te,E.adler=h.check=1,h.mode=512&j?10:12,j=0,C=0;break;case 2:for(;C<16;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(h.flags=j,(255&h.flags)!=8){E.msg="unknown compression method",h.mode=30;break}if(57344&h.flags){E.msg="unknown header flags set",h.mode=30;break}h.head&&(h.head.text=j>>8&1),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0,h.mode=3;case 3:for(;C<32;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.head&&(h.head.time=j),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,$[2]=j>>>16&255,$[3]=j>>>24&255,h.check=l(h.check,$,4,0)),j=0,C=0,h.mode=4;case 4:for(;C<16;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.head&&(h.head.xflags=255&j,h.head.os=j>>8),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0,h.mode=5;case 5:if(1024&h.flags){for(;C<16;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.length=j,h.head&&(h.head.extra_len=j),512&h.flags&&($[0]=255&j,$[1]=j>>>8&255,h.check=l(h.check,$,2,0)),j=0,C=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&((D=h.length)>b&&(D=b),D&&(h.head&&(te=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),r.arraySet(h.head.extra,R,X,D,te)),512&h.flags&&(h.check=l(h.check,R,D,X)),b-=D,X+=D,h.length-=D),h.length))break e;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(b===0)break e;D=0;do te=R[X+D++],h.head&&te&&h.length<65536&&(h.head.name+=String.fromCharCode(te));while(te&&D<b);if(512&h.flags&&(h.check=l(h.check,R,D,X)),b-=D,X+=D,te)break e}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(b===0)break e;D=0;do te=R[X+D++],h.head&&te&&h.length<65536&&(h.head.comment+=String.fromCharCode(te));while(te&&D<b);if(512&h.flags&&(h.check=l(h.check,R,D,X)),b-=D,X+=D,te)break e}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;C<16;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(j!==(65535&h.check)){E.msg="header crc mismatch",h.mode=30;break}j=0,C=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),E.adler=h.check=0,h.mode=12;break;case 10:for(;C<32;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}E.adler=h.check=g(j),j=0,C=0,h.mode=11;case 11:if(h.havedict===0)return E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=b,h.hold=j,h.bits=C,2;E.adler=h.check=1,h.mode=12;case 12:if(T===5||T===6)break e;case 13:if(h.last){j>>>=7&C,C-=7&C,h.mode=27;break}for(;C<3;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}switch(h.last=1&j,C-=1,3&(j>>>=1)){case 0:h.mode=14;break;case 1:if(N(h),h.mode=20,T===6){j>>>=2,C-=2;break e}break;case 2:h.mode=17;break;case 3:E.msg="invalid block type",h.mode=30}j>>>=2,C-=2;break;case 14:for(j>>>=7&C,C-=7&C;C<32;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if((65535&j)!=(j>>>16^65535)){E.msg="invalid stored block lengths",h.mode=30;break}if(h.length=65535&j,j=0,C=0,h.mode=15,T===6)break e;case 15:h.mode=16;case 16:if(D=h.length){if(D>b&&(D=b),D>G&&(D=G),D===0)break e;r.arraySet(W,R,X,D,m),b-=D,X+=D,G-=D,m+=D,h.length-=D;break}h.mode=12;break;case 17:for(;C<14;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(h.nlen=257+(31&j),j>>>=5,C-=5,h.ndist=1+(31&j),j>>>=5,C-=5,h.ncode=4+(15&j),j>>>=4,C-=4,h.nlen>286||h.ndist>30){E.msg="too many length or distance symbols",h.mode=30;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;C<3;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.lens[K[h.have++]]=7&j,j>>>=3,C-=3}for(;h.have<19;)h.lens[K[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,x={bits:h.lenbits},k=s(0,h.lens,0,19,h.lencode,0,h.work,x),h.lenbits=x.bits,k){E.msg="invalid code lengths set",h.mode=30;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;A=(I=h.lencode[j&(1<<h.lenbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(V<16)j>>>=U,C-=U,h.lens[h.have++]=V;else{if(V===16){for(_=U+2;C<_;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(j>>>=U,C-=U,h.have===0){E.msg="invalid bit length repeat",h.mode=30;break}te=h.lens[h.have-1],D=3+(3&j),j>>>=2,C-=2}else if(V===17){for(_=U+3;C<_;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}C-=U,te=0,D=3+(7&(j>>>=U)),j>>>=3,C-=3}else{for(_=U+7;C<_;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}C-=U,te=0,D=11+(127&(j>>>=U)),j>>>=7,C-=7}if(h.have+D>h.nlen+h.ndist){E.msg="invalid bit length repeat",h.mode=30;break}for(;D--;)h.lens[h.have++]=te}}if(h.mode===30)break;if(h.lens[256]===0){E.msg="invalid code -- missing end-of-block",h.mode=30;break}if(h.lenbits=9,x={bits:h.lenbits},k=s(1,h.lens,0,h.nlen,h.lencode,0,h.work,x),h.lenbits=x.bits,k){E.msg="invalid literal/lengths set",h.mode=30;break}if(h.distbits=6,h.distcode=h.distdyn,x={bits:h.distbits},k=s(2,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,x),h.distbits=x.bits,k){E.msg="invalid distances set",h.mode=30;break}if(h.mode=20,T===6)break e;case 20:h.mode=21;case 21:if(b>=6&&G>=258){E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=b,h.hold=j,h.bits=C,u(E,P),m=E.next_out,W=E.output,G=E.avail_out,X=E.next_in,R=E.input,b=E.avail_in,j=h.hold,C=h.bits,h.mode===12&&(h.back=-1);break}for(h.back=0;A=(I=h.lencode[j&(1<<h.lenbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(A&&!(240&A)){for(q=U,Q=A,ee=V;A=(I=h.lencode[ee+((j&(1<<q+Q)-1)>>q)])>>>16&255,V=65535&I,!(q+(U=I>>>24)<=C);){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}j>>>=q,C-=q,h.back+=q}if(j>>>=U,C-=U,h.back+=U,h.length=V,A===0){h.mode=26;break}if(32&A){h.back=-1,h.mode=12;break}if(64&A){E.msg="invalid literal/length code",h.mode=30;break}h.extra=15&A,h.mode=22;case 22:if(h.extra){for(_=h.extra;C<_;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.length+=j&(1<<h.extra)-1,j>>>=h.extra,C-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;A=(I=h.distcode[j&(1<<h.distbits)-1])>>>16&255,V=65535&I,!((U=I>>>24)<=C);){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(!(240&A)){for(q=U,Q=A,ee=V;A=(I=h.distcode[ee+((j&(1<<q+Q)-1)>>q)])>>>16&255,V=65535&I,!(q+(U=I>>>24)<=C);){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}j>>>=q,C-=q,h.back+=q}if(j>>>=U,C-=U,h.back+=U,64&A){E.msg="invalid distance code",h.mode=30;break}h.offset=V,h.extra=15&A,h.mode=24;case 24:if(h.extra){for(_=h.extra;C<_;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}h.offset+=j&(1<<h.extra)-1,j>>>=h.extra,C-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){E.msg="invalid distance too far back",h.mode=30;break}h.mode=25;case 25:if(G===0)break e;if(D=P-G,h.offset>D){if((D=h.offset-D)>h.whave&&h.sane){E.msg="invalid distance too far back",h.mode=30;break}D>h.wnext?(D-=h.wnext,O=h.wsize-D):O=h.wnext-D,D>h.length&&(D=h.length),L=h.window}else L=W,O=m-h.offset,D=h.length;D>G&&(D=G),G-=D,h.length-=D;do W[m++]=L[O++];while(--D);h.length===0&&(h.mode=21);break;case 26:if(G===0)break e;W[m++]=h.length,G--,h.mode=21;break;case 27:if(h.wrap){for(;C<32;){if(b===0)break e;b--,j|=R[X++]<<C,C+=8}if(P-=G,E.total_out+=P,h.total+=P,P&&(E.adler=h.check=h.flags?l(h.check,W,P,m-P):o(h.check,W,P,m-P)),P=G,(h.flags?j:g(j))!==h.check){E.msg="incorrect data check",h.mode=30;break}j=0,C=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;C<32;){if(b===0)break e;b--,j+=R[X++]<<C,C+=8}if(j!==(4294967295&h.total)){E.msg="incorrect length check",h.mode=30;break}j=0,C=0}h.mode=29;case 29:k=1;break e;case 30:k=-3;break e;case 31:return-4;case 32:default:return-2}return E.next_out=m,E.avail_out=G,E.next_in=X,E.avail_in=b,h.hold=j,h.bits=C,(h.wsize||P!==E.avail_out&&h.mode<30&&(h.mode<27||T!==4))&&B(E,E.output,E.next_out,P-E.avail_out)?(h.mode=31,-4):(z-=E.avail_in,P-=E.avail_out,E.total_in+=z,E.total_out+=P,h.total+=P,h.wrap&&P&&(E.adler=h.check=h.flags?l(h.check,W,P,E.next_out-P):o(h.check,W,P,E.next_out-P)),E.data_type=h.bits+(h.last?64:0)+(h.mode===12?128:0)+(h.mode===20||h.mode===15?256:0),(z===0&&P===0||T===4)&&k===0&&(k=-5),k)},t.inflateEnd=function(E){if(!E||!E.state)return-2;var T=E.state;return T.window&&(T.window=null),E.state=null,0},t.inflateGetHeader=function(E,T){var h;return E&&E.state&&2&(h=E.state).wrap?(h.head=T,T.done=!1,0):-2},t.inflateSetDictionary=function(E,T){var h,R=T.length;return E&&E.state?(h=E.state).wrap!==0&&h.mode!==11?-2:h.mode===11&&o(1,T,R,0)!==h.check?-3:B(E,T,R,R)?(h.mode=31,-4):(h.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,n){e.exports=function(r,o){var l,u,s,g,c,d,w,v,y,f,p,S,N,B,E,T,h,R,W,X,m,b,G,j,C;l=r.state,u=r.next_in,j=r.input,s=u+(r.avail_in-5),g=r.next_out,C=r.output,c=g-(o-r.avail_out),d=g+(r.avail_out-257),w=l.dmax,v=l.wsize,y=l.whave,f=l.wnext,p=l.window,S=l.hold,N=l.bits,B=l.lencode,E=l.distcode,T=(1<<l.lenbits)-1,h=(1<<l.distbits)-1;e:do{N<15&&(S+=j[u++]<<N,N+=8,S+=j[u++]<<N,N+=8),R=B[S&T];t:for(;;){if(S>>>=W=R>>>24,N-=W,(W=R>>>16&255)===0)C[g++]=65535&R;else{if(!(16&W)){if(!(64&W)){R=B[(65535&R)+(S&(1<<W)-1)];continue t}if(32&W){l.mode=12;break e}r.msg="invalid literal/length code",l.mode=30;break e}X=65535&R,(W&=15)&&(N<W&&(S+=j[u++]<<N,N+=8),X+=S&(1<<W)-1,S>>>=W,N-=W),N<15&&(S+=j[u++]<<N,N+=8,S+=j[u++]<<N,N+=8),R=E[S&h];n:for(;;){if(S>>>=W=R>>>24,N-=W,!(16&(W=R>>>16&255))){if(!(64&W)){R=E[(65535&R)+(S&(1<<W)-1)];continue n}r.msg="invalid distance code",l.mode=30;break e}if(m=65535&R,N<(W&=15)&&(S+=j[u++]<<N,(N+=8)<W&&(S+=j[u++]<<N,N+=8)),(m+=S&(1<<W)-1)>w){r.msg="invalid distance too far back",l.mode=30;break e}if(S>>>=W,N-=W,m>(W=g-c)){if((W=m-W)>y&&l.sane){r.msg="invalid distance too far back",l.mode=30;break e}if(b=0,G=p,f===0){if(b+=v-W,W<X){X-=W;do C[g++]=p[b++];while(--W);b=g-m,G=C}}else if(f<W){if(b+=v+f-W,(W-=f)<X){X-=W;do C[g++]=p[b++];while(--W);if(b=0,f<X){X-=W=f;do C[g++]=p[b++];while(--W);b=g-m,G=C}}}else if(b+=f-W,W<X){X-=W;do C[g++]=p[b++];while(--W);b=g-m,G=C}for(;X>2;)C[g++]=G[b++],C[g++]=G[b++],C[g++]=G[b++],X-=3;X&&(C[g++]=G[b++],X>1&&(C[g++]=G[b++]))}else{b=g-m;do C[g++]=C[b++],C[g++]=C[b++],C[g++]=C[b++],X-=3;while(X>2);X&&(C[g++]=C[b++],X>1&&(C[g++]=C[b++]))}break}}break}}while(u<s&&g<d);u-=X=N>>3,S&=(1<<(N-=X<<3))-1,r.next_in=u,r.next_out=g,r.avail_in=u<s?s-u+5:5-(u-s),r.avail_out=g<d?d-g+257:257-(g-d),l.hold=S,l.bits=N}},function(e,t,n){var r=n(38),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(g,c,d,w,v,y,f,p){var S,N,B,E,T,h,R,W,X,m=p.bits,b=0,G=0,j=0,C=0,z=0,P=0,D=0,O=0,L=0,U=0,A=null,V=0,q=new r.Buf16(16),Q=new r.Buf16(16),ee=null,te=0;for(b=0;b<=15;b++)q[b]=0;for(G=0;G<w;G++)q[c[d+G]]++;for(z=m,C=15;C>=1&&q[C]===0;C--);if(z>C&&(z=C),C===0)return v[y++]=20971520,v[y++]=20971520,p.bits=1,0;for(j=1;j<C&&q[j]===0;j++);for(z<j&&(z=j),O=1,b=1;b<=15;b++)if(O<<=1,(O-=q[b])<0)return-1;if(O>0&&(g===0||C!==1))return-1;for(Q[1]=0,b=1;b<15;b++)Q[b+1]=Q[b]+q[b];for(G=0;G<w;G++)c[d+G]!==0&&(f[Q[c[d+G]]++]=G);if(g===0?(A=ee=f,h=19):g===1?(A=o,V-=257,ee=l,te-=257,h=256):(A=u,ee=s,h=-1),U=0,G=0,b=j,T=y,P=z,D=0,B=-1,E=(L=1<<z)-1,g===1&&L>852||g===2&&L>592)return 1;for(;;){R=b-D,f[G]<h?(W=0,X=f[G]):f[G]>h?(W=ee[te+f[G]],X=A[V+f[G]]):(W=96,X=0),S=1<<b-D,j=N=1<<P;do v[T+(U>>D)+(N-=S)]=R<<24|W<<16|X|0;while(N!==0);for(S=1<<b-1;U&S;)S>>=1;if(S!==0?(U&=S-1,U+=S):U=0,G++,--q[b]==0){if(b===C)break;b=c[d+f[G]]}if(b>z&&(U&E)!==B){for(D===0&&(D=z),T+=j,O=1<<(P=b-D);P+D<C&&!((O-=q[P+D])<=0);)P++,O<<=1;if(L+=1<<P,g===1&&L>852||g===2&&L>592)return 1;v[B=U&E]=z<<24|P<<16|T-y|0}}return U!==0&&(v[T+U]=b-D<<24|64<<16|0),p.bits=z,0}},function(e,t,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t){},function(e,t,n){function r(w,v){var y=Object.keys(w);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(w);v&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(w,p).enumerable})),y.push.apply(y,f)}return y}function o(w){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{};v%2?r(Object(y),!0).forEach(function(f){l(w,f,y[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(f){Object.defineProperty(w,f,Object.getOwnPropertyDescriptor(y,f))})}return w}function l(w,v,y){return(v=s(v))in w?Object.defineProperty(w,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):w[v]=y,w}function u(w,v){for(var y=0;y<v.length;y++){var f=v[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(w,s(f.key),f)}}function s(w){var v=function(y,f){if(typeof y!="object"||y===null)return y;var p=y[Symbol.toPrimitive];if(p!==void 0){var S=p.call(y,f||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}(w,"string");return typeof v=="symbol"?v:String(v)}var g=n(5).Buffer,c=n(185).inspect,d=c&&c.custom||"inspect";e.exports=function(){function w(){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,w),this.head=null,this.tail=null,this.length=0}var v,y;return v=w,(y=[{key:"push",value:function(f){var p={data:f,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(f){var p={data:f,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(f){if(this.length===0)return"";for(var p=this.head,S=""+p.data;p=p.next;)S+=f+p.data;return S}},{key:"concat",value:function(f){if(this.length===0)return g.alloc(0);for(var p,S,N,B=g.allocUnsafe(f>>>0),E=this.head,T=0;E;)p=E.data,S=B,N=T,g.prototype.copy.call(p,S,N),T+=E.data.length,E=E.next;return B}},{key:"consume",value:function(f,p){var S;return f<this.head.data.length?(S=this.head.data.slice(0,f),this.head.data=this.head.data.slice(f)):S=f===this.head.data.length?this.shift():p?this._getString(f):this._getBuffer(f),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(f){var p=this.head,S=1,N=p.data;for(f-=N.length;p=p.next;){var B=p.data,E=f>B.length?B.length:f;if(E===B.length?N+=B:N+=B.slice(0,f),(f-=E)==0){E===B.length?(++S,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=B.slice(E));break}++S}return this.length-=S,N}},{key:"_getBuffer",value:function(f){var p=g.allocUnsafe(f),S=this.head,N=1;for(S.data.copy(p),f-=S.data.length;S=S.next;){var B=S.data,E=f>B.length?B.length:f;if(B.copy(p,p.length-f,0,E),(f-=E)==0){E===B.length?(++N,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=B.slice(E));break}++N}return this.length-=N,p}},{key:d,value:function(f,p){return c(this,o(o({},p),{},{depth:0,customInspect:!1}))}}])&&u(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),w}()},function(e,t){},function(e,t,n){(function(r){var o;function l(E,T,h){return(T=function(R){var W=function(X,m){if(typeof X!="object"||X===null)return X;var b=X[Symbol.toPrimitive];if(b!==void 0){var G=b.call(X,m||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(X)}(R,"string");return typeof W=="symbol"?W:String(W)}(T))in E?Object.defineProperty(E,T,{value:h,enumerable:!0,configurable:!0,writable:!0}):E[T]=h,E}var u=n(48),s=Symbol("lastResolve"),g=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),w=Symbol("lastPromise"),v=Symbol("handlePromise"),y=Symbol("stream");function f(E,T){return{value:E,done:T}}function p(E){var T=E[s];if(T!==null){var h=E[y].read();h!==null&&(E[w]=null,E[s]=null,E[g]=null,T(f(h,!1)))}}function S(E){r.nextTick(p,E)}var N=Object.getPrototypeOf(function(){}),B=Object.setPrototypeOf((l(o={get stream(){return this[y]},next:function(){var E=this,T=this[c];if(T!==null)return Promise.reject(T);if(this[d])return Promise.resolve(f(void 0,!0));if(this[y].destroyed)return new Promise(function(X,m){r.nextTick(function(){E[c]?m(E[c]):X(f(void 0,!0))})});var h,R=this[w];if(R)h=new Promise(function(X,m){return function(b,G){X.then(function(){m[d]?b(f(void 0,!0)):m[v](b,G)},G)}}(R,this));else{var W=this[y].read();if(W!==null)return Promise.resolve(f(W,!1));h=new Promise(this[v])}return this[w]=h,h}},Symbol.asyncIterator,function(){return this}),l(o,"return",function(){var E=this;return new Promise(function(T,h){E[y].destroy(null,function(R){R?h(R):T(f(void 0,!0))})})}),o),N);e.exports=function(E){var T,h=Object.create(B,(l(T={},y,{value:E,writable:!0}),l(T,s,{value:null,writable:!0}),l(T,g,{value:null,writable:!0}),l(T,c,{value:null,writable:!0}),l(T,d,{value:E._readableState.endEmitted,writable:!0}),l(T,v,{value:function(R,W){var X=h[y].read();X?(h[w]=null,h[s]=null,h[g]=null,R(f(X,!1))):(h[s]=R,h[g]=W)},writable:!0}),T));return h[w]=null,u(E,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var W=h[g];return W!==null&&(h[w]=null,h[s]=null,h[g]=null,W(R)),void(h[c]=R)}var X=h[s];X!==null&&(h[w]=null,h[s]=null,h[g]=null,X(f(void 0,!0))),h[d]=!0}),E.on("readable",S.bind(null,h)),h}}).call(this,n(2))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,n){e.exports=o;var r=n(82);function o(l){if(!(this instanceof o))return new o(l);r.call(this,l)}n(7)(o,r),o.prototype._transform=function(l,u,s){s(null,l)}},function(e,t,n){var r,o=n(24).codes,l=o.ERR_MISSING_ARGS,u=o.ERR_STREAM_DESTROYED;function s(v){if(v)throw v}function g(v,y,f,p){p=function(B){var E=!1;return function(){E||(E=!0,B.apply(void 0,arguments))}}(p);var S=!1;v.on("close",function(){S=!0}),r===void 0&&(r=n(48)),r(v,{readable:y,writable:f},function(B){if(B)return p(B);S=!0,p()});var N=!1;return function(B){if(!S&&!N)return N=!0,function(E){return E.setHeader&&typeof E.abort=="function"}(v)?v.abort():typeof v.destroy=="function"?v.destroy():void p(B||new u("pipe"))}}function c(v){v()}function d(v,y){return v.pipe(y)}function w(v){return v.length?typeof v[v.length-1]!="function"?s:v.pop():s}e.exports=function(){for(var v=arguments.length,y=new Array(v),f=0;f<v;f++)y[f]=arguments[f];var p,S=w(y);if(Array.isArray(y[0])&&(y=y[0]),y.length<2)throw new l("streams");var N=y.map(function(B,E){var T=E<y.length-1;return g(B,T,E>0,function(h){p||(p=h),h&&N.forEach(c),T||(N.forEach(c),S(p))})});return y.reduce(d)}},function(e,t,n){var r=n(191)(function o(l,u){return(u=u||{}).namespace=l,u.prod=!0,u.dev=!1,u.force||o.force?o.yep(u):o.nope(u)});e.exports=r},function(e,t){var n=[],r=[],o=function(){};function l(f){return!~n.indexOf(f)&&(n.push(f),!0)}function u(f){o=f}function s(f){for(var p=[],S=0;S<n.length;S++)if(n[S].async)p.push(n[S]);else if(n[S](f))return!0;return!!p.length&&new Promise(function(N){Promise.all(p.map(function(B){return B(f)})).then(function(B){N(B.some(Boolean))})})}function g(f){return!~r.indexOf(f)&&(r.push(f),!0)}function c(){o.apply(o,arguments)}function d(f){for(var p=0;p<r.length;p++)f=r[p].apply(r[p],arguments);return f}function w(f,p){var S=Object.prototype.hasOwnProperty;for(var N in p)S.call(p,N)&&(f[N]=p[N]);return f}function v(f){return f.enabled=!1,f.modify=g,f.set=u,f.use=l,w(function(){return!1},f)}function y(f){return f.enabled=!0,f.modify=g,f.set=u,f.use=l,w(function(){var p=Array.prototype.slice.call(arguments,0);return c.call(c,f,d(p,f)),!0},f)}e.exports=function(f){return f.introduce=w,f.enabled=s,f.process=d,f.modify=g,f.write=c,f.nope=v,f.yep=y,f.set=u,f.use=l,f}},function(e,t,n){(function(r){var o=n(66),l=n(21).StringDecoder,u=n(33).Stream;function s(){}e.exports=function(g,c){var d=r.alloc(65536),w=new l("utf8"),v=new u,y="",f=0,p=0;return g.start===-1&&delete g.start,v.readable=!0,v.destroy=function(){v.destroyed=!0,v.emit("end"),v.emit("close")},o.open(g.file,"a+","0644",function(S,N){if(S)return c?c(S):v.emit("error",S),void v.destroy();(function B(){if(!v.destroyed)return o.read(N,d,0,d.length,f,function(E,T){if(E)return c?c(E):v.emit("error",E),void v.destroy();if(!T)return y&&((g.start==null||p>g.start)&&(c?c(null,y):v.emit("line",y)),p++,y=""),setTimeout(B,1e3);var h=w.write(d.slice(0,T));c||v.emit("data",h);for(var R=(h=(y+h).split(/\n+/)).length-1,W=0;W<R;W++)(g.start==null||p>g.start)&&(c?c(null,h[W]):v.emit("line",h[W])),p++;return y=h[R],f+=T,B()});o.close(N,s)})()}),c?v.destroy:v}}).call(this,n(5).Buffer)},function(e,t,n){(function(r,o){function l(T){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(T)}function u(T,h){var R=Object.keys(T);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(T);h&&(W=W.filter(function(X){return Object.getOwnPropertyDescriptor(T,X).enumerable})),R.push.apply(R,W)}return R}function s(T){for(var h=1;h<arguments.length;h++){var R=arguments[h]!=null?arguments[h]:{};h%2?u(Object(R),!0).forEach(function(W){g(T,W,R[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(R)):u(Object(R)).forEach(function(W){Object.defineProperty(T,W,Object.getOwnPropertyDescriptor(R,W))})}return T}function g(T,h,R){return h in T?Object.defineProperty(T,h,{value:R,enumerable:!0,configurable:!0,writable:!0}):T[h]=R,T}function c(T,h){if(!(T instanceof h))throw new TypeError("Cannot call a class as a function")}function d(T,h){for(var R=0;R<h.length;R++){var W=h[R];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(T,W.key,W)}}function w(T,h){return(w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,W){return R.__proto__=W,R})(T,h)}function v(T){var h=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var R,W=f(T);if(h){var X=f(this).constructor;R=Reflect.construct(W,arguments,X)}else R=W.apply(this,arguments);return y(this,R)}}function y(T,h){if(h&&(l(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R}(T)}function f(T){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)})(T)}var p=n(83),S=n(204),N=n(33).Stream,B=n(14),E=n(29);e.exports=function(T){(function(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(b&&b.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),b&&w(m,b)})(X,T);var h,R,W=v(X);function X(){var m,b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return c(this,X),(m=W.call(this,b)).options=b,m.name=b.name||"http",m.ssl=!!b.ssl,m.host=b.host||"localhost",m.port=b.port,m.auth=b.auth,m.path=b.path||"",m.agent=b.agent,m.headers=b.headers||{},m.headers["content-type"]="application/json",m.batch=b.batch||!1,m.batchInterval=b.batchInterval||5e3,m.batchCount=b.batchCount||10,m.batchOptions=[],m.batchTimeoutID=-1,m.batchCallback={},m.port||(m.port=m.ssl?443:80),m}return h=X,(R=[{key:"log",value:function(m,b){var G=this;this._request(m,function(j,C){C&&C.statusCode!==200&&(j=new Error("Invalid HTTP Status Code: ".concat(C.statusCode))),j?G.emit("warn",j):G.emit("logged",m)}),b&&r(b)}},{key:"query",value:function(m,b){typeof m=="function"&&(b=m,m={}),(m={method:"query",params:this.normalizeQuery(m)}).params.path&&(m.path=m.params.path,delete m.params.path),m.params.auth&&(m.auth=m.params.auth,delete m.params.auth),this._request(m,function(G,j,C){if(j&&j.statusCode!==200&&(G=new Error("Invalid HTTP Status Code: ".concat(j.statusCode))),G)return b(G);if(typeof C=="string")try{C=JSON.parse(C)}catch(z){return b(z)}b(null,C)})}},{key:"stream",value:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},b=new N;(m={method:"stream",params:m}).params.path&&(m.path=m.params.path,delete m.params.path),m.params.auth&&(m.auth=m.params.auth,delete m.params.auth);var G="",j=this._request(m);return b.destroy=function(){return j.destroy()},j.on("data",function(C){for(var z=(C=(G+C).split(/\n+/)).length-1,P=0;P<z;P++)try{b.emit("log",JSON.parse(C[P]))}catch(D){b.emit("error",D)}G=C[z]}),j.on("error",function(C){return b.emit("error",C)}),b}},{key:"_request",value:function(m,b){var G=(m=m||{}).auth||this.auth,j=m.path||this.path||"";delete m.auth,delete m.path,this.batch?this._doBatch(m,b,G,j):this._doRequest(m,b,G,j)}},{key:"_doBatch",value:function(m,b,G,j){if(this.batchOptions.push(m),this.batchOptions.length===1){var C=this;this.batchCallback=b,this.batchTimeoutID=setTimeout(function(){C.batchTimeoutID=-1,C._doBatchRequest(C.batchCallback,G,j)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,G,j)}},{key:"_doBatchRequest",value:function(m,b,G){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var j=this.batchOptions.slice();this.batchOptions=[],this._doRequest(j,m,b,G)}},{key:"_doRequest",value:function(m,b,G,j){var C=Object.assign({},this.headers);G&&G.bearer&&(C.Authorization="Bearer ".concat(G.bearer));var z=(this.ssl?S:p).request(s(s({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(j.replace(/^\//,"")),headers:C,auth:G&&G.username&&G.password?"".concat(G.username,":").concat(G.password):"",agent:this.agent}));z.on("error",b),z.on("response",function(P){return P.on("end",function(){return b(null,P)}).resume()}),z.end(o.from(E(m,this.options.replacer),"utf8"))}}])&&d(h.prototype,R),Object.defineProperty(h,"prototype",{writable:!1}),X}(B)}).call(this,n(19).setImmediate,n(5).Buffer)},function(e,t,n){(function(r,o,l){var u=n(84),s=n(7),g=n(85),c=n(31),d=n(195),w=g.IncomingMessage,v=g.readyStates,y=e.exports=function(p){var S,N=this;c.Writable.call(N),N._opts=p,N._body=[],N._headers={},p.auth&&N.setHeader("Authorization","Basic "+new r(p.auth).toString("base64")),Object.keys(p.headers).forEach(function(E){N.setHeader(E,p.headers[E])});var B=!0;if(p.mode==="disable-fetch"||"requestTimeout"in p&&!u.abortController)B=!1,S=!0;else if(p.mode==="prefer-streaming")S=!1;else if(p.mode==="allow-wrong-content-type")S=!u.overrideMimeType;else{if(p.mode&&p.mode!=="default"&&p.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");S=!0}N._mode=function(E,T){return u.fetch&&T?"fetch":u.mozchunkedarraybuffer?"moz-chunked-arraybuffer":u.msstream?"ms-stream":u.arraybuffer&&E?"arraybuffer":u.vbArray&&E?"text:vbarray":"text"}(S,B),N._fetchTimer=null,N.on("finish",function(){N._onFinish()})};s(y,c.Writable),y.prototype.setHeader=function(p,S){var N=p.toLowerCase();f.indexOf(N)===-1&&(this._headers[N]={name:p,value:S})},y.prototype.getHeader=function(p){var S=this._headers[p.toLowerCase()];return S?S.value:null},y.prototype.removeHeader=function(p){delete this._headers[p.toLowerCase()]},y.prototype._onFinish=function(){var p=this;if(!p._destroyed){var S=p._opts,N=p._headers,B=null;S.method!=="GET"&&S.method!=="HEAD"&&(B=u.arraybuffer?d(r.concat(p._body)):u.blobConstructor?new o.Blob(p._body.map(function(W){return d(W)}),{type:(N["content-type"]||{}).value||""}):r.concat(p._body).toString());var E=[];if(Object.keys(N).forEach(function(W){var X=N[W].name,m=N[W].value;Array.isArray(m)?m.forEach(function(b){E.push([X,b])}):E.push([X,m])}),p._mode==="fetch"){var T=null;if(u.abortController){var h=new AbortController;T=h.signal,p._fetchAbortController=h,"requestTimeout"in S&&S.requestTimeout!==0&&(p._fetchTimer=o.setTimeout(function(){p.emit("requestTimeout"),p._fetchAbortController&&p._fetchAbortController.abort()},S.requestTimeout))}o.fetch(p._opts.url,{method:p._opts.method,headers:E,body:B||void 0,mode:"cors",credentials:S.withCredentials?"include":"same-origin",signal:T}).then(function(W){p._fetchResponse=W,p._connect()},function(W){o.clearTimeout(p._fetchTimer),p._destroyed||p.emit("error",W)})}else{var R=p._xhr=new o.XMLHttpRequest;try{R.open(p._opts.method,p._opts.url,!0)}catch(W){return void l.nextTick(function(){p.emit("error",W)})}"responseType"in R&&(R.responseType=p._mode.split(":")[0]),"withCredentials"in R&&(R.withCredentials=!!S.withCredentials),p._mode==="text"&&"overrideMimeType"in R&&R.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in S&&(R.timeout=S.requestTimeout,R.ontimeout=function(){p.emit("requestTimeout")}),E.forEach(function(W){R.setRequestHeader(W[0],W[1])}),p._response=null,R.onreadystatechange=function(){switch(R.readyState){case v.LOADING:case v.DONE:p._onXHRProgress()}},p._mode==="moz-chunked-arraybuffer"&&(R.onprogress=function(){p._onXHRProgress()}),R.onerror=function(){p._destroyed||p.emit("error",new Error("XHR error"))};try{R.send(B)}catch(W){return void l.nextTick(function(){p.emit("error",W)})}}}},y.prototype._onXHRProgress=function(){(function(p){try{var S=p.status;return S!==null&&S!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},y.prototype._connect=function(){var p=this;p._destroyed||(p._response=new w(p._xhr,p._fetchResponse,p._mode,p._fetchTimer),p._response.on("error",function(S){p.emit("error",S)}),p.emit("response",p._response))},y.prototype._write=function(p,S,N){this._body.push(p),N()},y.prototype.abort=y.prototype.destroy=function(){this._destroyed=!0,o.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},y.prototype.end=function(p,S,N){typeof p=="function"&&(N=p,p=void 0),c.Writable.prototype.end.call(this,p,S,N)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(5).Buffer,n(6),n(2))},function(e,t,n){var r=n(5).Buffer;e.exports=function(o){if(o instanceof Uint8Array){if(o.byteOffset===0&&o.byteLength===o.buffer.byteLength)return o.buffer;if(typeof o.buffer.slice=="function")return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}if(r.isBuffer(o)){for(var l=new Uint8Array(o.length),u=o.length,s=0;s<u;s++)l[s]=o[s];return l.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var r={},o=0;o<arguments.length;o++){var l=arguments[o];for(var u in l)n.call(l,u)&&(r[u]=l[u])}return r};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){(function(r,o){var l;(function(u){t&&t.nodeType,r&&r.nodeType;var s=typeof o=="object"&&o;s.global!==s&&s.window!==s&&s.self;var g,c=2147483647,d=/^xn--/,w=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function S(m){throw new RangeError(y[m])}function N(m,b){for(var G=m.length,j=[];G--;)j[G]=b(m[G]);return j}function B(m,b){var G=m.split("@"),j="";return G.length>1&&(j=G[0]+"@",m=G[1]),j+N((m=m.replace(v,".")).split("."),b).join(".")}function E(m){for(var b,G,j=[],C=0,z=m.length;C<z;)(b=m.charCodeAt(C++))>=55296&&b<=56319&&C<z?(64512&(G=m.charCodeAt(C++)))==56320?j.push(((1023&b)<<10)+(1023&G)+65536):(j.push(b),C--):j.push(b);return j}function T(m){return N(m,function(b){var G="";return b>65535&&(G+=p((b-=65536)>>>10&1023|55296),b=56320|1023&b),G+=p(b)}).join("")}function h(m,b){return m+22+75*(m<26)-((b!=0)<<5)}function R(m,b,G){var j=0;for(m=G?f(m/700):m>>1,m+=f(m/b);m>455;j+=36)m=f(m/35);return f(j+36*m/(m+38))}function W(m){var b,G,j,C,z,P,D,O,L,U,A,V=[],q=m.length,Q=0,ee=128,te=72;for((G=m.lastIndexOf("-"))<0&&(G=0),j=0;j<G;++j)m.charCodeAt(j)>=128&&S("not-basic"),V.push(m.charCodeAt(j));for(C=G>0?G+1:0;C<q;){for(z=Q,P=1,D=36;C>=q&&S("invalid-input"),((O=(A=m.charCodeAt(C++))-48<10?A-22:A-65<26?A-65:A-97<26?A-97:36)>=36||O>f((c-Q)/P))&&S("overflow"),Q+=O*P,!(O<(L=D<=te?1:D>=te+26?26:D-te));D+=36)P>f(c/(U=36-L))&&S("overflow"),P*=U;te=R(Q-z,b=V.length+1,z==0),f(Q/b)>c-ee&&S("overflow"),ee+=f(Q/b),Q%=b,V.splice(Q++,0,ee)}return T(V)}function X(m){var b,G,j,C,z,P,D,O,L,U,A,V,q,Q,ee,te=[];for(V=(m=E(m)).length,b=128,G=0,z=72,P=0;P<V;++P)(A=m[P])<128&&te.push(p(A));for(j=C=te.length,C&&te.push("-");j<V;){for(D=c,P=0;P<V;++P)(A=m[P])>=b&&A<D&&(D=A);for(D-b>f((c-G)/(q=j+1))&&S("overflow"),G+=(D-b)*q,b=D,P=0;P<V;++P)if((A=m[P])<b&&++G>c&&S("overflow"),A==b){for(O=G,L=36;!(O<(U=L<=z?1:L>=z+26?26:L-z));L+=36)ee=O-U,Q=36-U,te.push(p(h(U+ee%Q,0))),O=f(ee/Q);te.push(p(h(O,0))),z=R(G,q,j==C),G=0,++j}++G,++b}return te.join("")}g={version:"1.4.1",ucs2:{decode:E,encode:T},decode:W,encode:X,toASCII:function(m){return B(m,function(b){return w.test(b)?"xn--"+X(b):b})},toUnicode:function(m){return B(m,function(b){return d.test(b)?W(b.slice(4).toLowerCase()):b})}},(l=(function(){return g}).call(t,n,t,r))===void 0||(r.exports=l)})()}).call(this,n(199)(e),n(6))},function(e,t){e.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(e,t,n){e.exports={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}}},function(e,t,n){t.decode=t.parse=n(202),t.encode=t.stringify=n(203)},function(e,t,n){function r(l,u){return Object.prototype.hasOwnProperty.call(l,u)}e.exports=function(l,u,s,g){u=u||"&",s=s||"=";var c={};if(typeof l!="string"||l.length===0)return c;var d=/\+/g;l=l.split(u);var w=1e3;g&&typeof g.maxKeys=="number"&&(w=g.maxKeys);var v=l.length;w>0&&v>w&&(v=w);for(var y=0;y<v;++y){var f,p,S,N,B=l[y].replace(d,"%20"),E=B.indexOf(s);E>=0?(f=B.substr(0,E),p=B.substr(E+1)):(f=B,p=""),S=decodeURIComponent(f),N=decodeURIComponent(p),r(c,S)?o(c[S])?c[S].push(N):c[S]=[c[S],N]:c[S]=N}return c};var o=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}},function(e,t,n){var r=function(s){switch(typeof s){case"string":return s;case"boolean":return s?"true":"false";case"number":return isFinite(s)?s:"";default:return""}};e.exports=function(s,g,c,d){return g=g||"&",c=c||"=",s===null&&(s=void 0),typeof s=="object"?l(u(s),function(w){var v=encodeURIComponent(r(w))+c;return o(s[w])?l(s[w],function(y){return v+encodeURIComponent(r(y))}).join(g):v+encodeURIComponent(r(s[w]))}).join(g):d?encodeURIComponent(r(d))+c+encodeURIComponent(r(s)):""};var o=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function l(s,g){if(s.map)return s.map(g);for(var c=[],d=0;d<s.length;d++)c.push(g(s[d],d));return c}var u=Object.keys||function(s){var g=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&g.push(c);return g}},function(e,t,n){var r=n(83),o=n(86),l=e.exports;for(var u in r)r.hasOwnProperty(u)&&(l[u]=r[u]);function s(g){if(typeof g=="string"&&(g=o.parse(g)),g.protocol||(g.protocol="https:"),g.protocol!=="https:")throw new Error('Protocol "'+g.protocol+'" not supported. Expected "https:"');return g}l.request=function(g,c){return g=s(g),r.request.call(this,g,c)},l.get=function(g,c){return g=s(g),r.get.call(this,g,c)}},function(e,t,n){(function(r){function o(p){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S})(p)}function l(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}function u(p,S){for(var N=0;N<S.length;N++){var B=S[N];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(p,B.key,B)}}function s(p,S){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N})(p,S)}function g(p){var S=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var N,B=d(p);if(S){var E=d(this).constructor;N=Reflect.construct(B,arguments,E)}else N=B.apply(this,arguments);return c(this,N)}}function c(p,S){if(S&&(o(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}(p)}function d(p){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)})(p)}var w=n(87),v=n(3).MESSAGE,y=n(16),f=n(14);e.exports=function(p){(function(T,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(h&&h.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),h&&s(T,h)})(E,p);var S,N,B=g(E);function E(){var T,h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(l(this,E),T=B.call(this,h),!h.stream||!w(h.stream))throw new Error("options.stream is required.");return T._stream=h.stream,T._stream.setMaxListeners(1/0),T.isObjectMode=h.stream._writableState.objectMode,T.eol=typeof h.eol=="string"?h.eol:y.EOL,T}return S=E,(N=[{key:"log",value:function(T,h){var R=this;if(r(function(){return R.emit("logged",T)}),this.isObjectMode)return this._stream.write(T),void(h&&h());this._stream.write("".concat(T[v]).concat(this.eol)),h&&h()}}])&&u(S.prototype,N),Object.defineProperty(S,"prototype",{writable:!1}),E}(f)}).call(this,n(19).setImmediate)},function(e,t,n){(function(r){function o(j,C,z){return C in j?Object.defineProperty(j,C,{value:z,enumerable:!0,configurable:!0,writable:!0}):j[C]=z,j}function l(j){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(j)}function u(j,C){for(var z=0;z<C.length;z++){var P=C[z];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(j,P.key,P)}}function s(j,C){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(z,P){return z.__proto__=P,z})(j,C)}function g(j){var C=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var z,P=d(j);if(C){var D=d(this).constructor;z=Reflect.construct(P,arguments,D)}else z=P.apply(this,arguments);return c(this,z)}}function c(j,C){if(C&&(l(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(z){if(z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z}(j)}function d(j){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(C){return C.__proto__||Object.getPrototypeOf(C)})(j)}var w=n(33),v=w.Stream,y=w.Transform,f=n(50),p=n(3),S=p.LEVEL,N=p.SPLAT,B=n(87),E=n(89),T=n(93),h=n(210),R=n(211),W=n(60).warn,X=n(49),m=/%[scdjifoO%]/g,b=function(j){(function(O,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");O.prototype=Object.create(L&&L.prototype,{constructor:{value:O,writable:!0,configurable:!0}}),Object.defineProperty(O,"prototype",{writable:!1}),L&&s(O,L)})(D,j);var C,z,P=g(D);function D(O){var L;return function(U,A){if(!(U instanceof A))throw new TypeError("Cannot call a class as a function")}(this,D),(L=P.call(this,{objectMode:!0})).configure(O),L}return C=D,(z=[{key:"child",value:function(O){var L=this;return Object.create(L,{write:{value:function(U){var A=Object.assign({},O,U);U instanceof Error&&(A.stack=U.stack,A.message=U.message),L.write(A)}}})}},{key:"configure",value:function(){var O=this,L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=L.silent,A=L.format,V=L.defaultMeta,q=L.levels,Q=L.level,ee=Q===void 0?"info":Q,te=L.exitOnError,k=te===void 0||te,x=L.transports,_=L.colors,I=L.emitErrs,$=L.formatters,K=L.padLevels,Y=L.rewriters,ne=L.stripColors,ie=L.exceptionHandlers,ue=L.rejectionHandlers;if(this.transports.length&&this.clear(),this.silent=U,this.format=A||this.format||n(212)(),this.defaultMeta=V||null,this.levels=q||this.levels||X.npm.levels,this.level=ee,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new E(this),this.rejections=new T(this),this.profilers={},this.exitOnError=k,x&&(x=Array.isArray(x)?x:[x]).forEach(function(we){return O.add(we)}),_||I||$||K||Y||ne)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
57
+ `));ie&&this.exceptions.handle(ie),ue&&this.rejections.handle(ue)}},{key:"isLevelEnabled",value:function(O){var L=this,U=G(this.levels,O);if(U===null)return!1;var A=G(this.levels,this.level);return A!==null&&(this.transports&&this.transports.length!==0?this.transports.findIndex(function(V){var q=G(L.levels,V.level);return q===null&&(q=A),q>=U})!==-1:A>=U)}},{key:"log",value:function(O,L){for(var U,A,V=arguments.length,q=new Array(V>2?V-2:0),Q=2;Q<V;Q++)q[Q-2]=arguments[Q];if(arguments.length===1)return O[S]=O.level,this._addDefaultMeta(O),this.write(O),this;if(arguments.length===2)return L&&l(L)==="object"?(L[S]=L.level=O,this._addDefaultMeta(L),this.write(L),this):(o(A={},S,O),o(A,"level",O),o(A,"message",L),L=A,this._addDefaultMeta(L),this.write(L),this);var ee=q[0];if(l(ee)==="object"&&ee!==null){var te=L&&L.match&&L.match(m);if(!te){var k,x=Object.assign({},this.defaultMeta,ee,(o(k={},S,O),o(k,N,q),o(k,"level",O),o(k,"message",L),k));return ee.message&&(x.message="".concat(x.message," ").concat(ee.message)),ee.stack&&(x.stack=ee.stack),this.write(x),this}}return this.write(Object.assign({},this.defaultMeta,(o(U={},S,O),o(U,N,q),o(U,"level",O),o(U,"message",L),U))),this}},{key:"_transform",value:function(O,L,U){if(this.silent)return U();O[S]||(O[S]=O.level),this.levels[O[S]]||this.levels[O[S]]===0||console.error("[winston] Unknown logger level: %s",O[S]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",O);try{this.push(this.format.transform(O,this.format.options))}finally{this._writableState.sync=!1,U()}}},{key:"_final",value:function(O){var L=this.transports.slice();f(L,function(U,A){if(!U||U.finished)return r(A);U.once("finish",A),U.end()},O)}},{key:"add",value:function(O){var L=!B(O)||O.log.length>2?new h({transport:O}):O;if(!L._writableState||!L._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",L),this._onEvent("warn",L),this.pipe(L),O.handleExceptions&&this.exceptions.handle(),O.handleRejections&&this.rejections.handle(),this}},{key:"remove",value:function(O){if(!O)return this;var L=O;return(!B(O)||O.log.length>2)&&(L=this.transports.filter(function(U){return U.transport===O})[0]),L&&this.unpipe(L),this}},{key:"clear",value:function(){return this.unpipe(),this}},{key:"close",value:function(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}},{key:"setLevels",value:function(){W.deprecated("setLevels")}},{key:"query",value:function(O,L){typeof O=="function"&&(L=O,O={}),O=O||{};var U={},A=Object.assign({},O.query||{});f(this.transports.filter(function(V){return!!V.query}),function(V,q){(function(Q,ee){O.query&&typeof Q.formatQuery=="function"&&(O.query=Q.formatQuery(A)),Q.query(O,function(te,k){if(te)return ee(te);typeof Q.formatResults=="function"&&(k=Q.formatResults(k,O.format)),ee(null,k)})})(V,function(Q,ee){q&&((ee=Q||ee)&&(U[V.name]=ee),q()),q=null})},function(){return L(null,U)})}},{key:"stream",value:function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},L=new v,U=[];return L._streams=U,L.destroy=function(){for(var A=U.length;A--;)U[A].destroy()},this.transports.filter(function(A){return!!A.stream}).forEach(function(A){var V=A.stream(O);V&&(U.push(V),V.on("log",function(q){q.transport=q.transport||[],q.transport.push(A.name),L.emit("log",q)}),V.on("error",function(q){q.transport=q.transport||[],q.transport.push(A.name),L.emit("error",q)}))}),L}},{key:"startTimer",value:function(){return new R(this)}},{key:"profile",value:function(O){var L=Date.now();if(this.profilers[O]){var U=this.profilers[O];delete this.profilers[O];for(var A=arguments.length,V=new Array(A>1?A-1:0),q=1;q<A;q++)V[q-1]=arguments[q];typeof V[V.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),V.pop());var Q=l(V[V.length-1])==="object"?V.pop():{};return Q.level=Q.level||"info",Q.durationMs=L-U,Q.message=Q.message||O,this.write(Q)}return this.profilers[O]=L,this}},{key:"handleExceptions",value:function(){var O;console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),(O=this.exceptions).handle.apply(O,arguments)}},{key:"unhandleExceptions",value:function(){var O;console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),(O=this.exceptions).unhandle.apply(O,arguments)}},{key:"cli",value:function(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
58
+ `))}},{key:"_onEvent",value:function(O,L){L["__winston"+O]||(L["__winston"+O]=(function(U){O!=="error"||this.transports.includes(L)||this.add(L),this.emit(O,U,L)}).bind(this),L.on(O,L["__winston"+O]))}},{key:"_addDefaultMeta",value:function(O){this.defaultMeta&&Object.assign(O,this.defaultMeta)}}])&&u(C.prototype,z),Object.defineProperty(C,"prototype",{writable:!1}),D}(y);function G(j,C){var z=j[C];return z||z===0?z:null}Object.defineProperty(b.prototype,"transports",{configurable:!1,enumerable:!0,get:function(){var j=this._readableState.pipes;return Array.isArray(j)?j:[j].filter(Boolean)}}),e.exports=b}).call(this,n(19).setImmediate)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(44)),o=d(n(45)),l=d(n(67)),u=d(n(68)),s=d(n(69)),g=d(n(23)),c=d(n(30));function d(y){return y&&y.__esModule?y:{default:y}}function w(y,f,p){p=(0,u.default)(p);var S=0,N=0,{length:B}=y,E=!1;function T(h,R){h===!1&&(E=!0),E!==!0&&(h?p(h):++N!==B&&R!==o.default||p(null))}for(B===0&&p(null);S<B;S++)f(y[S],S,(0,s.default)(T))}function v(y,f,p){return(0,l.default)(y,1/0,f,p)}t.default=(0,c.default)(function(y,f,p){return((0,r.default)(y)?w:v)(y,(0,g.default)(f),p)},3),e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(r){return(o,l,u)=>r(o,u)},e.exports=t.default},function(e,t,n){var r=Object.prototype.toString;e.exports=function(o){if(typeof o.displayName=="string"&&o.constructor.name)return o.displayName;if(typeof o.name=="string"&&o.name)return o.name;if(typeof o=="object"&&o.constructor&&typeof o.constructor.name=="string")return o.constructor.name;var l=o.toString(),u=r.call(o).slice(8,-1);return(l=u==="Function"?l.substring(l.indexOf("(")+1,l.indexOf(")")):u)||"anonymous"}},function(e,t,n){const r=n(13),{LEVEL:o}=n(3),l=n(14),u=e.exports=function(s={}){if(l.call(this,s),!s.transport||typeof s.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=s.transport,this.level=this.level||s.transport.level,this.handleExceptions=this.handleExceptions||s.transport.handleExceptions,this._deprecated(),this.transport.__winstonError||(this.transport.__winstonError=(function(g){this.emit("error",g,this.transport)}).bind(this),this.transport.on("error",this.transport.__winstonError))};r.inherits(u,l),u.prototype._write=function(s,g,c){if(this.silent||s.exception===!0&&!this.handleExceptions)return c(null);(!this.level||this.levels[this.level]>=this.levels[s[o]])&&this.transport.log(s[o],s.message,s,this._nop),c(null)},u.prototype._writev=function(s,g){for(let c=0;c<s.length;c++)this._accept(s[c])&&(this.transport.log(s[c].chunk[o],s[c].chunk.message,s[c].chunk,this._nop),s[c].callback());return g(null)},u.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
59
+ `))},u.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}},function(e,t,n){function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u})(l)}function o(l,u){for(var s=0;s<u.length;s++){var g=u[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(l,g.key,g)}}e.exports=function(){function l(g){if(function(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}(this,l),!g)throw new Error("Logger is required for profiling.");this.logger=g,this.start=Date.now()}var u,s;return u=l,(s=[{key:"done",value:function(){for(var g=arguments.length,c=new Array(g),d=0;d<g;d++)c[d]=arguments[d];typeof c[c.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),c.pop());var w=r(c[c.length-1])==="object"?c.pop():{};return w.level=w.level||"info",w.durationMs=Date.now()-this.start,this.logger.write(w)}}])&&o(u.prototype,s),Object.defineProperty(u,"prototype",{writable:!1}),l}()},function(e,t,n){const r=n(213),{MESSAGE:o}=n(3),l=n(29);function u(s,g){return typeof g=="bigint"?g.toString():g}e.exports=r((s,g)=>{const c=l.configure(g);return s[o]=c(s,g.replacer||u,g.space),s})},function(e,t,n){class r extends Error{constructor(l){super(`Format functions must be synchronous taking a two arguments: (info, opts)
60
+ Found: ${l.toString().split(`
61
+ `)[0]}
62
+ `),Error.captureStackTrace(this,r)}}e.exports=o=>{if(o.length>2)throw new r(o);function l(s={}){this.options=s}function u(s){return new l(s)}return l.prototype.transform=o,u.Format=l,u}},function(e,t,n){function r(u,s){if(!(u instanceof s))throw new TypeError("Cannot call a class as a function")}function o(u,s){for(var g=0;g<s.length;g++){var c=s[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}var l=n(88);e.exports=function(){function u(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,u),this.loggers=new Map,this.options=c}var s,g;return s=u,(g=[{key:"add",value:function(c,d){var w=this;if(!this.loggers.has(c)){var v=(d=Object.assign({},d||this.options)).transports||this.options.transports;d.transports=v?v.slice():[];var y=l(d);y.on("close",function(){return w._delete(c)}),this.loggers.set(c,y)}return this.loggers.get(c)}},{key:"get",value:function(c,d){return this.add(c,d)}},{key:"has",value:function(c){return!!this.loggers.has(c)}},{key:"close",value:function(c){var d=this;if(c)return this._removeLogger(c);this.loggers.forEach(function(w,v){return d._removeLogger(v)})}},{key:"_removeLogger",value:function(c){this.loggers.has(c)&&(this.loggers.get(c).close(),this._delete(c))}},{key:"_delete",value:function(c){this.loggers.delete(c)}}])&&o(s.prototype,g),Object.defineProperty(s,"prototype",{writable:!1}),u}()},function(e,t,n){(function(r){const o=n(51),l=/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;e.exports=function(u,s,g,c){let d,w,v=!1,y=!1;const f=n(94);function p(B){c(s,B)}function S(B,E){let T=`"${s}" ${E}`;throw B&&(T=`${T}`),w&&(T=`${T}. An example of a valid value would be: ${w}`),new o(T)}const N={convertFromBase64:function(){return p("marking for base64 conversion"),v=!0,N},default:function(B){if(typeof B=="number")d=B.toString();else if(Array.isArray(B)||typeof B=="object"&&B!==null)d=JSON.stringify(B);else{if(typeof B!="string")throw new o("values passed to default() must be of Number, String, Array, or Object type");d=B}return p(`setting default value to "${d}"`),N},required:function(B){return B===void 0?(p("marked as required"),y=!0):(p(`setting required flag to ${B}`),y=B),N},example:function(B){return w=B,N}};return Object.entries({...f,...g}).forEach(([B,E])=>{N[B]=function(T){return function(){let h=u[s];if(p(`will be read from the environment using "${T.name}" accessor`),h===void 0)if(d===void 0&&y)p("was not found in the environment, but is required to be set"),S(void 0,"is a required variable, but it was not set");else{if(d===void 0)return void p("was not found in the environment, but is not required. returning undefined");p(`was not found in the environment, parsing default value "${d}" instead`),h=d}y&&(p("verifying variable value is not an empty string"),h.trim().length===0&&S(void 0,"is a required variable, but its value was empty")),v&&(p("verifying variable is a valid base64 string"),h.match(l)||S(h,"should be a valid base64 string if using convertFromBase64"),p("converting from base64 to utf8 string"),h=r.from(h,"base64").toString());const R=[h].concat(Array.prototype.slice.call(arguments));try{p(`passing value "${h}" to "${T.name}" accessor`);const W=T.apply(T,R);return p(`parsed successfully, returning ${W}`),W}catch(W){S(h,W.message)}}}(E)}),N}}).call(this,n(5).Buffer)},function(e,t,n){const r=n(34);e.exports=function(o,l){return l=l||",",o.length?r(o).split(l).filter(Boolean):[]}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(o!=="false"&&o!=="true")throw new Error('should be either "true", "false", "TRUE", or "FALSE"');return o!=="false"}},function(e,t,n){e.exports=function(r){const o=r.toLowerCase();if(["false","0","true","1"].indexOf(o)===-1)throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0');return!(o==="0"||o==="false")}},function(e,t,n){const r=n(95);e.exports=function(o){var l=r(o);if(l>65535)throw new Error("cannot assign a port number greater than 65535");return l}},function(e,t,n){const r=n(34);e.exports=function(o,l){const u=r(o);if(l.indexOf(u)<0)throw new Error(`should be one of [${l.join(", ")}]`);return u}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative float");return l}},function(e,t,n){const r=n(53);e.exports=function(o){const l=r(o);if(l<0)throw new Error("should be a positive float");return l}},function(e,t,n){const r=n(52);e.exports=function(o){const l=r(o);if(l>0)throw new Error("should be a negative integer");return l}},function(e,t,n){const r=n(54);e.exports=function(o){var l=r(o);if(!Array.isArray(l))throw new Error("should be a parseable JSON Array");return l}},function(e,t,n){const r=n(54);e.exports=function(o){var l=r(o);if(Array.isArray(l))throw new Error("should be a parseable JSON Object");return l}},function(e,t,n){e.exports=function(r,o){try{RegExp(void 0,o)}catch{throw new Error("invalid regexp flags")}try{return new RegExp(r,o)}catch{throw new Error("should be a valid regexp")}}},function(e,t,n){const r=n(96);e.exports=function(o){return r(o).toString()}},function(e,t,n){const r=n(34),o=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021\u0023-\u005b\u005d-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\u0001-\u0008\u000b\u000c\u000e-\u001f\u0021-\u005a\u0053-\u007f]|\\[\u0001-\u0009\u000b\u000c\u000e-\u007f])+)\])$/;e.exports=function(l){const u=r(l);if(!o.test(u))throw new Error("should be a valid email address");return u}},function(e,t,n){e.exports=function(r,o){return function(l,u){o&&o.match(/prod|production/)||r(`env-var (${l}): ${u}`)}}},function(e,t,n){(function(r){(function(){var o,l,u,s,g,c;typeof performance<"u"&&performance!==null&&performance.now?e.exports=function(){return performance.now()}:r!=null&&r.hrtime?(e.exports=function(){return(o()-g)/1e6},l=r.hrtime,s=(o=function(){var d;return 1e9*(d=l())[0]+d[1]})(),c=1e9*r.uptime(),g=s-c):Date.now?(e.exports=function(){return Date.now()-u},u=Date.now()):(e.exports=function(){return new Date().getTime()-u},u=new Date().getTime())}).call(this)}).call(this,n(2))},function(e,t,n){(function(r){(function(o){function l(s){if((s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+s+"') is invalid.")}function u(s,g){if(g=g===void 0?{fatal:!1}:g,(s=s===void 0?"utf-8":s)!=="utf-8")throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+s+"') is invalid.");if(g.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(o.TextEncoder&&o.TextDecoder)return!1;Object.defineProperty(l.prototype,"encoding",{value:"utf-8"}),l.prototype.encode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");g=0;for(var c=s.length,d=0,w=Math.max(32,c+(c>>1)+7),v=new Uint8Array(w>>3<<3);g<c;){var y=s.charCodeAt(g++);if(55296<=y&&56319>=y){if(g<c){var f=s.charCodeAt(g);(64512&f)==56320&&(++g,y=((1023&y)<<10)+(1023&f)+65536)}if(55296<=y&&56319>=y)continue}if(d+4>v.length&&(w+=8,w=(w*=1+g/s.length*2)>>3<<3,(f=new Uint8Array(w)).set(v),v=f),(4294967168&y)==0)v[d++]=y;else{if(!(4294965248&y))v[d++]=y>>6&31|192;else if(!(4294901760&y))v[d++]=y>>12&15|224,v[d++]=y>>6&63|128;else{if(4292870144&y)continue;v[d++]=y>>18&7|240,v[d++]=y>>12&63|128,v[d++]=y>>6&63|128}v[d++]=63&y|128}}return v.slice(0,d)},Object.defineProperty(u.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(u.prototype,"fatal",{value:!1}),Object.defineProperty(u.prototype,"ignoreBOM",{value:!1}),u.prototype.decode=function(s,g){if((g=g===void 0?{stream:!1}:g).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");g=0;for(var c=(s=new Uint8Array(s)).length,d=[];g<c;){var w=s[g++];if(w===0)break;if(!(128&w))d.push(w);else if((224&w)==192){var v=63&s[g++];d.push((31&w)<<6|v)}else if((240&w)==224){v=63&s[g++];var y=63&s[g++];d.push((31&w)<<12|v<<6|y)}else(248&w)==240&&(65535<(w=(7&w)<<18|(v=63&s[g++])<<12|(y=63&s[g++])<<6|63&s[g++])&&(w-=65536,d.push(w>>>10&1023|55296),w=56320|1023&w),d.push(w))}return String.fromCharCode.apply(null,d)},o.TextEncoder=l,o.TextDecoder=u})(typeof window<"u"?window:r!==void 0?r:this)}).call(this,n(6))},function(e,t,n){n.r(t),n.d(t,"AuthClient",function(){return l}),n.d(t,"RtcSignalingClient",function(){return s}),n.d(t,"Credentials",function(){return z}),n.d(t,"SignalingPromiseClient",function(){return P.SignalingPromiseClient}),n.d(t,"RtcClient",function(){return zt}),n.d(t,"RtcClientV1",function(){return jt}),n.d(t,"createRtcStreamMessage",function(){return nt});var r=n(26),o=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class l extends r.a{adminSignup(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/admin-signup",{token:H,method:"POST",body:F})})}login(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login",{method:"POST",body:F,allowUnsafeRetries:!0})})}loginWithGoogleToken(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/login-google",{method:"POST",body:F,allowUnsafeRetries:!0})})}refresh(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/refresh",{method:"POST",body:{refreshToken:F,tokenExpirationSeconds:H},allowUnsafeRetries:!0})})}respondToNewPasswordRequiredChallenge(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/respond-to-new-password-required-challenge",{method:"POST",body:F})})}forgotPassword(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/forgot-password",{method:"POST",body:{email:F}})})}confirmForgotPassword(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/confirm-forgot-password",{method:"POST",body:F})})}resendInvitation(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/resend-invitation",{method:"POST",body:{email:F}})})}changePassword({token:F,refreshToken:H,currentPassword:J,newPassword:oe}){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/change-password",{token:F,method:"POST",body:{refreshToken:H,currentPassword:J,newPassword:oe}})})}getDeviceCredentials(F){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/device-credentials",{token:F,method:"POST",allowUnsafeRetries:!0})})}impersonate(F,H){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/impersonate",{token:F,method:"POST",allowUnsafeRetries:!0,body:{userId:H}})})}createServiceAccount(F,H,J,oe){return o(this,void 0,void 0,function*(){return yield this.fetch("auth/service-account",{token:F,method:"POST",allowUnsafeRetries:!0,body:{name:H,roleId:J,tags:oe}})})}getFeatures(F){return o(this,void 0,void 0,function*(){return(yield this.fetch("auth/features",{token:F})).features})}}var u=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class s extends r.a{createPeer(F,H){return u(this,void 0,void 0,function*(){return yield this.fetch("peers",{token:F,method:"POST",body:H})})}getPeers(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("peers",{token:F})).items})}refreshPeer(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`peers/${H}/refresh`,{token:F,method:"POST",allowUnsafeRetries:!0})})}createSession(F,H){return u(this,void 0,void 0,function*(){return yield this.fetch("sessions",{token:F,method:"POST",body:H})})}refreshSession(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/refresh`,{token:F,method:"POST",allowUnsafeRetries:!0})})}deleteSession(F,H){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}`,{token:F,method:"DELETE",allowUnsafeRetries:!0})})}getSessions(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("sessions",{token:F})).items})}getIceServers(F){return u(this,void 0,void 0,function*(){return(yield this.fetch("ice-servers",{token:F})).items})}addSignals(F,H,J){return u(this,void 0,void 0,function*(){yield this.fetch(`sessions/${H}/add-signals`,{token:F,method:"POST",body:J})})}takeSignals(F,H){return u(this,void 0,void 0,function*(){return(yield this.fetch(`sessions/${H}/take-signals`,{token:F,method:"POST"})).items})}}var g=n(1),c=n(9),d=n(15),w=n.n(d),v=n(102),y=n.n(v),f=n(4),p=n(0),S=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class N extends class{constructor(F,H){this.type=F,this.name=H}}{constructor(F){super("simple","LogReporter"),this.message=F}send(F){return S(this,void 0,void 0,function*(){var H,J;p.a.debug(this.message,(H=F.reduce((oe,se)=>Object.assign(Object.assign({},oe),{[se.name]:se.stat}),{}),J=oe=>{const{sum:se,count:ce}=oe,he=se/ce;return Object.assign(Object.assign({},oe),{average:he})},Object.keys(H).reduce((oe,se)=>Object.assign(Object.assign({},oe),{[se]:J(H[se])}),{})))})}}var B=n(40);function E(_e){return!!_e.match(/^[a-zA-Z0-9-_.,:?'"()@\/\\#$+ ]{1,255}$/)}var T=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};function h({func:_e,delay:F,immediate:H=!1}){let J=!1,oe=setTimeout(function ce(){return T(this,void 0,void 0,function*(){if(J)return;const he=new Date().getTime();try{se=_e(),yield se}finally{if(!J){const pe=new Date().getTime();oe=setTimeout(ce,Math.max(F-(pe-he),0))}}})},H?0:F),se=Promise.resolve();return{stop(){return T(this,void 0,void 0,function*(){J=!0,clearTimeout(oe),yield se})}}}var R=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};const W=n(230);class X{constructor(F){this.buffer={},this.reporters=[],this.flushInterval=h({func:()=>this.flushStats(),delay:X.samplePeriodMs}),this.tags=this.filterTags((F==null?void 0:F.tags)||{app:f.a,version:f.j,namespace:f.i,instanceId:B.a})}shutdown(){return R(this,void 0,void 0,function*(){yield this.flushInterval.stop(),yield this.flushStats(),yield Object(c.a)(2*g.a.second)})}aggregate(F,H,J){this.addToBuffer(this.buffer,this.encodeKey({metric:F,tags:this.filterTags(J||{})}),typeof H=="number"?{min:H,max:H,sum:H,count:1}:H)}increment(F,H){this.aggregate(F,1,H)}timer(F,H,J){return R(this,void 0,void 0,function*(){const oe=W(),se=yield H(),ce=W();return this.aggregate(F,ce-oe,J),se})}registerStatsReporter(F){this.reporters.push(F)}setTag(F,H){const J=this.filterTags({[F]:H});this.tags=Object.assign(Object.assign({},this.tags),J)}addToBuffer(F,H,J){if(F[H]){const{min:oe,max:se,sum:ce,count:he}=F[H];F[H]={min:Math.min(oe,J.min),max:Math.max(se,J.max),sum:ce+J.sum,count:he+J.count}}else F[H]=J}write(F){return R(this,void 0,void 0,function*(){yield Promise.all(this.reporters.map(H=>R(this,void 0,void 0,function*(){let J;const oe={};switch(H.type){case"simple":for(const[ce,he]of Object.entries(F)){const{metric:pe}=this.decodeKey(ce);this.addToBuffer(oe,this.encodeKey({metric:pe}),he)}J=oe;break;case"tagged":J=F;break;default:(function(ce){throw new Error(`Unreachable type encountered (${ce})`)})(H.type)}const se=Object.entries(J);if(se.length>0)return H.send(se.map(([ce,he])=>{const{metric:pe,tags:fe}=this.decodeKey(ce);return{name:pe,tags:Object.assign(Object.assign({},fe),this.tags),stat:he}}),X.samplePeriodMs).catch(ce=>{p.a.debug(`Failed to write stats to ${H.name}`,{error:ce})})})))})}flushStats(){return R(this,void 0,void 0,function*(){yield this.write(this.buffer),this.buffer={}})}encodeKey(F){return w()(Object.assign(Object.assign({},F),Object.keys(F.tags||{}).length>0?{tags:F.tags}:{}))}decodeKey(F){return JSON.parse(F)}filterTags(F){return Object.entries(F||{}).reduce((H,[J,oe])=>(E(J)&&E(oe)&&(H[J]=oe),H),{})}}X.samplePeriodMs=5*g.a.minute;const m=!!f.c,b=new X;m||["local","on-prem"].includes(f.i)||b.registerStatsReporter(new N("stats"));var G=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class j extends class{constructor(F){this.options=F,this.cache=new y.a(Object.assign(Object.assign(Object.assign({},F.dispose||F.disposeAfter?{ttlAutopurge:!0}:{}),F),{dispose:(...H)=>{var J;H[2]==="evict"&&b.increment("lru-eviction",{name:F.name}),(J=F.dispose)===null||J===void 0||J.call(F,...H)},disposeAfter:(...H)=>{var J;this.updateStats(),(J=F.disposeAfter)===null||J===void 0||J.call(F,...H)}})),this.stringify=F.fastStringify?JSON.stringify:w.a}set(F,H,J){const oe=this.stringify(F);if(!this.cache.set(oe,H,{ttl:J})){const se=this.cache.sizeCalculation?this.cache.sizeCalculation(H,oe):"unknown";throw Error(`Value too large (${se} > ${this.cache.max})`)}this.updateStats()}get(F){const{name:H}=this.options,J=this.stringify(F),oe=this.cache.getRemainingTTL(J);return oe<=0?b.increment("cache-miss",{name:H}):oe!==1/0&&b.aggregate("cache-item-ttl",oe,{name:H}),this.cache.get(J)}delete(F){this.cache.delete(this.stringify(F))}peek(F){return this.cache.peek(this.stringify(F))}size(){return this.cache.size}clear(){this.cache.clear()}forEach(F){this.cache.forEach(F)}purgeStale(){return this.cache.purgeStale()}updateStats(){const{name:F}=this.options;b.aggregate("cache-item-count",this.cache.size,{name:F}),this.cache.calculatedSize!==void 0&&b.aggregate("cache-length",this.cache.calculatedSize,{name:F})}}{constructor(F){if(super(F),this.expireRejectedPromiseValues=F.expireRejectedPromiseValues===void 0||F.expireRejectedPromiseValues,this.rejectedPromiseValueTtl=F.rejectedPromiseValueTtl!==void 0?F.rejectedPromiseValueTtl:g.a.second,this.rejectedPromiseValueTtl<0)throw new Error("rejectedPromiseValueTtl must not be negative")}set(F,H,J){super.set(F,H,J),this.expireRejectedPromiseValues&&H.catch(()=>G(this,void 0,void 0,function*(){yield Object(c.a)(this.rejectedPromiseValueTtl),this.peek(F)===H&&this.delete(F)}))}}var C=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class z{constructor(F,H,J){this.authClient=F,this.email=H,this.password=J,this.tokenTtlMs=1*g.a.hour,this.tokenCache=new j({name:"Credentials-tokenCache",max:100,ttl:this.tokenTtlMs-5*g.a.minute,fastStringify:!0})}getToken(){return C(this,void 0,void 0,function*(){let F=this.tokenCache.get(this.email);return F||(F=(()=>C(this,void 0,void 0,function*(){const{authentication:H}=yield this.authClient.login({email:this.email,password:this.password,tokenExpirationSeconds:this.tokenTtlMs/g.a.second});if(!H)throw new Error("User account not verified.");return H.accessToken}))(),this.tokenCache.set(this.email,F)),F})}}var P=n(97),D=n(17),O=n(233),L=n(41),U=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class A extends L.a{constructor(F){super(F)}postLanRtcOffer(F){return U(this,void 0,void 0,function*(){return yield this.fetch("v1/lan-rtc-offer",{method:"POST",body:F})})}}var V=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};function q(_e){return V(this,void 0,void 0,function*(){return(yield Promise.all(_e.map(F=>F.catch(H=>H)))).filter(F=>F instanceof Error)})}function Q(_e,F){if(_e===void 0)throw new Error(`Value is undefined${F?`: ${F}`:""}`)}function ee(_e,F){if(_e===null)throw new Error(`Value is null${F?`: ${F}`:""}`)}function te(_e){return Q(_e),_e}function k(_e,F){const H=_e.reduce((J,oe)=>[...J,...oe.urls],[]).filter(J=>x(J,F)).sort(J=>_(J,"udp")?-1:0).shift();if(H)return Object.assign(Object.assign({},te(_e.find(J=>J.urls.includes(H)))),{urls:[H]})}function x(_e,F){switch(F){case"stun":return/^stuns?:/.test(_e);case"turn":return/^turns?:/.test(_e)}}function _(_e,F){return _e.endsWith(`transport=${F}`)}var I=n(10);class $ extends Error{constructor(F,H){super(`Deadline expired after ${F}ms + ${H}ms`)}}class K{static withDeadline(F,H){const J=new Promise((oe,se)=>{setTimeout(()=>{se(new $(H,this.grpcCallDeadlineSlopMs))},H+this.grpcCallDeadlineSlopMs)});return Promise.race([F,J])}}K.grpcCallDeadlineSlopMs=500*g.a.millisecond;var Y=n(27);const ne={ordered:!1,maxPacketLifeTime:300*g.a.millisecond},ie={ordered:!0},ue={ordered:!0},we={ordered:!1,maxRetransmits:0},Oe={ordered:!1,maxRetransmits:0},Ee=_e=>"received"in _e&&_e.received!==void 0,De=_e=>!("received"in _e)||_e.received===void 0,Te=2*g.a.second;function Ae(_e,F={}){const H=Array.from(_e.values()),J=H.filter(Ee),oe=J.length>0,se=Math.max(...J.map(fe=>fe.received));let ce;if(oe){const fe=H.length,le=J.length,Se=J.map(ke=>ke.received-ke.sent),{standardDeviation:Ne,mean:xe,jitter:Ve}=function(ke){const Ue=ke.length;if(Ue===0)return{mean:NaN,standardDeviation:-1,jitter:NaN};const Ze=ke.reduce((Qe,ut)=>Qe+ut,0)/Ue,Ke=Math.sqrt(ke.map(Qe=>Math.pow(Qe-Ze,2)).reduce((Qe,ut)=>Qe+ut)/Ue);if(Ue===1)return{mean:Ze,standardDeviation:Ke,jitter:NaN};let Je=0;for(let Qe=1;Qe<Ue;Qe++)Je+=Math.abs(ke[Qe]-ke[Qe-1]);return{mean:Ze,standardDeviation:Ke,jitter:Je/(Ue-1)}}(Se),qe=H.filter(ke=>ke.sent<se-Te),Xe=qe.filter(De),et=Xe.length===0?0:Xe.length/qe.length;ce={pingsSent:fe,pongsReceived:le,average:xe,standardDeviation:Ne,jitter:Ve,max:Math.max(...Se),min:Math.min(...Se),loss:et}}else ce=null;const{temporalNow:he=Date.now()}=F,pe=(oe?se:he)-4*Te;return Array.from(_e.entries()).forEach(fe=>{const[le,Se]=fe;Se.sent<pe&&_e.delete(le)}),ce}function Ie({entityId:_e,streamName:F,streamType:H}){return`${_e}.${F}.${H}`}var ze=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class $e{constructor(F,H){this.counts={localSent:new Map,localReceived:new Map,remoteSent:new Map,remoteReceived:new Map},this.sessionId=F,this.connection=H}updateRemoteMessagesCounts(F){if(F.payload.streamsInfo){this.counts.remoteSent=new Map,this.counts.remoteReceived=new Map;for(const H of F.payload.streamsInfo.items)this.counts.remoteSent.set(H.streamId,H.sentCount),this.counts.remoteReceived.set(H.streamId,H.receivedCount)}}getLocalStreamsInfo(F){const{localSent:H,localReceived:J}=this.counts;return{items:[...new Set([...H.keys(),...J.keys()])].map(oe=>{var se,ce;return{streamId:oe,sentCount:(se=H.get(oe))!==null&&se!==void 0?se:0,receivedCount:(ce=J.get(oe))!==null&&ce!==void 0?ce:0}}),timestamp:F}}incrementLocalSent(F){const{localSent:H}=this.counts,J=Ie(F.header.stream);H.set(J,(H.get(J)||0)+1)}incrementLocalReceived(F){const{localReceived:H}=this.counts,J=Ie(F.header.stream),oe=H.get(J)||0;if(oe===0){const{streamName:se,streamType:ce}=F.header.stream;p.a.debug("RTC client received first message for stream",{streamName:se,streamType:ce})}H.set(J,oe+1)}uploadMetrics(){return ze(this,void 0,void 0,function*(){const{sessionId:F}=this,H=yield this.connection.peerConnection.getStats(),J={};H.forEach(fe=>J[fe.id]=fe),p.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:F}));const{localSent:oe,localReceived:se,remoteSent:ce,remoteReceived:he}=this.counts,pe=[...new Set([...oe.keys(),...se.keys()])].reduce((fe,le)=>{const Se=oe.get(le),Ne=se.get(le),xe=ce.get(le),Ve=he.get(le);return Object.assign(Object.assign({},fe),{[`local-${le}-sent`]:Se,[`local-${le}-received`]:Ne,[`remote-${le}-sent`]:xe,[`remote-${le}-received`]:Ve})},{sessionId:F});p.a.debug("rtc-message-report",Object.assign({deviceId:this.connection.getRemoteDeviceId()},pe))})}}function nt(_e,F,H){return{header:{stream:_e,created:Date.now(),frameId:H||""},payload:F}}function _t(_e){const F=_e.localCandidate.candidateType,H=_e.remoteCandidate.candidateType;return F==="host"&&H==="host"?"local":F==="relay"||H==="relay"?"TURN":"STUN"}function vt(_e){return new Set(["disconnected","failed","closed"]).has(_e.iceConnectionState)}function Rt(_e){switch(_e.header.stream.streamType){case"twist":{const{twist:F}=_e.payload;if(!F)throw Error("twist not in payload of RTC message with type twist");return{header:_e.header,payload:{twist:{linear:Object.assign({x:0,y:0,z:0},F.linear),angular:Object.assign({x:0,y:0,z:0},F.angular)}}}}case"pose":{const{pose:F}=_e.payload;if(!F)throw Error("pose not in payload of RTC message with type pose");return{header:_e.header,payload:{pose:{translation:Object.assign({x:0,y:0,z:0},F.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},F.rotation)}}}}case"pose-with-covariance":{const{poseWithCovariance:F}=_e.payload;if(!F)throw Error("poseWithCovariance not in payload of RTC message with type pose-with-covariance");const H=new Array(36).fill(0);return F.covariance.forEach((J,oe)=>{if(oe>=36)throw Error("covariance contains more than 36 elements");H[oe]=J}),{header:_e.header,payload:{poseWithCovariance:{pose:{translation:Object.assign({x:0,y:0,z:0},F.pose.translation),rotation:Object.assign({x:0,y:0,z:0,w:0},F.pose.rotation)},covariance:H}}}}case"point":{const{point:F}=_e.payload;if(!F)throw Error("point not in payload of RTC message with type point");return{header:_e.header,payload:{point:Object.assign({x:0,y:0,z:0},F)}}}default:return _e}}var st=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class pt{get peerConnection(){return ee(this._peerConnection,"RTCPeerConnection is closed!"),this._peerConnection}constructor(F,H,J,oe){this.iceServers=H,this.config=J,this.dataChannelNotifier=oe,this.connectTimeoutMs=20*g.a.second,this.iceGatheringTimeoutMs=3*g.a.second,this.pingUpdateTimeoutMs=1*g.a.second,this.pingV2UpdateTimeoutMs=250*g.a.millisecond,this.pingV2MetricsGatherTimeoutMs=1*g.a.second,this.streamsInfoUpdateTimeoutMs=2*g.a.second,this.reassemblyTimeoutMs=500*g.a.millisecond,this.reassemblyTableCleanupMs=1*g.a.second,this.heartbeatTimeoutMs=20*g.a.millisecond,this._peerConnection=null,this.heartbeatChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.streamLatestTimestamp=new Map,this.reassemblyTable=new Map,this.reassemblyTableLastTimestamp=new Map,this.closeCalled=!1,this.gotOffer=!1,this.hasIceCandidate=!1,this.pingV2Map=new Map,this.sendPingV2=()=>{const{latestTryOnceStreamChannel:ce}=this;if(!ce)return;const he=new Date().getTime(),pe=Object(O.a)();this.sendSystemMessage(ce,{type:"ping-v2",payload:{timestamp:he,id:pe}}),this.pingV2Map.set(pe,{sent:he})},this.gatherPingV2Metrics=()=>{const ce=Ae(this.pingV2Map);if(ce){const he=this.getRemoteDeviceId();this.pingInfo=ce,b.aggregate("rtc-ping-average",ce.average,Object.assign({},he?{deviceId:he}:{})),b.aggregate("rtc-ping-loss",ce.loss,Object.assign({},he?{deviceId:he}:{})),b.aggregate("rtc-jitter",ce.jitter,Object.assign({},he?{deviceId:he}:{}))}},this._peerConnection=F;const{isOffer:se}=J.baseConfig;se?this.initializeChannels(F):F.ondatachannel=ce=>{switch(ce.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=ce.channel;break;case"stream.reliable":this.reliableStreamChannel=ce.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=ce.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=ce.channel;break;case"heartbeat":return void(this.heartbeatChannel=ce.channel);default:return void this.dataChannelNotifier(ce.channel)}this.setupChannel(ce.channel)},this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:ce}=this;ce&&this.sendSystemMessage(ce,{type:"ping"})},this.pingUpdateTimeoutMs),this.pingV2UpdateTimeout=setInterval(this.sendPingV2,this.pingV2UpdateTimeoutMs),this.pingV2MetricsGatherTimeout=setInterval(this.gatherPingV2Metrics,this.pingV2MetricsGatherTimeoutMs),this.streamsInfoUpdateTimeout=setInterval(()=>{const{latestTtlStreamChannel:ce}=this;ce&&this.sendSystemMessage(ce,{type:"streams-info"})},this.streamsInfoUpdateTimeoutMs),this.reassemblyTableCleanupTimeout=setInterval(()=>{const ce=new Date().getTime();this.reassemblyTableLastTimestamp.forEach((he,pe,fe)=>{ce>pe+this.reassemblyTimeoutMs&&this.reassemblyTable.delete(he)})},this.reassemblyTableCleanupMs),this.heartbeatTimeout=setInterval(()=>{const{heartbeatChannel:ce}=this;ce&&ce.readyState==="open"&&ce.send(new Uint8Array([1]))},this.heartbeatTimeoutMs)}handleSignal(F){return st(this,void 0,void 0,function*(){const{peerConnection:H}=this,{track:J}=this.config.baseConfig,oe=(()=>{try{return JSON.parse(F.getPayload())}catch{return}})();if(!oe)return void p.a.error("Received unparseable signal.");p.a.debug("Handling signal",{description:oe});const{sdp:se,type:ce}=oe;if(!se||!ce)return void p.a.warn("Received non-SDP signal");const{signalingState:he,connectionState:pe}=H;if(he!=="stable"||pe!=="connected")if(H.remoteDescription)p.a.warn(`Received SDP after remote description was set: ${se}`);else{if(ce==="offer"){if(he!=="stable")return void p.a.warn("Received offer SDP when signaling is ongoing.");yield H.setRemoteDescription(oe);const fe=yield H.createAnswer();yield H.setLocalDescription(fe);const le=F.clone();return J==null||J("Answer Received",le),le.setPayload(JSON.stringify(fe)),le.setReceiverId(F.getSenderId()),le.setSenderId(F.getReceiverId()),le}if(ce==="answer"){if(he==="stable")return void p.a.warn("Received answer SDP when signaling hasn't started.");yield H.setRemoteDescription(oe)}}else p.a.warn(`Received SDP when already connected: ${se}`)})}send(F,H){const J=this.getChannelFromLabel(H.channelLabel);J?this.sendOnChannel(J,F):p.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(F){var H;this.sendSystemMessage((ee(H=this.reliableStreamChannel),H),{type:"stream-control",streamControl:F})}isActive(){return new Set(["new","checking","connected","completed"]).has(this.peerConnection.iceConnectionState)||this.isReady()}isReady(){const{reliableStreamChannel:F,latestTtlStreamChannel:H,latestTryOnceStreamChannel:J,latestReliableStreamChannel:oe}=this;return(F==null?void 0:F.readyState)==="open"&&(H==null?void 0:H.readyState)==="open"&&(J==null?void 0:J.readyState)==="open"&&(oe==null?void 0:oe.readyState)==="open"}close(){var F,H,J,oe,se,ce,he;return st(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield(F=this.sessionMetrics)===null||F===void 0?void 0:F.uploadMetrics(),gt(this.pingUpdateTimeout),gt(this.pingV2UpdateTimeout),gt(this.pingV2MetricsGatherTimeout),gt(this.reassemblyTableCleanupTimeout),gt(this.streamsInfoUpdateTimeout),gt(this.heartbeatTimeout),(H=this._peerConnection)===null||H===void 0||H.close(),(J=this.heartbeatChannel)===null||J===void 0||J.close(),(oe=this.latestReliableStreamChannel)===null||oe===void 0||oe.close(),(se=this.latestTryOnceStreamChannel)===null||se===void 0||se.close(),(ce=this.latestTtlStreamChannel)===null||ce===void 0||ce.close(),(he=this.reliableStreamChannel)===null||he===void 0||he.close(),this._peerConnection=null,this.heartbeatChannel=null,this.latestReliableStreamChannel=null,this.latestTryOnceStreamChannel=null,this.latestTtlStreamChannel=null,this.reliableStreamChannel=null)})}getPing(){return this.pingTimeMs}getPingInfo(){return this.pingInfo}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionCreatedTimestamp(){var F;return(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionCreatedTimestamp}setSessionCreatedTimestamp(F){this.config.remoteConfig&&(this.config.remoteConfig.sessionCreatedTimestamp=F)}getSessionId(){var F;return(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionId}setSessionId(F){this.config.remoteConfig&&(this.config.remoteConfig.sessionId=F,this.sessionMetrics=new $e(F,this))}getRemotePeerId(){return this.config.baseConfig.remotePeerId}getRemoteDeviceId(){var F;return(F=this.config.baseConfig)===null||F===void 0?void 0:F.remoteDeviceId}setRemoteDeviceId(F){this.config.baseConfig.remoteDeviceId=F}getSessionMetricsMessageCounts(){var F;return(F=this.sessionMetrics)===null||F===void 0?void 0:F.counts}getConnectionStatsInfo(){return st(this,void 0,void 0,function*(){const{peerConnection:F}=this;if(!F)return;const H=yield F.getStats(null),J=[];H.forEach(pe=>{J.push(pe)});const oe=J.find(pe=>pe.type==="transport");if(!oe)return;const se=J.find(pe=>(pe.type==="candidate-pair"||pe.type==="candidatepair")&&pe.id===oe.selectedCandidatePairId);if(!se)return;const ce=J.find(pe=>pe.id===se.localCandidateId),he=J.find(pe=>pe.id===se.remoteCandidateId);return ce&&he&&(ce.address=ce.address||ce.ip,he.address=he.address||he.ip,ce.address!==void 0&&he.address!==void 0)?{transport:oe,localCandidate:ce,remoteCandidate:he}:void 0})}initializeChannels(F){this.heartbeatChannel=F.createDataChannel("heartbeat",Oe),this.heartbeatChannel.binaryType="arraybuffer",this.latestTtlStreamChannel=F.createDataChannel("stream.latest-ttl",ne),this.latestTtlStreamChannel.binaryType="arraybuffer",this.reliableStreamChannel=F.createDataChannel("stream.reliable",ie),this.reliableStreamChannel.binaryType="arraybuffer",this.latestReliableStreamChannel=F.createDataChannel("stream.latest-reliable",ue),this.latestReliableStreamChannel.binaryType="arraybuffer",this.latestTryOnceStreamChannel=F.createDataChannel("stream.latest-try-once",we),this.latestTryOnceStreamChannel.binaryType="arraybuffer",this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}getOffer(){var F,H;return st(this,void 0,void 0,function*(){const{gotOffer:J}=this,{peerConnection:oe,config:se}=this;if(this.config.baseConfig.isLan)throw new Error('"getOffer" method can only be called with internet connections. LAN connections should call the "getLanOffer" method.');const ce=(F=this.config.remoteConfig)===null||F===void 0?void 0:F.sessionId;if(J)return void p.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,vt(this.peerConnection))return void p.a.debug("Failed to generate offer because the peer connection was inactive.");const he=se.baseConfig.track;oe.onicecandidate=()=>{this.hasIceCandidate=!0},oe.oniceconnectionstatechange=()=>st(this,void 0,void 0,function*(){const xe=oe.iceConnectionState;if(xe==="connected"||xe==="completed"){const Ve=yield this.getConnectionStatsInfo(),qe=Ve?_t(Ve):void 0;p.a.info(`ICE connection state changed to ${xe}`,{sessionId:ce,connectionStatsInfo:Ve,iceMode:qe}),he==null||he("ICE connection state change",{iceConnectionState:xe,sessionId:ce,connectionStatsInfo:Ve,iceMode:qe})}}),yield oe.setLocalDescription(yield oe.createOffer());const pe=oe.getConfiguration?oe.getConfiguration().iceTransportPolicy:"all",fe=new Date().getTime();for(;;){const xe=new Date().getTime()-fe;if(xe>this.connectTimeoutMs)return void p.a.debug("Failed to generate offer because ICE gathering timed out.");if(xe>this.iceGatheringTimeoutMs&&this.hasIceCandidate){p.a.debug("ICE gathering partially completed; proceeding",{iceTransportPolicy:pe,waitTime:xe}),he==null||he("ICE gathering partially completed",{sessionId:ce,iceTransportPolicy:pe,waitTime:xe});break}if(oe.iceGatheringState==="complete"){p.a.debug("ICE gathering complete",{iceTransportPolicy:pe,waitTime:xe}),he==null||he("ICE gathering completed",{sessionId:ce,iceTransportPolicy:pe,waitTime:xe});break}yield Object(c.a)(.1*g.a.second)}const le=(H=this.iceServers)!==null&&H!==void 0?H:[];for(const xe of le)"credentialType"in xe&&(xe.credentialType=void 0);const Se=JSON.stringify(le),Ne=new I.Signal;return Ne.setPayload(JSON.stringify(oe.localDescription)),Ne.setSenderId(this.config.baseConfig.localPeerId),Ne.setReceiverId(this.config.baseConfig.remotePeerId),Ne.setIceServers(Se),Ne.setIceTransportPolicy(pe??"all"),this.config.baseConfig.sessionType!==void 0?Ne.setSessionType(this.config.baseConfig.sessionType):Ne.setSessionType(I.SessionType.TELEOP),p.a.debug("Sending offer signal with description",{description:Ne.getPayload()}),Ne})}getLanOffer(){return st(this,void 0,void 0,function*(){const{peerConnection:F,gotOffer:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"getLanOffer" method can only be used with LAN connections. Internet connections should call the "getOffer" method.');if(H)return void p.a.debug("Failed to generate offer because gotOffer was already called.");if(this.gotOffer=!0,vt(this.peerConnection))return void p.a.debug("Failed to generate offer because the peer connection was inactive.");yield F.setLocalDescription(yield F.createOffer());const J=new Date().getTime();for(;;){if(new Date().getTime()-J>this.iceGatheringTimeoutMs)return void p.a.debug("Failed to generate offer because ICE gathering timed out.");if(F.iceGatheringState==="complete")break;yield Object(c.a)(.1*g.a.second)}const oe=F.localDescription;if(oe)return p.a.debug("Sending LAN offer signal with description",{description:oe}),oe;p.a.error("Failed to generate LAN offer description")})}handleLanAnswer(F){return st(this,void 0,void 0,function*(){const{peerConnection:H}=this;if(!this.config.baseConfig.isLan)throw new Error('"handleLanAnswer" method can only be used with LAN connections. Internet connections should call the "handleSignal" method.');yield H.setRemoteDescription(F)})}getChannelFromLabel(F){switch(F){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(F,H){var J;let oe;try{oe=Object(Y.encode)(JSON.stringify(H))}catch(se){return void p.a.warn("Failed to encode RTC message",{error:se})}try{F.send(oe),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalSent(H)}catch(se){p.a.warn("Failed to send message to channel",{error:se,channel:F.label})}}channelNotRecognized(F){return F!==this.latestTtlStreamChannel&&F!==this.latestReliableStreamChannel&&F!==this.latestTryOnceStreamChannel&&F!==this.reliableStreamChannel}setupChannel(F){F.onmessage=H=>{if(this.channelNotRecognized(F))return void p.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(H.data))}catch(oe){return void p.a.warn("Received unparseable message on RTC stream data channel",{error:oe,channel:F.label})}J.communicationType==="message-chunk"?this.receiveChannelMessageChunk(F,J):this.receiveChannelMessage(F,J)},F.onerror=H=>{p.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:F.label})},F.onopen=()=>{p.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:F.label})},F.onclose=()=>{const H={bufferedAmount:F.bufferedAmount,sessionId:this.getSessionId(),channelLabel:F.label};this.closeCalled===!1?p.a.debug("Unexpected channel closed",H):p.a.debug("Channel closed",H)}}receiveChannelMessage(F,H){var J;const{config:oe}=this,{remotePeerId:se}=this.config.baseConfig;this.lastMessageTimestamp=new Date().getTime(),H=Rt(H),(J=this.sessionMetrics)===null||J===void 0||J.incrementLocalReceived(H),this.handleSystemMessage(F,H)||(F===this.latestTryOnceStreamChannel||F===this.latestTtlStreamChannel||F===this.latestReliableStreamChannel)&&!this.isLatestMessage(H)||oe.baseConfig.receive(se,H)}receiveChannelMessageChunk(F,H){const J=this.reassemblyTable.get(H.id)||[];if(J.push(H),J.length===H.total){const oe=function(se){const ce=se.sort((he,pe)=>he.seq<pe.seq?-1:1).map(he=>he.part).reduce((he,pe)=>he+pe);try{return JSON.parse(ce)}catch{return void p.a.warn("Could not reassemble RTC message chunks")}}(J);return oe&&this.receiveChannelMessage(F,oe),void this.reassemblyTable.delete(H.id)}this.reassemblyTable.set(H.id,J),this.reassemblyTableLastTimestamp.set(H.id,new Date().getTime())}handleSystemMessage(F,H){var J,oe;const{config:se}=this,{baseConfig:ce}=se,{remotePeerId:he,remoteDeviceId:pe}=ce;switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(F,{type:"pong",timestamp:te(H.payload.ping)}),!0;case"pong":{const fe=new Date().getTime()-te(H.payload.pong);return this.pingTimeMs=fe,b.aggregate("rtc-ping-time",fe,Object.assign({},pe?{deviceId:pe}:{})),!0}case"ping-v2":return this.sendPingV2(),!0;case"pong-v2":{const fe=te(H.payload.pongV2),le=this.pingV2Map.get(fe.id);return(le==null?void 0:le.sent)!==fe.timestamp&&p.a.warn("Pong timestamp doesn't match stored value",{currentEntry:le,pong:fe}),this.pingV2Map.set(fe.id,{sent:fe.timestamp,received:new Date().getTime()}),!0}case"streams-info":{const{sessionMetrics:fe}=this,le=(J=H.payload.streamsInfo)===null||J===void 0?void 0:J.timestamp;return!!le&&(fe==null||fe.updateRemoteMessagesCounts(H),(oe=ce.onStreamsInfoUpdate)===null||oe===void 0||oe.call(ce,he,le),!0)}case"stream-control":return!0;default:return!1}}sendSystemMessage(F,H){var J;const{localUserId:oe,localPeerId:se}=this.config.baseConfig;if(F.readyState!=="open")return;const ce={entityId:oe??se,streamName:`$.${H.type}`,streamType:H.type};let he;switch(H.type){case"ping":he={ping:new Date().getTime()};break;case"pong":he={pong:H.timestamp};break;case"ping-v2":he={pingV2:H.payload};break;case"pong-v2":he={pongV2:H.payload};break;case"stream-control":he={streamControl:H.streamControl};break;case"streams-info":he={streamsInfo:(J=this.sessionMetrics)===null||J===void 0?void 0:J.getLocalStreamsInfo(new Date().getTime())}}this.sendOnChannel(F,nt(ce,he))}isLatestMessage(F){const H=Ie(F.header.stream),J=(this.streamLatestTimestamp.get(H)||0)<=F.header.created;return J&&this.streamLatestTimestamp.set(H,F.header.created),J}}function gt(_e){_e&&clearInterval(_e)}function Pt(){p.a.debug("forceGarbageCollection() triggered"),queueMicrotask(()=>{let _e=document.createElement("img");_e.src=window.URL.createObjectURL(new Blob([new ArrayBuffer(5e7)])),_e.onerror=function(){window.URL.revokeObjectURL(this.src),_e=null}})}function xt(_e){try{return _e instanceof Error?`${_e.name}: ${_e.message}`:typeof _e=="object"?JSON.stringify(_e):String(_e)}catch{return"Unknown error"}}function Ot(_e){var F,H;return{userId:(F=_e.getUserId())===null||F===void 0?void 0:F.getValue(),deviceId:(H=_e.getDeviceId())===null||H===void 0?void 0:H.getValue(),organizationId:_e.getOrganizationId(),id:_e.getPeerId(),capabilities:[],capabilitySet:{}}}var Be=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};const ft=_e=>_e.map(F=>Object.assign(Object.assign(Object.assign({},F),F.username?{username:"<REDACTED>"}:null),F.credential?{credential:"<REDACTED>"}:null));class zt{constructor(F){this.config=F,this.grpcCallDeadline=5*g.a.second,this.refreshIntervalDelayMs=2*g.a.second,this.iceServersTtl=30*g.a.minute,this.connections=[],this.localConnections=[],this.isConnectionInitiator=new WeakSet,this.isOutgoingConnection=new Set,this.peerDataChannelListeners=[],this.rtcInstancesConstructed=0,this.statsLoopsExecuted=0;const{refreshIntervalDelayMs:H}=this;this.refreshInterval=h({func:()=>Be(this,void 0,void 0,function*(){try{yield this.update()}catch(J){p.a.warn("RTC refresh failed",{error:J})}}),delay:H,immediate:!0})}send(F,H,J){const oe=this.getActiveConnection(F);oe?oe.isReady()?oe.send(H,J):p.a.warn("Send called with unready connection."):p.a.warn("Send called with no connection.")}controlRemoteStream(F,H){const J=this.getActiveConnection(F);J?J.isReady()?J.controlRemoteStream(H):p.a.warn("controlRemoteStream called with unready connection."):p.a.warn("controlRemoteStream called with no connection.")}getLocalPeer(){return Be(this,void 0,void 0,function*(){for(;!this.localPeer;)yield Object(c.a)(.1*g.a.second);return Ot(this.localPeer)})}connect(F,H){var J,oe,se;return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode===!0)throw new Error("connect method called in local only mode.");const{track:ce,signalingClient:he}=this.config,{localPeer:pe,receiveSignalStream:fe,iceServers:le}=this;if(!pe||!fe||!le)return void p.a.warn("Connect called prior to local peer, receiveSignalStream, and ICE servers ready");if(this.getActiveConnection(F))return void p.a.warn("Connect called for peer with existing connection.");if(this.isOutgoingConnection.has(F))return void p.a.warn("Connect called for peer with an existing outgoing connection offer.");this.isOutgoingConnection.add(F);const Se=function(ke,Ue,Ze){const{rtcIceTransportPolicies:Ke,rtcIceServerProtocol:Je,useAllServers:Qe}=Ue||{},ut=ke.map(lt=>Object.assign(Object.assign({},lt),{urls:lt.urls.filter(yt=>{const kt=(Ke===void 0||Ke.some(Ct=>x(yt,Ct)))&&(Je===void 0||_(yt,Je));return kt||p.a.debug(`Ignoring ICE server: ${yt}`,{organizationId:Ze}),kt})})).filter(({urls:lt})=>lt.filter(yt=>yt).length>0);return Qe?ut:[k(ut,"stun"),k(ut,"turn")].filter(lt=>lt!==void 0).map(lt=>te(lt))}(le,H);p.a.debug("Received ICE servers:",ft(le)),p.a.debug("Using ICE servers:",ft(Se));const Ne=new pt(yield this.createRTCPeerConnection(Se),Se,{baseConfig:{isOffer:!0,isLan:!1,receive:(ke,Ue)=>this.config.receive(ke,Ue),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(ke,Ue)=>{var Ze,Ke;return(Ke=(Ze=this.config).onStreamsInfoUpdate)===null||Ke===void 0?void 0:Ke.call(Ze,ke,Ue)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=pe.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:pe.getPeerId(),remotePeerId:F,sessionType:this.config.sessionType},remoteConfig:{}},ke=>this.onCustomDataChannel(F,ke)),xe=yield Ne.getOffer();if(!xe)return p.a.error("Failed to generate offer."),void this.isOutgoingConnection.delete(F);p.a.debug("Sending offer."),ce==null||ce("Sending offer",xe);const Ve=new I.SendSignalRequest;Ve.setSignal(xe);const qe=yield(()=>Be(this,void 0,void 0,function*(){try{return yield K.withDeadline(he.sendSignal(Ve,yield this.getMetadata()),this.grpcCallDeadline)}catch(ke){p.a.warn("Error when sending signal",{error:ke})}}))();if(!this.isOutgoingConnection.has(F))return void p.a.debug("No offer set after receiving offer signal response.");p.a.debug("Offer sent.");const Xe=(oe=qe==null?void 0:qe.getSessionId())===null||oe===void 0?void 0:oe.getValue(),et=(se=qe==null?void 0:qe.getSessionCreatedTimestamp())===null||se===void 0?void 0:se.getValue();return Xe&&et?(Ne.setSessionId(Xe),Ne.setSessionCreatedTimestamp(et),this.isOutgoingConnection.delete(F),this.connections.push(Ne),this.isConnectionInitiator.add(Ne),this.setupHandlers(Ne),Xe):(p.a.warn("No session ID or no session created timestamp on send signal response."),void this.isOutgoingConnection.delete(F))})}connectLan(F){var H,J;return Be(this,void 0,void 0,function*(){const oe=new A(F),se=new pt(yield this.createRTCPeerConnection([]),[],{baseConfig:{isOffer:!0,isLan:!0,receive:(fe,le)=>this.config.receive(fe,le),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(fe,le)=>{var Se,Ne;return(Ne=(Se=this.config).onStreamsInfoUpdate)===null||Ne===void 0?void 0:Ne.call(Se,fe,le)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localUserId:(J=(H=this.localPeer)===null||H===void 0?void 0:H.getUserId())===null||J===void 0?void 0:J.getValue(),localPeerId:"lan_client",remotePeerId:F}},fe=>this.onCustomDataChannel(F,fe)),ce=yield se.getLanOffer();if(!ce)return p.a.warn("Could not generate LAN offer"),!1;const he=yield oe.postLanRtcOffer({offer:JSON.stringify(ce)}),pe=new RTCSessionDescription(JSON.parse(he.answer));return yield se.handleLanAnswer(pe),this.localConnections.push(se),this.isConnectionInitiator.add(se),Object(O.a)()})}getConnections(){return[...this.connections,...this.localConnections]}createCustomDataChannel(F,H,J,oe,se){const ce=this.getActiveConnection(F);if(ce&&this.isConnectionInitiator.has(ce)){const pe=ce.peerConnection.createDataChannel("custom."+H,J);return oe&&(pe.binaryType="arraybuffer"),se(F,pe),()=>{}}const he=(pe,fe)=>{F===pe&&fe.label==="custom."+H&&se(F,fe)};return this.peerDataChannelListeners.push(he),()=>{this.peerDataChannelListeners=this.peerDataChannelListeners.filter(pe=>pe!==he)}}onCustomDataChannel(F,H){this.peerDataChannelListeners.forEach(J=>J(F,H))}getConnectionStatus(F){if(this.isOutgoingConnection.has(F))return"connecting";const H=this.getActiveConnection(F);return H?H.isReady()?"connected":"connecting":"disconnected"}getConnectionStatsInfo(F){return Be(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);if(H)return yield H.getConnectionStatsInfo()})}disconnect(F){return Be(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);H&&(yield H.close(),this.connections=this.connections.filter(J=>J!==H),this.localConnections=this.localConnections.filter(J=>J!==H))})}getPeers(){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>Be(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.getPeers(new I.GetPeersRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){p.a.warn("Error when getting peers",{error:se})}}))();if(!H)return[];const J=H.getPeersList();if(!J)return[];const oe=se=>{var ce,he;return(he=(ce=se.getPeerCreatedTimestamp())===null||ce===void 0?void 0:ce.getValue())!==null&&he!==void 0?he:0};return J.sort((se,ce)=>oe(ce)-oe(se)).map(se=>Ot(se))})}getSessions(){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getPeers method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>Be(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.getPeers(new I.GetPeersRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){p.a.warn("Error when getting peers",{error:se})}}))();if(!H)return{};const J=H.getPeersList(),oe={};for(const se of J)oe[se.getPeerId()]=se.getSessionIdsList();return oe})}getPing(F){const H=this.getActiveConnection(F);if(H)return H.getPing();p.a.warn("Attempted to get ping time from inactive peer.")}getPingInfo(F){const H=this.getActiveConnection(F);if(H)return H.getPingInfo();p.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(F){const H=this.getActiveConnection(F);if(H)return H.getLastMessageTimestamp();p.a.warn("Attempted to get last message time from inactive peer.")}getSessionMetricsMessageCounts(F){const H=this.getActiveConnection(F);if(H)return H.getSessionMetricsMessageCounts();p.a.warn("Attempted to get session metrics counts from inactive peer.")}isReady(){if(this.config.lanOnlyMode)return!0;const{localPeer:F,receiveSignalStream:H,iceServers:J}=this;return!!(F&&H&&J)}shutdown(){return Be(this,void 0,void 0,function*(){p.a.info("Shutdown called on RTC client"),yield this.refreshInterval.stop(),this.receiveSignalStream&&this.receiveSignalStream.cancel();const F=this.connections;this.connections=[],yield this.closeConnections(F);const H=this.localConnections;this.localConnections=[],yield this.closeConnections(H),this.isOutgoingConnection.clear(),this.peerDataChannelListeners=[];const{localPeer:J}=this;if(!J||this.config.lanOnlyMode)return;const{signalingClient:oe}=this.config;yield(()=>Be(this,void 0,void 0,function*(){try{const se=new I.DeletePeerRequest;se.setPeerId(J.getPeerId()),yield K.withDeadline(oe.deletePeer(se,yield this.getMetadata()),this.grpcCallDeadline)}catch(se){return void p.a.warn("Error deleting local peer",{error:se})}}))()})}createPeer(){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createPeer method cannot be used in local-only mode.");const{signalingClient:F}=this.config,H=yield(()=>Be(this,void 0,void 0,function*(){try{return yield K.withDeadline(F.createPeer(new I.CreatePeerRequest,yield this.getMetadata()),this.grpcCallDeadline)}catch(oe){const se=oe;p.a.debug("createPeer failed",{error:se});const ce=xt(se);throw new Error(`Was not able to create peer: ${ce}`)}}))(),J=H==null?void 0:H.getPeer();if(!J)throw new Error("Response did not provide peer.");return this.localPeer=J})}createReceiveSignalStream(){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("createReceiveSignalStream method cannot be used in local-only mode.");const{signalingClient:F}=this.config,{localPeer:H,iceServers:J}=this;if(!H||!J)return;const{receiveSignalStream:oe}=this;oe&&oe.cancel();const se=new I.ReceiveSignalStreamRequest;se.setPeerId(H.getPeerId());const ce=yield(()=>Be(this,void 0,void 0,function*(){try{return F.receiveSignalStream(se,yield this.getMetadata({hasDeadline:!1}))}catch(he){p.a.debug("createReceiveSignalStream failed",{error:he});const pe=xt(he);throw new Error(`Unable to create receive signal stream: ${pe}`)}}))();if(!ce)throw new Error("Response did not provide stream.");return ce.on("data",he=>Be(this,void 0,void 0,function*(){var pe,fe,le,Se;const Ne=he.getSignal(),xe=(pe=Ne==null?void 0:Ne.getSessionId())===null||pe===void 0?void 0:pe.getValue(),Ve=Ne==null?void 0:Ne.getSenderId(),qe=Ne==null?void 0:Ne.getReceiverId(),Xe=(fe=Ne==null?void 0:Ne.getSessionCreatedTimestamp())===null||fe===void 0?void 0:fe.getValue();if(!(Ne&&xe&&Ve&&qe&&Xe))return void p.a.warn("Received signal with missing information.");const et=this.getActiveConnection(Ve);if(et)if(et.getSessionId()!==xe){if(p.a.debug("Received signal: different session for a peer we're already connected to."),(et.getSessionCreatedTimestamp()||0)>Xe)return;const ke=new pt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Ue,Ze)=>this.config.receive(Ue,Ze),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Ue,Ze)=>{var Ke,Je;return(Je=(Ke=this.config).onStreamsInfoUpdate)===null||Je===void 0?void 0:Je.call(Ke,Ue,Ze)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(Se=H.getUserId())===null||Se===void 0?void 0:Se.getValue(),remotePeerId:Ve},remoteConfig:{sessionId:xe,sessionCreatedTimestamp:Xe}},Ue=>this.onCustomDataChannel(Ve,Ue));yield ke.handleSignal(Ne),this.connections.push(ke)}else p.a.debug("Received signal: for an existing connection."),yield et.handleSignal(Ne);else{p.a.debug("Received signal: new connection.");const ke=new pt(yield this.createRTCPeerConnection(J),J,{baseConfig:{isOffer:!1,isLan:!1,receive:(Ue,Ze)=>this.config.receive(Ue,Ze),onStreamsInfoUpdate:this.config.onStreamsInfoUpdate?(Ue,Ze)=>{var Ke,Je;return(Je=(Ke=this.config).onStreamsInfoUpdate)===null||Je===void 0?void 0:Je.call(Ke,Ue,Ze)}:void 0,track:this.config.lanOnlyMode?void 0:this.config.track,localPeerId:H.getPeerId(),localUserId:(le=H.getUserId())===null||le===void 0?void 0:le.getValue(),remotePeerId:Ve},remoteConfig:{sessionId:xe,sessionCreatedTimestamp:Xe}},Ue=>this.onCustomDataChannel(Ve,Ue));yield ke.handleSignal(Ne),this.connections.push(ke)}})),ce.on("end",()=>{ce.cancel(),this.receiveSignalStream=void 0}),ce.on("error",he=>{switch(he.code){case D.StatusCode.CANCELLED:case D.StatusCode.UNAVAILABLE:case D.StatusCode.UNKNOWN:p.a.debug("Receive signal stream error",{error:he});break;case D.StatusCode.UNAUTHENTICATED:p.a.warn("Receive signal stream error",{error:he});break;default:p.a.error("Receive signal stream error",{error:he})}ce.cancel(),this.receiveSignalStream=void 0}),this.receiveSignalStream=ce})}createRTCPeerConnection(F){var H;return Be(this,void 0,void 0,function*(){const J=(H=this.config.alternateRTCPeerConnection)!==null&&H!==void 0?H:window.RTCPeerConnection;if(!J)throw function(){const{userAgent:oe}=navigator;return oe.includes("Firefox/")?"Firefox":oe.includes("Edg/")?"Edge":oe.includes("Chrome/")?"Chrome":oe.includes("Safari/")?"Safari":oe.includes("MSIE/")||oe.includes("Trident/")?"IE":"Other"}()!=="Chrome"?new Error("WebRTC is not enabled. Please try again with the latest version of Google Chrome."):new Error("WebRTC is not enabled. Please ensure WebRTC is not disabled by ad blocking software.");this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||Pt();try{return new J({iceServers:F})}catch(oe){throw p.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),oe}})}closeConnections(F){return Be(this,void 0,void 0,function*(){const H=yield q(F.map(J=>Be(this,void 0,void 0,function*(){yield J.close()})));for(const J of H)p.a.warn("Request to close session failed",{error:J})})}getActiveConnection(F){return this.getConnections().find(H=>H.getRemotePeerId()===F&&H.isActive())}update(){var F;return Be(this,void 0,void 0,function*(){if(this.localConnections=this.localConnections.filter(Se=>Se.isActive()),this.config.lanOnlyMode)return;const{signalingClient:H}=this.config;if(!this.localPeer||!this.receiveSignalStream||!this.iceServers){const Se=[];return this.localPeer||Se.push(this.createPeer()),this.iceServers||Se.push(this.updateIceServers()),yield Promise.all(Se),void(this.receiveSignalStream||(yield this.createReceiveSignalStream()))}const[J,oe]=(se=this.connections,ce=Se=>Se.isActive(),se.reduce((Se,Ne,xe,Ve)=>{const[qe,Xe]=Se;return(ce(Ne,xe,Ve)?qe:Xe).push(Ne),Se},[[],[]]));var se,ce;yield this.closeConnections(oe),this.connections=J,this.gatherConnectionStats().catch(Se=>{p.a.warn("Error calling gatherConnectionStats",{error:Se})}),this.statsLoopsExecuted++;const{localPeer:he}=this,pe=this.connections.filter(Se=>Se.getSessionId).map(Se=>te(Se.getSessionId()));he.setSessionIdsList(pe);const fe=new I.RefreshPeerRequest;fe.setPeer(he);try{yield K.withDeadline(H.refreshPeer(fe,yield this.getMetadata()),this.grpcCallDeadline)}catch(Se){Se instanceof D.RpcError&&Se.code===D.StatusCode.NOT_FOUND?(p.a.warn("Peer expired, creating new peer",{peerId:he.getPeerId()}),yield this.reset()):p.a.warn("Error calling RefreshPeer",{error:Se})}const le=yield this.getPeers();for(const Se of this.connections)Se.setRemoteDeviceId((F=le.find(Ne=>Ne.id===Se.getRemotePeerId()))===null||F===void 0?void 0:F.deviceId)})}gatherConnectionStats(){return Be(this,void 0,void 0,function*(){if(this.statsLoopsExecuted%10!=0||this.connections.length!==1)return;const F=yield this.connections[0].getConnectionStatsInfo(),H=F?_t(F):void 0;H?(p.a.info(`Detected RTC connection type: ${H}`),b.setTag("rtc-connection-type",H)):b.setTag("rtc-connection-type","unknown")})}reset(){return Be(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.isOutgoingConnection.clear(),yield this.createPeer(),yield this.createReceiveSignalStream()})}updateIceServers(){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)return;const{iceServersLastUpdate:F,iceServersTtl:H}=this,J=new Date().getTime();if(!F||J-F>H)try{const oe=(yield K.withDeadline(this.config.signalingClient.getIceServers(new I.GetIceServersRequest,yield this.getMetadata()),this.grpcCallDeadline)).getIceServers();this.iceServers=JSON.parse(oe),this.iceServersLastUpdate=J}catch(oe){p.a.warn("Error in updateIceServers",{error:oe})}})}setupHandlers(F){const{peerConnection:H}=F,J=F.getSessionCreatedTimestamp();H.onconnectionstatechange=()=>Be(this,void 0,void 0,function*(){const oe=H.connectionState;if(!J)return;const se=F.getRemoteDeviceId();switch(oe){case"connected":b.aggregate("rtc-connect-time",new Date().getTime()-J,Object.assign({},se?{deviceId:se}:{}));break;case"failed":b.increment("rtc-connect-failed",Object.assign({},se?{deviceId:se}:{}))}})}getMetadata(F={}){return Be(this,void 0,void 0,function*(){if(this.config.lanOnlyMode)throw new Error("getMetadata method cannot be called in local-only mode");const{getToken:H}=this.config,{grpcCallDeadline:J}=this,{hasDeadline:oe=!0}=F,se=oe?{deadline:(Date.now()+J).toString(10)}:null;try{const ce=yield H();return Object.assign({authorization:ce},se)}catch(ce){throw p.a.error("getToken() failed",{error:ce}),new Error("Cannot get authorization token")}})}}var rt=n(12),mt=n(11),wt=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class Ht{constructor(F,H){this.sentMessagesCounts=new Map,this.receivedMessagesCounts=new Map,this.sessionId=F,this.connection=H}incrementMessageSent(F){const H=Ie(F.header.stream);this.sentMessagesCounts.set(H,(this.sentMessagesCounts.get(H)||0)+1)}incrementMessageReceived(F){const H=Ie(F.header.stream);this.receivedMessagesCounts.set(H,(this.receivedMessagesCounts.get(H)||0)+1)}uploadMetrics(){return wt(this,void 0,void 0,function*(){const{sessionId:F}=this,H=yield this.connection.peerConnection.getStats(),J={};H.forEach(se=>J[se.id]=se),p.a.debug("rtc-stats",Object.assign(Object.assign({},J),{sessionId:F}));const oe=[...new Set(Array.from(this.sentMessagesCounts.keys()).concat(Array.from(this.receivedMessagesCounts.keys())))].reduce((se,ce)=>{const he=this.sentMessagesCounts.get(ce),pe=this.receivedMessagesCounts.get(ce);return Object.assign(Object.assign({},se),{[`${ce}-sent`]:he,[`${ce}-received`]:pe})},{sessionId:F});p.a.debug("rtc-message-report",oe)})}}function Lt(_e,F){return Ie(_e)===Ie(F)}var it=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class St{constructor(F,H){this.peerConnection=F,this.config=H,this.connectTimeoutMs=10*g.a.second,this.gatherIceTimeoutMs=5*g.a.second,this.pingUpdateTimeoutMs=2*g.a.second,this.streamLatestTimestamp=new Map,this.closeCalled=!1,this.connectCalled=!1,this.sentOffer=!1,this.receivedIceCandidate=!1;const{isOffer:J}=H;J?this.initializeChannels(F):F.ondatachannel=oe=>{switch(oe.channel.label){case"stream.latest-ttl":this.latestTtlStreamChannel=oe.channel;break;case"stream.reliable":this.reliableStreamChannel=oe.channel;break;case"stream.latest-reliable":this.latestReliableStreamChannel=oe.channel;break;case"stream.latest-try-once":this.latestTryOnceStreamChannel=oe.channel}this.setupChannel(oe.channel)},this.sessionMetrics=new Ht(this.getSessionId(),this)}connect(){return it(this,void 0,void 0,function*(){if(this.connectCalled)return;this.connectCalled=!0,this.pingUpdateTimeout=setInterval(()=>{const{reliableStreamChannel:oe}=this;oe&&this.sendSystemMessage(oe,{type:"ping"})},this.pingUpdateTimeoutMs),this.connectTimeout=setTimeout(()=>it(this,void 0,void 0,function*(){this.isReady()||(p.a.warn("RTC connect timed out, closing connection"),yield this.close())}),this.connectTimeoutMs);const{peerConnection:F,config:{isOffer:H,sessionId:J}}=this;if(H){const oe=yield F.createOffer();yield F.setLocalDescription(oe)}H&&(this.gatherIceTimeout=setTimeout(()=>it(this,void 0,void 0,function*(){this.sentOffer||(p.a.warn("ICE gathering timed out"),this.receivedIceCandidate?(p.a.warn("Attempting to connect with partial ICE candidate pool"),yield this.sendOffer()):yield this.close())}),this.gatherIceTimeoutMs),F.onicecandidate=oe=>it(this,void 0,void 0,function*(){oe.candidate?this.receivedIceCandidate=!0:yield this.sendOffer()}),F.onicegatheringstatechange=()=>it(this,void 0,void 0,function*(){F.iceGatheringState==="complete"&&(yield this.sendOffer())}),F.onnegotiationneeded=()=>{p.a.debug("Negotiation needed",{sessionId:J})})})}handleSignal(F){return it(this,void 0,void 0,function*(){const{peerConnection:H,config:{sessionId:J,sendSignal:oe}}=this,{description:se}=JSON.parse(F.payload);if(p.a.debug("Handling signal",{sessionId:J,description:JSON.stringify(se)}),se)if(H.signalingState!=="stable"||H.connectionState!=="connected")if(H.remoteDescription)p.a.warn(`Received SDP signal during negotiation when remote description is already set: ${JSON.stringify(F)}`);else if(se.type==="offer"){yield H.setRemoteDescription(se);const ce=yield H.createAnswer();yield H.setLocalDescription(ce),yield oe({payload:JSON.stringify({description:ce})})}else se.type==="answer"&&(yield H.setRemoteDescription(se));else p.a.warn(`Received SDP signal when signaling is stable and connected: ${JSON.stringify(F)}`);else p.a.warn(`Received non-SDP signal: ${JSON.stringify(F)}`)})}send(F,H){const J=this.getChannelFromLabel(H.channelLabel);J?this.sendOnChannel(J,F):p.a.warn("Send called with unexpected channel label",{channelLabel:H.channelLabel})}controlRemoteStream(F){this.sendSystemMessage(te(this.reliableStreamChannel),{type:"stream-control",streamControl:F})}isActive(){return new Set(["new","connecting","connected"]).has(this.peerConnection.connectionState)}isReady(){const{peerConnection:F,latestTtlStreamChannel:H,reliableStreamChannel:J,latestTryOnceStreamChannel:oe}=this;return!!(J&&H&&oe)&&F.connectionState==="connected"&&J.readyState==="open"&&H.readyState==="open"&&oe.readyState==="open"}isClosed(){const{peerConnection:F,reliableStreamChannel:H,latestTryOnceStreamChannel:J,latestTtlStreamChannel:oe}=this;return!(F.connectionState!=="closed"||H!==void 0&&H.readyState!=="closed"||J!==void 0&&J.readyState!=="closed"||oe!==void 0&&oe.readyState!=="closed")}needsClosing(){const{peerConnection:F,latestTtlStreamChannel:H,reliableStreamChannel:J,latestTryOnceStreamChannel:oe}=this;if(this.isClosed())return!1;const se=new Set(["closing","closed"]),ce=he=>he&&se.has(he.readyState);return vt(F)||ce(H)||ce(J)||ce(oe)}close(){return it(this,void 0,void 0,function*(){this.closeCalled||(this.closeCalled=!0,yield this.sessionMetrics.uploadMetrics(),this.pingUpdateTimeout&&clearInterval(this.pingUpdateTimeout),this.connectTimeout&&clearTimeout(this.connectTimeout),this.gatherIceTimeout&&clearTimeout(this.gatherIceTimeout),this.peerConnection.close())})}getPing(){return this.pingTimeMs}getLastMessageTimestamp(){return this.lastMessageTimestamp}getSessionId(){return this.config.sessionId}getRemotePeer(){return this.config.remotePeer}initializeChannels(F){this.latestTtlStreamChannel=F.createDataChannel("stream.latest-ttl",ne),this.reliableStreamChannel=F.createDataChannel("stream.reliable",ie),this.latestReliableStreamChannel=F.createDataChannel("stream.latest-reliable",ue),this.latestTryOnceStreamChannel=F.createDataChannel("stream.latest-try-once",we),this.setupChannel(this.latestTtlStreamChannel),this.setupChannel(this.reliableStreamChannel),this.setupChannel(this.latestReliableStreamChannel),this.setupChannel(this.latestTryOnceStreamChannel)}sendOffer(){return it(this,void 0,void 0,function*(){if(this.sentOffer||(this.sentOffer=!0,vt(this.peerConnection)))return;const{peerConnection:F,config:{sendSignal:H}}=this,J=yield F.createOffer();yield F.setLocalDescription(J);const oe={payload:JSON.stringify({description:J})};yield H(oe)})}getChannelFromLabel(F){switch(F){case"stream.latest-ttl":return this.latestTtlStreamChannel;case"stream.reliable":return this.reliableStreamChannel;case"stream.latest-reliable":return this.latestReliableStreamChannel;case"stream.latest-try-once":return this.latestTryOnceStreamChannel}}sendOnChannel(F,H){let J;try{J=Object(Y.encode)(JSON.stringify(H))}catch(oe){return void p.a.warn("Failed to encode RTC message",{error:oe})}try{F.send(J),this.sessionMetrics.incrementMessageSent(H)}catch(oe){p.a.warn("Failed to send message to channel",{error:oe,channel:F.label})}}channelNotRecognized(F){return F!==this.latestTtlStreamChannel&&F!==this.latestReliableStreamChannel&&F!==this.latestTryOnceStreamChannel&&F!==this.reliableStreamChannel}setupChannel(F){F.onmessage=H=>{if(this.channelNotRecognized(F))return void p.a.warn("Received message on unrecognized data channel.");let J;try{J=JSON.parse(Object(Y.decode)(H.data))}catch(oe){return void p.a.warn("Received unparseable RTC message",{error:oe,channel:F.label})}if(this.lastMessageTimestamp=new Date().getTime(),J=Rt(J),this.sessionMetrics.incrementMessageReceived(J),!this.handleSystemMessage(F,J)){if(!this.hasCapabilities(J))return void p.a.warn("Received RTC message that was not within the capability scope of the connection.");(F===this.latestTryOnceStreamChannel||F===this.latestTtlStreamChannel||F===this.latestReliableStreamChannel)&&!this.isLatestMessage(J)||this.config.receive(this.config.remotePeer.id,J)}},F.onerror=H=>{p.a.warn(`Channel error: ${H.error}`,{error:H.error,sessionId:this.getSessionId(),channelLabel:F.label})},F.onopen=()=>{p.a.debug("Channel opened",{sessionId:this.getSessionId(),channelLabel:F.label})},F.onclose=()=>{const H={bufferedAmount:F.bufferedAmount,sessionId:this.getSessionId(),channelLabel:F.label};this.closeCalled===!1?p.a.debug("Unexpected channel closed",H):p.a.debug("Channel closed",H)}}handleSystemMessage(F,H){switch(H.header.stream.streamType){case"ping":return this.sendSystemMessage(F,{type:"pong",timestamp:te(H.payload.ping)}),!0;case"pong":{const J=new Date().getTime()-te(H.payload.pong);return this.pingTimeMs=J,b.aggregate("rtc-ping-time",J),!0}case"stream-control":return!0;default:return!1}}sendSystemMessage(F,H){if(F.readyState!=="open")return;const J={entityId:te(this.config.localPeer.deviceId||this.config.localPeer.userId),streamName:`$.${H.type}`,streamType:H.type};let oe;switch(H.type){case"ping":oe={ping:new Date().getTime()};break;case"pong":oe={pong:H.timestamp};break;case"stream-control":oe={streamControl:H.streamControl}}this.sendOnChannel(F,nt(J,oe))}hasCapabilities(F){var H,J;const{localPeer:oe,remotePeer:se}=this.config,ce=(H=oe.capabilitySet.streaming)===null||H===void 0?void 0:H.streams,he=ce&&ce.some(le=>le.receive&&Lt(le.stream,F.header.stream)),pe=(J=se.capabilitySet.streaming)===null||J===void 0?void 0:J.streams,fe=pe&&pe.some(le=>le.send&&Lt(le.stream,F.header.stream));return he||fe}isLatestMessage(F){const H=Ie(F.header.stream),J=(this.streamLatestTimestamp.get(H)||0)<=F.header.created;return J&&this.streamLatestTimestamp.set(H,F.header.created),J}}var Fe=function(_e,F,H,J){return new(H||(H=Promise))(function(oe,se){function ce(fe){try{pe(J.next(fe))}catch(le){se(le)}}function he(fe){try{pe(J.throw(fe))}catch(le){se(le)}}function pe(fe){var le;fe.done?oe(fe.value):(le=fe.value,le instanceof H?le:new H(function(Se){Se(le)})).then(ce,he)}pe((J=J.apply(_e,F||[])).next())})};class jt{constructor(F){this.config=F,this.connections=[],this.connectingSessions=new Map,this.rtcInstancesConstructed=0,this.updateInterval=h({func:()=>Fe(this,void 0,void 0,function*(){try{yield this.update()}catch(H){p.a.warn("RTC update failed",{error:H})}}),delay:250*g.a.millisecond,immediate:!0}),this.localPeer=this.createPeer()}send(F,H,J){const oe=this.getActiveConnection(F);oe?oe.isReady()?oe.send(H,J):p.a.warn("Attempted to send with an active connection to that peer which was not yet ready."):p.a.warn("Attempted to send with no active connection to that peer.")}controlRemoteStream(F,H){const J=this.getActiveConnection(F);J?J.isReady()?J.controlRemoteStream(H):p.a.warn("Attempted to control remote stream with an active connection to that peer which was not yet ready."):p.a.warn("Attempted to control remote stream with no active connection to that peer.")}connect(F){return Fe(this,void 0,void 0,function*(){const H=yield this.getLocalPeer();if(this.getActiveConnection(F))return void p.a.warn("Attempted to connect to peer with an already active connection.");let J;try{J=yield this.config.signalingClient.createSession(yield this.config.getToken(),{offerPeerId:H.id,answerPeerId:F})}catch(oe){Object(rt.a)(oe,mt.a,se=>se.statusCode===404),p.a.warn("Attempted to connect to peer that does not exist.")}if(J)for(this.connectingSessions.set(J.id,new Date().getTime()),yield this.connectToSession(J);;)switch(yield Object(c.a)(.1),this.getConnectionStatus(F)){case"connecting":continue;case"connected":return J.id;case"disconnected":return}})}getConnectionStatus(F){const H=this.getActiveConnection(F);return H?H.isReady()?"connected":"connecting":"disconnected"}getIceMode(F){const H=this.getActiveConnection(F);if(H)return H.iceMode}disconnect(F){return Fe(this,void 0,void 0,function*(){const H=this.getActiveConnection(F);H&&(yield this.closeConnection(H))})}getLocalPeer(){return Fe(this,void 0,void 0,function*(){return yield this.localPeer})}getPeers(){return Fe(this,void 0,void 0,function*(){return yield this.config.signalingClient.getPeers(yield this.config.getToken())})}getPing(F){const H=this.getActiveConnection(F);if(H)return H.getPing();p.a.warn("Attempted to get ping time from inactive peer.")}getLastMessageTimestamp(F){const H=this.getActiveConnection(F);if(H)return H.getLastMessageTimestamp();p.a.warn("Attempted to get ping time from inactive peer.")}shutdown(){return Fe(this,void 0,void 0,function*(){yield this.updateInterval.stop();const F=this.connections;this.connections=[],yield this.closeConnections(F)})}closeConnection(F){return Fe(this,void 0,void 0,function*(){this.connectingSessions.delete(F.getSessionId()),yield F.close();try{yield this.config.signalingClient.deleteSession(yield this.config.getToken(),F.getSessionId())}catch(H){Object(rt.a)(H,mt.a,J=>J.statusCode===404)}})}getSessions(){return Fe(this,void 0,void 0,function*(){const F=yield this.getLocalPeer();return(yield this.config.signalingClient.getSessions(yield this.config.getToken())).filter(H=>H.offer.peer.id===F.id||H.answer.peer.id===F.id)})}createPeer(){return Fe(this,void 0,void 0,function*(){return yield this.config.signalingClient.createPeer(yield this.config.getToken(),{capabilitySet:this.config.capabilitySet||{}})})}createRTCPeerConnection(F={}){return Fe(this,void 0,void 0,function*(){const H=this.config.alternateRTCPeerConnection||RTCPeerConnection;this.rtcInstancesConstructed++,this.rtcInstancesConstructed%20||Pt();try{return new H(Object.assign({iceServers:yield this.config.signalingClient.getIceServers(yield this.config.getToken())},F))}catch(J){throw p.a.debug(`Failed to create RTCPeerConnection: ${this.rtcInstancesConstructed} total allocated`),J}})}closeConnections(F){return Fe(this,void 0,void 0,function*(){const H=yield q(F.map(J=>Fe(this,void 0,void 0,function*(){yield this.closeConnection(J)})));for(const J of H)p.a.warn("Request to close session failed",{error:J})})}reset(){return Fe(this,void 0,void 0,function*(){yield this.closeConnections(this.connections),this.connections=[],this.connectingSessions=new Map,this.localPeer=this.createPeer(),yield this.localPeer})}getActiveConnection(F){return this.connections.find(H=>H.getRemotePeer().id===F&&H.isActive())}update(){return Fe(this,void 0,void 0,function*(){const F=yield this.getLocalPeer();try{yield this.config.signalingClient.refreshPeer(yield this.config.getToken(),F.id)}catch(H){Object(rt.a)(H,mt.a,J=>J.statusCode===404),p.a.warn("Peer expired, creating new peer",{peerId:F.id}),yield this.reset()}yield this.handleSessions(yield this.getSessions())})}handleSessions(F){return Fe(this,void 0,void 0,function*(){yield this.syncConnectionsAndSessions(F);const H=F.map(J=>({session:J,connection:this.connections.find(oe=>oe.getSessionId()===J.id)}));yield Promise.all(H.map(({session:J,connection:oe})=>Fe(this,void 0,void 0,function*(){return yield this.maintainConnection(J,oe)})))})}syncConnectionsAndSessions(F){return Fe(this,void 0,void 0,function*(){const H=new Set(F.map(se=>se.id)),J=se=>H.has(se.getSessionId())||this.connectingSessions.has(se.getSessionId());this.connections=this.connections.filter(se=>J(se));const oe=this.connections.filter(se=>!J(se)||se.needsClosing());yield Promise.all(oe.map(se=>Fe(this,void 0,void 0,function*(){yield this.closeConnection(se)})))})}maintainConnection(F,H){return Fe(this,void 0,void 0,function*(){const J=yield this.getLocalPeer(),oe=F.offer.peer.id===J.id;if(H){if(H.isReady())try{yield this.config.signalingClient.refreshSession(yield this.config.getToken(),F.id)}catch(se){Object(rt.a)(se,mt.a,ce=>ce.statusCode===404),p.a.debug("Refresh session not found",{sessionId:F.id})}else if(H.isActive())try{yield this.consumeSignals(H)}catch(se){p.a.warn("Failed to ingest signals, closing connection",{error:se}),yield this.closeConnection(H)}}else{if(oe)return;yield this.connectToSession(F)}})}connectToSession(F){return Fe(this,void 0,void 0,function*(){const H=yield this.getLocalPeer(),J=F.offer.peer.id===H.id,oe=yield this.createRTCPeerConnection(),se=new St(oe,{localPeer:J?F.offer.peer:F.answer.peer,remotePeer:J?F.answer.peer:F.offer.peer,sessionId:F.id,isOffer:J,sendSignal:ce=>this.sendSignal(F.id,ce),receive:(ce,he)=>this.config.receive(ce,he)});if(this.connections.find(ce=>ce.getSessionId()===F.id))return p.a.warn("connectToSession called on a session that already has a connection.",{sessionId:F.id}),void(yield se.close());this.setupHandlers(se),this.connections.push(se);try{yield se.connect()}catch(ce){p.a.warn("Failed to handle negotiation, closing connection",{error:ce}),yield this.closeConnection(se)}})}setupHandlers(F){const{peerConnection:H}=F,J=F.getSessionId();H.onconnectionstatechange=()=>Fe(this,void 0,void 0,function*(){const oe=this.connectingSessions.get(J);if(oe===void 0)return;const se=H.connectionState;switch(vt(H)&&this.connectingSessions.delete(J),se){case"connected":{this.connectingSessions.delete(J);const ce=new Date().getTime()-oe;b.aggregate("rtc-connect-time",ce);break}case"failed":b.increment("rtc-connect-failed"),yield this.closeConnection(F)}})}consumeSignals(F){return Fe(this,void 0,void 0,function*(){let H=[];try{H=yield this.config.signalingClient.takeSignals(yield this.config.getToken(),F.getSessionId())}catch(J){Object(rt.a)(J,mt.a,oe=>oe.statusCode===404)}for(const J of H)yield F.handleSignal(J)})}sendSignal(F,H){return Fe(this,void 0,void 0,function*(){try{yield this.config.signalingClient.addSignals(yield this.config.getToken(),F,{signals:[H]})}catch(J){Object(rt.a)(J,mt.a,oe=>oe.statusCode===404)}})}}},function(e,t,n){var r={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const l=new Uint8Array(16);function u(){if(!o&&(o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(l)}const s=[];for(let c=0;c<256;++c)s.push((c+256).toString(16).slice(1));function g(c,d=0){return(s[c[d+0]]+s[c[d+1]]+s[c[d+2]]+s[c[d+3]]+"-"+s[c[d+4]]+s[c[d+5]]+"-"+s[c[d+6]]+s[c[d+7]]+"-"+s[c[d+8]]+s[c[d+9]]+"-"+s[c[d+10]]+s[c[d+11]]+s[c[d+12]]+s[c[d+13]]+s[c[d+14]]+s[c[d+15]]).toLowerCase()}t.a=function(c,d,w){if(r.randomUUID&&!d&&!c)return r.randomUUID();const v=(c=c||{}).random||(c.rng||u)();if(v[6]=15&v[6]|64,v[8]=63&v[8]|128,d){w=w||0;for(let y=0;y<16;++y)d[w+y]=v[y];return d}return g(v)}},,function(e,t,n){n.r(t),n.d(t,"LogClient",function(){return s});var r=n(26),o=n(12),l=n(11),u=function(g,c,d,w){return new(d||(d=Promise))(function(v,y){function f(N){try{S(w.next(N))}catch(B){y(B)}}function p(N){try{S(w.throw(N))}catch(B){y(B)}}function S(N){var B;N.done?v(N.value):(B=N.value,B instanceof d?B:new d(function(E){E(B)})).then(f,p)}S((w=w.apply(g,c||[])).next())})};class s extends r.a{log(c){return u(this,void 0,void 0,function*(){const d=s.token;try{yield this.fetch("logs",{token:d,method:"POST",body:{logs:c},allowUnsafeRetries:!0})}catch(w){Object(o.a)(w,l.a,v=>v.statusCode===401&&d!==void 0),s.token===d&&delete s.token,yield this.log(c)}})}}}])})})(dist);var distExports=dist.exports;const SessionTypes={UNKNOWN:0,TELEOP:1,PORT_FORWARD:2,OBSERVE:3,HEADLESS:4},SessionTypeConstants={...SessionTypes,Unknown:SessionTypes.UNKNOWN,Teleop:SessionTypes.TELEOP,PortForward:SessionTypes.PORT_FORWARD,Observe:SessionTypes.OBSERVE,Headless:SessionTypes.HEADLESS,unknown:SessionTypes.UNKNOWN,teleop:SessionTypes.TELEOP,portForward:SessionTypes.PORT_FORWARD,observe:SessionTypes.OBSERVE,headless:SessionTypes.HEADLESS},singleton=Symbol("RtcClientPool.instance");var wn;class RtcClientPool{constructor(t){be(this,wn,null);be(this,"createClient");be(this,"ttlMs");be(this,"proxyHandler");be(this,"proxyReceivers",new Map);be(this,"teardownTimeout",null);be(this,"dispatch",(t,n)=>{this.proxyReceivers.forEach(r=>r==null?void 0:r(t,n))});const{createClient:n,ttlMs:r=0}=t;this.createClient=n,this.ttlMs=Math.max(r,0),this.proxyHandler={get:(o,l,u)=>{switch(l){case"shutdown":return()=>this.releaseInstance(u);default:return Reflect.get(o,l,u)}}}}get isActive(){return this[singleton]!==null}get size(){return this.proxyReceivers.size}get(t){const n=new Proxy(this.allocate(),this.proxyHandler);return this.proxyReceivers.set(n,t??null),n}allocate(){if(this[singleton])return this.teardownTimeout&&(clearTimeout(this.teardownTimeout),this.teardownTimeout=null),this[singleton];const t=this.createClient(this.dispatch);return this[singleton]=t,t}async teardown(){const t=this[singleton];if(!t){console.warn("singleton has already been shutdown!");return}try{await t.shutdown()}finally{this[singleton]=null}}async releaseInstance(t){return this.proxyReceivers.delete(t)?this.proxyReceivers.size!==0?!1:(!this.teardownTimeout&&Number.isFinite(this.ttlMs)&&(this.ttlMs===0?await this.teardown():this.teardownTimeout=setTimeout(()=>{this.teardown().catch(n=>console.error("teardown failed",{err:n})).finally(()=>this.teardownTimeout=null)},this.ttlMs)),!0):(console.warn("this instance has already been released!"),!1)}}wn=singleton;const getToken=async()=>defined(Authentication.token,"Realtime when user isn't authorized"),EnumRtcClientPools={[SessionTypes.UNKNOWN]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.UNKNOWN,receive:e})}),[SessionTypes.TELEOP]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.TELEOP,receive:e})}),[SessionTypes.PORT_FORWARD]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.PORT_FORWARD,receive:e})}),[SessionTypes.OBSERVE]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.OBSERVE,receive:e})}),[SessionTypes.HEADLESS]:new RtcClientPool({ttlMs:2500,createClient:e=>new distExports.RtcClient({signalingClient:new distExports.SignalingPromiseClient(FORMANT_API_URL),getToken,sessionType:SessionTypes.HEADLESS,receive:e})})},AppRtcClientPools={...EnumRtcClientPools,unknown:EnumRtcClientPools[SessionTypes.UNKNOWN],teleop:EnumRtcClientPools[SessionTypes.TELEOP],portForward:EnumRtcClientPools[SessionTypes.PORT_FORWARD],observe:EnumRtcClientPools[SessionTypes.OBSERVE],headless:EnumRtcClientPools[SessionTypes.HEADLESS]},defaultRtcClientPool=EnumRtcClientPools[SessionTypes.TELEOP],getRtcClientPool=e=>{const{sessionType:t}=e;return t?AppRtcClientPools[t]:defaultRtcClientPool};class CaptureStream{constructor(t){be(this,"token");this.captureSession=t}async ingestJSON(t){if(!this.token){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions/${this.captureSession.code}/authenticate`,{method:"POST"})).json();this.token=r.token}await fetch(`${FORMANT_API_URL}/v1/ingest`,{method:"POST",body:JSON.stringify({deviceId:this.captureSession.deviceId,name:this.captureSession.streamName,type:"json",points:[[Date.now(),JSON.stringify(t)]]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.token}})}}function delay(e){return new Promise(t=>setTimeout(t,e))}const isRtcPeer=e=>e!==void 0&&e.capabilities!==void 0&&e.capabilitySet!==void 0;class DataChannel{constructor(t){be(this,"ready",!1);be(this,"listeners",[]);be(this,"openListeners",[]);be(this,"closeListeners",[]);be(this,"errorListeners",[]);be(this,"binaryListeners",[]);be(this,"error");be(this,"decoder",new TextDecoder);this.dataChannel=t,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{this.setReady()},this.dataChannel.onclose=()=>{this.ready=!1,this.closeListeners.forEach(n=>n())},this.dataChannel.onerror=n=>{console.error(n),this.error="An error occurred in DataChannel",this.errorListeners.forEach(r=>r(n))},this.dataChannel.onmessage=n=>{this.listeners.forEach(r=>{const o=new Uint8Array(n.data),l=this.decoder.decode(o);r(l)}),this.binaryListeners.forEach(r=>{r(new Uint8Array(n.data))})}}setReady(){this.ready=!0,this.openListeners.forEach(t=>t())}addOpenListener(t){this.openListeners.push(t)}removeOpenListener(t){this.openListeners=this.openListeners.filter(n=>n!==t)}addCloseListener(t){this.closeListeners.push(t)}removeCloseListener(t){this.closeListeners=this.closeListeners.filter(n=>n!==t)}addErrorListener(t){this.errorListeners.push(t)}removeErrorListener(t){this.errorListeners=this.errorListeners.filter(n=>n!==t)}async waitTilReady(){return this.ready?!0:new Promise((n,r)=>{let o=setInterval(()=>{this.dataChannel.readyState==="open"&&this.setReady(),this.ready&&(clearInterval(o),n(!0)),this.error&&r(this.error)},10)})}send(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}sendBinary(t){if(!this.ready)throw new Error("Connection has been closed");this.dataChannel.send(t)}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.listeners.splice(n,1)}addBinaryListener(t){this.binaryListeners.push(t)}removeBinaryListener(t){const n=this.binaryListeners.indexOf(t);if(n===-1)throw new Error("Could not find data channel listener to remove");if(this.error)throw new Error(this.error);this.binaryListeners.splice(n,1)}}var eventemitter3={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(g,c,d){this.fn=g,this.context=c,this.once=d||!1}function l(g,c,d,w,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var y=new o(d,w||g,v),f=n?n+c:c;return g._events[f]?g._events[f].fn?g._events[f]=[g._events[f],y]:g._events[f].push(y):(g._events[f]=y,g._eventsCount++),g}function u(g,c){--g._eventsCount===0?g._events=new r:delete g._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],d,w;if(this._eventsCount===0)return c;for(w in d=this._events)t.call(d,w)&&c.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},s.prototype.listeners=function(c){var d=n?n+c:c,w=this._events[d];if(!w)return[];if(w.fn)return[w.fn];for(var v=0,y=w.length,f=new Array(y);v<y;v++)f[v]=w[v].fn;return f},s.prototype.listenerCount=function(c){var d=n?n+c:c,w=this._events[d];return w?w.fn?1:w.length:0},s.prototype.emit=function(c,d,w,v,y,f){var p=n?n+c:c;if(!this._events[p])return!1;var S=this._events[p],N=arguments.length,B,E;if(S.fn){switch(S.once&&this.removeListener(c,S.fn,void 0,!0),N){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,d),!0;case 3:return S.fn.call(S.context,d,w),!0;case 4:return S.fn.call(S.context,d,w,v),!0;case 5:return S.fn.call(S.context,d,w,v,y),!0;case 6:return S.fn.call(S.context,d,w,v,y,f),!0}for(E=1,B=new Array(N-1);E<N;E++)B[E-1]=arguments[E];S.fn.apply(S.context,B)}else{var T=S.length,h;for(E=0;E<T;E++)switch(S[E].once&&this.removeListener(c,S[E].fn,void 0,!0),N){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,d);break;case 3:S[E].fn.call(S[E].context,d,w);break;case 4:S[E].fn.call(S[E].context,d,w,v);break;default:if(!B)for(h=1,B=new Array(N-1);h<N;h++)B[h-1]=arguments[h];S[E].fn.apply(S[E].context,B)}}return!0},s.prototype.on=function(c,d,w){return l(this,c,d,w,!1)},s.prototype.once=function(c,d,w){return l(this,c,d,w,!0)},s.prototype.removeListener=function(c,d,w,v){var y=n?n+c:c;if(!this._events[y])return this;if(!d)return u(this,y),this;var f=this._events[y];if(f.fn)f.fn===d&&(!v||f.once)&&(!w||f.context===w)&&u(this,y);else{for(var p=0,S=[],N=f.length;p<N;p++)(f[p].fn!==d||v&&!f[p].once||w&&f[p].context!==w)&&S.push(f[p]);S.length?this._events[y]=S.length===1?S[0]:S:u(this,y)}return this},s.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&u(this,d)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);class Manipulator{constructor(t,n){be(this,"currentListeners",[]);be(this,"onRealtimeMessage",(t,n)=>{n.payload.jointState&&this.currentListeners.forEach(r=>{n.payload.jointState&&r(n.payload.jointState)})});this.device=t,this.config=n}async synchronize(){this.device.addRealtimeListener(this.onRealtimeMessage),this.device.startListeningToRealtimeDataStream(this.config.currentJointStateStream)}async desynchronize(){this.device.removeRealtimeListener(this.onRealtimeMessage),this.device.stopListeningToRealtimeDataStream(this.config.currentJointStateStream)}async addCurrentJointStateListener(t){this.currentListeners.push(t)}}class RequestDataChannel{constructor(t,n,r){be(this,"channel");be(this,"requestIdToResponseMap",new Map);this.device=t,this.channel_name=n,this.timeout=r}addOpenListener(t){defined(this.channel,"channel not initalized").addOpenListener(t)}removeOpenListener(t){defined(this.channel,"channel not initalized").removeOpenListener(t)}addCloseListener(t){defined(this.channel,"channel not initalized").addCloseListener(t)}removeCloseListener(t){defined(this.channel,"channel not initalized").removeCloseListener(t)}addErrorListener(t){defined(this.channel,"channel not initalized").addErrorListener(t)}removeErrorListener(t){defined(this.channel,"channel not initalized").removeErrorListener(t)}}class BinaryRequestDataChannel extends RequestDataChannel{constructor(){super(...arguments);be(this,"RESPONSE_SUCCESS_BYTE",0);be(this,"decoder",new TextDecoder)}generateBinaryId(){const n=new Uint8Array(16);for(let r=0;r<n.length;r++)n[r]=Math.floor(Math.random()*256);return n}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addBinaryListener(n=>{const o=n.slice(0,16).toString();if(o.length===0)throw new Error("Invalid response");const l=n.slice(16);if(l.length===0)throw new Error("Invalid response");this.requestIdToResponseMap.has(o)&&this.requestIdToResponseMap.set(o,l)})}async request(n){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:r,requestIdToResponseMap:o,timeout:l}=this;await r.waitTilReady();const u=this.generateBinaryId(),s=u.toString();o.set(s,!0),r.sendBinary(new Uint8Array([...u,...n]));const g=new Date().getTime();for(;new Date().getTime()<g+l;)if(await delay(50),o.has(s)){const c=o.get(s);if(c!==!0){o.delete(s);const d=c[0]===this.RESPONSE_SUCCESS_BYTE,w=c.slice(1);if(d)return w;throw console.error({name:"AdapterError",message:this.decoder.decode(w)}),new Error("Binary request datachannel adapter error")}}throw o.delete(s),console.error({name:"TimeoutError",message:`Request timed out after ${l/1e3} seconds`}),new Error("Binary request data channel request timed out")}}class TextRequestDataChannel extends RequestDataChannel{generateTextId(){return Math.random().toString(36).substring(2)+"-"+Math.random().toString(36).substring(2)}async initialize(){this.channel=await this.device.createCustomDataChannel(this.channel_name),this.channel.addListener(t=>{const n=JSON.parse(t),{id:r,data:o,error:l}=n;if(!r)throw new Error("Invalid response");if(!o&&!l)throw new Error("Invalid response");this.requestIdToResponseMap.has(r)&&this.requestIdToResponseMap.set(r,n)})}async request(t){if(this.channel||await this.initialize(),!this.channel)throw new Error("Failed to create channel");const{channel:n,requestIdToResponseMap:r,timeout:o}=this;await n.waitTilReady();const l=this.generateTextId();r.set(l,!0),n.send(JSON.stringify({id:l,data:t}));const u=new Date().getTime();for(;new Date().getTime()<u+o;)if(await delay(50),r.has(l)){const s=r.get(l);if(s!==!0){r.delete(l);const{data:g,error:c}=s;if(g)return g;if(c)throw console.error({name:"AdapterError",message:c}),new Error("Text request datachannel adapter error")}}throw r.delete(l),console.error({name:"TimeoutError",message:`Request timed out after ${o/1e3} seconds`}),new Error("Text request datachannel request timed out")}}class BaseDevice extends EventEmitter{constructor(){super(...arguments);be(this,"rtcClient");be(this,"remoteDevicePeerId",null);be(this,"realtimeListeners",[]);be(this,"connectionMonitorInterval");be(this,"handleMessage",(n,r)=>{this.realtimeListeners.forEach(o=>o(n,r))})}stopConnectionMonitoring(){clearInterval(this.connectionMonitorInterval),this.connectionMonitorInterval=void 0}assertNotCancelled(n){if(n)throw new Error("Cancelled by deadline")}getRealtimeStatus(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getConnectionStatus(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}getRealtimePing(){if(this.rtcClient&&this.remoteDevicePeerId)return this.rtcClient.getPing(this.remoteDevicePeerId);throw new Error("Realtime connection hasn't been started")}addRealtimeListener(n){this.realtimeListeners.push(n)}removeRealtimeListener(n){const r=this.realtimeListeners.indexOf(n);if(r===-1)throw new Error("Could not find realtime listener to remove");this.realtimeListeners.splice(r,1)}async getRealtimeManipulators(){const n=await this.getConfiguration(),r=[];for(const o of n.teleop.rosStreams??[])o.topicType=="sensor_msgs/JointState"&&r.push(new Manipulator(this,{currentJointStateStream:{name:o.topicName},plannedJointStateStream:o.plannedTopic?{name:o.plannedTopic}:void 0,planValidStream:o.planValidTopic?{name:o.planValidTopic}:void 0,endEffectorStream:o.endEffectorTopic?{name:o.endEffectorTopic}:void 0,endEffectorLinkName:o.endEffectorLinkName,baseReferenceFrame:o.baseReferenceFrame,localFrame:o.localFrame}));return r}async getRealtimeVideoStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="formant/H264VideoFrame"&&r.push({name:s.topicName}),(s.topicType==="sensor_msgs/Image"||s.topicType==="sensor_msgs/CompressedImage")&&s.encodeVideo&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="h264-video-frame"&&r.push({name:s.name});return r}createCustomRequestDataChannel(n,r=3e3){return new TextRequestDataChannel(this,n,r)}createCustomBinaryRequestDataChannel(n,r=3e3){return new BinaryRequestDataChannel(this,n,r)}async startListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeVideo(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async startListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!0,pipeline:"rtc"})}async stopListeningToRealtimeDataStream(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n.name,enable:!1,pipeline:"rtc"})}async enableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!0,pipeline:"telemetry"})}async disableRealtimeTelemetryPriorityIngestion(n){const r=defined(this.rtcClient,"Realtime connection has not been started"),o=await this.getRemotePeer();r.controlRemoteStream(defined(o).id,{streamName:n,enablePriorityUpload:!1,pipeline:"telemetry"})}async changeStreamAudioType(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.controlRemoteStream(defined(l).id,{streamName:n,setAudioFormat:r})}async createCustomDataChannel(n,r){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer(),u=await new Promise(s=>{o.createCustomDataChannel(defined(l).id,n,{ordered:!0,...r},!1,(g,c)=>{const d=new DataChannel(c);s(d)})});return await u.waitTilReady(),u}async sendRealtimeMessage(n,r={channelLabel:"stream.reliable"}){const o=defined(this.rtcClient,"Realtime connection has not been started"),l=await this.getRemotePeer();o.send(defined(l).id,n,r)}async getRealtimeAudioStreams(){var o,l,u;const n=await this.getConfiguration(),r=[];for(const s of((o=n.teleop)==null?void 0:o.hardwareStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});for(const s of((l=n.teleop)==null?void 0:l.rosStreams)??[])s.topicType=="audio_common_msgs/AudioData"&&r.push({name:s.topicName});for(const s of((u=n.teleop)==null?void 0:u.customStreams)??[])s.rtcStreamType==="audio-chunk"&&r.push({name:s.name});return r}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(e){let t=e.length;for(;--t>=0;)e[t]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const d_code=e=>e<256?_dist_code[e]:_dist_code[256+(e>>>7)],put_short=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},send_bits=(e,t,n)=>{e.bi_valid>Buf_size-n?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>Buf_size-e.bi_valid,e.bi_valid+=n-Buf_size):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},send_code=(e,t,n)=>{send_bits(e,n[t*2],n[t*2+1])},bi_reverse=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},bi_flush=e=>{e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},gen_bitlen=(e,t)=>{const n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,l=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,g=t.stat_desc.max_length;let c,d,w,v,y,f,p=0;for(v=0;v<=MAX_BITS$1;v++)e.bl_count[v]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<HEAP_SIZE$1;c++)d=e.heap[c],v=n[n[d*2+1]*2+1]+1,v>g&&(v=g,p++),n[d*2+1]=v,!(d>r)&&(e.bl_count[v]++,y=0,d>=s&&(y=u[d-s]),f=n[d*2],e.opt_len+=f*(v+y),l&&(e.static_len+=f*(o[d*2+1]+y)));if(p!==0){do{for(v=g-1;e.bl_count[v]===0;)v--;e.bl_count[v]--,e.bl_count[v+1]+=2,e.bl_count[g]--,p-=2}while(p>0);for(v=g;v!==0;v--)for(d=e.bl_count[v];d!==0;)w=e.heap[--c],!(w>r)&&(n[w*2+1]!==v&&(e.opt_len+=(v-n[w*2+1])*n[w*2],n[w*2+1]=v),d--)}},gen_codes=(e,t,n)=>{const r=new Array(MAX_BITS$1+1);let o=0,l,u;for(l=1;l<=MAX_BITS$1;l++)o=o+n[l-1]<<1,r[l]=o;for(u=0;u<=t;u++){let s=e[u*2+1];s!==0&&(e[u*2]=bi_reverse(r[s]++,s))}},tr_static_init=()=>{let e,t,n,r,o;const l=new Array(MAX_BITS$1+1);for(n=0,r=0;r<LENGTH_CODES$1-1;r++)for(base_length[r]=n,e=0;e<1<<extra_lbits[r];e++)_length_code[n++]=r;for(_length_code[n-1]=r,o=0,r=0;r<16;r++)for(base_dist[r]=o,e=0;e<1<<extra_dbits[r];e++)_dist_code[o++]=r;for(o>>=7;r<D_CODES$1;r++)for(base_dist[r]=o<<7,e=0;e<1<<extra_dbits[r]-7;e++)_dist_code[256+o++]=r;for(t=0;t<=MAX_BITS$1;t++)l[t]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,l[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,l[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,l[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,l[8]++;for(gen_codes(static_ltree,L_CODES$1+1,l),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=e=>{let t;for(t=0;t<L_CODES$1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<D_CODES$1;t++)e.dyn_dtree[t*2]=0;for(t=0;t<BL_CODES$1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},bi_windup=e=>{e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},smaller=(e,t,n,r)=>{const o=t*2,l=n*2;return e[o]<e[l]||e[o]===e[l]&&r[t]<=r[n]},pqdownheap=(e,t,n)=>{const r=e.heap[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&smaller(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!smaller(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r},compress_block=(e,t,n)=>{let r,o,l=0,u,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+l++]&255,r+=(e.pending_buf[e.sym_buf+l++]&255)<<8,o=e.pending_buf[e.sym_buf+l++],r===0?send_code(e,o,t):(u=_length_code[o],send_code(e,u+LITERALS$1+1,t),s=extra_lbits[u],s!==0&&(o-=base_length[u],send_bits(e,o,s)),r--,u=d_code(r),send_code(e,u,n),s=extra_dbits[u],s!==0&&(r-=base_dist[u],send_bits(e,r,s)));while(l<e.sym_next);send_code(e,END_BLOCK,t)},build_tree=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems;let u,s,g=-1,c;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,u=0;u<l;u++)n[u*2]!==0?(e.heap[++e.heap_len]=g=u,e.depth[u]=0):n[u*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=g<2?++g:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,o&&(e.static_len-=r[c*2+1]);for(t.max_code=g,u=e.heap_len>>1;u>=1;u--)pqdownheap(e,n,u);c=l;do u=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=u,e.heap[--e.heap_max]=s,n[c*2]=n[u*2]+n[s*2],e.depth[c]=(e.depth[u]>=e.depth[s]?e.depth[u]:e.depth[s])+1,n[u*2+1]=n[s*2+1]=c,e.heap[1]=c++,pqdownheap(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,t),gen_codes(n,g,e.bl_count)},scan_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)&&(s<c?e.bl_tree[l*2]+=s:l!==0?(l!==o&&e.bl_tree[l*2]++,e.bl_tree[REP_3_6*2]++):s<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4))},send_tree=(e,t,n)=>{let r,o=-1,l,u=t[0*2+1],s=0,g=7,c=4;for(u===0&&(g=138,c=3),r=0;r<=n;r++)if(l=u,u=t[(r+1)*2+1],!(++s<g&&l===u)){if(s<c)do send_code(e,l,e.bl_tree);while(--s!==0);else l!==0?(l!==o&&(send_code(e,l,e.bl_tree),s--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,s-3,2)):s<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,s-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,s-11,7));s=0,o=l,u===0?(g=138,c=3):l===u?(g=6,c=3):(g=7,c=4)}},build_bl_tree=e=>{let t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=BL_CODES$1-1;t>=3&&e.bl_tree[bl_order[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},send_all_trees=(e,t,n,r)=>{let o;for(send_bits(e,t-257,5),send_bits(e,n-1,5),send_bits(e,r-4,4),o=0;o<r;o++)send_bits(e,e.bl_tree[bl_order[o]*2+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,n-1)},detect_data_type=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Z_BINARY;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT;for(n=32;n<LITERALS$1;n++)if(e.dyn_ltree[n*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=e=>{static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)},_tr_stored_block$1=(e,t,n,r)=>{send_bits(e,(STORED_BLOCK<<1)+(r?1:0),3),bi_windup(e),put_short(e,n),put_short(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},_tr_align$1=e=>{send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)},_tr_flush_block$1=(e,t,n,r)=>{let o,l,u=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$1&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),u=build_bl_tree(e),o=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=o&&(o=l)):o=l=n+5,n+4<=o&&t!==-1?_tr_stored_block$1(e,t,n,r):e.strategy===Z_FIXED$1||l===o?(send_bits(e,(STATIC_TREES<<1)+(r?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(r?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),r&&bi_windup(e)},_tr_tally$1=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(_length_code[n]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(t)*2]++),e.sym_next===e.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(e,t,n,r)=>{let o=e&65535|0,l=e>>>16&65535|0,u=0;for(;n!==0;){u=n>2e3?2e3:n,n-=u;do o=o+t[r++]|0,l=l+o|0;while(--u);o%=65521,l%=65521}return o|l<<16|0};var adler32_1=adler32;const makeTable=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},crcTable=new Uint32Array(makeTable()),crc32=(e,t,n,r)=>{const o=crcTable,l=r+n;e^=-1;for(let u=r;u<l;u++)e=e>>>8^o[(e^t[u])&255];return e^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(e,t)=>(e.msg=messages[t],t),rank=e=>e*2-(e>4?9:0),zero=e=>{let t=e.length;for(;--t>=0;)e[t]=0},slide_hash=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=o?n-o:0;while(--t);t=o,r=t;do n=e.prev[--r],e.prev[r]=n>=o?n-o:0;while(--t)};let HASH_ZLIB=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,HASH=HASH_ZLIB;const flush_pending=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},flush_block_only=(e,t)=>{_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)},put_byte=(e,t)=>{e.pending_buf[e.pending++]=t},putShortMSB=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},read_buf=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),o===0?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),e.state.wrap===1?e.adler=adler32_1(e.adler,t,o,n):e.state.wrap===2&&(e.adler=crc32_1(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},longest_match=(e,t)=>{let n=e.max_chain_length,r=e.strstart,o,l,u=e.prev_length,s=e.nice_match;const g=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,c=e.window,d=e.w_mask,w=e.prev,v=e.strstart+MAX_MATCH;let y=c[r+u-1],f=c[r+u];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=t,!(c[o+u]!==f||c[o+u-1]!==y||c[o]!==c[r]||c[++o]!==c[r+1])){r+=2,o++;do;while(c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&c[++r]===c[++o]&&r<v);if(l=MAX_MATCH-(v-r),r=v-MAX_MATCH,l>u){if(e.match_start=t,u=l,l>=s)break;y=c[r+u-1],f=c[r+u]}}while((t=w[t&d])>g&&--n!==0);return u<=e.lookahead?u:e.lookahead},fill_window=e=>{const t=e.w_size;let n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-MIN_LOOKAHEAD)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),slide_hash(e),r+=t),e.strm.avail_in===0)break;if(n=read_buf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=MIN_MATCH)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=HASH(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=HASH(e,e.ins_h,e.window[o+MIN_MATCH-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)},deflate_stored=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,o,l,u=0,s=e.strm.avail_in;do{if(r=65535,l=e.bi_valid+42>>3,e.strm.avail_out<l||(l=e.strm.avail_out-l,o=e.strstart-e.block_start,r>o+e.strm.avail_in&&(r=o+e.strm.avail_in),r>l&&(r=l),r<n&&(r===0&&t!==Z_FINISH$3||t===Z_NO_FLUSH$2||r!==o+e.strm.avail_in)))break;u=t===Z_FINISH$3&&r===o+e.strm.avail_in?1:0,_tr_stored_block(e,0,0,u),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,flush_pending(e.strm),o&&(o>r&&(o=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,r-=o),r&&(read_buf(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(u===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),u?BS_FINISH_DONE:t!==Z_NO_FLUSH$2&&t!==Z_FINISH$3&&e.strm.avail_in===0&&e.strstart===e.block_start?BS_BLOCK_DONE:(l=e.window_size-e.strstart,e.strm.avail_in>l&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,l+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),l>e.strm.avail_in&&(l=e.strm.avail_in),l&&(read_buf(e.strm,e.window,e.strstart,l),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.high_water<e.strstart&&(e.high_water=e.strstart),l=e.bi_valid+42>>3,l=e.pending_buf_size-l>65535?65535:e.pending_buf_size-l,n=l>e.w_size?e.w_size:l,o=e.strstart-e.block_start,(o>=n||(o||t===Z_FINISH$3)&&t!==Z_NO_FLUSH$2&&e.strm.avail_in===0&&o<=l)&&(r=o>l?l:o,u=t===Z_FINISH$3&&e.strm.avail_in===0&&r===o?1:0,_tr_stored_block(e,e.block_start,r,u),e.block_start+=r,flush_pending(e.strm)),u?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(e,t)=>{let n,r;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n)),e.match_length>=MIN_MATCH)if(r=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+1]);else r=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(e,t)=>{let n,r,o;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(n=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,n),e.match_length<=5&&(e.strategy===Z_FILTERED||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-MIN_MATCH,r=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,r&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(r=_tr_tally(e,0,e.window[e.strstart-1]),r&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(e,t)=>{let n,r,o,l;const u=e.window;for(;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&t===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(o=e.strstart-1,r=u[o],r===u[++o]&&r===u[++o]&&r===u[++o])){l=e.strstart+MAX_MATCH;do;while(r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&o<l);e.match_length=MAX_MATCH-(l-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(n=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(t===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(e.match_length=0,n=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,t===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.sym_next&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=e=>{e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==INIT_STATE&&t.status!==GZIP_STATE&&t.status!==EXTRA_STATE&&t.status!==NAME_STATE&&t.status!==COMMENT_STATE&&t.status!==HCRC_STATE&&t.status!==BUSY_STATE&&t.status!==FINISH_STATE?1:0},deflateResetKeep=e=>{if(deflateStateCheck(e))return err(e,Z_STREAM_ERROR$2);e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?GZIP_STATE:t.wrap?INIT_STATE:BUSY_STATE,e.adler=t.wrap===2?0:1,t.last_flush=-2,_tr_init(t),Z_OK$3},deflateReset=e=>{const t=deflateResetKeep(e);return t===Z_OK$3&&lm_init(e.state),t},deflateSetHeader=(e,t)=>deflateStateCheck(e)||e.state.wrap!==2?Z_STREAM_ERROR$2:(e.state.gzhead=t,Z_OK$3),deflateInit2=(e,t,n,r,o,l)=>{if(!e)return Z_STREAM_ERROR$2;let u=1;if(t===Z_DEFAULT_COMPRESSION$1&&(t=6),r<0?(u=0,r=-r):r>15&&(u=2,r-=16),o<1||o>MAX_MEM_LEVEL||n!==Z_DEFLATED$2||r<8||r>15||t<0||t>9||l<0||l>Z_FIXED||r===8&&u!==1)return err(e,Z_STREAM_ERROR$2);r===8&&(r=9);const s=new DeflateState;return e.state=s,s.strm=e,s.status=INIT_STATE,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=o+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<o+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=l,s.method=n,deflateReset(e)},deflateInit=(e,t)=>deflateInit2(e,t,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(e,t)=>{if(deflateStateCheck(e)||t>Z_BLOCK$1||t<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===FINISH_STATE&&t!==Z_FINISH$3)return err(e,e.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(flush_pending(e),e.avail_out===0)return n.last_flush=-1,Z_OK$3}else if(e.avail_in===0&&rank(t)<=rank(r)&&t!==Z_FINISH$3)return err(e,Z_BUF_ERROR$1);if(n.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$1);if(n.status===INIT_STATE&&n.wrap===0&&(n.status=BUSY_STATE),n.status===INIT_STATE){let o=Z_DEFLATED$2+(n.w_bits-8<<4)<<8,l=-1;if(n.strategy>=Z_HUFFMAN_ONLY||n.level<2?l=0:n.level<6?l=1:n.level===6?l=2:l=3,o|=l<<6,n.strstart!==0&&(o|=PRESET_DICT),o+=31-o%31,putShortMSB(n,o),n.strstart!==0&&(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),e.adler=1,n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===GZIP_STATE){if(e.adler=0,put_byte(n,31),put_byte(n,139),put_byte(n,8),n.gzhead)put_byte(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),put_byte(n,n.gzhead.time&255),put_byte(n,n.gzhead.time>>8&255),put_byte(n,n.gzhead.time>>16&255),put_byte(n,n.gzhead.time>>24&255),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(put_byte(n,n.gzhead.extra.length&255),put_byte(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=EXTRA_STATE;else if(put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,n.level===9?2:n.strategy>=Z_HUFFMAN_ONLY||n.level<2?4:0),put_byte(n,OS_CODE),n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(n.status===EXTRA_STATE){if(n.gzhead.extra){let o=n.pending,l=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+l>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex+=s,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0,l-=s}let u=new Uint8Array(n.gzhead.extra);n.pending_buf.set(u.subarray(n.gzindex,n.gzindex+l),n.pending),n.pending+=l,n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=NAME_STATE}if(n.status===NAME_STATE){if(n.gzhead.name){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.name.length?l=n.gzhead.name.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=COMMENT_STATE}if(n.status===COMMENT_STATE){if(n.gzhead.comment){let o=n.pending,l;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o)),flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3;o=0}n.gzindex<n.gzhead.comment.length?l=n.gzhead.comment.charCodeAt(n.gzindex++)&255:l=0,put_byte(n,l)}while(l!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=crc32_1(e.adler,n.pending_buf,n.pending-o,o))}n.status=HCRC_STATE}if(n.status===HCRC_STATE){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(flush_pending(e),n.pending!==0))return n.last_flush=-1,Z_OK$3;put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),e.adler=0}if(n.status=BUSY_STATE,flush_pending(e),n.pending!==0)return n.last_flush=-1,Z_OK$3}if(e.avail_in!==0||n.lookahead!==0||t!==Z_NO_FLUSH$2&&n.status!==FINISH_STATE){let o=n.level===0?deflate_stored(n,t):n.strategy===Z_HUFFMAN_ONLY?deflate_huff(n,t):n.strategy===Z_RLE?deflate_rle(n,t):configuration_table[n.level].func(n,t);if((o===BS_FINISH_STARTED||o===BS_FINISH_DONE)&&(n.status=FINISH_STATE),o===BS_NEED_MORE||o===BS_FINISH_STARTED)return e.avail_out===0&&(n.last_flush=-1),Z_OK$3;if(o===BS_BLOCK_DONE&&(t===Z_PARTIAL_FLUSH?_tr_align(n):t!==Z_BLOCK$1&&(_tr_stored_block(n,0,0,!1),t===Z_FULL_FLUSH$1&&(zero(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),flush_pending(e),e.avail_out===0))return n.last_flush=-1,Z_OK$3}return t!==Z_FINISH$3?Z_OK$3:n.wrap<=0?Z_STREAM_END$3:(n.wrap===2?(put_byte(n,e.adler&255),put_byte(n,e.adler>>8&255),put_byte(n,e.adler>>16&255),put_byte(n,e.adler>>24&255),put_byte(n,e.total_in&255),put_byte(n,e.total_in>>8&255),put_byte(n,e.total_in>>16&255),put_byte(n,e.total_in>>24&255)):(putShortMSB(n,e.adler>>>16),putShortMSB(n,e.adler&65535)),flush_pending(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=e=>{if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const t=e.state.status;return e.state=null,t===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(e,t)=>{let n=t.length;if(deflateStateCheck(e))return Z_STREAM_ERROR$2;const r=e.state,o=r.wrap;if(o===2||o===1&&r.status!==INIT_STATE||r.lookahead)return Z_STREAM_ERROR$2;if(o===1&&(e.adler=adler32_1(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){o===0&&(zero(r.head),r.strstart=0,r.block_start=0,r.insert=0);let g=new Uint8Array(r.w_size);g.set(t.subarray(n-r.w_size,n),0),t=g,n=r.w_size}const l=e.avail_in,u=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,fill_window(r);r.lookahead>=MIN_MATCH;){let g=r.strstart,c=r.lookahead-(MIN_MATCH-1);do r.ins_h=HASH(r,r.ins_h,r.window[g+MIN_MATCH-1]),r.prev[g&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=g,g++;while(--c);r.strstart=g,r.lookahead=MIN_MATCH-1,fill_window(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=MIN_MATCH-1,r.match_available=0,e.next_in=u,e.input=s,e.avail_in=l,r.wrap=o,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)_has(n,r)&&(e[r]=n[r])}}return e},flattenChunks=e=>{let t=0;for(let r=0,o=e.length;r<o;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,o=0,l=e.length;r<l;r++){let u=e[r];n.set(u,o),o+=u.length}return n},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let e=0;e<256;e++)_utf8len[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,o,l,u=e.length,s=0;for(o=0;o<u;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),l=0,o=0;l<s;o++)n=e.charCodeAt(o),(n&64512)===55296&&o+1<u&&(r=e.charCodeAt(o+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[l++]=n:n<2048?(t[l++]=192|n>>>6,t[l++]=128|n&63):n<65536?(t[l++]=224|n>>>12,t[l++]=128|n>>>6&63,t[l++]=128|n&63):(t[l++]=240|n>>>18,t[l++]=128|n>>>12&63,t[l++]=128|n>>>6&63,t[l++]=128|n&63);return t};const buf2binstring=(e,t)=>{if(t<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var buf2string=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,o;const l=new Array(n*2);for(o=0,r=0;r<n;){let u=e[r++];if(u<128){l[o++]=u;continue}let s=_utf8len[u];if(s>4){l[o++]=65533,r+=s-1;continue}for(u&=s===2?31:s===3?15:7;s>1&&r<n;)u=u<<6|e[r++]&63,s--;if(s>1){l[o++]=65533;continue}u<65536?l[o++]=u:(u-=65536,l[o++]=55296|u>>10&1023,l[o++]=56320|u&1023)}return buf2binstring(l,o)},utf8border=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+_utf8len[e[n]]>t?n:t},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(e){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=deflate_1$2.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Z_OK$2)throw new Error(messages[n]);if(t.header&&deflate_1$2.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=strings.string2buf(t.dictionary):toString$1.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=deflate_1$2.deflateSetDictionary(this.strm,r),n!==Z_OK$2)throw new Error(messages[n]);this._dict_set=!0}}Deflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let o,l;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof e=="string"?n.input=strings.string2buf(e):toString$1.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(l===Z_SYNC_FLUSH||l===Z_FULL_FLUSH)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(o=deflate_1$2.deflate(n,l),o===Z_STREAM_END$2)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=deflate_1$2.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Z_OK$2;if(n.avail_out===0){this.onData(n.output);continue}if(l>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Deflate$1.prototype.onData=function(e){this.chunks.push(e)};Deflate$1.prototype.onEnd=function(e){e===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function deflate$1(e,t){const n=new Deflate$1(t);if(n.push(e,!0),n.err)throw n.msg||messages[n.err];return n.result}function deflateRaw$1(e,t){return t=t||{},t.raw=!0,deflate$1(e,t)}function gzip$1(e,t){return t=t||{},t.gzip=!0,deflate$1(e,t)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,constants$1=constants$2,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1,constants:constants$1};const BAD$1=16209,TYPE$1=16191;var inffast=function e(t,n){let r,o,l,u,s,g,c,d,w,v,y,f,p,S,N,B,E,T,h,R,W,X,m,b;const G=t.state;r=t.next_in,m=t.input,o=r+(t.avail_in-5),l=t.next_out,b=t.output,u=l-(n-t.avail_out),s=l+(t.avail_out-257),g=G.dmax,c=G.wsize,d=G.whave,w=G.wnext,v=G.window,y=G.hold,f=G.bits,p=G.lencode,S=G.distcode,N=(1<<G.lenbits)-1,B=(1<<G.distbits)-1;e:do{f<15&&(y+=m[r++]<<f,f+=8,y+=m[r++]<<f,f+=8),E=p[y&N];t:for(;;){if(T=E>>>24,y>>>=T,f-=T,T=E>>>16&255,T===0)b[l++]=E&65535;else if(T&16){h=E&65535,T&=15,T&&(f<T&&(y+=m[r++]<<f,f+=8),h+=y&(1<<T)-1,y>>>=T,f-=T),f<15&&(y+=m[r++]<<f,f+=8,y+=m[r++]<<f,f+=8),E=S[y&B];n:for(;;){if(T=E>>>24,y>>>=T,f-=T,T=E>>>16&255,T&16){if(R=E&65535,T&=15,f<T&&(y+=m[r++]<<f,f+=8,f<T&&(y+=m[r++]<<f,f+=8)),R+=y&(1<<T)-1,R>g){t.msg="invalid distance too far back",G.mode=BAD$1;break e}if(y>>>=T,f-=T,T=l-u,R>T){if(T=R-T,T>d&&G.sane){t.msg="invalid distance too far back",G.mode=BAD$1;break e}if(W=0,X=v,w===0){if(W+=c-T,T<h){h-=T;do b[l++]=v[W++];while(--T);W=l-R,X=b}}else if(w<T){if(W+=c+w-T,T-=w,T<h){h-=T;do b[l++]=v[W++];while(--T);if(W=0,w<h){T=w,h-=T;do b[l++]=v[W++];while(--T);W=l-R,X=b}}}else if(W+=w-T,T<h){h-=T;do b[l++]=v[W++];while(--T);W=l-R,X=b}for(;h>2;)b[l++]=X[W++],b[l++]=X[W++],b[l++]=X[W++],h-=3;h&&(b[l++]=X[W++],h>1&&(b[l++]=X[W++]))}else{W=l-R;do b[l++]=b[W++],b[l++]=b[W++],b[l++]=b[W++],h-=3;while(h>2);h&&(b[l++]=b[W++],h>1&&(b[l++]=b[W++]))}}else if(T&64){t.msg="invalid distance code",G.mode=BAD$1;break e}else{E=S[(E&65535)+(y&(1<<T)-1)];continue n}break}}else if(T&64)if(T&32){G.mode=TYPE$1;break e}else{t.msg="invalid literal/length code",G.mode=BAD$1;break e}else{E=p[(E&65535)+(y&(1<<T)-1)];continue t}break}}while(r<o&&l<s);h=f>>3,r-=h,f-=h<<3,y&=(1<<f)-1,t.next_in=r,t.next_out=l,t.avail_in=r<o?5+(o-r):5-(r-o),t.avail_out=l<s?257+(s-l):257-(l-s),G.hold=y,G.bits=f};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,t,n,r,o,l,u,s)=>{const g=s.bits;let c=0,d=0,w=0,v=0,y=0,f=0,p=0,S=0,N=0,B=0,E,T,h,R,W,X=null,m;const b=new Uint16Array(MAXBITS+1),G=new Uint16Array(MAXBITS+1);let j=null,C,z,P;for(c=0;c<=MAXBITS;c++)b[c]=0;for(d=0;d<r;d++)b[t[n+d]]++;for(y=g,v=MAXBITS;v>=1&&b[v]===0;v--);if(y>v&&(y=v),v===0)return o[l++]=1<<24|64<<16|0,o[l++]=1<<24|64<<16|0,s.bits=1,0;for(w=1;w<v&&b[w]===0;w++);for(y<w&&(y=w),S=1,c=1;c<=MAXBITS;c++)if(S<<=1,S-=b[c],S<0)return-1;if(S>0&&(e===CODES$1||v!==1))return-1;for(G[1]=0,c=1;c<MAXBITS;c++)G[c+1]=G[c]+b[c];for(d=0;d<r;d++)t[n+d]!==0&&(u[G[t[n+d]]++]=d);if(e===CODES$1?(X=j=u,m=20):e===LENS$1?(X=lbase,j=lext,m=257):(X=dbase,j=dext,m=0),B=0,d=0,c=w,W=l,f=y,p=0,h=-1,N=1<<y,R=N-1,e===LENS$1&&N>ENOUGH_LENS$1||e===DISTS$1&&N>ENOUGH_DISTS$1)return 1;for(;;){C=c-p,u[d]+1<m?(z=0,P=u[d]):u[d]>=m?(z=j[u[d]-m],P=X[u[d]-m]):(z=32+64,P=0),E=1<<c-p,T=1<<f,w=T;do T-=E,o[W+(B>>p)+T]=C<<24|z<<16|P|0;while(T!==0);for(E=1<<c-1;B&E;)E>>=1;if(E!==0?(B&=E-1,B+=E):B=0,d++,--b[c]===0){if(c===v)break;c=t[n+u[d]]}if(c>y&&(B&R)!==h){for(p===0&&(p=y),W+=w,f=c-p,S=1<<f;f+p<v&&(S-=b[f+p],!(S<=0));)f++,S<<=1;if(N+=1<<f,e===LENS$1&&N>ENOUGH_LENS$1||e===DISTS$1&&N>ENOUGH_DISTS$1)return 1;h=B&R,o[h]=y<<24|f<<16|W-l|0}}return B!==0&&(o[W+B]=c-p<<24|64<<16|0),s.bits=y,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<HEAD||t.mode>SYNC?1:0},inflateResetKeep=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=HEAD,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ENOUGH_LENS),t.distcode=t.distdyn=new Int32Array(ENOUGH_DISTS),t.sane=1,t.back=-1,Z_OK$1},inflateReset=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)},inflateReset2=(e,t)=>{let n;if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Z_STREAM_ERROR$1:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,inflateReset(e))},inflateInit2=(e,t)=>{if(!e)return Z_STREAM_ERROR$1;const n=new InflateState;e.state=n,n.strm=e,n.window=null,n.mode=HEAD;const r=inflateReset2(e,t);return r!==Z_OK$1&&(e.state=null),r},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,t,n,r)=>{let o;const l=e.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new Uint8Array(l.wsize)),r>=l.wsize?(l.window.set(t.subarray(n-l.wsize,n),0),l.wnext=0,l.whave=l.wsize):(o=l.wsize-l.wnext,o>r&&(o=r),l.window.set(t.subarray(n-r,n-r+o),l.wnext),r-=o,r?(l.window.set(t.subarray(n-r,n),0),l.wnext=r,l.whave=l.wsize):(l.wnext+=o,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=o))),0},inflate$2=(e,t)=>{let n,r,o,l,u,s,g,c,d,w,v,y,f,p,S=0,N,B,E,T,h,R,W,X;const m=new Uint8Array(4);let b,G;const j=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(e)||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;n=e.state,n.mode===TYPE&&(n.mode=TYPEDO),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,d=n.bits,w=s,v=g,X=Z_OK$1;e:for(;;)switch(n.mode){case HEAD:if(n.wrap===0){n.mode=TYPEDO;break}for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&2&&c===35615){n.wbits===0&&(n.wbits=15),n.check=0,m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0),c=0,d=0,n.mode=FLAGS;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=BAD;break}if((c&15)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(c>>>=4,d-=4,W=(c&15)+8,n.wbits===0&&(n.wbits=W),W>15||W>n.wbits){e.msg="invalid window size",n.mode=BAD;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=c&512?DICTID:TYPE,c=0,d=0;break;case FLAGS:for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.flags=c,(n.flags&255)!==Z_DEFLATED){e.msg="unknown compression method",n.mode=BAD;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=BAD;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0,n.mode=TIME;case TIME:for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.head&&(n.head.time=c),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,m[2]=c>>>16&255,m[3]=c>>>24&255,n.check=crc32_1(n.check,m,4,0)),c=0,d=0,n.mode=OS;case OS:for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0,n.mode=EXLEN;case EXLEN:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&n.wrap&4&&(m[0]=c&255,m[1]=c>>>8&255,n.check=crc32_1(n.check,m,2,0)),c=0,d=0}else n.head&&(n.head.extra=null);n.mode=EXTRA;case EXTRA:if(n.flags&1024&&(y=n.length,y>s&&(y=s),y&&(n.head&&(W=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(l,l+y),W)),n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,n.length-=y),n.length))break e;n.length=0,n.mode=NAME;case NAME:if(n.flags&2048){if(s===0)break e;y=0;do W=r[l+y++],n.head&&W&&n.length<65536&&(n.head.name+=String.fromCharCode(W));while(W&&y<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,W)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=COMMENT;case COMMENT:if(n.flags&4096){if(s===0)break e;y=0;do W=r[l+y++],n.head&&W&&n.length<65536&&(n.head.comment+=String.fromCharCode(W));while(W&&y<s);if(n.flags&512&&n.wrap&4&&(n.check=crc32_1(n.check,r,y,l)),s-=y,l+=y,W)break e}else n.head&&(n.head.comment=null);n.mode=HCRC;case HCRC:if(n.flags&512){for(;d<16;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&4&&c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=BAD;break}c=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=TYPE;break;case DICTID:for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}e.adler=n.check=zswap32(c),c=0,d=0,n.mode=DICT;case DICT:if(n.havedict===0)return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,Z_NEED_DICT$1;e.adler=n.check=1,n.mode=TYPE;case TYPE:if(t===Z_BLOCK||t===Z_TREES)break e;case TYPEDO:if(n.last){c>>>=d&7,d-=d&7,n.mode=CHECK;break}for(;d<3;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}switch(n.last=c&1,c>>>=1,d-=1,c&3){case 0:n.mode=STORED;break;case 1:if(fixedtables(n),n.mode=LEN_,t===Z_TREES){c>>>=2,d-=2;break e}break;case 2:n.mode=TABLE;break;case 3:e.msg="invalid block type",n.mode=BAD}c>>>=2,d-=2;break;case STORED:for(c>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=BAD;break}if(n.length=c&65535,c=0,d=0,n.mode=COPY_,t===Z_TREES)break e;case COPY_:n.mode=COPY;case COPY:if(y=n.length,y){if(y>s&&(y=s),y>g&&(y=g),y===0)break e;o.set(r.subarray(l,l+y),u),s-=y,l+=y,g-=y,u+=y,n.length-=y;break}n.mode=TYPE;break;case TABLE:for(;d<14;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.nlen=(c&31)+257,c>>>=5,d-=5,n.ndist=(c&31)+1,c>>>=5,d-=5,n.ncode=(c&15)+4,c>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=BAD;break}n.have=0,n.mode=LENLENS;case LENLENS:for(;n.have<n.ncode;){for(;d<3;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.lens[j[n.have++]]=c&7,c>>>=3,d-=3}for(;n.have<19;)n.lens[j[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,b={bits:n.lenbits},X=inftrees(CODES,n.lens,0,19,n.lencode,0,n.work,b),n.lenbits=b.bits,X){e.msg="invalid code lengths set",n.mode=BAD;break}n.have=0,n.mode=CODELENS;case CODELENS:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[c&(1<<n.lenbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(E<16)c>>>=N,d-=N,n.lens[n.have++]=E;else{if(E===16){for(G=N+2;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(c>>>=N,d-=N,n.have===0){e.msg="invalid bit length repeat",n.mode=BAD;break}W=n.lens[n.have-1],y=3+(c&3),c>>>=2,d-=2}else if(E===17){for(G=N+3;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=N,d-=N,W=0,y=3+(c&7),c>>>=3,d-=3}else{for(G=N+7;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=N,d-=N,W=0,y=11+(c&127),c>>>=7,d-=7}if(n.have+y>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=BAD;break}for(;y--;)n.lens[n.have++]=W}}if(n.mode===BAD)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=BAD;break}if(n.lenbits=9,b={bits:n.lenbits},X=inftrees(LENS,n.lens,0,n.nlen,n.lencode,0,n.work,b),n.lenbits=b.bits,X){e.msg="invalid literal/lengths set",n.mode=BAD;break}if(n.distbits=6,n.distcode=n.distdyn,b={bits:n.distbits},X=inftrees(DISTS,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,b),n.distbits=b.bits,X){e.msg="invalid distances set",n.mode=BAD;break}if(n.mode=LEN_,t===Z_TREES)break e;case LEN_:n.mode=LEN;case LEN:if(s>=6&&g>=258){e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,inffast(e,v),u=e.next_out,o=e.output,g=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,c=n.hold,d=n.bits,n.mode===TYPE&&(n.back=-1);break}for(n.back=0;S=n.lencode[c&(1<<n.lenbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(B&&!(B&240)){for(T=N,h=B,R=E;S=n.lencode[R+((c&(1<<T+h)-1)>>T)],N=S>>>24,B=S>>>16&255,E=S&65535,!(T+N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=T,d-=T,n.back+=T}if(c>>>=N,d-=N,n.back+=N,n.length=E,B===0){n.mode=LIT;break}if(B&32){n.back=-1,n.mode=TYPE;break}if(B&64){e.msg="invalid literal/length code",n.mode=BAD;break}n.extra=B&15,n.mode=LENEXT;case LENEXT:if(n.extra){for(G=n.extra;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=DIST;case DIST:for(;S=n.distcode[c&(1<<n.distbits)-1],N=S>>>24,B=S>>>16&255,E=S&65535,!(N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(!(B&240)){for(T=N,h=B,R=E;S=n.distcode[R+((c&(1<<T+h)-1)>>T)],N=S>>>24,B=S>>>16&255,E=S&65535,!(T+N<=d);){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}c>>>=T,d-=T,n.back+=T}if(c>>>=N,d-=N,n.back+=N,B&64){e.msg="invalid distance code",n.mode=BAD;break}n.offset=E,n.extra=B&15,n.mode=DISTEXT;case DISTEXT:if(n.extra){for(G=n.extra;d<G;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=BAD;break}n.mode=MATCH;case MATCH:if(g===0)break e;if(y=v-g,n.offset>y){if(y=n.offset-y,y>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=BAD;break}y>n.wnext?(y-=n.wnext,f=n.wsize-y):f=n.wnext-y,y>n.length&&(y=n.length),p=n.window}else p=o,f=u-n.offset,y=n.length;y>g&&(y=g),g-=y,n.length-=y;do o[u++]=p[f++];while(--y);n.length===0&&(n.mode=LEN);break;case LIT:if(g===0)break e;o[u++]=n.length,g--,n.mode=LEN;break;case CHECK:if(n.wrap){for(;d<32;){if(s===0)break e;s--,c|=r[l++]<<d,d+=8}if(v-=g,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,u-v):adler32_1(n.check,o,v,u-v)),v=g,n.wrap&4&&(n.flags?c:zswap32(c))!==n.check){e.msg="incorrect data check",n.mode=BAD;break}c=0,d=0}n.mode=LENGTH;case LENGTH:if(n.wrap&&n.flags){for(;d<32;){if(s===0)break e;s--,c+=r[l++]<<d,d+=8}if(n.wrap&4&&c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=BAD;break}c=0,d=0}n.mode=DONE;case DONE:X=Z_STREAM_END$1;break e;case BAD:X=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=u,e.avail_out=g,e.next_in=l,e.avail_in=s,n.hold=c,n.bits=d,(n.wsize||v!==e.avail_out&&n.mode<BAD&&(n.mode<CHECK||t!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,v-e.avail_out),w-=e.avail_in,v-=e.avail_out,e.total_in+=w,e.total_out+=v,n.total+=v,n.wrap&4&&v&&(e.adler=n.check=n.flags?crc32_1(n.check,o,v,e.next_out-v):adler32_1(n.check,o,v,e.next_out-v)),e.data_type=n.bits+(n.last?64:0)+(n.mode===TYPE?128:0)+(n.mode===LEN_||n.mode===COPY_?256:0),(w===0&&v===0||t===Z_FINISH$1)&&X===Z_OK$1&&(X=Z_BUF_ERROR),X},inflateEnd=e=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;let t=e.state;return t.window&&(t.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,t)=>{if(inflateStateCheck(e))return Z_STREAM_ERROR$1;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(e,t)=>{const n=t.length;let r,o,l;return inflateStateCheck(e)||(r=e.state,r.wrap!==0&&r.mode!==DICT)?Z_STREAM_ERROR$1:r.mode===DICT&&(o=1,o=adler32_1(o,t,n,0),o!==r.check)?Z_DATA_ERROR$1:(l=updatewindow(e,t,n,n),l?(r.mode=MEM,Z_MEM_ERROR$1):(r.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let n=inflate_1$2.inflateInit2(this.strm,t.windowBits);if(n!==Z_OK)throw new Error(messages[n]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=strings.string2buf(t.dictionary):toString.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=inflate_1$2.inflateSetDictionary(this.strm,t.dictionary),n!==Z_OK)))throw new Error(messages[n])}Inflate$1.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let l,u,s;if(this.ended)return!1;for(t===~~t?u=t:u=t===!0?Z_FINISH:Z_NO_FLUSH,toString.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),l=inflate_1$2.inflate(n,u),l===Z_NEED_DICT&&o&&(l=inflate_1$2.inflateSetDictionary(n,o),l===Z_OK?l=inflate_1$2.inflate(n,u):l===Z_DATA_ERROR&&(l=Z_NEED_DICT));n.avail_in>0&&l===Z_STREAM_END&&n.state.wrap>0&&e[n.next_in]!==0;)inflate_1$2.inflateReset(n),l=inflate_1$2.inflate(n,u);switch(l){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(l),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||l===Z_STREAM_END))if(this.options.to==="string"){let g=strings.utf8border(n.output,n.next_out),c=n.next_out-g,d=strings.buf2string(n.output,g);n.next_out=c,n.avail_out=r-c,c&&n.output.set(n.output.subarray(g,g+c),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(l===Z_OK&&s===0)){if(l===Z_STREAM_END)return l=inflate_1$2.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Inflate$1.prototype.onData=function(e){this.chunks.push(e)};Inflate$1.prototype.onEnd=function(e){e===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1;var deflate_1=deflate,fromByteArray_1=fromByteArray,lookup=[],code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i)lookup[i]=code[i];function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(tripletToBase64(r));return o.join("")}function fromByteArray(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,s=n-r;u<s;u+=l)o.push(encodeChunk(e,u,u+l>s?s:u+l));return r===1?(t=e[n-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}const encoder=new TextEncoder;new TextDecoder;function serializeHash(e){const t=JSON.stringify(e),n=encoder.encode(t),r=deflate_1(n);return fromByteArray_1(r)}async function getViews(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/views`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function createShareLink(e,t){if(!Authentication.token)throw new Error("Not authenticated");const r=(await getViews()).filter(s=>s.name===t);if(r.length===0)return console.warn("View does not exist or it is misspell"),null;const o=await fetch(`${FORMANT_API_URL}/v1/admin/shares`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=FORMANT_API_URL.replace("api","app"),{code:u}=await o.json();return`${l}/shares/${u}#${serializeHash({viewId:r[0].id})}`}const vailableAggregationIntervals=["day","week","month","year","hour","minute","quarter"],aggregateFunctions=["interval","start","end","sub","get"];function getVariance(e){return e.count<2?0:e.sumOfSquares/(e.count-1)}function getStandardDeviation(e){return Math.sqrt(getVariance(e))}function getMax(e){return e.max}function getMin(e){return e.min}function getAverage(e){return e.count===0?-1:e.sum/e.count}function getSum(e){return e.sum}function getCount(e){return e.count}const aggregateFunctionMap={min:getMin,max:getMax,"standard deviation":getStandardDeviation,average:getAverage,sum:getSum,count:getCount},aggregateByDateFunctions={day:{interval:eachDayOfInterval,start:startOfDay,end:endOfDay,sub:subDays,get:getDay},week:{interval:eachWeekOfInterval,start:startOfWeek,end:endOfWeek,sub:subWeeks,get:getWeek},month:{interval:eachMonthOfInterval,start:startOfMonth,end:endOfMonth,sub:subMonths,get:getMonth},year:{interval:eachYearOfInterval,start:startOfYear,end:endOfYear,sub:subYears,get:getYear},hour:{interval:eachHourOfInterval,start:startOfHour,end:endOfHour,sub:subHours,get:getHours},minute:{interval:eachMinuteOfInterval,start:startOfMinute,end:endOfMinute,sub:subMinutes,get:getMinutes},quarter:{interval:eachQuarterOfInterval,start:startOfQuarter,end:endOfQuarter,sub:subQuarters,get:getQuarter}},formatTimeFrameText=(e,t)=>e.split("/")[0]+"/"+e.split("/")[1]+"–"+t.split("/")[0]+"/"+t.split("/")[1];async function queryEvents(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function eventsCounter(e,t,n,r,o){const l=aggregateByDateFunctions[t];return await Promise.all(Array(n).fill(0).map(async(u,s)=>{const g=new Date(r),c=l.sub(l.start(g),n-s-1),d=l.sub(l.end(g),n-s-1),w=formatTimeFrameText(c.toLocaleDateString(),d.toLocaleDateString()),v=await queryEvents({...o,eventTypes:e,start:new Date(c).toISOString(),end:new Date(d).toISOString()});return{date:w,events:v}}))}async function getAnnotationCount(e,t){return(await queryEvents({...e,eventTypes:["annotation"]})).filter(l=>!!l.tags&&Object.keys(l.tags).includes(t)).reduce((l,u)=>{const s=u.tags[t];return s in l?(l[s]+=1,l):(l[s]=1,l)},{})}async function getAnnotationCountByIntervals(e,t,n){const{end:r,start:o}=e,u=aggregateByDateFunctions[n].interval({start:new Date(o),end:new Date(r)}),s=u.map((c,d)=>{const w=new Date(c).toISOString(),v=d===u.length-1?new Date(Date.now()).toISOString():new Date(u[d+1]);return getAnnotationCount({...e,start:w,end:v},t)}),g=await Promise.all(s);return u.map((c,d)=>({date:new Date(c).toISOString(),annotations:g[d]}))}async function getTelemetry(e,t,n,r,o){let l=e;Array.isArray(e)||(l=[e]);let u=t;return Array.isArray(t)||(u=[t]),(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify({deviceIds:l,end:r.toISOString(),names:u,start:n.toISOString(),tags:o}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getRealtimeSessions(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getSessions()}finally{await e.shutdown()}}async function getPeers(){if(!Authentication.token)throw new Error("Not authenticated");const e=defaultRtcClientPool.get();try{return await e.getPeers()}finally{await e.shutdown()}}async function createDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchDevice(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getDevicesData(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function queryDevicesData(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function disableDevice(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}/disable`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}class Device extends BaseDevice{constructor(t,n,r,o){super(),this.id=t,this.name=n,this.organizationId=r,this.tags=o}async getLatestTelemetry(){return(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async getConfiguration(t=!1){let n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});const r=await n.json();if(!r.state.reportedConfiguration)throw new Error("Device has no configuration, has it ever been turned on?");const o=t?r.desiredConfigurationVersion:r.state.reportedConfiguration.version;return n=await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${o}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),(await n.json()).document}async getAgentVersion(){var r;const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return(r=n==null?void 0:n.state)==null?void 0:r.agentVersion}async getFileUrl(t){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[t]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).fileUrls}async startRealtimeConnection(t={}){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const{sessionType:n,deadlineMs:r=1e4,maxConnectRetries:o=3}=typeof t=="number"?{sessionType:t}:t,u=getRtcClientPool({sessionType:n}).get(this.handleMessage);let s=!1;const g=new Promise((d,w)=>setTimeout(()=>{s=!0,w(new Error("Connection timed out: the connection could not be finalized in time, possibly due to network issues or misconfigured settings."))},r)),c=async()=>{if("isReady"in u)for(;!u.isReady();)this.assertNotCancelled(s),await delay(100);const d=await this.getRemoteDevicePeerId(u);this.assertNotCancelled(s);let w;for(let y=0;y<o&&(w=await u.connect(d),!w);y++)delay(100),this.assertNotCancelled(s);if(!w)throw new Error(`Session could not be created: exhausted ${o} retries`);let v=0;for(;!s&&u.getConnectionStatus(d)!=="connected";)await delay(100),v+=1;return this.assertNotCancelled(s),console.debug(`${new Date().toISOString()} :: Connection completed after ${v} retries`),d};return Promise.race([c(),g]).then(d=>{this.remoteDevicePeerId=d,this.initConnectionMonitoring(),this.rtcClient=u,this.emit("connect")}).catch(d=>{throw console.debug(`${new Date().toISOString()} :: Connection failed: %o`,d),this.remoteDevicePeerId=null,u.shutdown().catch(w=>{console.error("rtcClient cannot shutdown: %o",w)}),this.emit("connection_failed",d),d})}async getRemoteDevicePeerId(t){const r=(await t.getPeers()).find(o=>o.deviceId===this.id);if(!isRtcPeer(r))throw new Error("Cannot find peer, is the robot offline?");return r.id}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let t=!1;if(this.rtcClient){const r=this.rtcClient.getConnections().find(o=>o.getRemotePeerId()===this.remoteDevicePeerId&&o.isActive());(r===void 0||!r.isReady())&&(console.debug(`${new Date().toISOString()} :: data channel closed`),t=!0)}(!this.rtcClient||!this.remoteDevicePeerId||await this.rtcClient.getConnectionStatsInfo(this.remoteDevicePeerId)===void 0||t)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(n=>{console.error(n)}))},1e3)}async getRemotePeer(){const n=(await defined(this.rtcClient,"Realtime connection has not been started").getPeers()).find(r=>r.deviceId===this.id);return defined(n,"Could not find remote peer for device "+this.id)}async stopRealtimeConnection(){let t=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.remoteDevicePeerId?(await this.rtcClient.disconnect(this.remoteDevicePeerId),this.remoteDevicePeerId=null):t=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(t)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async isInRealtimeSession(){const t=await getPeers(),n=await getRealtimeSessions(),r=t.find(o=>o.deviceId===this.id);return r?n[r.id].length>0:!1}async getAvailableCommands(){return(await(await fetch(`${FORMANT_API_URL}/v1/admin/command-templates/`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>({name:r.name,id:r.id,command:r.command,description:r.description,parameterEnabled:r.parameterEnabled,parameterValue:r.parameterValue,parameterMeta:r.parameterMeta,enabled:r.enabled,tags:r.tags}))}async sendCommand(t,n,r,o){var d;const u=(await this.getAvailableCommands()).find(w=>w.name===t);if(!u)throw new Error(`Could not find command with name "${t}"`);let s="";n===void 0?u.parameterEnabled&&u.parameterValue&&(s=u.parameterValue):s=n;let g={value:s,scrubberTime:(r||new Date).toISOString(),meta:{...u.parameterMeta,...o}};return await fetch(`${FORMANT_API_URL}/v1/admin/commands`,{method:"POST",body:JSON.stringify({commandTemplateId:u.id,organizationId:this.organizationId,deviceId:this.id,command:u.command,parameter:g,userId:(d=Authentication.currentUser)==null?void 0:d.id}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async getCommand(t){return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async createCaptureStream(t){const r=await(await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`,{method:"POST",body:JSON.stringify({deviceId:this.id,streamName:t,tags:{}}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return new CaptureStream(r)}async getTelemetry(t,n,r,o){return await getTelemetry(this.id,t,n,r,o)}async getTelemetryStreams(){var s,g;const t=await this.getConfiguration(),n=await fetch(`${FORMANT_API_URL}/v1/queries/metadata/stream-names`,{method:"POST",body:JSON.stringify({deviceIds:[this.id]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=[],o=[];return(g=(s=t.telemetry)==null?void 0:s.streams)==null||g.forEach(c=>{c.disabled!==!0&&r.push(c.name),c.onDemand===!0&&o.push(c.name)}),console.log(o),(await n.json()).items.filter(c=>!r.includes(c)).map(c=>({name:c,onDemand:o.includes(c)}))}async createInterventionRequest(t,n,r,o){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"POST",body:JSON.stringify({message:t,interventionType:n,time:new Date().toISOString(),deviceId:this.id,tags:o,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async addInterventionResponse(t,n,r){return await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-responses`,{method:"POST",body:JSON.stringify({interventionId:t,interventionType:n,data:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async getAnnotationCount(t,n){return await getAnnotationCount({...t,deviceIds:[this.id]},n)}async getAnnotationCountByIntervals(t,n,r){return await getAnnotationCountByIntervals({...t,deviceIds:[this.id]},n,r)}async eventsCounter(t,n,r,o,l){return await eventsCounter(t,n,r,o,{...l,deviceIds:[this.id]})}async createShareLink(t,n){return t.scope.deviceIds=[this.id],await createShareLink(t,n)}}be(Device,"createDevice",createDevice),be(Device,"patchDevice",patchDevice),be(Device,"getDevicesData",getDevicesData),be(Device,"queryDevicesData",queryDevicesData),be(Device,"disableDevice",disableDevice);class PeerDevice extends BaseDevice{constructor(n){super();be(this,"id");be(this,"telemetryStreamActive",!1);be(this,"streamTelemetry",{});this.peerUrl=n}async getLatestTelemetry(){this.telemetryStreamActive||this.subscribeToTelemetry();const n=this.streamTelemetry;return Object.entries(n).map(([o,l])=>({deviceId:this.id,streamName:o,streamType:"json",currentValue:l,currentValueTime:l.timestamp,tags:{}}))}subscribeToTelemetry(){this.telemetryStreamActive=!0;let n=0;const r=new XMLHttpRequest;r.responseType="text",r.addEventListener("error",o=>{this.handleXHRError("error")}),r.addEventListener("abort",o=>{this.handleXHRError("abort")}),r.addEventListener("timeout",o=>{this.handleXHRError("timeout")}),r.addEventListener("readystatechange",o=>{r.readyState===XMLHttpRequest.DONE&&this.handleXHRError("closed")}),r.addEventListener("progress",o=>{const l=o.loaded,u=l-n;n=l,r.responseText.substr(-u).split(`
63
+ `).forEach(c=>{var d;if(c.length>0){const w=JSON.parse(c);if((d=w.result)!=null&&d.datapoint){const v=w.result.datapoint,y=v.stream;delete v.stream,this.streamTelemetry[y]=v}}})}),r.open("POST",`${this.peerUrl}/v1/telemetry`),r.send()}handleXHRError(n){console.warn(`Telemetry stream ended: ${n}`),this.telemetryStreamActive=!1}async getDeviceId(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.id}async getConfiguration(){return(await(await fetch(`${this.peerUrl}/v1/config`)).json()).configuration.document}async startRealtimeConnection(n){if(console.debug(`${new Date().toISOString()} :: Connection start requested`),this.rtcClient&&this.connectionMonitorInterval!==void 0)throw new Error(`Already created realtime connection to device ${this.id}`);this.rtcClient&&console.warn("overwriting existing rtcClient due to missing connectionMonitorInterval");const r=new distExports.RtcClient({lanOnlyMode:!0,receive:this.handleMessage,sessionType:n});for(await r.connectLan(this.peerUrl);r.getConnectionStatus(this.peerUrl)!=="connected";)await delay(100);this.rtcClient=r,this.initConnectionMonitoring()}initConnectionMonitoring(){this.connectionMonitorInterval=setInterval(async()=>{let n=!1;this.rtcClient&&this.rtcClient.getConnectionStatus(this.peerUrl)!=="connected"&&(console.debug(`${new Date().toISOString()} :: data channel closed`),n=!0),(!this.rtcClient||n)&&(this.emit("disconnect"),this.stopRealtimeConnection().catch(r=>{console.error(r)}))},1e3)}async getRemotePeer(){return{id:this.peerUrl,organizationId:"",deviceId:this.id,capabilities:[],capabilitySet:{}}}async stopRealtimeConnection(){let n=!1;if(this.rtcClient){this.stopConnectionMonitoring(),this.id?(await this.rtcClient.disconnect(this.id),this.remoteDevicePeerId=null):n=!0;try{await this.rtcClient.shutdown()}finally{this.rtcClient=void 0}}if(n)throw new Error(`Realtime connection hasn't been started for ${this.id}`)}async sendCommand(n,r,o,l){const u={value:r,scrubberTime:(o||new Date).toISOString(),meta:l};return await fetch(`${this.peerUrl}/v1/enqueue-command`,{method:"POST",body:JSON.stringify({command:n,parameter:u}),headers:{"Content-Type":"application/json"}})}}async function addDeviceToFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"PATCH",body:JSON.stringify({fleetId:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function aggregateTelemetry(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/queries`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).aggregates}async function deleteFleet(e){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}async function getAnalyticStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsModules(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/analytics-modules`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getAnalyticsRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/query`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(r=>new Device(r.id,r.name,r.organizationId,r.tags))}async function getCurrentGroup(){if(!Authentication.token)throw new Error("Not authenticated");let e=new URLSearchParams("");typeof window<"u"&&window.location&&(e=new URLSearchParams(window.location.search));const t=e.get("group");if(t===null||t.trim()==="")return;const n=await fetch(`${FORMANT_API_URL}/v1/admin/groups/`+t,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),{tagKey:r,tagValue:o}=await n.json();return await queryDevices({tags:{[r]:[o]},enabled:!0,type:"default"})}async function getDevice(e){if(!Authentication.token)throw new Error("Not authenticated");const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/devices/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json(),r=n.name;return new Device(e,r,n.organizationId,n.tags)}async function getDevices(){if(!Authentication.token)throw new Error("Not authenticated");const t=await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",body:JSON.stringify({enabled:!0,type:"default"}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();return t.items,t.items.map(n=>new Device(n.id,n.name,defined(Authentication.currentOrganization),n.tags))}async function getEvent(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/events/query/id=${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getFileUrl(e){const n=await(await fetch(`${FORMANT_API_URL}/v1/admin/files/query`,{method:"POST",body:JSON.stringify({fileIds:[e]}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json();if(n.fileUrls.length===0)throw new Error("File not found");return n.fileUrls[0]}async function getFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getFleetDevices(e){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}/devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getInterventions(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/intervention-requests`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getLatestTelemetry(...e){const t=e.flat().filter(o=>!!o);return t.length===0?[]:(await(await fetch(`${FORMANT_API_URL}/v1/queries/stream-current-value`,{method:"POST",body:JSON.stringify({deviceIds:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getOnlineDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/queries/online-devices`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items;return(await getDevices()).filter(o=>n.includes(o.id))}async function getRealtimeDevices(){if(!Authentication.token)throw new Error("Not authenticated");const n=(await(await fetch(`${FORMANT_API_URL}/v1/signaling/peers`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.map(o=>o.deviceId);return(await getDevices()).filter(o=>n.includes(o.id))}async function getStreams(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/streams`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.filter(n=>n.enabled)}async function getTaskReportRows(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-report-rows`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getTaskReportTables(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics/task-reports`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function listFleets(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function patchFleet(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchStream(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/streams/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchView(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/views/${e.id}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function queryAnalytics(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/queries/analytics`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function createFleet(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/fleets`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function getAllEventTriggerGroup(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}async function getEventTriggerGroup(e){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups/${e}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}async function patchEventTriggerGroup(e,t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/event-trigger-groups/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}const Me=class Me{static async setDefaultDevice(t){Me.defaultDeviceId=t}static async getCurrentDevice(){if(!Authentication.token)throw new Error("Not authenticated");if(!Me.defaultDeviceId)throw new Error("No known default device");const r=(await(await fetch(`${FORMANT_API_URL}/v1/admin/device-details/query`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items.find(u=>u.id===Me.defaultDeviceId),o=r.name,l=new Device(Me.defaultDeviceId,o,defined(Authentication.currentOrganization),r.tags);return Me.knownContext.push(new WeakRef(l)),l}static async getPeerDevice(t){const n=new PeerDevice(t);return n.id=await n.getDeviceId(),n}static async getDevice(t){const n=await getDevice(t);return Me.knownContext.push(new WeakRef(n)),n}};be(Me,"defaultDeviceId"),be(Me,"knownContext",[]),be(Me,"createFleet",createFleet),be(Me,"listFleets",listFleets),be(Me,"getFleet",getFleet),be(Me,"patchFleet",patchFleet),be(Me,"deleteFleet",deleteFleet),be(Me,"addDeviceToFleet",addDeviceToFleet),be(Me,"getFleetDevices",getFleetDevices),be(Me,"aggregateTelemetry",aggregateTelemetry),be(Me,"createShareLink",createShareLink),be(Me,"eventsCounter",eventsCounter),be(Me,"getAnalyticStreams",getAnalyticStreams),be(Me,"getAnalyticsModules",getAnalyticsModules),be(Me,"getAnalyticsRows",getAnalyticsRows),be(Me,"getAnnotationCount",getAnnotationCount),be(Me,"getAnnotationCountByIntervals",getAnnotationCountByIntervals),be(Me,"getCurrentGroup",getCurrentGroup),be(Me,"getDevices",getDevices),be(Me,"getEvent",getEvent),be(Me,"getFileUrl",getFileUrl),be(Me,"getInterventions",getInterventions),be(Me,"getLatestTelemetry",getLatestTelemetry),be(Me,"getOnlineDevices",getOnlineDevices),be(Me,"getPeers",getPeers),be(Me,"getRealtimeDevices",getRealtimeDevices),be(Me,"getRealtimeSessions",getRealtimeSessions),be(Me,"getStreams",getStreams),be(Me,"getTaskReportRows",getTaskReportRows),be(Me,"getTaskReportTables",getTaskReportTables),be(Me,"getTelemetry",getTelemetry),be(Me,"getViews",getViews),be(Me,"patchStream",patchStream),be(Me,"patchView",patchView),be(Me,"queryAnalytics",queryAnalytics),be(Me,"queryDevices",queryDevices),be(Me,"queryEvents",queryEvents),be(Me,"queryTelemetry",queryTelemetry),be(Me,"getAllEventTriggerGroup",getAllEventTriggerGroup),be(Me,"getEventTriggerGroup",getEventTriggerGroup),be(Me,"patchEventTriggergroup",patchEventTriggerGroup);let Fleet=Me;class KeyValue{static async set(t,n,r){try{const o=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"POST",body:JSON.stringify({organizationId:defined(Authentication.currentUser).organizationId,key:t,value:n,tags:r}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),l=await o.json();if(o.status!==200)throw new Error(l.message)}catch(o){throw o}}static async get(t){try{const n=await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),r=await n.json();if(n.status!==200)throw new Error(r.message);return r.value}catch(n){throw n}}static async list(){try{const t=await fetch(FORMANT_API_URL+"/v1/admin/key-value",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}}),n=await t.json();if(t.status!==200)throw new Error(n.message);return n.items}catch(t){throw t}}static async delete(t){try{if(!(await fetch(FORMANT_API_URL+`/v1/admin/key-value/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to handle request");return}catch(n){throw n}}static async query(t){try{const n=await fetch(FORMANT_API_URL+"/v1/admin/key-value/query",{method:"POST",body:JSON.stringify({keys:t}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}});if(!n.ok)throw new Error("Unable to handle request");return(await n.json()).items}catch(n){throw n}}}function stringToArrayBuffer(e){return Uint8Array.from(base64Exports.decode(e),t=>t.charCodeAt(0))}function fork(e){}function browser(){const{userAgent:e}=navigator;return e?e.includes("Firefox/")?"Firefox":e.includes("Edg/")?"Edge":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":e.includes("MSIE/")||e.includes("Trident/")?"IE":"Other":"Other"}const rtcAudioChunkStreamType="audio-chunk";class AudioPlayer{constructor(t,n){be(this,"muted",!1);be(this,"hasReceivedData",!1);be(this,"audioContext");be(this,"chunks",[]);be(this,"isPlaying",!1);be(this,"startTime",0);be(this,"lastChunkOffset",0);be(this,"bufferSize",3);be(this,"receive",async t=>{var u;const n=(u=t.payload.audioChunk)==null?void 0:u.chunk_data;if(!n)return;this.hasReceivedData||(this.hasReceivedData=!0);const{audioContext:r,muted:o}=this;if(!r||t.header.stream.streamType!==rtcAudioChunkStreamType||o!==!1)return;const l=stringToArrayBuffer(n);try{await r.decodeAudioData(l.buffer,this.scheduleChunk)}catch(s){console.warn("Error decoding audio buffer, changing audioWireFormat on agent",{error:s}),this.changeAudioWireFormat("wav")}});be(this,"scheduleChunk",t=>{const{audioContext:n}=this;if(!n)return;(this.chunks.length>this.bufferSize||this.isPlaying===!1)&&(this.chunks.forEach(o=>{o.stop()}),this.isPlaying=!1,this.chunks=[]);const r=this.createChunk(t);r&&r.buffer&&(this.isPlaying===!1&&(this.startTime=n.currentTime,this.lastChunkOffset=0,this.isPlaying=!0),r.start(this.startTime+this.lastChunkOffset,0,t.duration),this.lastChunkOffset+=r.buffer.duration,this.chunks.push(r))});this.device=t,this.stream=n,this.device.startListeningToRealtimeDataStream(n),this.device.addRealtimeListener((o,l)=>{this.receive(l)}),browser()==="Safari"||browser()==="IE"?this.changeAudioWireFormat("wav"):this.changeAudioWireFormat("opus");const r=window.AudioContext||window.webkitAudioContext;this.audioContext=new r}async play(){var t,n;((t=this.audioContext)==null?void 0:t.state)==="suspended"&&await((n=this.audioContext)==null?void 0:n.resume()),this.muted=!1}async pause(){await this.audioContext.suspend(),this.muted=!0}destroy(){this.device.stopListeningToRealtimeDataStream(this.stream)}createChunk(t){const{audioContext:n}=this;if(!n)return;const r=n.createBufferSource();return r.buffer=t,r.connect(n.destination),r.loop=!1,r.onended=o=>{this.chunks.splice(this.chunks.indexOf(r),1),this.chunks.length===0&&(this.isPlaying=!1)},r}changeAudioWireFormat(t){const{stream:n}=this;(async()=>await this.device.changeStreamAudioType(n.name,t))()}}class Account{static async listAccounts(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createAccounts(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getAccount(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchAccount(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteAccount(t){if(!Authentication.token)throw new Error("Not authenticated");if(!(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).ok)throw new Error("Unable to delete account")}static async getAccountTree(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/accounts/${t}/tree`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}}class Role{static async listRoles(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getRole(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchRole(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteRole(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/roles/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}class User{static async listUsers(){if(!Authentication.token)throw new Error("Not authenticated");return(await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()).items}static async createUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async getUser(t){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async patchUser(t,n){if(!Authentication.token)throw new Error("Not authenticated");return await(await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})).json()}static async deleteUser(t){if(!Authentication.token)throw new Error("Not authenticated");await fetch(`${FORMANT_API_URL}/v1/admin/users/${t}`,{method:"PATCH",body:JSON.stringify({enabled:!1,roleId:null,teamId:null}),headers:{"Content-Type":"application/json",Authorization:"Bearer "+Authentication.token}})}}const accessLevels=["viewer","operator","administrator"],viewer="viewer",operator="operator",administrator="administrator",aggregateLevels=["year","month","week","day","hour","minute"],annotationTypes=["tag","sheet","user"],eventTypes=["triggered-event","intervention-request","teleop-session-record","port-forwarding-session-record","command-request","command-response","command-delivery","custom","comment","system","annotation"],healthStatuses=["unknown","operational","offline","error"],interventionTypes=["selection","labeling","teleop"],severities=["info","warning","error","critical"],videoMimeTypes=["video/mp4"],timeout=e=>new Promise(t=>setTimeout(t,e*1e3));try{const e=typeof window<"u"&&window.location?new URLSearchParams(window.location.search):new URLSearchParams(""),t=e.get("device");t&&Fleet.setDefaultDevice(t);const n=e.get("auth");n&&Authentication.loginWithToken(n),e.get("module")&&Authentication.listenForRefresh(),typeof window<"u"&&App.listenForConnectionEvents()}catch(e){}exports.Account=Account;exports.App=App;exports.AudioPlayer=AudioPlayer;exports.Authentication=Authentication;exports.BinaryRequestDataChannel=BinaryRequestDataChannel;exports.CaptureStream=CaptureStream;exports.DataChannel=DataChannel;exports.Device=Device;exports.Fleet=Fleet;exports.KeyValue=KeyValue;exports.Manipulator=Manipulator;exports.PeerDevice=PeerDevice;exports.Role=Role;exports.SessionType=SessionTypeConstants;exports.TextRequestDataChannel=TextRequestDataChannel;exports.User=User;exports.accessLevels=accessLevels;exports.administrator=administrator;exports.aggregateByDateFunctions=aggregateByDateFunctions;exports.aggregateFunctionMap=aggregateFunctionMap;exports.aggregateFunctions=aggregateFunctions;exports.aggregateLevels=aggregateLevels;exports.annotationTypes=annotationTypes;exports.createRtcStreamMessage=distExports.createRtcStreamMessage;exports.eventTypes=eventTypes;exports.formatTimeFrameText=formatTimeFrameText;exports.getAverage=getAverage;exports.getCount=getCount;exports.getMax=getMax;exports.getMin=getMin;exports.getStandardDeviation=getStandardDeviation;exports.getSum=getSum;exports.getVariance=getVariance;exports.healthStatuses=healthStatuses;exports.interventionTypes=interventionTypes;exports.operator=operator;exports.severities=severities;exports.timeout=timeout;exports.vailableAggregationIntervals=vailableAggregationIntervals;exports.videoMimeTypes=videoMimeTypes;exports.viewer=viewer;
3
64
  //# sourceMappingURL=data-sdk.cjs.js.map