1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[314],{80790:function(e,t,r){"use strict";r.d(t,{eI:function(){return ee}});class n extends Error{constructor(e){super(e),this.__dgError=!0,this.name="DeepgramError"}}function i(e){return"object"==typeof e&&null!==e&&"__dgError"in e}class o extends n{constructor(e,t){super(e),this.name="DeepgramApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class s extends n{constructor(e,t){super(e),this.name="DeepgramUnknownError",this.originalError=t}}class a extends n{constructor(){super("You are attempting to use an old format for a newer SDK version. Read more here: https://dpgr.am/js-v3"),this.name="DeepgramVersionError"}}var l=r(80751),c=r.n(l),u=r(51567),h=r.n(u);function d(e){return e.replace(/\/$/,"")}r(25566);let p=()=>"undefined"!=typeof window;function f(e,t){Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].forEach(t=>{e.append(r,String(t))}):e.append(r,String(t[r]))})}let y=()=>"undefined"==typeof Headers?l.Headers:Headers,v=e=>!!e.url,b=e=>!!e.text,w=e=>!!(g(e)||m(e)),m=e=>!!e,g=e=>!!e,j="3.3.3";var U=r(25566);let O=(null==U?void 0:U.versions.node)||"Unknown",_={"Content-Type":"application/json","X-Client-Info":`@deepgram/sdk; ${p()?"browser":"server"}; v${j}`,"User-Agent":`@deepgram/sdk/${j} ${p()?"javascript":`node/${O}`}`},E="https://api.deepgram.com",P={global:{url:E},fetch:{headers:_}};var k=r(25566);class x{constructor(e,t){var r,i;let o;if(this.key=e,this.options=t,this.key=e,e||(this.key=k.env.DEEPGRAM_API_KEY),!this.key)throw new n("A deepgram API key is required");if(this.options=h()(P,t),!(null===(r=this.options.global)||void 0===r?void 0:r.url))throw new n(`An API URL is required. It should be set to ${E} by default. No idea what happened!`);let s=this.options.global.url;if(s.startsWith("http")||s.startsWith("ws")||console.warn("The base URL provided does not begin with http, https, ws, or wss and will default to https as standard."),null===(i=this.options.restProxy)||void 0===i?void 0:i.url){if("proxy"!==this.key)throw new n('Do not attempt to pass any other API key than the string "proxy" when making proxied REST requests. Please ensure your proxy application is responsible for writing our API key to the Authorization header.');(o=this.options.restProxy.url).startsWith("http")||o.startsWith("ws")||console.warn("The proxy URL provided does not begin with http, https, ws, or wss and will default to https as standard."),s=o}this.baseUrl=this.resolveBaseUrl(s)}resolveBaseUrl(e){return/^https?:\/\//i.test(e)||(e="https://"+e),new URL(d(e))}willProxy(){var e;return!!(null===(e=this.options.restProxy)||void 0===e?void 0:e.url)}}var I=r(55445),L=r(25566);class R extends I.EventEmitter{constructor(e,t=P){var r;if(super(),this.key=e,this.options=t,this.key=e,e||(this.key=L.env.DEEPGRAM_API_KEY),!this.key)throw Error("A deepgram API key is required");if(this.options=h()(P,t),!(null===(r=this.options.global)||void 0===r?void 0:r.url))throw Error(`An API URL is required. It should be set to ${E} by default. No idea what happened!`);let n=this.options.global.url;/^https?:\/\//i.test(n)||(n="https://"+n),this.baseUrl=new URL(d(n)),this.baseUrl.protocol=this.baseUrl.protocol.toLowerCase().replace(/(http)(s)?/gi,"ws$2")}}var S=r(77047),A=r(93249),C=r(91709);class T extends R{constructor(e,t=P,r={},n="v1/listen"){super(e,t),this.key=e,this.options=t,this.transcriptionOptions=r;let i=new URL(n,this.baseUrl);i.protocol=i.protocol.toLowerCase().replace(/(http)(s)?/gi,"ws$2"),f(i.searchParams,this.transcriptionOptions),this._socket=new C.w3cwebsocket(i.toString(),["token",this.key]),this._socket.onopen=()=>{this.emit(S.l.Open,this)},this._socket.onclose=e=>{this.emit(S.l.Close,e)},this._socket.onerror=e=>{this.emit(S.l.Error,e)},this._socket.onmessage=e=>{try{let t=JSON.parse(e.data.toString());t.type===S.l.Metadata&&this.emit(S.l.Metadata,t),t.type===S.l.Transcript&&this.emit(S.l.Transcript,t),t.type===S.l.UtteranceEnd&&this.emit(S.l.UtteranceEnd,t),t.type===S.l.SpeechStarted&&this.emit(S.l.SpeechStarted,t)}
1catch(t){this.emit(S.l.Error,{event:e,message:"Unable to parse `data` as JSON.",error:t})}}}configure(e){this._socket.send(JSON.stringify({type:"Configure",processors:e}))}keepAlive(){this._socket.send(JSON.stringify({type:"KeepAlive"}))}getReadyState(){return this._socket.readyState}send(e){if(this._socket.readyState===A.x.OPEN)"string"==typeof e?this._socket.send(e):e instanceof Blob?this._socket.send(e):e.byteLength>0?this._socket.send(e):this.emit(S.l.Warning,"Zero-byte detected, skipping. Send `CloseStream` if trying to close the connection.");else throw new n("Could not send. Connection not open.")}finish(){this._socket.send(JSON.stringify({type:"CloseStream"}))}}var N=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let M=e=>{let t;return e?t=e:"undefined"==typeof fetch?t=c():t=fetch,(...e)=>t(...e)},D=(e,t)=>{let r=M(t),n=y();return(t,i)=>N(void 0,void 0,void 0,function*(){let o=new n(null==i?void 0:i.headers);return o.has("Authorization")||o.set("Authorization",`Token ${e}`),r(t,Object.assign(Object.assign({},i),{headers:o}))})},B=()=>N(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(r.t.bind(r,80751,23))).Response:Response});var q=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class F extends x{constructor(e,t){if(super(e,t),this.key=e,this.options=t,p()&&!this._willProxy())throw new n("Due to CORS we are unable to support REST-based API calls to our API from the browser. Please consider using a proxy, and including a `restProxy: { url: ''}` in your Deepgram client options.");this.fetch=D(this.key,t._experimentalCustomFetch)}_getErrorMessage(e){return e.msg||e.message||e.error_description||e.error||JSON.stringify(e)}handleError(e,t){return q(this,void 0,void 0,function*(){e instanceof(yield B())?e.json().then(r=>{t(new o(this._getErrorMessage(r),e.status||500))}).catch(e=>{t(new s(this._getErrorMessage(e),e))}):t(new s(this._getErrorMessage(e),e))})}
1_getRequestParams(e,t,r,n){var i,o,s;let a=Object.assign(Object.assign({},null===(i=this.options)||void 0===i?void 0:i.fetch),{method:e,headers:Object.assign(Object.assign({},null===(s=null===(o=this.options)||void 0===o?void 0:o.fetch)||void 0===s?void 0:s.headers),t)||{}});return"GET"===e?a:(a.body=n,a.duplex="half",Object.assign(Object.assign({},a),r))}_handleRequest(e,t,r,n,i,o){return q(this,void 0,void 0,function*(){return new Promise((s,a)=>{e(r,this._getRequestParams(t,n,i,o)).then(e=>{if(!e.ok)throw e;return e.json()}).then(e=>s(e)).catch(e=>this.handleError(e,a))})})}_handleRawRequest(e,t,r,n,i,o){return q(this,void 0,void 0,function*(){return new Promise((s,a)=>{e(r,this._getRequestParams(t,n,i,o)).then(e=>{if(!e.ok)throw e;return e}).then(e=>s(e)).catch(e=>this.handleError(e,a))})})}get(e,t,r,n){return q(this,void 0,void 0,function*(){return this._handleRequest(e,"GET",t,r,n)})}post(e,t,r,n,i){return q(this,void 0,void 0,function*(){return this._handleRequest(e,"POST",t,n,i,r)})}put(e,t,r,n,i){return q(this,void 0,void 0,function*(){return this._handleRequest(e,"PUT",t,n,i,r)})}patch(e,t,r,n,i){return q(this,void 0,void 0,function*(){return this._handleRequest(e,"PATCH",t,n,i,r)})}delete(e,t,r,n){return q(this,void 0,void 0,function*(){return this._handleRequest(e,"DELETE",t,r,n)})}_willProxy(){var e;return!!(null===(e=this.options.restProxy)||void 0===e?void 0:e.url)}}var J=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class H extends F{transcribeUrl(e,t,r="v1/listen"){return J(this,void 0,void 0,function*(){try{let i;if(v(e))i=JSON.stringify(e);else throw new n("Unknown transcription source type");if(void 0!==t&&"callback"in t)throw new n("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");let o=Object.assign({},t),s=new URL(r,this.baseUrl);return f(s.searchParams,o),{result:yield this.post(this.fetch,s,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}transcribeFile(e,t,r="v1/listen"){return J(this,void 0,void 0,function*(){try{let i;if(w(e))i=e;else throw new n("Unknown transcription source type");if(void 0!==t&&"callback"in t)throw new n("Callback cannot be provided as an option to a synchronous transcription. Use `transcribeUrlCallback` or `transcribeFileCallback` instead.");let o=Object.assign({},t),s=new URL(r,this.baseUrl);return f(s.searchParams,o),{result:yield this.post(this.fetch,s,i,{"Content-Type":"deepgram/audio+video"}),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}transcribeUrlCallback(e,t,r,o="v1/listen"){return J(this,void 0,void 0,function*(){try{let i;if(v(e))i=JSON.stringify(e);else throw new n("Unknown transcription source type");let s=Object.assign(Object.assign({},r),{callback:t.toString()}),a=new URL(o,this.baseUrl);return f(a.searchParams,s),{result:yield this.post(this.fetch,a,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}transcribeFileCallback(e,t,r,o="v1/listen"){return J(this,void 0,void 0,function*(){try{let i;if(w(e))i=e;else throw new n("Unknown transcription source type");let s=Object.assign(Object.assign({},r),{callback:t.toString()}),a=new URL(o,this.baseUrl);return f(a.searchParams,s),{result:yield this.post(this.fetch,a,i,{"Content-Type":"deepgram/audio+video"}),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}}class G extends x{get prerecorded(){return new H(this.key,this.options)}live(e,t="v1/listen"){return new T(this.key,this.options,e,t)}}var $=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};
1class z extends F{getTokenDetails(e="v1/auth/token"){return $(this,void 0,void 0,function*(){try{let t=new URL(this.baseUrl);return t.pathname=e,{result:yield this.get(this.fetch,t),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjects(e="v1/projects"){return $(this,void 0,void 0,function*(){try{let t=new URL(this.baseUrl);return t.pathname=e,{result:yield this.get(this.fetch,t),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProject(e,t="v1/projects/:projectId"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}updateProject(e,t,r="v1/projects/:projectId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);n.pathname=r.replace(/:projectId/,e);let i=JSON.stringify(t);return{result:yield this.patch(this.fetch,n,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}deleteProject(e,t="v1/projects/:projectId"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),yield this.delete(this.fetch,r),{error:null}}catch(e){if(i(e))return{error:e};throw e}})}getProjectKeys(e,t="v1/projects/:projectId/keys"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectKey(e,t,r="v1/projects/:projectId/keys/:keyId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:keyId/,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}createProjectKey(e,t,r="v1/projects/:projectId/keys"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);n.pathname=r.replace(/:projectId/,e);let i=JSON.stringify(t);return{result:yield this.post(this.fetch,n,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}deleteProjectKey(e,t,r="v1/projects/:projectId/keys/:keyId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:keyId/,t),yield this.delete(this.fetch,n),{error:null}}catch(e){if(i(e))return{error:e};throw e}})}getProjectMembers(e,t="v1/projects/:projectId/members"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}removeProjectMember(e,t,r="v1/projects/:projectId/members/:memberId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:memberId/,t),yield this.delete(this.fetch,n),{error:null}}catch(e){if(i(e))return{error:e};throw e}})}getProjectMemberScopes(e,t,r="v1/projects/:projectId/members/:memberId/scopes"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:memberId/,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}updateProjectMemberScope(e,t,r,n="v1/projects/:projectId/members/:memberId/scopes"){return $(this,void 0,void 0,function*(){try{let i=new URL(this.baseUrl);i.pathname=n.replace(/:projectId/,e).replace(/:memberId/,t);let o=JSON.stringify(r);return{result:yield this.put(this.fetch,i,o),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectInvites(e,t="v1/projects/:projectId/invites"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}sendProjectInvite(e,t,r="v1/projects/:projectId/invites"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);n.pathname=r.replace(/:projectId/,e);let i=JSON.stringify(t);return{result:yield this.post(this.fetch,n,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}deleteProjectInvite(e,t,r="v1/projects/:projectId/invites/:email"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:email/,t),yield this.delete(this.fetch,n),{error:null}}catch(e){if(i(e))return{error:e};throw e}})}
1leaveProject(e,t="v1/projects/:projectId/leave"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.delete(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectUsageRequests(e,t,r="v1/projects/:projectId/requests"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e),f(n.searchParams,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectUsageRequest(e,t,r="v1/projects/:projectId/requests/:requestId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:requestId/,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectUsageSummary(e,t,r="v1/projects/:projectId/usage"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e),f(n.searchParams,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectUsageFields(e,t,r="v1/projects/:projectId/usage/fields"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e),f(n.searchParams,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectBalances(e,t="v1/projects/:projectId/balances"){return $(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getProjectBalance(e,t,r="v1/projects/:projectId/balances/:balanceId"){return $(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:balanceId/,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}}var K=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class W extends F{listCredentials(e,t="v1/projects/:projectId/onprem/distribution/credentials"){return K(this,void 0,void 0,function*(){try{let r=new URL(this.baseUrl);return r.pathname=t.replace(/:projectId/,e),{result:yield this.get(this.fetch,r),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}getCredentials(e,t,r="v1/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return K(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:credentialsId/,t),{result:yield this.get(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}createCredentials(e,t,r="v1/projects/:projectId/onprem/distribution/credentials"){return K(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);n.pathname=r.replace(/:projectId/,e);let i=JSON.stringify(t);return{result:yield this.post(this.fetch,n,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}deleteCredentials(e,t,r="v1/projects/:projectId/onprem/distribution/credentials/:credentialsId"){return K(this,void 0,void 0,function*(){try{let n=new URL(this.baseUrl);return n.pathname=r.replace(/:projectId/,e).replace(/:credentialsId/,t),{result:yield this.delete(this.fetch,n),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}}var V=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class X extends F{analyzeUrl(e,t,r="v1/read"){return V(this,void 0,void 0,function*(){try{let i;if(v(e))i=JSON.stringify(e);else throw new n("Unknown source type");if(void 0!==t&&"callback"in t)throw new n("Callback cannot be provided as an option to a synchronous transcription. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");let o=Object.assign({},t),s=new URL(r,this.baseUrl);return f(s.searchParams,o),{result:yield this.post(this.fetch,s,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}analyzeText(e,t,r="v1/read"){return V(this,void 0,void 0,function*(){try{let i;if(b(e))i=JSON.stringify(e);else throw new n("Unknown source type");if(void 0!==t&&"callback"in t)throw new n("Callback cannot be provided as an option to a synchronous requests. Use `analyzeUrlCallback` or `analyzeTextCallback` instead.");let o=Object.assign({},t),s=new URL(r,this.baseUrl);return f(s.searchParams,o),{result:yield this.post(this.fetch,s,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}analyzeUrlCallback(e,t,r,o="v1/read"){return V(this,void 0,void 0,function*(){try{let i;if(v(e))i=JSON.stringify(e);else throw new n("Unknown source type");let s=Object.assign(Object.assign({},r),{callback:t.toString()}),a=new URL(o,this.baseUrl);return f(a.searchParams,s),{result:yield this.post(this.fetch,a,i),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}analyzeTextCallback(e,t,r,o="v1/read"){return V(this,void 0,void 0,function*(){try{let i;if(b(e))i=JSON.stringify(e);else throw new n("Unknown source type");let s=Object.assign(Object.assign({},r),{callback:t.toString()}),a=new URL(o,this.baseUrl);return f(a.searchParams,s),{result:yield this.post(this.fetch,a,i,{"Content-Type":"deepgram/audio+video"}),error:null}}catch(e){if(i(e))return{result:null,error:e};throw e}})}}var Y=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class Z extends F{request(e,t,r="v1/speak"){return Y(this,void 0,void 0,function*(){try{let i;if(b(e))i=JSON.stringify(e);else throw new n("Unknown transcription source type");let o=Object.assign({model:"aura-asteria-en"},t),s=new URL(r,this.baseUrl);return f(s.searchParams,o),this.result=yield this._handleRawRequest(this.fetch,"POST",s,{},{},i),this}catch(e){throw e}})}getStream(){return Y(this,void 0,void 0,function*(){if(!this.result)throw new s("Tried to get stream before making request","");return this.result.body})}getHeaders(){return Y(this,void 0,void 0,function*(){if(!this.result)throw new s("Tried to get headers before making request","");return this.result.headers})}}class Q extends x{get listen(){return new G(this.key,this.options)}get manage(){return new z(this.key,this.options)}get onprem(){return new W(this.key,this.options)}get read(){return new X(this.key,this.options)}get speak(){return new Z(this.key,this.options)}get transcription(){throw new a}get projects(){throw new a}get keys(){throw new a}get members(){throw new a}get scopes(){throw new a}
1get invitation(){throw new a}get usage(){throw new a}get billing(){throw new a}}let ee=(e,t={})=>new Q(e,t)},93249:function(e,t,r){"use strict";var n,i;r.d(t,{x:function(){return n}}),(i=n||(n={}))[i.CONNECTING=0]="CONNECTING",i[i.OPEN=1]="OPEN",i[i.CLOSING=2]="CLOSING",i[i.CLOSED=3]="CLOSED"},77047:function(e,t,r){"use strict";var n,i;r.d(t,{l:function(){return n}}),(i=n||(n={})).Open="open",i.Close="close",i.Transcript="Results",i.Metadata="Metadata",i.Error="error",i.Warning="warning",i.UtteranceEnd="UtteranceEnd",i.SpeechStarted="SpeechStarted"},80751:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function c(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=u(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=c(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,n=c(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=u(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=o(e),t=s(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[o(e)]},l.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},l.prototype.set=function(e,t){this.map[o(e)]=s(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var f=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,n,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new l(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),f.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})}
1,p.call(y.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];b.redirect=function(e,t){if(-1===w.indexOf(t))throw RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.DOMException=n.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function m(r,n){return new Promise(function(i,o){var s=new y(r,n);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),i(new b("response"in a?a.response:a.responseText,r))},a.onerror=function(){o(TypeError("Network request failed"))},a.ontimeout=function(){o(TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)})}m.polyfill=!0,n.fetch||(n.fetch=m,n.Headers=l,n.Request=y,n.Response=b),e.Headers=l,e.Request=y,e.Response=b,e.fetch=m,Object.defineProperty(e,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},51567:function(e){"use strict";var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function i(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function o(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c,u,h=Array.isArray(r);return h!==Array.isArray(e)?n(r,l):h?l.arrayMerge(e,r,l):(u={},(c=l).isMergeableObject(e)&&o(e).forEach(function(t){u[t]=n(e[t],c)}),o(r).forEach(function(t){(!s(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(s(e,t)&&c.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,c)(e[t],r[t],c):u[t]=n(r[t],c))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a},64565:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{if(!__global__)return t();return __global__}finally{delete Object.prototype.__global__}}()},55445:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){var i;function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&(i={once:!0},"function"==typeof e.on&&y(e,"error",o,i))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var i,o,s,c=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):f(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var c=l.length,u=f(l,c),r=0;r<c;++r)n(u[r],this,t);return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit
1("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},91709:function(e,t,r){if("object"==typeof globalThis)n=globalThis;else try{n=r(64565)}catch(e){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw Error("Could not determine global this")}var n,i=n.WebSocket||n.MozWebSocket,o=r(26961);function s(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(s,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?s:null,version:o}},26961:function(e,t,r){e.exports=r(62151).version},14071:function(){},62151:function(e){"use strict";e.exports={version:"1.0.35"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.