@pickaxeproject/react 6.13.2 → 6.13.3

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js");require("../../node_modules/.pnpm/regenerator-runtime@0.14.1/node_modules/regenerator-runtime/runtime.js");var t=require("react-speech-recognition"),r=require("react"),i=require("../../common/api/pickaxe.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=n(t);exports.useSpeechToText=()=>{const{transcript:n,listening:a,resetTranscript:c}=t.useSpeechRecognition(),[u,l]=r.useState(!1),[p,d]=r.useState(!1);return{speechTranscript:n,isSpeechSupported:!0,isSpeechProcessing:u,isSpeechListening:a,onStartListening:t=>e.__awaiter(void 0,void 0,void 0,(function*(){try{l(!0),yield navigator.mediaDevices.getUserMedia({audio:!0});const e=(yield i.pickaxeApi2.post("/speech")).data;if(!p){const{createSpeechServicesPonyfill:t}=yield Promise.resolve().then((function(){return o(require("web-speech-cognitive-services"))})),{SpeechRecognition:r}=t({credentials:{region:"eastus",authorizationToken:e.token}});s.default.applyPolyfill(r),d(!0)}c();const r={ar:"ar-SA",ca:"ca-ES",cs:"cs-CZ",da:"da-DK",de:"de-DE",en:"en-US",es:"es-ES",fi:"fi-FI",fr:"fr-FR",hi:"hi-IN",it:"it-IT",iw:"he-IL",ja:"ja-JP",ko:"ko-KR",nb:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT","pt-BR":"pt-BR",ro:"ro-RO",ru:"ru-RU",sv:"sv-SE",th:"th-TH",tr:"tr-TR",vi:"vi-VN",zh:"zh-CN",zu:"zu-ZA"};yield s.default.startListening({continuous:!0,interimResults:!0,language:r[t]||"en-US"})}catch(e){console.error(e)}finally{l(!1)}})),onStopListening:()=>e.__awaiter(void 0,void 0,void 0,(function*(){try{l(!0),yield s.default.abortListening()}catch(e){console.error(e)}finally{l(!1)}}))}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react"),r=require("../../common/api/pickaxe.js");const o=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},n=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()};exports.useSpeechToText=()=>{var s;const[c,i]=t.useState(""),[a,u]=t.useState(!1),[l,d]=t.useState(!1),m=t.useRef(!0),p=t.useRef(0),f=t.useRef(null),w=t.useRef(new Map),v=e=>{n(e),e.socket.readyState!==WebSocket.OPEN&&e.socket.readyState!==WebSocket.CONNECTING||e.socket.close(),f.current===e&&(f.current=null)};t.useEffect((()=>(m.current=!0,()=>{m.current=!1,p.current+=1;const e=f.current;e&&(e.socket.readyState===WebSocket.OPEN&&e.socket.send(JSON.stringify({type:"Terminate"})),v(e))})),[]);return{speechTranscript:c,isSpeechSupported:"undefined"!=typeof window&&Boolean(o())&&Boolean(null===(s=navigator.mediaDevices)||void 0===s?void 0:s.getUserMedia)&&"WebSocket"in window,isSpeechProcessing:l,isSpeechListening:a,onStartListening:t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const t=++p.current,s=o();if(!s||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return;const c=f.current;let a,l;c&&v(c);try{d(!0),u(!1),i(""),w.current.clear(),a=yield navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),l=new s;const{data:e}=yield r.pickaxeApi2.post("/speech/assemblyai");if(!e.success||!e.token)throw new Error(e.error||"AssemblyAI streaming token was not returned");if(!m.current||t!==p.current)return;const o=new URL("wss://streaming.assemblyai.com/v3/ws");o.searchParams.set("sample_rate",String(16e3)),o.searchParams.set("speech_model","whisper-rt"),o.searchParams.set("language_detection","true"),o.searchParams.set("format_turns","true"),o.searchParams.set("token",e.token);const c={socket:new WebSocket(o),stream:a,audioContext:l,started:!1};a=void 0,l=void 0,f.current=c,yield new Promise(((e,r)=>{const o=window.setTimeout((()=>{r(new Error("AssemblyAI streaming session timed out"))}),1e4),s=e=>{c.started||(window.clearTimeout(o),r(e))};c.socket.binaryType="arraybuffer",c.socket.onmessage=r=>{try{const n=JSON.parse(String(r.data));if("Begin"!==n.type||c.started){if("Turn"===n.type)(e=>{var t;const r=(e=>{var t,r,o;const n=null===(t=e.utterance)||void 0===t?void 0:t.trim();return n&&!/^(?:\[[^\]]+\]\s*)+$/.test(n)?n:null!==(o=null===(r=e.transcript)||void 0===r?void 0:r.trim())&&void 0!==o?o:""})(e),o=null!==(t=e.turn_order)&&void 0!==t?t:0;r?w.current.set(o,r):w.current.delete(o);const n=Array.from(w.current.entries()).sort((([e],[t])=>e-t)).map((([,e])=>e)).join(" ").trim();m.current&&i(n)})(n);else if("Termination"===n.type)c.socket.close();else if("Error"===n.type)throw new Error(n.error||"AssemblyAI streaming failed")}else{c.started=!0,window.clearTimeout(o);const r=c.audioContext.createMediaStreamSource(c.stream),n=c.audioContext.createScriptProcessor(4096,1,1),s=c.audioContext.createGain();s.gain.value=0,n.onaudioprocess=({inputBuffer:e})=>{if(c.socket.readyState!==WebSocket.OPEN)return;const t=((e,t)=>{const r=t/16e3,o=Math.max(1,Math.round(e.length/r)),n=new Int16Array(o);let s=0;for(let t=0;t<o;t+=1){const o=Math.min(e.length,Math.round((t+1)*r));let c=0,i=0;for(;s<o;s+=1)c+=e[s],i+=1;const a=Math.max(-1,Math.min(1,i?c/i:0));n[t]=a<0?32768*a:32767*a}return n})(e.getChannelData(0),e.sampleRate);c.socket.send(t.buffer)},r.connect(n),n.connect(s),s.connect(c.audioContext.destination),c.source=r,c.processor=n,c.silentGain=s,c.audioContext.resume(),m.current&&t===p.current&&u(!0),e()}}catch(e){console.error("Could not process AssemblyAI message",e),s(e instanceof Error?e:new Error(String(e))),c.socket.close()}},c.socket.onerror=()=>{const e=new Error("Could not connect to AssemblyAI streaming");s(e),c.started&&console.error(e),c.socket.close()},c.socket.onclose=()=>{s(new Error("AssemblyAI streaming closed before it started")),(e=>{n(e),f.current===e&&(f.current=null,m.current&&u(!1))})(c)}})),m.current&&t===p.current||v(c)}catch(e){const t=f.current;t&&v(t),console.error("Could not start AssemblyAI speech recognition",e)}finally{if(a)for(const e of a.getTracks())e.stop();"closed"!==(null==l?void 0:l.state)&&(null==l||l.close()),m.current&&t===p.current&&d(!1)}})),onStopListening:()=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=++p.current,t=f.current;if(t)try{d(!0),n(t),yield new Promise((e=>{const r=window.setTimeout(e,2e3),o=t.socket.onclose;t.socket.onclose=n=>{window.clearTimeout(r),null==o||o.call(t.socket,n),e()},t.socket.readyState===WebSocket.OPEN?t.socket.send(JSON.stringify({type:"Terminate"})):e()}))}catch(e){console.error("Could not stop AssemblyAI speech recognition",e)}finally{v(t),m.current&&e===p.current&&(u(!1),d(!1))}else u(!1)}))}};
@@ -1,9 +1,8 @@
1
- import "regenerator-runtime/runtime";
2
1
  export declare const useSpeechToText: () => {
3
2
  speechTranscript: string;
4
3
  isSpeechSupported: boolean;
5
4
  isSpeechProcessing: boolean;
6
5
  isSpeechListening: boolean;
7
- onStartListening: (locale: string) => Promise<void>;
6
+ onStartListening: (_locale: string) => Promise<void>;
8
7
  onStopListening: () => Promise<void>;
9
8
  };
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import"../../node_modules/.pnpm/regenerator-runtime@0.14.1/node_modules/regenerator-runtime/runtime.js";import i,{useSpeechRecognition as t}from"react-speech-recognition";import{useState as o}from"react";import{pickaxeApi2 as r}from"../../common/api/pickaxe.js";const n=()=>{const{transcript:n,listening:s,resetTranscript:c}=t(),[a,p]=o(!1),[l,d]=o(!1);return{speechTranscript:n,isSpeechSupported:!0,isSpeechProcessing:a,isSpeechListening:s,onStartListening:t=>e(void 0,void 0,void 0,(function*(){try{p(!0),yield navigator.mediaDevices.getUserMedia({audio:!0});const e=(yield r.post("/speech")).data;if(!l){const{createSpeechServicesPonyfill:t}=yield import("web-speech-cognitive-services"),{SpeechRecognition:o}=t({credentials:{region:"eastus",authorizationToken:e.token}});i.applyPolyfill(o),d(!0)}c();const o={ar:"ar-SA",ca:"ca-ES",cs:"cs-CZ",da:"da-DK",de:"de-DE",en:"en-US",es:"es-ES",fi:"fi-FI",fr:"fr-FR",hi:"hi-IN",it:"it-IT",iw:"he-IL",ja:"ja-JP",ko:"ko-KR",nb:"nb-NO",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT","pt-BR":"pt-BR",ro:"ro-RO",ru:"ru-RU",sv:"sv-SE",th:"th-TH",tr:"tr-TR",vi:"vi-VN",zh:"zh-CN",zu:"zu-ZA"};yield i.startListening({continuous:!0,interimResults:!0,language:o[t]||"en-US"})}catch(e){console.error(e)}finally{p(!1)}})),onStopListening:()=>e(void 0,void 0,void 0,(function*(){try{p(!0),yield i.abortListening()}catch(e){console.error(e)}finally{p(!1)}}))}};export{n as useSpeechToText};
1
+ import{__awaiter as e}from"../../_virtual/_tslib.js";import{useState as t,useRef as r,useEffect as o}from"react";import{pickaxeApi2 as n}from"../../common/api/pickaxe.js";const s=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},c=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()},i=()=>{var i;const[a,u]=t(""),[l,d]=t(!1),[m,p]=t(!1),f=r(!0),w=r(0),y=r(null),v=r(new Map),k=e=>{c(e),e.socket.readyState!==WebSocket.OPEN&&e.socket.readyState!==WebSocket.CONNECTING||e.socket.close(),y.current===e&&(y.current=null)};o((()=>(f.current=!0,()=>{f.current=!1,w.current+=1;const e=y.current;e&&(e.socket.readyState===WebSocket.OPEN&&e.socket.send(JSON.stringify({type:"Terminate"})),k(e))})),[]);return{speechTranscript:a,isSpeechSupported:"undefined"!=typeof window&&Boolean(s())&&Boolean(null===(i=navigator.mediaDevices)||void 0===i?void 0:i.getUserMedia)&&"WebSocket"in window,isSpeechProcessing:m,isSpeechListening:l,onStartListening:t=>e(void 0,void 0,void 0,(function*(){var e;const t=++w.current,r=s();if(!r||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return;const o=y.current;let i,a;o&&k(o);try{p(!0),d(!1),u(""),v.current.clear(),i=yield navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),a=new r;const{data:e}=yield n.post("/speech/assemblyai");if(!e.success||!e.token)throw new Error(e.error||"AssemblyAI streaming token was not returned");if(!f.current||t!==w.current)return;const o=new URL("wss://streaming.assemblyai.com/v3/ws");o.searchParams.set("sample_rate",String(16e3)),o.searchParams.set("speech_model","whisper-rt"),o.searchParams.set("language_detection","true"),o.searchParams.set("format_turns","true"),o.searchParams.set("token",e.token);const s={socket:new WebSocket(o),stream:i,audioContext:a,started:!1};i=void 0,a=void 0,y.current=s,yield new Promise(((e,r)=>{const o=window.setTimeout((()=>{r(new Error("AssemblyAI streaming session timed out"))}),1e4),n=e=>{s.started||(window.clearTimeout(o),r(e))};s.socket.binaryType="arraybuffer",s.socket.onmessage=r=>{try{const n=JSON.parse(String(r.data));if("Begin"!==n.type||s.started){if("Turn"===n.type)(e=>{var t;const r=(e=>{var t,r,o;const n=null===(t=e.utterance)||void 0===t?void 0:t.trim();return n&&!/^(?:\[[^\]]+\]\s*)+$/.test(n)?n:null!==(o=null===(r=e.transcript)||void 0===r?void 0:r.trim())&&void 0!==o?o:""})(e),o=null!==(t=e.turn_order)&&void 0!==t?t:0;r?v.current.set(o,r):v.current.delete(o);const n=Array.from(v.current.entries()).sort((([e],[t])=>e-t)).map((([,e])=>e)).join(" ").trim();f.current&&u(n)})(n);else if("Termination"===n.type)s.socket.close();else if("Error"===n.type)throw new Error(n.error||"AssemblyAI streaming failed")}else{s.started=!0,window.clearTimeout(o);const r=s.audioContext.createMediaStreamSource(s.stream),n=s.audioContext.createScriptProcessor(4096,1,1),c=s.audioContext.createGain();c.gain.value=0,n.onaudioprocess=({inputBuffer:e})=>{if(s.socket.readyState!==WebSocket.OPEN)return;const t=((e,t)=>{const r=t/16e3,o=Math.max(1,Math.round(e.length/r)),n=new Int16Array(o);let s=0;for(let t=0;t<o;t+=1){const o=Math.min(e.length,Math.round((t+1)*r));let c=0,i=0;for(;s<o;s+=1)c+=e[s],i+=1;const a=Math.max(-1,Math.min(1,i?c/i:0));n[t]=a<0?32768*a:32767*a}return n})(e.getChannelData(0),e.sampleRate);s.socket.send(t.buffer)},r.connect(n),n.connect(c),c.connect(s.audioContext.destination),s.source=r,s.processor=n,s.silentGain=c,s.audioContext.resume(),f.current&&t===w.current&&d(!0),e()}}catch(e){console.error("Could not process AssemblyAI message",e),n(e instanceof Error?e:new Error(String(e))),s.socket.close()}},s.socket.onerror=()=>{const e=new Error("Could not connect to AssemblyAI streaming");n(e),s.started&&console.error(e),s.socket.close()},s.socket.onclose=()=>{n(new Error("AssemblyAI streaming closed before it started")),(e=>{c(e),y.current===e&&(y.current=null,f.current&&d(!1))})(s)}})),f.current&&t===w.current||k(s)}catch(e){const t=y.current;t&&k(t),console.error("Could not start AssemblyAI speech recognition",e)}finally{if(i)for(const e of i.getTracks())e.stop();"closed"!==(null==a?void 0:a.state)&&(null==a||a.close()),f.current&&t===w.current&&p(!1)}})),onStopListening:()=>e(void 0,void 0,void 0,(function*(){const e=++w.current,t=y.current;if(t)try{p(!0),c(t),yield new Promise((e=>{const r=window.setTimeout(e,2e3),o=t.socket.onclose;t.socket.onclose=n=>{window.clearTimeout(r),null==o||o.call(t.socket,n),e()},t.socket.readyState===WebSocket.OPEN?t.socket.send(JSON.stringify({type:"Terminate"})):e()}))}catch(e){console.error("Could not stop AssemblyAI speech recognition",e)}finally{k(t),f.current&&e===w.current&&(d(!1),p(!1))}else d(!1)}))}};export{i as useSpeechToText};
@@ -1,9 +1,8 @@
1
- import "regenerator-runtime/runtime";
2
1
  export declare const useSpeechToText: () => {
3
2
  speechTranscript: string;
4
3
  isSpeechSupported: boolean;
5
4
  isSpeechProcessing: boolean;
6
5
  isSpeechListening: boolean;
7
- onStartListening: (locale: string) => Promise<void>;
6
+ onStartListening: (_locale: string) => Promise<void>;
8
7
  onStopListening: () => Promise<void>;
9
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "6.13.2",
3
+ "version": "6.13.3",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,8 +39,6 @@
39
39
  "jose": "^6.1.3",
40
40
  "lucide-react": "^0.563.0",
41
41
  "pkce-challenge": "3.0.0",
42
- "react-speech-recognition": "^4.0.1",
43
- "regenerator-runtime": "^0.14.1",
44
42
  "remove-markdown": "^0.6.3",
45
43
  "tldts": "^7.0.23"
46
44
  },
@@ -82,7 +80,6 @@
82
80
  "@types/node": "^18.11.18",
83
81
  "@types/react": "^18.0.26",
84
82
  "@types/react-dom": "^18.0.10",
85
- "@types/react-speech-recognition": "^3.9.6",
86
83
  "@types/react-syntax-highlighter": "^15.5.13",
87
84
  "@types/uuid": "^10.0.0",
88
85
  "@types/webfontloader": "^1.6.38",
@@ -151,7 +148,6 @@
151
148
  "vite-plugin-node-polyfills": "^0.24.0",
152
149
  "vite-plugin-svgr": "^4.3.0",
153
150
  "vite-tsconfig-paths": "^5.1.4",
154
- "web-speech-cognitive-services": "^8.1.4",
155
151
  "webfontloader": "^1.6.28",
156
152
  "webpack": "^5.75.0",
157
153
  "webpack-cli": "^5.0.1"
@@ -191,7 +187,6 @@
191
187
  "tailwind-scrollbar": "^3.1.0",
192
188
  "unist-util-visit": "^5.0.0",
193
189
  "uuid": "^11.1.0",
194
- "web-speech-cognitive-services": "^8.1.4",
195
190
  "webfontloader": "^1.6.28"
196
191
  },
197
192
  "engines": {
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.__module={exports:{}};
@@ -1 +0,0 @@
1
- "use strict";var t=require("../../../../../_virtual/runtime.js");t.__module.exports,function(t){var r=function(t){var r,e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var i=r&&r.prototype instanceof d?r:d,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:O(t,e,c)}),a}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var s="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function d(){}function m(){}function w(){}var b={};l(b,a,(function(){return this}));var L=Object.getPrototypeOf,x=L&&L(L(P([])));x&&x!==e&&n.call(x,a)&&(b=x);var E=w.prototype=d.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?r.resolve(h.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return i=i?i.then(o,o):o()}})}function O(t,e,n){var o=s;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===s)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,e,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function G(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}function P(t){if(null!=t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=l(w,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===m||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,c,(function(){return this})),t.AsyncIterator=j,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new j(h(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(E),l(E,u,"Generator"),l(E,a,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}(t.__module),t.__module.exports;
@@ -1 +0,0 @@
1
- var e={exports:{}};export{e as __module};
@@ -1 +0,0 @@
1
- import{__module as t}from"../../../../../_virtual/runtime.js";t.exports,function(t){var r=function(t){var r,e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{h({},"")}catch(t){h=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var i=r&&r.prototype instanceof d?r:d,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:O(t,e,c)}),a}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function d(){}function m(){}function w(){}var b={};h(b,a,(function(){return this}));var L=Object.getPrototypeOf,x=L&&L(L(P([])));x&&x!==e&&n.call(x,a)&&(b=x);var E=w.prototype=d.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(r){h(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var h=u.arg,l=h.value;return l&&"object"==typeof l&&n.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return i=i?i.then(o,o):o()}})}function O(t,e,n){var o=s;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===s)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var h=f(t,e,n);if("normal"===h.type){if(o=n.done?v:p,h.arg===g)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(o=v,n.method="throw",n.arg=h.arg)}}}function k(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function G(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}function P(t){if(null!=t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=h(w,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===m||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,h(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},_(j.prototype),h(j.prototype,c,(function(){return this})),t.AsyncIterator=j,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new j(l(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(E),h(E,u,"Generator"),h(E,a,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}(t),t.exports;