@speechly/browser-ui
Advanced tools
Comparing version 6.0.5 to 6.0.6
@@ -1,4 +0,4 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const u="undefined"!=typeof window;let h=u?()=>window.performance.now():()=>Date.now(),f=u?t=>requestAnimationFrame(t):t;const p=new Set;function g(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&f(g)}function m(t){let e;return 0===p.size&&f(g),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t){const e=T("style");return v(y(t),e),e.sheet}function v(t,e){return $(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function x(t){t.parentNode&&t.parentNode.removeChild(t)}function T(t){return document.createElement(t)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function S(t){return document.createTextNode(t)}function C(){return S(" ")}function k(){return S("")}function A(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function O(t){const e={};for(const n of t)e[n.name]=n.value;return e}const N=new Map;let R,F=0;function z(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,h=y(t),{stylesheet:f,rules:p}=N.get(h)||function(t,e){const n={stylesheet:b(e),rules:{}};return N.set(t,n),n}(h,t);p[u]||(p[u]=!0,f.insertRule(`@keyframes ${u} ${d}`,f.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${u} ${o}ms linear ${r}ms 1 both`,F+=1,u}function I(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),F-=r,F||f((()=>{F||(N.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&x(e)})),N.clear())})))}function D(t){R=t}function B(){if(!R)throw new Error("Function called outside component initialization");return R}const M=[],L=[],j=[],H=[],U=Promise.resolve();let V=!1;function W(t){j.push(t)}const q=new Set;let X,K=0;function Y(){const t=R;do{for(;K<M.length;){const t=M[K];K++,D(t),Z(t.$$)}for(D(null),M.length=0,K=0;L.length;)L.pop()();for(let t=0;t<j.length;t+=1){const e=j[t];q.has(e)||(q.add(e),e())}j.length=0}while(M.length);for(;H.length;)H.pop()();V=!1,q.clear(),D(t)}function Z(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}function G(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const J=new Set;function Q(t,e){t&&t.i&&(J.delete(t),t.i(e))}const tt={duration:0};function et(n,o,r){let i,c,a=o(n,r),l=!1,d=0;function u(){i&&I(n,i)}function f(){const{delay:o=0,duration:r=300,easing:s=e,tick:f=t,css:p}=a||tt;p&&(i=z(n,0,1,r,o,s,p,d++)),f(0,1);const g=h()+o,$=g+r;c&&c.abort(),l=!0,W((()=>G(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),G(n,!0,"end"),u(),l=!1;if(t>=g){const e=s((t-g)/r);f(e,1-e)}}return l}))}let p=!1;return{start(){p||(p=!0,I(n),s(a)?(a=a(),(X||(X=Promise.resolve(),X.then((()=>{X=null}))),X).then(f)):f())},invalidate(){p=!1},end(){l&&(u(),l=!1)}}}const nt="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ot(t,e,n,r){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,n),r||W((()=>{const e=t.$$.on_mount.map(o).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...e):i(e),t.$$.on_mount=[]})),a.forEach(W)}function rt(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function it(t,e){-1===t.$$.dirty[0]&&(M.push(t),V||(V=!0,U.then(Y)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function st(e,n,o,s,c,a,l,d=[-1]){const u=R;D(e);const h=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:r(),dirty:d,skip_bound:!1,root:n.target||u.$$.root};l&&l(h.root);let f=!1;if(h.ctx=o?o(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),f&&it(e,t)),n})):[],h.update(),f=!0,i(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(x)}else h.fragment&&h.fragment.c();n.intro&&Q(e.$$.fragment),ot(e,n.target,n.anchor,n.customElement),Y()}D(u)}let ct;"function"==typeof HTMLElement&&(ct=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){rt(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class at{$destroy(){rt(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var lt,dt,ut,ht,ft;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(lt||(lt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(dt||(dt={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(ut||(ut={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(ht||(ht={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(ft||(ft={})),new Map([[ft.Failed,"Failed"],[ft.Disconnected,"Disconnected"],[ft.Connected,"Connected"],[ft.Active,"Active"]]);for(var pt=[],gt=0;gt<256;++gt)pt.push((gt+256).toString(16).substr(1));var mt,$t,yt,bt,vt,wt,xt,Tt,Et="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},St={exports:{}};function Ct(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function kt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function At(t,{delay:e=0,speed:n,duration:o,easing:r=kt}={}){let i=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(i+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:i/n:"function"==typeof o&&(o=o(i)),{delay:e,duration:o,easing:r,css:(t,e)=>`stroke-dasharray: ${t*i} ${e*i}`}} | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const u="undefined"!=typeof window;let h=u?()=>window.performance.now():()=>Date.now(),f=u?t=>requestAnimationFrame(t):t;const p=new Set;function g(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&f(g)}function m(t){let e;return 0===p.size&&f(g),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t){const e=T("style");return v(y(t),e),e.sheet}function v(t,e){return $(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function x(t){t.parentNode&&t.parentNode.removeChild(t)}function T(t){return document.createElement(t)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function S(t){return document.createTextNode(t)}function C(){return S(" ")}function k(){return S("")}function A(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function P(t,e,n){t.classList[n?"add":"remove"](e)}function O(t){const e={};for(const n of t)e[n.name]=n.value;return e}const N=new Map;let R,F=0;function z(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,u=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,h=y(t),{stylesheet:f,rules:p}=N.get(h)||function(t,e){const n={stylesheet:b(e),rules:{}};return N.set(t,n),n}(h,t);p[u]||(p[u]=!0,f.insertRule(`@keyframes ${u} ${d}`,f.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${u} ${o}ms linear ${r}ms 1 both`,F+=1,u}function I(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),F-=r,F||f((()=>{F||(N.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&x(e)})),N.clear())})))}function D(t){R=t}function B(){if(!R)throw new Error("Function called outside component initialization");return R}const M=[],L=[],j=[],H=[],U=Promise.resolve();let V=!1;function W(t){j.push(t)}const q=new Set;let X,K=0;function Y(){if(0!==K)return;const t=R;do{try{for(;K<M.length;){const t=M[K];K++,D(t),Z(t.$$)}}catch(t){throw M.length=0,K=0,t}for(D(null),M.length=0,K=0;L.length;)L.pop()();for(let t=0;t<j.length;t+=1){const e=j[t];q.has(e)||(q.add(e),e())}j.length=0}while(M.length);for(;H.length;)H.pop()();V=!1,q.clear(),D(t)}function Z(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}function G(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const J=new Set;let Q;function tt(t,e){t&&t.i&&(J.delete(t),t.i(e))}const et={duration:0};function nt(n,o,r){const i={direction:"in"};let c,a,l=o(n,r,i),d=!1,u=0;function f(){c&&I(n,c)}function p(){const{delay:o=0,duration:r=300,easing:i=e,tick:s=t,css:p}=l||et;p&&(c=z(n,0,1,r,o,i,p,u++)),s(0,1);const g=h()+o,$=g+r;a&&a.abort(),d=!0,W((()=>G(n,!0,"start"))),a=m((t=>{if(d){if(t>=$)return s(1,0),G(n,!0,"end"),f(),d=!1;if(t>=g){const e=i((t-g)/r);s(e,1-e)}}return d}))}let g=!1;return{start(){g||(g=!0,I(n),s(l)?(l=l(i),(X||(X=Promise.resolve(),X.then((()=>{X=null}))),X).then(p)):p())},invalidate(){g=!1},end(){d&&(f(),d=!1)}}}const ot="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function rt(t,e,n,r){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,n),r||W((()=>{const e=t.$$.on_mount.map(o).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...e):i(e),t.$$.on_mount=[]})),a.forEach(W)}function it(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function st(t,e){-1===t.$$.dirty[0]&&(M.push(t),V||(V=!0,U.then(Y)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ct(e,n,o,s,c,a,l,d=[-1]){const u=R;D(e);const h=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:r(),dirty:d,skip_bound:!1,root:n.target||u.$$.root};l&&l(h.root);let f=!1;if(h.ctx=o?o(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),f&&st(e,t)),n})):[],h.update(),f=!0,i(h.before_update),h.fragment=!!s&&s(h.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);h.fragment&&h.fragment.l(t),t.forEach(x)}else h.fragment&&h.fragment.c();n.intro&&tt(e.$$.fragment),rt(e,n.target,n.anchor,n.customElement),Y()}D(u)}let at;"function"==typeof HTMLElement&&(at=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){it(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class lt{$destroy(){it(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var dt,ut,ht,ft,pt;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(dt||(dt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ut||(ut={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(ht||(ht={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(ft||(ft={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(pt||(pt={})),new Map([[pt.Failed,"Failed"],[pt.Disconnected,"Disconnected"],[pt.Connected,"Connected"],[pt.Active,"Active"]]);for(var gt=[],mt=0;mt<256;++mt)gt.push((mt+256).toString(16).substr(1));var $t,yt,bt,vt,wt,xt,Tt,Et,St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ct={exports:{}};function kt(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function At(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function _t(t,{delay:e=0,speed:n,duration:o,easing:r=At}={}){let i=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(i+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:i/n:"function"==typeof o&&(o=o(i)),{delay:e,duration:o,easing:r,css:(t,e)=>`\n\t\t\tstroke-dasharray: ${i};\n\t\t\tstroke-dashoffset: ${e*i};\n\t\t`}} | ||
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ | ||
mt=St,$t=St.exports,function(t){var e=$t,n=mt&&mt.exports==e&&mt,o="object"==typeof Et&&Et;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,d=t.length-c;++l<d;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(Et),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(yt||(yt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(bt||(bt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(vt||(vt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(wt||(wt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(xt||(xt={})),function(t){t.None="none",t.Whirl="whirl"}(Tt||(Tt={})),ft.Disconnected,ft.Connected,ft.Active,ft.Failed,lt.NoBrowserSupport,lt.NoAudioConsent;const _t=[0,1];function Pt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let r=(o-n)/(t.length-1);if(r<=0)return t[0];let i=(e-n)/r,s=Math.floor(i),c=Math.ceil(i),a=i-s;return(1-a)*t[s]+a*t[c]}function Ot(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=T("style");t.id=e,t.textContent=n,v(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function Nt(e){let n;return{c(){n=T("canvas"),_(n,"color",e[0]),_(n,"display","block"),_(n,"width","1.35rem"),_(n,"height","1.5rem"),_(n,"margin","0"),_(n,"padding","0 0.8rem 0 0rem"),_(n,"flex-grow","0"),_(n,"flex-shrink","0"),_(n,"flex-basis","1.35rem"),A(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&_(n,"color",t[0])},i:t,o:t,d(t){t&&x(n),e[3](null)}}}function Rt(t,e,n){let{color:o="#60e0ff"}=e;const r=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let i,s=0,c=0,a=[0,0];const l=(t,e,n,o,r,i)=>{o<2*i&&(i=o/2),r<2*i&&(i=r/2),t.beginPath(),t.moveTo(e+i,n),t.arcTo(e+o,n,e+o,n+r,i),t.arcTo(e+o,n+r,e,n+r,i),t.arcTo(e,n+r,e,n,i),t.arcTo(e,n,e+o,n,i),t.closePath()};var d;return d=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!i)return;const e=i.getContext("2d");if(!e)return;let r=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),u=Number.parseInt(getComputedStyle(i).getPropertyValue("width").slice(0,-2)),h=Number.parseInt(getComputedStyle(i).getPropertyValue("height").slice(0,-2));n(1,i.width=u*r,i),n(1,i.height=h*r,i),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,i.width,i.height);const p=3/o*i.width*.5,g=4/o*i.width;for(e.fillStyle=i.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*i.height;t*i.height>2*p?l(e,.5*i.width-p+f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width+f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*i.height>2*p?l(e,.5*i.width-p-f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width-f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill())}};return d(),r(1,500),()=>{cancelAnimationFrame(t)}},B().$$.on_mount.push(d),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,i,r,function(t){L[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class Ft extends at{constructor(t){super(),st(this,t,Rt,Nt,c,{color:0,updateVU:2},Ot)}get updateVU(){return this.$$.ctx[2]}}const zt=[];function It(t){return"[object Date]"===Object.prototype.toString.call(t)}function Dt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>Dt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(It(t)&&It(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=Dt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function Bt(o,r={}){const i=function(e,n=t){let o;const r=new Set;function i(t){if(c(e,t)&&(e=t,o)){const t=!zt.length;for(const t of r)t[1](),zt.push(t,e);if(t){for(let t=0;t<zt.length;t+=2)zt[t][0](zt[t+1]);zt.length=0}}}return{set:i,update:function(t){i(t(e))},subscribe:function(s,c=t){const a=[s,c];return r.add(a),1===r.size&&(o=n(i)||t),s(e),()=>{r.delete(a),0===r.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return i.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:u=0,duration:f=400,easing:p=e,interpolate:g=Dt}=n(n({},r),c);if(0===f)return l&&(l.abort(),l=null),i.set(o=a),Promise.resolve();const $=h()+u;let y;return s=m((e=>{if(e<$)return!0;d||(y=g(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(i.set(o=t),!1):(i.set(o=y(p(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:i.subscribe}}const{window:Mt}=nt;function Lt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function jt(t){let e;return{c(){e=T("div"),A(e,"class","TransscriptItemBgDiv")},m(t,n){w(t,e,n)},d(t){t&&x(e)}}}function Ht(e){let n,o;return{c(){n=T("div"),n.textContent="Listening...",A(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||W((()=>{o=et(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&x(n)}}}function Ut(e){let n,o;return{c(){n=T("div"),A(n,"class","TransscriptItemBgDiv")},m(t,e){w(t,n,e)},p(t,n){e=t},i(t){o||W((()=>{o=et(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&x(n)}}}function Vt(t){let e,n;return{c(){e=T("span"),A(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&A(e,"style",n)},d(t){t&&x(e)}}}function Wt(e){let n,o,r,i,s,c,a,l=e[42].word+"",d=e[16]&&Ut(e),u=e[44]<e[11].length&&Vt(e);return{c(){n=T("div"),d&&d.c(),o=C(),r=T("div"),i=S(l),s=C(),u&&u.c(),A(r,"class","TransscriptItemContent"),A(n,"class",a="TranscriptItem "+e[23](e[42])),P(n,"Entity",null!==e[42].entityType),P(n,"Final",e[42].isFinal)},m(t,e){w(t,n,e),d&&d.m(n,null),$(n,o),$(n,r),$(r,i),$(r,s),u&&u.m(r,null)},p(t,s){(e=t)[16]?d?65536&s[0]&&Q(d,1):(d=Ut(e),d.c(),Q(d,1),d.m(n,o)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l=e[42].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(i,l),e[44]<e[11].length?u?u.p(e,s):(u=Vt(e),u.c(),u.m(r,null)):u&&(u.d(1),u=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&A(n,"class",a),2048&s[0]&&P(n,"Entity",null!==e[42].entityType),2048&s[0]&&P(n,"Final",e[42].isFinal)},i(t){Q(d),c||W((()=>{c=et(r,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&x(n),d&&d.d(),u&&u.d()}}}function qt(e){let n,o,r,i,s,c,a,l;return{c(){n=T("div"),o=T("div"),r=C(),i=T("div"),s=E("svg"),c=E("path"),A(o,"class","TransscriptItemBgDiv"),_(o,"background-color",e[5]),A(c,"stroke","currentColor"),A(c,"stroke-width","3"),A(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),A(c,"fill","none"),A(c,"fill-rule","evenodd"),_(s,"width","2rem"),_(s,"height","2rem"),_(s,"position","absolute"),_(s,"transform","translate(-0.6rem, -0.5rem)"),_(s,"stroke","#eee"),A(s,"viewBox","0 0 24 24"),A(s,"xmlns","http://www.w3.org/2000/svg"),_(i,"width","1.0rem"),_(i,"height","1rem"),_(i,"position","relative"),A(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,r),$(n,i),$(i,s),$(s,c)},p(t,e){32&e[0]&&_(o,"background-color",t[5])},i(t){a||W((()=>{a=et(c,e[20],{duration:500}),a.start()})),l||W((()=>{l=et(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&x(n)}}}function Xt(t){let e;return{c(){e=T("link"),A(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),A(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&x(e)}}}function Kt(t){let e;return{c(){e=T("link"),A(e,"href",t[10]),A(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){1024&n[0]&&A(e,"href",t[10])},d(t){t&&x(e)}}}function Yt(e){let n,o,r,i,s,c,a,l,d,u,h,f,p,g,m,y=e[16]&&jt(),b={color:e[5]};s=new Ft({props:b}),e[34](s);let v=e[17]&&Ht(e),E=e[11],S=[];for(let t=0;t<E.length;t+=1)S[t]=Wt(Lt(e,E,t));let O=e[13]&&qt(e),N=e[15]&&Xt(),R=void 0!==e[10]&&Kt(e);return{c(){var p;n=T("main"),o=T("div"),y&&y.c(),r=C(),i=T("div"),(p=s.$$.fragment)&&p.c(),c=C(),v&&v.c(),a=C();for(let t=0;t<S.length;t+=1)S[t].c();l=C(),O&&O.c(),d=C(),N&&N.c(),u=k(),h=C(),R&&R.c(),f=k(),this.c=t,A(i,"class","TransscriptItemContent"),A(o,"class","TranscriptItem"),A(n,"class","BigTranscript"),_(n,"--voffset",e[1]),_(n,"--hoffset",e[2]),_(n,"--fontsize",e[3]),_(n,"--color",e[4]),_(n,"--highlight-color",e[5]),_(n,"--text-bg-color",e[6]),_(n,"--gradient-stop1",e[7]),_(n,"--gradient-stop2",e[8]),_(n,"--marginbottom",e[9]),_(n,"--transition",e[18].transition),_(n,"opacity",e[18].transition),_(n,"max-height",10*Pt(_t,e[18].transition,0,.6)+"rem"),_(n,"visibility",0!==e[18].transition?"visible":"hidden"),P(n,"placementTop","top"===e[0]),P(n,"defaultTypography",e[15])},m(t,b){w(t,n,b),$(n,o),y&&y.m(o,null),$(o,r),$(o,i),ot(s,i,null),$(i,c),v&&v.m(i,null),$(n,a);for(let t=0;t<S.length;t+=1)S[t].m(n,null);var x,T,E,C;$(n,l),O&&O.m(n,null),w(t,d,b),N&&N.m(document.head,null),$(document.head,u),w(t,h,b),R&&R.m(t,b),w(t,f,b),p=!0,g||(x=Mt,T="message",E=e[22],x.addEventListener(T,E,C),m=()=>x.removeEventListener(T,E,C),g=!0)},p(t,e){t[16]?y||(y=jt(),y.c(),y.m(o,r)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?v?131072&e[0]&&Q(v,1):(v=Ht(t),v.c(),Q(v,1),v.m(i,null)):v&&(v.d(1),v=null),8464384&e[0]){let o;for(E=t[11],o=0;o<E.length;o+=1){const r=Lt(t,E,o);S[o]?(S[o].p(r,e),Q(S[o],1)):(S[o]=Wt(r),S[o].c(),Q(S[o],1),S[o].m(n,l))}for(;o<S.length;o+=1)S[o].d(1);S.length=E.length}t[13]?O?(O.p(t,e),8192&e[0]&&Q(O,1)):(O=qt(t),O.c(),Q(O,1),O.m(n,null)):O&&(O.d(1),O=null),(!p||2&e[0])&&_(n,"--voffset",t[1]),(!p||4&e[0])&&_(n,"--hoffset",t[2]),(!p||8&e[0])&&_(n,"--fontsize",t[3]),(!p||16&e[0])&&_(n,"--color",t[4]),(!p||32&e[0])&&_(n,"--highlight-color",t[5]),(!p||64&e[0])&&_(n,"--text-bg-color",t[6]),(!p||128&e[0])&&_(n,"--gradient-stop1",t[7]),(!p||256&e[0])&&_(n,"--gradient-stop2",t[8]),(!p||512&e[0])&&_(n,"--marginbottom",t[9]),(!p||262144&e[0])&&_(n,"--transition",t[18].transition),(!p||262144&e[0])&&_(n,"opacity",t[18].transition),(!p||262144&e[0])&&_(n,"max-height",10*Pt(_t,t[18].transition,0,.6)+"rem"),(!p||262144&e[0])&&_(n,"visibility",0!==t[18].transition?"visible":"hidden"),(!p||1&e[0])&&P(n,"placementTop","top"===t[0]),(!p||32768&e[0])&&P(n,"defaultTypography",t[15]),t[15]?N||(N=Xt(),N.c(),N.m(u.parentNode,u)):N&&(N.d(1),N=null),void 0!==t[10]?R?R.p(t,e):(R=Kt(t),R.c(),R.m(f.parentNode,f)):R&&(R.d(1),R=null)},i(t){if(!p){Q(s.$$.fragment,t),Q(v);for(let t=0;t<E.length;t+=1)Q(S[t]);Q(O),p=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(J.has(t))return;J.add(t),(void 0).c.push((()=>{J.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}(s.$$.fragment,t),p=!1},d(t){t&&x(n),y&&y.d(),e[34](null),rt(s),v&&v.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(S,t),O&&O.d(),t&&x(d),N&&N.d(t),x(u),t&&x(h),R&&R.d(t),t&&x(f),g=!1,m()}}}function Zt(t,e,n){let o,r,i,s,c,a,l,u,{placement:h}=e,{voffset:f="3rem"}=e,{hoffset:p="2rem"}=e,{fontsize:g="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:v="#ffffffcc"}=e,{marginbottom:w="0rem"}=e,{formattext:x}=e,{demomode:T}=e,{customcssurl:E}=e,{customtypography:S}=e,C=[],k=null,A=null,_=ft.Disconnected,P=!1,O=!1,N=!1,R=Bt({transition:0},{duration:200});d(t,R,(t=>n(18,l=t)));const F=B(),z=Ct(At),I=Ct(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Pt(_t,t,0,1)*o}rem;\n `}))),D=t=>{n(13,N=N||t)},M=t=>{n(30,_=t),_===ft.Active&&(n(13,N=!1),n(11,C=[]),A=null)},j=t=>{if(void 0===t)return;u&&(s||_===ft.Active)&&u.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?H(C.length>0?s?3500:2e3:0):C.length>0&&(P||n(31,P=!0),H(2e3));const e=`${t.contextId}/${t.id}`;null!==A?A!==e&&(n(13,N=!1),A=e):A=e,n(11,C=[]),t.words.forEach((t=>{n(11,C[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},C)})),i?t.entities.forEach((t=>{n(11,C[t.startPosition].word=t.value,C),n(11,C[t.startPosition].entityType=t.type,C),n(11,C[t.startPosition].isFinal=t.isFinal,C),n(11,C[t.startPosition].hide=!1,C);for(let e=t.startPosition+1;e<t.endPosition;e++)C[e]&&n(11,C[e].hide=!0,C)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)C[e]&&(n(11,C[e].entityType=t.type,C),n(11,C[e].isFinal=t.isFinal,C))})),n(11,C=C.filter((t=>!t.hide)))},H=(t=0)=>{U(),k=window.setTimeout((()=>{k=null,P&&n(31,P=!1)}),t)},U=()=>{null!==k&&(window.clearTimeout(k),k=null)};return t.$$set=t=>{"placement"in t&&n(0,h=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,p=t.hoffset),"fontsize"in t&&n(3,g=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,v=t.gradientstop2),"marginbottom"in t&&n(9,w=t.marginbottom),"formattext"in t&&n(24,x=t.formattext),"demomode"in t&&n(25,T=t.demomode),"customcssurl"in t&&n(10,E=t.customcssurl),"customtypography"in t&&n(26,S=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===C.length),64&t.$$.dirty[0]&&n(16,r="none"!==y),16777216&t.$$.dirty[0]&&(i=void 0===x||"false"!==x),33554432&t.$$.dirty[0]&&n(33,s=void 0!==T&&"false"!==T),67108864&t.$$.dirty[0]&&n(15,c=void 0===S||"false"===S),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=_===ft.Active||P;t!==O&&(e="visibilitychanged",l=t,F.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,O=t),R.set({transition:O?1:0})}var e,l;4&t.$$.dirty[1]&&(s||H(0))},[h,f,p,g,m,$,y,b,v,w,E,C,u,N,a,c,r,o,l,R,z,I,t=>{switch(t.data.type){case bt.speechsegment:j(t.data.segment);break;case bt.speechhandled:D(t.data.success);break;case bt.speechstate:M(t.data.state)}},t=>t.entityType||"",x,T,S,D,M,j,_,P,O,s,function(t){L[t?"unshift":"push"]((()=>{u=t,n(12,u)}))}]}class Gt extends ct{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition));height:fit-content}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",st(this,{target:this.shadowRoot,props:O(this.attributes),customElement:!0},Zt,Yt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),Y()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),Y()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),Y()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),Y()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),Y()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),Y()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Y()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Y()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Y()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Y()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),Y()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),Y()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),Y()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),Y()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),Y()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",Gt)})); | ||
$t=Ct,yt=Ct.exports,function(t){var e=yt,n=$t&&$t.exports==e&&$t,o="object"==typeof St&&St;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,d=t.length-c;++l<d;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(St),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(bt||(bt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(vt||(vt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(wt||(wt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(xt||(xt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(Tt||(Tt={})),function(t){t.None="none",t.Whirl="whirl"}(Et||(Et={})),pt.Disconnected,pt.Connected,pt.Active,pt.Failed,dt.NoBrowserSupport,dt.NoAudioConsent;const Pt=[0,1];function Ot(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let r=(o-n)/(t.length-1);if(r<=0)return t[0];let i=(e-n)/r,s=Math.floor(i),c=Math.ceil(i),a=i-s;return(1-a)*t[s]+a*t[c]}function Nt(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=T("style");t.id=e,t.textContent=n,v(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function Rt(e){let n;return{c(){n=T("canvas"),_(n,"color",e[0]),_(n,"display","block"),_(n,"width","1.35rem"),_(n,"height","1.5rem"),_(n,"margin","0"),_(n,"padding","0 0.8rem 0 0rem"),_(n,"flex-grow","0"),_(n,"flex-shrink","0"),_(n,"flex-basis","1.35rem"),A(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&_(n,"color",t[0])},i:t,o:t,d(t){t&&x(n),e[3](null)}}}function Ft(t,e,n){let{color:o="#60e0ff"}=e;const r=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let i,s=0,c=0,a=[0,0];const l=(t,e,n,o,r,i)=>{o<2*i&&(i=o/2),r<2*i&&(i=r/2),t.beginPath(),t.moveTo(e+i,n),t.arcTo(e+o,n,e+o,n+r,i),t.arcTo(e+o,n+r,e,n+r,i),t.arcTo(e,n+r,e,n,i),t.arcTo(e,n,e+o,n,i),t.closePath()};var d;return d=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!i)return;const e=i.getContext("2d");if(!e)return;let r=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),u=Number.parseInt(getComputedStyle(i).getPropertyValue("width").slice(0,-2)),h=Number.parseInt(getComputedStyle(i).getPropertyValue("height").slice(0,-2));n(1,i.width=u*r,i),n(1,i.height=h*r,i),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,i.width,i.height);const p=3/o*i.width*.5,g=4/o*i.width;for(e.fillStyle=i.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*i.height;t*i.height>2*p?l(e,.5*i.width-p+f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width+f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*i.height>2*p?l(e,.5*i.width-p-f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width-f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill())}};return d(),r(1,500),()=>{cancelAnimationFrame(t)}},B().$$.on_mount.push(d),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,i,r,function(t){L[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class zt extends lt{constructor(t){super(),ct(this,t,Ft,Rt,c,{color:0,updateVU:2},Nt)}get updateVU(){return this.$$.ctx[2]}}const It=[];function Dt(t){return"[object Date]"===Object.prototype.toString.call(t)}function Bt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>Bt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(Dt(t)&&Dt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=Bt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function Mt(o,r={}){const i=function(e,n=t){let o;const r=new Set;function i(t){if(c(e,t)&&(e=t,o)){const t=!It.length;for(const t of r)t[1](),It.push(t,e);if(t){for(let t=0;t<It.length;t+=2)It[t][0](It[t+1]);It.length=0}}}return{set:i,update:function(t){i(t(e))},subscribe:function(s,c=t){const a=[s,c];return r.add(a),1===r.size&&(o=n(i)||t),s(e),()=>{r.delete(a),0===r.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return i.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:u=0,duration:f=400,easing:p=e,interpolate:g=Bt}=n(n({},r),c);if(0===f)return l&&(l.abort(),l=null),i.set(o=a),Promise.resolve();const $=h()+u;let y;return s=m((e=>{if(e<$)return!0;d||(y=g(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(i.set(o=t),!1):(i.set(o=y(p(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:i.subscribe}}const{window:Lt}=ot;function jt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function Ht(t){let e;return{c(){e=T("div"),A(e,"class","TransscriptItemBgDiv")},m(t,n){w(t,e,n)},d(t){t&&x(e)}}}function Ut(e){let n,o;return{c(){n=T("div"),n.textContent="Listening...",A(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||W((()=>{o=nt(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&x(n)}}}function Vt(e){let n,o;return{c(){n=T("div"),A(n,"class","TransscriptItemBgDiv")},m(t,e){w(t,n,e)},p(t,n){e=t},i(t){o||W((()=>{o=nt(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&x(n)}}}function Wt(t){let e,n;return{c(){e=T("span"),A(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&A(e,"style",n)},d(t){t&&x(e)}}}function qt(e){let n,o,r,i,s,c,a,l=e[42].word+"",d=e[16]&&Vt(e),u=e[44]<e[11].length&&Wt(e);return{c(){n=T("div"),d&&d.c(),o=C(),r=T("div"),i=S(l),s=C(),u&&u.c(),A(r,"class","TransscriptItemContent"),A(n,"class",a="TranscriptItem "+e[23](e[42])),P(n,"Entity",null!==e[42].entityType),P(n,"Final",e[42].isFinal)},m(t,e){w(t,n,e),d&&d.m(n,null),$(n,o),$(n,r),$(r,i),$(r,s),u&&u.m(r,null)},p(t,s){(e=t)[16]?d?65536&s[0]&&tt(d,1):(d=Vt(e),d.c(),tt(d,1),d.m(n,o)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l=e[42].word+"")&&function(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}(i,l),e[44]<e[11].length?u?u.p(e,s):(u=Wt(e),u.c(),u.m(r,null)):u&&(u.d(1),u=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&A(n,"class",a),2048&s[0]&&P(n,"Entity",null!==e[42].entityType),2048&s[0]&&P(n,"Final",e[42].isFinal)},i(t){tt(d),c||W((()=>{c=nt(r,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&x(n),d&&d.d(),u&&u.d()}}}function Xt(e){let n,o,r,i,s,c,a,l;return{c(){n=T("div"),o=T("div"),r=C(),i=T("div"),s=E("svg"),c=E("path"),A(o,"class","TransscriptItemBgDiv"),_(o,"background-color",e[5]),A(c,"stroke","currentColor"),A(c,"stroke-width","3"),A(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),A(c,"fill","none"),A(c,"fill-rule","evenodd"),_(s,"width","2rem"),_(s,"height","2rem"),_(s,"position","absolute"),_(s,"transform","translate(-0.6rem, -0.5rem)"),_(s,"stroke","#eee"),A(s,"viewBox","0 0 24 24"),A(s,"xmlns","http://www.w3.org/2000/svg"),_(i,"width","1.0rem"),_(i,"height","1rem"),_(i,"position","relative"),A(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,r),$(n,i),$(i,s),$(s,c)},p(t,e){32&e[0]&&_(o,"background-color",t[5])},i(t){a||W((()=>{a=nt(c,e[20],{duration:500}),a.start()})),l||W((()=>{l=nt(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&x(n)}}}function Kt(t){let e;return{c(){e=T("link"),A(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),A(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&x(e)}}}function Yt(t){let e;return{c(){e=T("link"),A(e,"href",t[10]),A(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){1024&n[0]&&A(e,"href",t[10])},d(t){t&&x(e)}}}function Zt(e){let n,o,r,i,s,c,a,l,d,u,h,f,p,g,m,y=e[16]&&Ht(),b={color:e[5]};s=new zt({props:b}),e[34](s);let v=e[17]&&Ut(e),E=e[11],S=[];for(let t=0;t<E.length;t+=1)S[t]=qt(jt(e,E,t));let O=e[13]&&Xt(e),N=e[15]&&Kt(),R=void 0!==e[10]&&Yt(e);return{c(){var p;n=T("main"),o=T("div"),y&&y.c(),r=C(),i=T("div"),(p=s.$$.fragment)&&p.c(),c=C(),v&&v.c(),a=C();for(let t=0;t<S.length;t+=1)S[t].c();l=C(),O&&O.c(),d=C(),N&&N.c(),u=k(),h=C(),R&&R.c(),f=k(),this.c=t,A(i,"class","TransscriptItemContent"),A(o,"class","TranscriptItem"),A(n,"class","BigTranscript"),_(n,"--voffset",e[1]),_(n,"--hoffset",e[2]),_(n,"--fontsize",e[3]),_(n,"--color",e[4]),_(n,"--highlight-color",e[5]),_(n,"--text-bg-color",e[6]),_(n,"--gradient-stop1",e[7]),_(n,"--gradient-stop2",e[8]),_(n,"--marginbottom",e[9]),_(n,"--transition",e[18].transition),_(n,"opacity",e[18].transition),_(n,"max-height",10*Ot(Pt,e[18].transition,0,.6)+"rem"),_(n,"visibility",0!==e[18].transition?"visible":"hidden"),P(n,"placementTop","top"===e[0]),P(n,"defaultTypography",e[15])},m(t,b){w(t,n,b),$(n,o),y&&y.m(o,null),$(o,r),$(o,i),rt(s,i,null),$(i,c),v&&v.m(i,null),$(n,a);for(let t=0;t<S.length;t+=1)S[t].m(n,null);var x,T,E,C;$(n,l),O&&O.m(n,null),w(t,d,b),N&&N.m(document.head,null),$(document.head,u),w(t,h,b),R&&R.m(t,b),w(t,f,b),p=!0,g||(x=Lt,T="message",E=e[22],x.addEventListener(T,E,C),m=()=>x.removeEventListener(T,E,C),g=!0)},p(t,e){t[16]?y||(y=Ht(),y.c(),y.m(o,r)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?v?131072&e[0]&&tt(v,1):(v=Ut(t),v.c(),tt(v,1),v.m(i,null)):v&&(v.d(1),v=null),8464384&e[0]){let o;for(E=t[11],o=0;o<E.length;o+=1){const r=jt(t,E,o);S[o]?(S[o].p(r,e),tt(S[o],1)):(S[o]=qt(r),S[o].c(),tt(S[o],1),S[o].m(n,l))}for(;o<S.length;o+=1)S[o].d(1);S.length=E.length}t[13]?O?(O.p(t,e),8192&e[0]&&tt(O,1)):(O=Xt(t),O.c(),tt(O,1),O.m(n,null)):O&&(O.d(1),O=null),(!p||2&e[0])&&_(n,"--voffset",t[1]),(!p||4&e[0])&&_(n,"--hoffset",t[2]),(!p||8&e[0])&&_(n,"--fontsize",t[3]),(!p||16&e[0])&&_(n,"--color",t[4]),(!p||32&e[0])&&_(n,"--highlight-color",t[5]),(!p||64&e[0])&&_(n,"--text-bg-color",t[6]),(!p||128&e[0])&&_(n,"--gradient-stop1",t[7]),(!p||256&e[0])&&_(n,"--gradient-stop2",t[8]),(!p||512&e[0])&&_(n,"--marginbottom",t[9]),(!p||262144&e[0])&&_(n,"--transition",t[18].transition),(!p||262144&e[0])&&_(n,"opacity",t[18].transition),(!p||262144&e[0])&&_(n,"max-height",10*Ot(Pt,t[18].transition,0,.6)+"rem"),(!p||262144&e[0])&&_(n,"visibility",0!==t[18].transition?"visible":"hidden"),(!p||1&e[0])&&P(n,"placementTop","top"===t[0]),(!p||32768&e[0])&&P(n,"defaultTypography",t[15]),t[15]?N||(N=Kt(),N.c(),N.m(u.parentNode,u)):N&&(N.d(1),N=null),void 0!==t[10]?R?R.p(t,e):(R=Yt(t),R.c(),R.m(f.parentNode,f)):R&&(R.d(1),R=null)},i(t){if(!p){tt(s.$$.fragment,t),tt(v);for(let t=0;t<E.length;t+=1)tt(S[t]);tt(O),p=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(J.has(t))return;J.add(t),Q.c.push((()=>{J.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}(s.$$.fragment,t),p=!1},d(t){t&&x(n),y&&y.d(),e[34](null),it(s),v&&v.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(S,t),O&&O.d(),t&&x(d),N&&N.d(t),x(u),t&&x(h),R&&R.d(t),t&&x(f),g=!1,m()}}}const Gt=2e3,Jt=3500;function Qt(t,e,n){let o,r,i,s,c,a,l,u,{placement:h}=e,{voffset:f="3rem"}=e,{hoffset:p="2rem"}=e,{fontsize:g="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:v="#ffffffcc"}=e,{marginbottom:w="0rem"}=e,{formattext:x}=e,{demomode:T}=e,{customcssurl:E}=e,{customtypography:S}=e,C=[],k=null,A=null,_=pt.Disconnected,P=!1,O=!1,N=!1,R=Mt({transition:0},{duration:200});d(t,R,(t=>n(18,l=t)));const F=B(),z=kt(_t),I=kt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Ot(Pt,t,0,1)*o}rem;\n `}))),D=t=>{n(13,N=N||t)},M=t=>{n(30,_=t),_===pt.Active&&(n(13,N=!1),n(11,C=[]),A=null)},j=t=>{if(void 0===t)return;u&&(s||_===pt.Active)&&u.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?H(C.length>0?s?Jt:Gt:0):C.length>0&&(P||n(31,P=!0),H(Gt));const e=`${t.contextId}/${t.id}`;null!==A?A!==e&&(n(13,N=!1),A=e):A=e,n(11,C=[]),t.words.forEach((t=>{n(11,C[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},C)})),i?t.entities.forEach((t=>{n(11,C[t.startPosition].word=t.value,C),n(11,C[t.startPosition].entityType=t.type,C),n(11,C[t.startPosition].isFinal=t.isFinal,C),n(11,C[t.startPosition].hide=!1,C);for(let e=t.startPosition+1;e<t.endPosition;e++)C[e]&&n(11,C[e].hide=!0,C)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)C[e]&&(n(11,C[e].entityType=t.type,C),n(11,C[e].isFinal=t.isFinal,C))})),n(11,C=C.filter((t=>!t.hide)))},H=(t=0)=>{U(),k=window.setTimeout((()=>{k=null,P&&n(31,P=!1)}),t)},U=()=>{null!==k&&(window.clearTimeout(k),k=null)};return t.$$set=t=>{"placement"in t&&n(0,h=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,p=t.hoffset),"fontsize"in t&&n(3,g=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,v=t.gradientstop2),"marginbottom"in t&&n(9,w=t.marginbottom),"formattext"in t&&n(24,x=t.formattext),"demomode"in t&&n(25,T=t.demomode),"customcssurl"in t&&n(10,E=t.customcssurl),"customtypography"in t&&n(26,S=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===C.length),64&t.$$.dirty[0]&&n(16,r="none"!==y),16777216&t.$$.dirty[0]&&(i=void 0===x||"false"!==x),33554432&t.$$.dirty[0]&&n(33,s=void 0!==T&&"false"!==T),67108864&t.$$.dirty[0]&&n(15,c=void 0===S||"false"===S),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=_===pt.Active||P;t!==O&&(e="visibilitychanged",l=t,F.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,O=t),R.set({transition:O?1:0})}var e,l;4&t.$$.dirty[1]&&(s||H(0))},[h,f,p,g,m,$,y,b,v,w,E,C,u,N,a,c,r,o,l,R,z,I,t=>{switch(t.data.type){case vt.speechsegment:j(t.data.segment);break;case vt.speechhandled:D(t.data.success);break;case vt.speechstate:M(t.data.state)}},t=>t.entityType||"",x,T,S,D,M,j,_,P,O,s,function(t){L[t?"unshift":"push"]((()=>{u=t,n(12,u)}))}]}class te extends at{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition));height:fit-content}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",ct(this,{target:this.shadowRoot,props:O(this.attributes),customElement:!0},Qt,Zt,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),Y()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),Y()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),Y()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),Y()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),Y()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),Y()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),Y()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),Y()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),Y()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),Y()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),Y()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),Y()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),Y()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),Y()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),Y()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",te)})); | ||
//# sourceMappingURL=big-transcript.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}const a="undefined"!=typeof window;let c=a?()=>window.performance.now():()=>Date.now(),l=a?t=>requestAnimationFrame(t):t;const u=new Set;function d(t){u.forEach((e=>{e.c(t)||(u.delete(e),e.f())})),0!==u.size&&l(d)}function f(t){let e;return 0===u.size&&l(d),{promise:new Promise((n=>{u.add(e={c:t,f:n})})),abort(){u.delete(e)}}}function h(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=w("style");return function(t,e){h(t.head||t,e),e.sheet}(m(t),e),e.sheet}function g(t,e,n){t.insertBefore(e,n||null)}function p(t){t.parentNode&&t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function v(){return t=" ",document.createTextNode(t);var t}function b(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function x(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function y(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function k(t){const e={};for(const n of t)e[n.name]=n.value;return e}const _=new Map;let E,C=0;function D(t,e,n,o,r,i,s,a=0){const c=16.666/o;let l="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${a}`,f=m(t),{stylesheet:h,rules:g}=_.get(f)||function(t,e){const n={stylesheet:$(e),rules:{}};return _.set(t,n),n}(f,t);g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${r}ms 1 both`,C+=1,d}function z(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),C-=r,C||l((()=>{C||(_.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&p(e)})),_.clear())})))}function A(t){E=t}const P=[],S=[],T=[],L=[],M=Promise.resolve();let N=!1;function O(t){T.push(t)}const R=new Set;let j,H=0;function q(){const t=E;do{for(;H<P.length;){const t=P[H];H++,A(t),B(t.$$)}for(A(null),P.length=0,H=0;S.length;)S.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];R.has(e)||(R.add(e),e())}T.length=0}while(P.length);for(;L.length;)L.pop()();N=!1,R.clear(),A(t)}function B(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(O)}}function F(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function G(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const I=new Set;let J;function K(t,e){t&&t.i&&(I.delete(t),t.i(e))}function Q(t,e,n,o){if(t&&t.o){if(I.has(t))return;I.add(t),J.c.push((()=>{I.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const U={duration:0};function V(t,e){-1===t.$$.dirty[0]&&(P.push(t),N||(N=!0,M.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function W(e,s,a,c,l,u,d,f=[-1]){const h=E;A(e);const m=e.$$={fragment:null,ctx:[],props:u,update:t,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};d&&d(m.root);let $=!1;if(m.ctx=a?a(e,s.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return m.ctx&&l(m.ctx[t],m.ctx[t]=r)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](r),$&&V(e,t)),n})):[],m.update(),$=!0,r(m.before_update),m.fragment=!!c&&c(m.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);m.fragment&&m.fragment.l(t),t.forEach(p)}else m.fragment&&m.fragment.c();s.intro&&K(e.$$.fragment),function(t,e,o,s){const{fragment:a,after_update:c}=t.$$;a&&a.m(e,o),s||O((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),c.forEach(O)}(e,s.target,s.anchor,s.customElement),q()}A(h)}let X;function Y(n){let o,s,a,l,u,d,m,$,k,_;return{c(){o=w("div"),s=w("div"),s.innerHTML="<slot></slot>",a=v(),l=w("div"),u=v(),x(s,"class","CalloutDiv"),function(t,e,n){t.classList[n?"add":"remove"](e)}(s,"useShadow",tt),x(l,"class","ArrowDiv"),y(l,"--ax",n[3].x),y(l,"--ay","100%"),x(o,"class","CalloutContainerDiv"),y(o,"width",n[1])},m(t,e){g(t,o,e),h(o,s),h(o,a),h(o,l),h(o,u),$=!0,k||(_=[b(o,"mousedown",n[7]),b(o,"touchstart",n[7]),b(o,"dragstart",n[7])],k=!0)},p(t,e){(!$||8&e)&&y(l,"--ax",t[3].x),(!$||2&e)&&y(o,"width",t[1])},i(r){$||(O((()=>{m&&m.end(1),d=function(n,o,r){let s,a,l=o(n,r),u=!1,d=0;function h(){s&&z(n,s)}function m(){const{delay:o=0,duration:r=300,easing:i=e,tick:m=t,css:$}=l||U;$&&(s=D(n,0,1,r,o,i,$,d++)),m(0,1);const g=c()+o,p=g+r;a&&a.abort(),u=!0,O((()=>G(n,!0,"start"))),a=f((t=>{if(u){if(t>=p)return m(1,0),G(n,!0,"end"),h(),u=!1;if(t>=g){const e=i((t-g)/r);m(e,1-e)}}return u}))}let $=!1;return{start(){$||($=!0,z(n),i(l)?(l=l(),F().then(m)):m())},invalidate(){$=!1},end(){u&&(h(),u=!1)}}}(o,n[6],{}),d.start()})),$=!0)},o(s){d&&d.invalidate(),m=function(n,o,s){let a,l=o(n,s),u=!0;const d=J;function h(){const{delay:o=0,duration:i=300,easing:s=e,tick:h=t,css:m}=l||U;m&&(a=D(n,1,0,i,o,s,m));const $=c()+o,g=$+i;O((()=>G(n,!1,"start"))),f((t=>{if(u){if(t>=g)return h(0,1),G(n,!1,"end"),--d.r||r(d.c),!1;if(t>=$){const e=s((t-$)/i);h(1-e,e)}}return u}))}return d.r+=1,i(l)?F().then((()=>{l=l(),h()})):h(),{end(t){t&&l.tick&&l.tick(1,0),u&&(a&&z(n,a),u=!1)}}}(o,n[6],{}),$=!1},d(t){t&&p(o),t&&m&&m.end(),k=!1,r(_)}}}function Z(e){let n,o,i=e[2]&&Y(e);return{c(){n=w("main"),i&&i.c(),this.c=t,y(n,"--ax",e[4].x),y(n,"--ay",e[4].y),y(n,"--halign",e[3].x),y(n,"--valign",e[3].y),y(n,"--borderradius",et),y(n,"--arrowpad",`${e[5].value}${e[5].unit}`),y(n,"--backgroundcolor",e[0]),y(n,"--size",`${e[5].value*Math.sqrt(2)}${e[5].unit}`),y(n,"--offsetx","0rem"),y(n,"--offsety",`${e[5].value}${e[5].unit}`)},m(t,e){g(t,n,e),i&&i.m(n,null),o=!0},p(t,[e]){t[2]?i?(i.p(t,e),4&e&&K(i,1)):(i=Y(t),i.c(),K(i,1),i.m(n,null)):i&&(J={r:0,c:[],p:J},Q(i,1,1,(()=>{i=null})),J.r||r(J.c),J=J.p),(!o||8&e)&&y(n,"--halign",t[3].x),(!o||8&e)&&y(n,"--valign",t[3].y),(!o||1&e)&&y(n,"--backgroundcolor",t[0])},i(t){o||(K(i),o=!0)},o(t){Q(i),o=!1},d(t){t&&p(n),i&&i.d()}}}"function"==typeof HTMLElement&&(X=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});let tt=!1,et="0rem";function nt(t,e,n){let o,{show:r}=e,{showtime:i=1e4}=e,{backgroundcolor:s="#202020"}=e,{xalign:a="50%"}=e,{width:c="auto"}=e,l=null,u=!1;const d=(f=(t,{duration:e=250})=>({duration:e,css:t=>`\n clip-path: circle(${100*t}% at ${o.x} 50%);\n `}),function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return f(t,e)});var f;return t.$$set=t=>{"show"in t&&n(8,r=t.show),"showtime"in t&&n(9,i=t.showtime),"backgroundcolor"in t&&n(0,s=t.backgroundcolor),"xalign"in t&&n(10,a=t.xalign),"width"in t&&n(1,c=t.width)},t.$$.update=()=>{1024&t.$$.dirty&&n(3,o={x:a,y:"100%"}),256&t.$$.dirty&&(t=>{null!==l&&(window.clearTimeout(l),l=null),void 0!==t&&"false"!==t?l=window.setTimeout((()=>{n(2,u=!0),l=null,i>0&&(l=window.setTimeout((()=>{n(2,u=!1),l=null}),i))}),500):n(2,u=!1)})(r)},[s,c,u,o,{x:"50%",y:"10%"},{value:.55,unit:"rem"},d,t=>{t.preventDefault(),t.stopPropagation(),n(2,u=!1)},r,i,a]}class ot extends X{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{margin:0;padding:0}.CalloutContainerDiv{position:absolute;left:var(--ax);top:var(--ay);transform:translate(calc(-1 * var(--halign)), calc(-1 * var(--valign)));padding:var(--arrowpad);z-index:10;pointer-events:auto}.CalloutDiv{position:relative;box-sizing:border-box;min-width:8rem;border-radius:var(--borderradius);padding:0.50rem 1rem;background-color:var(--backgroundcolor);text-align:center;user-select:none;z-index:10}.useShadow{box-shadow:0 0.2rem 0.5rem #00000040}.ArrowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);z-index:10}.ArrowShadowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);background-color:#00000000;box-shadow:0 0.2rem 0.5rem #00000040;z-index:9}</style>",W(this,{target:this.shadowRoot,props:k(this.attributes),customElement:!0},nt,Z,s,{show:8,showtime:9,backgroundcolor:0,xalign:10,width:1},null),t&&(t.target&&g(t.target,this,t.anchor),t.props&&(this.$set(t.props),q()))}static get observedAttributes(){return["show","showtime","backgroundcolor","xalign","width"]}get show(){return this.$$.ctx[8]}set show(t){this.$$set({show:t}),q()}get showtime(){return this.$$.ctx[9]}set showtime(t){this.$$set({showtime:t}),q()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),q()}get xalign(){return this.$$.ctx[10]}set xalign(t){this.$$set({xalign:t}),q()}get width(){return this.$$.ctx[1]}set width(t){this.$$set({width:t}),q()}}customElements.get("call-out")?console.warn("Skipping re-defining customElement call-out"):customElements.define("call-out",ot)})); | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}const a="undefined"!=typeof window;let c=a?()=>window.performance.now():()=>Date.now(),l=a?t=>requestAnimationFrame(t):t;const u=new Set;function d(t){u.forEach((e=>{e.c(t)||(u.delete(e),e.f())})),0!==u.size&&l(d)}function f(t){let e;return 0===u.size&&l(d),{promise:new Promise((n=>{u.add(e={c:t,f:n})})),abort(){u.delete(e)}}}function h(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=w("style");return function(t,e){h(t.head||t,e),e.sheet}(m(t),e),e.sheet}function g(t,e,n){t.insertBefore(e,n||null)}function p(t){t.parentNode&&t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function v(){return t=" ",document.createTextNode(t);var t}function b(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function x(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function y(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function k(t){const e={};for(const n of t)e[n.name]=n.value;return e}const _=new Map;let E,C=0;function D(t,e,n,o,r,i,s,a=0){const c=16.666/o;let l="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${a}`,f=m(t),{stylesheet:h,rules:g}=_.get(f)||function(t,e){const n={stylesheet:$(e),rules:{}};return _.set(t,n),n}(f,t);g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const p=t.style.animation||"";return t.style.animation=`${p?`${p}, `:""}${d} ${o}ms linear ${r}ms 1 both`,C+=1,d}function z(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),C-=r,C||l((()=>{C||(_.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&p(e)})),_.clear())})))}function A(t){E=t}const P=[],S=[],T=[],L=[],M=Promise.resolve();let N=!1;function O(t){T.push(t)}const R=new Set;let j,H=0;function q(){if(0!==H)return;const t=E;do{try{for(;H<P.length;){const t=P[H];H++,A(t),B(t.$$)}}catch(t){throw P.length=0,H=0,t}for(A(null),P.length=0,H=0;S.length;)S.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];R.has(e)||(R.add(e),e())}T.length=0}while(P.length);for(;L.length;)L.pop()();N=!1,R.clear(),A(t)}function B(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(O)}}function F(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function G(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const I=new Set;let J;function K(t,e){t&&t.i&&(I.delete(t),t.i(e))}function Q(t,e,n,o){if(t&&t.o){if(I.has(t))return;I.add(t),J.c.push((()=>{I.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const U={duration:0};function V(t,e){-1===t.$$.dirty[0]&&(P.push(t),N||(N=!0,M.then(q)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function W(e,s,a,c,l,u,d,f=[-1]){const h=E;A(e);const m=e.$$={fragment:null,ctx:[],props:u,update:t,not_equal:l,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};d&&d(m.root);let $=!1;if(m.ctx=a?a(e,s.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return m.ctx&&l(m.ctx[t],m.ctx[t]=r)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](r),$&&V(e,t)),n})):[],m.update(),$=!0,r(m.before_update),m.fragment=!!c&&c(m.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);m.fragment&&m.fragment.l(t),t.forEach(p)}else m.fragment&&m.fragment.c();s.intro&&K(e.$$.fragment),function(t,e,o,s){const{fragment:a,after_update:c}=t.$$;a&&a.m(e,o),s||O((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),c.forEach(O)}(e,s.target,s.anchor,s.customElement),q()}A(h)}let X;function Y(n){let o,s,a,l,u,d,m,$,k,_;return{c(){o=w("div"),s=w("div"),s.innerHTML="<slot></slot>",a=v(),l=w("div"),u=v(),x(s,"class","CalloutDiv"),function(t,e,n){t.classList[n?"add":"remove"](e)}(s,"useShadow",et),x(l,"class","ArrowDiv"),y(l,"--ax",n[3].x),y(l,"--ay","100%"),x(o,"class","CalloutContainerDiv"),y(o,"width",n[1])},m(t,e){g(t,o,e),h(o,s),h(o,a),h(o,l),h(o,u),$=!0,k||(_=[b(o,"mousedown",n[7]),b(o,"touchstart",n[7]),b(o,"dragstart",n[7])],k=!0)},p(t,e){(!$||8&e)&&y(l,"--ax",t[3].x),(!$||2&e)&&y(o,"width",t[1])},i(r){$||(O((()=>{m&&m.end(1),d=function(n,o,r){const s={direction:"in"};let a,l,u=o(n,r,s),d=!1,h=0;function m(){a&&z(n,a)}function $(){const{delay:o=0,duration:r=300,easing:i=e,tick:s=t,css:$}=u||U;$&&(a=D(n,0,1,r,o,i,$,h++)),s(0,1);const g=c()+o,p=g+r;l&&l.abort(),d=!0,O((()=>G(n,!0,"start"))),l=f((t=>{if(d){if(t>=p)return s(1,0),G(n,!0,"end"),m(),d=!1;if(t>=g){const e=i((t-g)/r);s(e,1-e)}}return d}))}let g=!1;return{start(){g||(g=!0,z(n),i(u)?(u=u(s),F().then($)):$())},invalidate(){g=!1},end(){d&&(m(),d=!1)}}}(o,n[6],{}),d.start()})),$=!0)},o(s){d&&d.invalidate(),m=function(n,o,s){const a={direction:"out"};let l,u=o(n,s,a),d=!0;const h=J;function m(){const{delay:o=0,duration:i=300,easing:s=e,tick:a=t,css:m}=u||U;m&&(l=D(n,1,0,i,o,s,m));const $=c()+o,g=$+i;O((()=>G(n,!1,"start"))),f((t=>{if(d){if(t>=g)return a(0,1),G(n,!1,"end"),--h.r||r(h.c),!1;if(t>=$){const e=s((t-$)/i);a(1-e,e)}}return d}))}return h.r+=1,i(u)?F().then((()=>{u=u(a),m()})):m(),{end(t){t&&u.tick&&u.tick(1,0),d&&(l&&z(n,l),d=!1)}}}(o,n[6],{}),$=!1},d(t){t&&p(o),t&&m&&m.end(),k=!1,r(_)}}}function Z(e){let n,o,i=e[2]&&Y(e);return{c(){n=w("main"),i&&i.c(),this.c=t,y(n,"--ax",e[4].x),y(n,"--ay",e[4].y),y(n,"--halign",e[3].x),y(n,"--valign",e[3].y),y(n,"--borderradius",nt),y(n,"--arrowpad",`${e[5].value}${e[5].unit}`),y(n,"--backgroundcolor",e[0]),y(n,"--size",`${e[5].value*Math.sqrt(2)}${e[5].unit}`),y(n,"--offsetx","0rem"),y(n,"--offsety",`${e[5].value}${e[5].unit}`)},m(t,e){g(t,n,e),i&&i.m(n,null),o=!0},p(t,[e]){t[2]?i?(i.p(t,e),4&e&&K(i,1)):(i=Y(t),i.c(),K(i,1),i.m(n,null)):i&&(J={r:0,c:[],p:J},Q(i,1,1,(()=>{i=null})),J.r||r(J.c),J=J.p),(!o||8&e)&&y(n,"--halign",t[3].x),(!o||8&e)&&y(n,"--valign",t[3].y),(!o||1&e)&&y(n,"--backgroundcolor",t[0])},i(t){o||(K(i),o=!0)},o(t){Q(i),o=!1},d(t){t&&p(n),i&&i.d()}}}"function"==typeof HTMLElement&&(X=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const tt=500;let et=!1,nt="0rem";function ot(t,e,n){let o,{show:r}=e,{showtime:i=1e4}=e,{backgroundcolor:s="#202020"}=e,{xalign:a="50%"}=e,{width:c="auto"}=e,l=null,u=!1;const d=(f=(t,{duration:e=250})=>({duration:e,css:t=>`\n clip-path: circle(${100*t}% at ${o.x} 50%);\n `}),function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return f(t,e)});var f;return t.$$set=t=>{"show"in t&&n(8,r=t.show),"showtime"in t&&n(9,i=t.showtime),"backgroundcolor"in t&&n(0,s=t.backgroundcolor),"xalign"in t&&n(10,a=t.xalign),"width"in t&&n(1,c=t.width)},t.$$.update=()=>{1024&t.$$.dirty&&n(3,o={x:a,y:"100%"}),256&t.$$.dirty&&(t=>{null!==l&&(window.clearTimeout(l),l=null),void 0!==t&&"false"!==t?l=window.setTimeout((()=>{n(2,u=!0),l=null,i>0&&(l=window.setTimeout((()=>{n(2,u=!1),l=null}),i))}),tt):n(2,u=!1)})(r)},[s,c,u,o,{x:"50%",y:"10%"},{value:.55,unit:"rem"},d,t=>{t.preventDefault(),t.stopPropagation(),n(2,u=!1)},r,i,a]}class rt extends X{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{margin:0;padding:0}.CalloutContainerDiv{position:absolute;left:var(--ax);top:var(--ay);transform:translate(calc(-1 * var(--halign)), calc(-1 * var(--valign)));padding:var(--arrowpad);z-index:10;pointer-events:auto}.CalloutDiv{position:relative;box-sizing:border-box;min-width:8rem;border-radius:var(--borderradius);padding:0.50rem 1rem;background-color:var(--backgroundcolor);text-align:center;user-select:none;z-index:10}.useShadow{box-shadow:0 0.2rem 0.5rem #00000040}.ArrowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);z-index:10}.ArrowShadowDiv{position:absolute;left:calc(var(--ax) - var(--offsetx));top:calc(var(--ay) - var(--offsety));transform:translate(-50%, -50%) rotate(45deg);width:var(--size);height:var(--size);background-color:var(--backgroundcolor);background-color:#00000000;box-shadow:0 0.2rem 0.5rem #00000040;z-index:9}</style>",W(this,{target:this.shadowRoot,props:k(this.attributes),customElement:!0},ot,Z,s,{show:8,showtime:9,backgroundcolor:0,xalign:10,width:1},null),t&&(t.target&&g(t.target,this,t.anchor),t.props&&(this.$set(t.props),q()))}static get observedAttributes(){return["show","showtime","backgroundcolor","xalign","width"]}get show(){return this.$$.ctx[8]}set show(t){this.$$set({show:t}),q()}get showtime(){return this.$$.ctx[9]}set showtime(t){this.$$set({showtime:t}),q()}get backgroundcolor(){return this.$$.ctx[0]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),q()}get xalign(){return this.$$.ctx[10]}set xalign(t){this.$$set({xalign:t}),q()}get width(){return this.$$.ctx[1]}set width(t){this.$$set({width:t}),q()}}customElements.get("call-out")?console.warn("Skipping re-defining customElement call-out"):customElements.define("call-out",rt)})); | ||
//# sourceMappingURL=call-out.js.map |
import type { Segment } from "./types"; | ||
export declare type SpeechSegmentCallback = (s: Segment) => void; | ||
export type SpeechSegmentCallback = (s: Segment) => void; | ||
export declare const startDemo: (demoStrings: string[], onSegmentCallback?: SpeechSegmentCallback) => void; | ||
export declare const stopDemo: () => void; | ||
//# sourceMappingURL=demomode.d.ts.map |
@@ -1,4 +0,4 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}function c(t){return 0===Object.keys(t).length}function a(t,e){t.appendChild(e)}function d(t,e,n){const o=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;if(e&&e.host)return e;return t.ownerDocument}(t);if(!o.getElementById(e)){const t=f("style");t.id=e,t.textContent=n,function(t,e){a(t.head||t,e),e.sheet}(o,t)}}function l(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function $(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function x(t,e,n){t.classList[n?"add":"remove"](e)}function w(t){const e={};for(const n of t)e[n.name]=n.value;return e}let b;function y(t){b=t}function k(){if(!b)throw new Error("Function called outside component initialization");return b}const E=[],S=[],C=[],A=[],_=Promise.resolve();let z=!1;function T(t){C.push(t)}const M=new Set;let N=0;function O(){const t=b;do{for(;N<E.length;){const t=E[N];N++,y(t),R(t.$$)}for(y(null),E.length=0,N=0;S.length;)S.pop()();for(let t=0;t<C.length;t+=1){const e=C[t];M.has(e)||(M.add(e),e())}C.length=0}while(E.length);for(;A.length;)A.pop()();z=!1,M.clear(),y(t)}function R(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const F=new Set;function D(t,e){t&&t.i&&(F.delete(t),t.i(e))}function L(t,e,n,o){if(t&&t.o){if(F.has(t))return;F.add(t),undefined.c.push((()=>{F.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const B="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function P(t){t&&t.c()}function I(t,n,i,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(n,i),s||T((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),a.forEach(T)}function V(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function H(t,e){-1===t.$$.dirty[0]&&(E.push(t),z||(z=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function j(e,r,i,s,c,a,d,l=[-1]){const f=b;y(e);const h=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(f?f.$$.context:[])),callbacks:n(),dirty:l,skip_bound:!1,root:r.target||f.$$.root};d&&d(h.root);let p=!1;if(h.ctx=i?i(e,r.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),p&&H(e,t)),n})):[],h.update(),p=!0,o(h.before_update),h.fragment=!!s&&s(h.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);h.fragment&&h.fragment.l(t),t.forEach(u)}else h.fragment&&h.fragment.c();r.intro&&D(e.$$.fragment),I(e,r.target,r.anchor,r.customElement),O()}y(f)}let U;"function"==typeof HTMLElement&&(U=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){V(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class q{$destroy(){V(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function W(t){d(t,"svelte-1mwhwtl",".Frame.svelte-1mwhwtl{position:absolute;width:100%;height:100%;top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));transition:width 0.1s, height 0.1s;pointer-events:none;user-select:none}")}function X(e){let n,o,r,i,s,c,d;return{c(){n=h("svg"),o=h("defs"),r=h("linearGradient"),i=h("stop"),s=h("stop"),c=h("circle"),d=h("circle"),m(i,"stop-color","var(--gradient-stop1)"),m(i,"offset","0%"),m(s,"stop-color","var(--gradient-stop2)"),m(s,"offset","100%"),m(r,"x1","50%"),m(r,"y1","0%"),m(r,"x2","50%"),m(r,"y2","100%"),m(r,"id","a"),m(c,"cx","46"),m(c,"cy","46"),m(c,"r",e[0]),m(c,"stroke","none"),m(c,"fill","var(--frame-background)"),m(d,"cx","46"),m(d,"cy","46"),m(d,"r",e[0]),m(d,"stroke","url(#a)"),m(d,"stroke-width","var(--frame-stroke-width)"),m(d,"fill","none"),m(n,"class","Frame svelte-1mwhwtl"),m(n,"viewBox","0 0 92 92"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){l(t,n,e),a(n,o),a(o,r),a(r,i),a(r,s),a(n,c),a(n,d)},p(t,[e]){1&e&&m(c,"r",t[0]),1&e&&m(d,"r",t[0])},i:t,o:t,d(t){t&&u(n)}}}function G(t,e,n){let{frameRadius:o=46}=e;return t.$$set=t=>{"frameRadius"in t&&n(0,o=t.frameRadius)},[o]}class K extends q{constructor(t){super(),j(this,t,G,X,i,{frameRadius:0},W)}}var Y,Z,J,Q,tt;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(Y||(Y={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(Z||(Z={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(J||(J={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(Q||(Q={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(tt||(tt={})),new Map([[tt.Failed,"Failed"],[tt.Disconnected,"Disconnected"],[tt.Connected,"Connected"],[tt.Active,"Active"]]);for(var et=[],nt=0;nt<256;++nt)et.push((nt+256).toString(16).substr(1));var ot,rt,it,st,ct,at,dt,lt,ut="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ft={exports:{}}; | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e}function c(t){return 0===Object.keys(t).length}function a(t,e){t.appendChild(e)}function d(t,e,n){const o=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;if(e&&e.host)return e;return t.ownerDocument}(t);if(!o.getElementById(e)){const t=f("style");t.id=e,t.textContent=n,function(t,e){a(t.head||t,e),e.sheet}(o,t)}}function l(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function h(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function p(t){return document.createTextNode(t)}function g(){return p(" ")}function $(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function x(t,e,n){t.classList[n?"add":"remove"](e)}function w(t){const e={};for(const n of t)e[n.name]=n.value;return e}let y;function b(t){y=t}function k(){if(!y)throw new Error("Function called outside component initialization");return y}const E=[],S=[],C=[],A=[],_=Promise.resolve();let z=!1;function T(t){C.push(t)}const M=new Set;let N=0;function O(){if(0!==N)return;const t=y;do{try{for(;N<E.length;){const t=E[N];N++,b(t),R(t.$$)}}catch(t){throw E.length=0,N=0,t}for(b(null),E.length=0,N=0;S.length;)S.pop()();for(let t=0;t<C.length;t+=1){const e=C[t];M.has(e)||(M.add(e),e())}C.length=0}while(E.length);for(;A.length;)A.pop()();z=!1,M.clear(),b(t)}function R(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const F=new Set;let D;function L(t,e){t&&t.i&&(F.delete(t),t.i(e))}function B(t,e,n,o){if(t&&t.o){if(F.has(t))return;F.add(t),D.c.push((()=>{F.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const P="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function I(t){t&&t.c()}function V(t,n,i,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(n,i),s||T((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),a.forEach(T)}function H(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function j(t,e){-1===t.$$.dirty[0]&&(E.push(t),z||(z=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(e,r,i,s,c,a,d,l=[-1]){const f=y;b(e);const h=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(r.context||(f?f.$$.context:[])),callbacks:n(),dirty:l,skip_bound:!1,root:r.target||f.$$.root};d&&d(h.root);let p=!1;if(h.ctx=i?i(e,r.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return h.ctx&&c(h.ctx[t],h.ctx[t]=r)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](r),p&&j(e,t)),n})):[],h.update(),p=!0,o(h.before_update),h.fragment=!!s&&s(h.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);h.fragment&&h.fragment.l(t),t.forEach(u)}else h.fragment&&h.fragment.c();r.intro&&L(e.$$.fragment),V(e,r.target,r.anchor,r.customElement),O()}b(f)}let q;"function"==typeof HTMLElement&&(q=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){H(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class W{$destroy(){H(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!c(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function X(t){d(t,"svelte-1mwhwtl",".Frame.svelte-1mwhwtl{position:absolute;width:100%;height:100%;top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));transition:width 0.1s, height 0.1s;pointer-events:none;user-select:none}")}function G(e){let n,o,r,i,s,c,d;return{c(){n=h("svg"),o=h("defs"),r=h("linearGradient"),i=h("stop"),s=h("stop"),c=h("circle"),d=h("circle"),m(i,"stop-color","var(--gradient-stop1)"),m(i,"offset","0%"),m(s,"stop-color","var(--gradient-stop2)"),m(s,"offset","100%"),m(r,"x1","50%"),m(r,"y1","0%"),m(r,"x2","50%"),m(r,"y2","100%"),m(r,"id","a"),m(c,"cx","46"),m(c,"cy","46"),m(c,"r",e[0]),m(c,"stroke","none"),m(c,"fill","var(--frame-background)"),m(d,"cx","46"),m(d,"cy","46"),m(d,"r",e[0]),m(d,"stroke","url(#a)"),m(d,"stroke-width","var(--frame-stroke-width)"),m(d,"fill","none"),m(n,"class","Frame svelte-1mwhwtl"),m(n,"viewBox","0 0 92 92"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){l(t,n,e),a(n,o),a(o,r),a(r,i),a(r,s),a(n,c),a(n,d)},p(t,[e]){1&e&&m(c,"r",t[0]),1&e&&m(d,"r",t[0])},i:t,o:t,d(t){t&&u(n)}}}function K(t,e,n){let{frameRadius:o=46}=e;return t.$$set=t=>{"frameRadius"in t&&n(0,o=t.frameRadius)},[o]}class Y extends W{constructor(t){super(),U(this,t,K,G,i,{frameRadius:0},X)}}var Z,J,Q,tt,et;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(Z||(Z={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(J||(J={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(Q||(Q={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(tt||(tt={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(et||(et={})),new Map([[et.Failed,"Failed"],[et.Disconnected,"Disconnected"],[et.Connected,"Connected"],[et.Active,"Active"]]);for(var nt=[],ot=0;ot<256;++ot)nt.push((ot+256).toString(16).substr(1));var rt,it,st,ct,at,dt,lt,ut,ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ht={exports:{}}; | ||
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ | ||
ot=ft,rt=ft.exports,function(t){var e=rt,n=ot&&ot.exports==e&&ot,o="object"==typeof ut&&ut;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",d=-1,l=t.length-c;++d<l;)e=t.charCodeAt(d)<<16,n=t.charCodeAt(++d)<<8,o=t.charCodeAt(++d),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(d)<<8,n=t.charCodeAt(++d),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(d),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",d=-1;++d<e;)o=s.indexOf(t.charAt(d)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var d in a)a.hasOwnProperty(d)&&(e[d]=a[d]);else t.base64=a}(ut),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(it||(it={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(st||(st={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(ct||(ct={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(at||(at={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(dt||(dt={})),function(t){t.None="none",t.Whirl="whirl"}(lt||(lt={}));const ht={[tt.Disconnected]:{icon:"mic",behaviour:"click",effect:"none",triggerFx:"whirl"},[tt.Connected]:{icon:"mic",behaviour:"hold",effect:"none",triggerFx:"whirl"},[tt.Active]:{icon:"micactive",behaviour:"hold",effect:"none"},[tt.Failed]:{icon:"error",behaviour:"click",effect:"none"},[Y.NoBrowserSupport]:{icon:"error",behaviour:"click",effect:"none"},[Y.NoAudioConsent]:{icon:"denied",behaviour:"click",effect:"none"}};function pt(t){d(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function gt(t){let e,n,o,r,i,s,c,d,f,g,$,v,x;return{c(){e=h("svg"),n=h("linearGradient"),o=h("animate"),r=h("animate"),i=h("stop"),s=h("stop"),c=h("stop"),d=h("stop"),f=h("stop"),g=p(">\n "),$=h("g"),v=h("path"),x=h("rect"),m(o,"attributeName","y1"),m(o,"values","-200%; 0%;"),m(o,"dur","2s"),m(o,"repeatCount","indefinite"),m(r,"attributeName","y2"),m(r,"values","200%; 400%;"),m(r,"dur","2s"),m(r,"repeatCount","indefinite"),m(i,"offset","0%"),m(i,"stop-color","var(--gradient-stop1)"),m(s,"offset","25%"),m(s,"stop-color","var(--gradient-stop2)"),m(c,"offset","50%"),m(c,"stop-color","var(--gradient-stop1)"),m(d,"offset","75%"),m(d,"stop-color","var(--gradient-stop2)"),m(f,"offset","100%"),m(f,"stop-color","var(--gradient-stop1)"),m(n,"id","gradient"),m(n,"x1","50%"),m(n,"y1","-200%"),m(n,"x2","50%"),m(n,"y2","200%"),m(v,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(x,"x","20"),m(x,"y","1"),m(x,"width","16"),m(x,"height","37"),m(x,"rx","8"),m($,"fill","url(#gradient)"),m($,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,u){l(t,e,u),a(e,n),a(n,o),a(n,r),a(n,i),a(n,s),a(n,c),a(n,d),a(n,f),a(e,g),a(e,$),a($,v),a($,x)},d(t){t&&u(e)}}}function $t(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("rect"),m(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(r,"x","20"),m(r,"y","1"),m(r,"width","16"),m(r,"height","37"),m(r,"rx","8"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function mt(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("path"),m(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(o,"fill-rule","nonzero"),m(r,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function vt(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("path"),m(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),m(r,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","nonzero"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function xt(e){let n,o,r,i,s=e[0]===ct.MicActive&>(),c=e[0]===ct.Mic&&$t(),a=e[0]===ct.Error&&mt(),d=e[0]===ct.Denied&&vt();return{c(){s&&s.c(),n=g(),c&&c.c(),o=g(),a&&a.c(),r=g(),d&&d.c(),i=p("")},m(t,e){s&&s.m(t,e),l(t,n,e),c&&c.m(t,e),l(t,o,e),a&&a.m(t,e),l(t,r,e),d&&d.m(t,e),l(t,i,e)},p(t,[e]){t[0]===ct.MicActive?s||(s=gt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===ct.Mic?c||(c=$t(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===ct.Error?a||(a=mt(),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null),t[0]===ct.Denied?d||(d=vt(),d.c(),d.m(i.parentNode,i)):d&&(d.d(1),d=null)},i:t,o:t,d(t){s&&s.d(t),t&&u(n),c&&c.d(t),t&&u(o),a&&a.d(t),t&&u(r),d&&d.d(t),t&&u(i)}}}function wt(t,e,n){let{icon:o=ct.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class bt extends q{constructor(t){super(),j(this,t,wt,xt,i,{icon:0},pt)}}function yt(t){d(t,"svelte-1fpkb0k",".Fx.svelte-1fpkb0k{position:absolute;width:var(--fx-size);height:var(--fx-size);top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));pointer-events:none;opacity:var(--fx-opacity)}")}function kt(e){let n,o,r,i,s,c,d,f;return{c(){n=h("svg"),o=h("defs"),r=h("linearGradient"),i=h("stop"),s=h("stop"),c=h("filter"),d=h("feGaussianBlur"),f=h("circle"),m(i,"stop-color","var(--fx-gradient-stop1)"),m(i,"offset","0%"),m(s,"stop-color","var(--fx-gradient-stop2)"),m(s,"offset","100%"),m(r,"x1","50%"),m(r,"y1","10%"),m(r,"x2","50%"),m(r,"y2","100%"),m(r,"id","a"),m(d,"stdDeviation","18"),m(d,"in","SourceGraphic"),m(c,"x","-35%"),m(c,"y","-35%"),m(c,"width","170%"),m(c,"height","170%"),m(c,"filterUnits","objectBoundingBox"),m(c,"id","b"),m(f,"filter","url(#b)"),m(f,"cx","124"),m(f,"cy","124"),m(f,"r","79"),m(f,"fill","url(#a)"),m(f,"fillrule","evenodd"),m(n,"class","Fx svelte-1fpkb0k"),m(n,"viewBox","0 0 246 246"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){l(t,n,e),a(n,o),a(o,r),a(r,i),a(r,s),a(o,c),a(c,d),a(n,f)},p:t,i:t,o:t,d(t){t&&u(n)}}}class Et extends q{constructor(t){super(),j(this,t,null,kt,i,{},yt)}}const{window:St}=B;function Ct(t){let e;return{c(){e=f("link"),m(e,"href",t[9]),m(e,"rel","stylesheet")},m(t,n){l(t,e,n)},p(t,n){512&n[0]&&m(e,"href",t[9])},d(t){t&&u(e)}}}function At(e){let n,r,i,s,c,d,h,p,w,b,y,k,E=void 0!==e[9]&&Ct(e);return i=new Et({}),c=new K({props:{frameRadius:e[16]}}),h=new bt({props:{icon:e[15].icon}}),{c(){E&&E.c(),n=g(),r=f("main"),P(i.$$.fragment),s=g(),P(c.$$.fragment),d=g(),P(h.$$.fragment),p=g(),w=f("slot"),this.c=t,m(r,"class","HoldableButton"),v(r,"width",e[0]),v(r,"height",e[0]),v(r,"--gradient-stop1",e[5]),v(r,"--gradient-stop2",e[6]),v(r,"--fx-gradient-stop1",e[7]||e[5]),v(r,"--fx-gradient-stop2",e[8]||e[6]),v(r,"--fx-rotation",e[11][1]+"deg"),v(r,"--fx-opacity",e[14][1]),v(r,"--fx-size",e[2]),v(r,"--icon-opacity",e[13][1]),v(r,"--icon-size",e[1]),v(r,"--icon-color",e[4]),v(r,"--frame-stroke-width",e[17]),v(r,"--frame-background",e[3]),v(r,"transform","scale("+e[12][1]+")"),x(r,"pressed",e[10])},m(t,o){E&&E.m(t,o),l(t,n,o),l(t,r,o),I(i,r,null),a(r,s),I(c,r,null),a(r,d),I(h,r,null),a(r,p),a(r,w),b=!0,y||(k=[$(St,"mouseup",e[19]),$(St,"keydown",e[20]),$(St,"keyup",e[21]),$(r,"mousedown",e[18]),$(r,"touchstart",e[18]),$(r,"dragstart",e[18]),$(r,"mouseup",e[19]),$(r,"touchend",e[19],{passive:!0}),$(r,"dragend",e[19])],y=!0)},p(t,e){void 0!==t[9]?E?E.p(t,e):(E=Ct(t),E.c(),E.m(n.parentNode,n)):E&&(E.d(1),E=null);const o={};65536&e[0]&&(o.frameRadius=t[16]),c.$set(o);const i={};32768&e[0]&&(i.icon=t[15].icon),h.$set(i),(!b||1&e[0])&&v(r,"width",t[0]),(!b||1&e[0])&&v(r,"height",t[0]),(!b||32&e[0])&&v(r,"--gradient-stop1",t[5]),(!b||64&e[0])&&v(r,"--gradient-stop2",t[6]),(!b||160&e[0])&&v(r,"--fx-gradient-stop1",t[7]||t[5]),(!b||320&e[0])&&v(r,"--fx-gradient-stop2",t[8]||t[6]),(!b||2048&e[0])&&v(r,"--fx-rotation",t[11][1]+"deg"),(!b||16384&e[0])&&v(r,"--fx-opacity",t[14][1]),(!b||4&e[0])&&v(r,"--fx-size",t[2]),(!b||8192&e[0])&&v(r,"--icon-opacity",t[13][1]),(!b||2&e[0])&&v(r,"--icon-size",t[1]),(!b||16&e[0])&&v(r,"--icon-color",t[4]),(!b||131072&e[0])&&v(r,"--frame-stroke-width",t[17]),(!b||8&e[0])&&v(r,"--frame-background",t[3]),(!b||4096&e[0])&&v(r,"transform","scale("+t[12][1]+")"),(!b||1024&e[0])&&x(r,"pressed",t[10])},i(t){b||(D(i.$$.fragment,t),D(c.$$.fragment,t),D(h.$$.fragment,t),b=!0)},o(t){L(i.$$.fragment,t),L(c.$$.fragment,t),L(h.$$.fragment,t),b=!1},d(t){E&&E.d(t),t&&u(n),t&&u(r),V(i),V(c),V(h),y=!1,o(k)}}}function _t(t,e,n){let o,r,i,s,{icon:c=tt.Disconnected}=e,{capturekey:a=" "}=e,{hide:d}=e,{size:l="80px"}=e,{holdscale:u="1.35"}=e,{borderscale:f="0.075"}=e,{iconsize:h="60%"}=e,{fxsize:p="250%"}=e,{backgroundcolor:g="#ffffff"}=e,{iconcolor:$="#000000"}=e,{gradientstop1:m="#15e8b5"}=e,{gradientstop2:v="#4fa1f9"}=e,{fxgradientstop1:x}=e,{fxgradientstop2:w}=e,{customcssurl:b}=e;let y=!1,E=0,S=[0,0],C=[0,0],A=[1,1],_=[0,0],z=ht[c],T=null,M=0,N=0;const O=k(),R=(t,e)=>{O.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};var F;F=()=>{n(12,C=[1,0]);let t=null;const e=()=>{M=N,N=(new Date).getTime();const r=N-(M||N);z.effect===dt.Connecting&&n(13,A[0]=.25*Math.cos(N/2500*Math.PI*2)+.25,A),z.effect===dt.Busy&&n(13,A[0]=.25*Math.cos(N/1e3*Math.PI*2)+.25,A),n(12,C=[C[0],B(C[1],o?C[0]:0,.2,r)]),n(13,A=[A[0],B(A[1],A[0],.08,r)]),n(14,_=[_[0],B(_[1],_[0],.08,r)]),n(11,S=[S[0]+2.5,B(S[1],S[0],.05,r)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)},k().$$.on_mount.push(F);const D=t=>{t.preventDefault(),t.stopPropagation(),o&&!y&&(n(10,y=!0),E=Date.now(),P(),z.triggerFx===lt.Whirl&&n(11,S[0]+=720,S),z.behaviour===at.Click&&null===T&&(T=window.setTimeout((()=>{n(14,_[0]=0,_),T=null}),500)),O.onholdstart&&O.onholdstart(),R(st.holdstart))},L=()=>{if(y){n(10,y=!1);const t={timeMs:Date.now()-E};P(),null!==T&&window.clearTimeout(T),O.onholdend&&O.onholdend(t),R("holdend",t)}},B=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,P=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(22,c=t.icon),"capturekey"in t&&n(23,a=t.capturekey),"hide"in t&&n(24,d=t.hide),"size"in t&&n(0,l=t.size),"holdscale"in t&&n(25,u=t.holdscale),"borderscale"in t&&n(26,f=t.borderscale),"iconsize"in t&&n(1,h=t.iconsize),"fxsize"in t&&n(2,p=t.fxsize),"backgroundcolor"in t&&n(3,g=t.backgroundcolor),"iconcolor"in t&&n(4,$=t.iconcolor),"gradientstop1"in t&&n(5,m=t.gradientstop1),"gradientstop2"in t&&n(6,v=t.gradientstop2),"fxgradientstop1"in t&&n(7,x=t.fxgradientstop1),"fxgradientstop2"in t&&n(8,w=t.fxgradientstop2),"customcssurl"in t&&n(9,b=t.customcssurl)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&(o=void 0===d||"false"===d),67108864&t.$$.dirty[0]&&n(17,r=""+46*f),67108864&t.$$.dirty[0]&&n(16,i=46-23*f),33554432&t.$$.dirty[0]&&(s=u),4195328&t.$$.dirty[0]&&((t,e)=>{switch(n(15,z=ht[e]),n(12,C[0]=t?s:1,C),n(14,_[0]=t||e==tt.Active?1:0,_),z.icon){case ct.MicActive:case ct.Mic:case ct.Denied:case ct.Error:n(13,A[0]=1,A)}})(y,c)},[l,h,p,g,$,m,v,x,w,b,y,S,C,A,_,z,i,r,D,L,t=>{a&&(t.key===a&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):D(t))))},t=>{t.key===a&&L()},c,a,d,u,f,()=>y]}class zt extends U{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{text-align:left;position:relative;pointer-events:auto;cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none !important;-webkit-user-select:none !important}</style>",j(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},_t,At,s,{icon:22,capturekey:23,hide:24,size:0,holdscale:25,borderscale:26,iconsize:1,fxsize:2,backgroundcolor:3,iconcolor:4,gradientstop1:5,gradientstop2:6,fxgradientstop1:7,fxgradientstop2:8,customcssurl:9,isbuttonpressed:27},null,[-1,-1]),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["icon","capturekey","hide","size","holdscale","borderscale","iconsize","fxsize","backgroundcolor","iconcolor","gradientstop1","gradientstop2","fxgradientstop1","fxgradientstop2","customcssurl","isbuttonpressed"]}get icon(){return this.$$.ctx[22]}set icon(t){this.$$set({icon:t}),O()}get capturekey(){return this.$$.ctx[23]}set capturekey(t){this.$$set({capturekey:t}),O()}get hide(){return this.$$.ctx[24]}set hide(t){this.$$set({hide:t}),O()}get size(){return this.$$.ctx[0]}set size(t){this.$$set({size:t}),O()}get holdscale(){return this.$$.ctx[25]}set holdscale(t){this.$$set({holdscale:t}),O()}get borderscale(){return this.$$.ctx[26]}set borderscale(t){this.$$set({borderscale:t}),O()}get iconsize(){return this.$$.ctx[1]}set iconsize(t){this.$$set({iconsize:t}),O()}get fxsize(){return this.$$.ctx[2]}set fxsize(t){this.$$set({fxsize:t}),O()}get backgroundcolor(){return this.$$.ctx[3]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),O()}get iconcolor(){return this.$$.ctx[4]}set iconcolor(t){this.$$set({iconcolor:t}),O()}get gradientstop1(){return this.$$.ctx[5]}set gradientstop1(t){this.$$set({gradientstop1:t}),O()}get gradientstop2(){return this.$$.ctx[6]}set gradientstop2(t){this.$$set({gradientstop2:t}),O()}get fxgradientstop1(){return this.$$.ctx[7]}set fxgradientstop1(t){this.$$set({fxgradientstop1:t}),O()}get fxgradientstop2(){return this.$$.ctx[8]}set fxgradientstop2(t){this.$$set({fxgradientstop2:t}),O()}get customcssurl(){return this.$$.ctx[9]}set customcssurl(t){this.$$set({customcssurl:t}),O()}get isbuttonpressed(){return this.$$.ctx[27]}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",zt)})); | ||
rt=ht,it=ht.exports,function(t){var e=it,n=rt&&rt.exports==e&&rt,o="object"==typeof ft&&ft;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",d=-1,l=t.length-c;++d<l;)e=t.charCodeAt(d)<<16,n=t.charCodeAt(++d)<<8,o=t.charCodeAt(++d),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(d)<<8,n=t.charCodeAt(++d),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(d),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",d=-1;++d<e;)o=s.indexOf(t.charAt(d)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var d in a)a.hasOwnProperty(d)&&(e[d]=a[d]);else t.base64=a}(ft),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(st||(st={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(ct||(ct={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(at||(at={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(dt||(dt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(lt||(lt={})),function(t){t.None="none",t.Whirl="whirl"}(ut||(ut={}));const pt={[et.Disconnected]:{icon:"mic",behaviour:"click",effect:"none",triggerFx:"whirl"},[et.Connected]:{icon:"mic",behaviour:"hold",effect:"none",triggerFx:"whirl"},[et.Active]:{icon:"micactive",behaviour:"hold",effect:"none"},[et.Failed]:{icon:"error",behaviour:"click",effect:"none"},[Z.NoBrowserSupport]:{icon:"error",behaviour:"click",effect:"none"},[Z.NoAudioConsent]:{icon:"denied",behaviour:"click",effect:"none"}};function gt(t){d(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function $t(t){let e,n,o,r,i,s,c,d,f,g,$,v,x;return{c(){e=h("svg"),n=h("linearGradient"),o=h("animate"),r=h("animate"),i=h("stop"),s=h("stop"),c=h("stop"),d=h("stop"),f=h("stop"),g=p(">\n "),$=h("g"),v=h("path"),x=h("rect"),m(o,"attributeName","y1"),m(o,"values","-200%; 0%;"),m(o,"dur","2s"),m(o,"repeatCount","indefinite"),m(r,"attributeName","y2"),m(r,"values","200%; 400%;"),m(r,"dur","2s"),m(r,"repeatCount","indefinite"),m(i,"offset","0%"),m(i,"stop-color","var(--gradient-stop1)"),m(s,"offset","25%"),m(s,"stop-color","var(--gradient-stop2)"),m(c,"offset","50%"),m(c,"stop-color","var(--gradient-stop1)"),m(d,"offset","75%"),m(d,"stop-color","var(--gradient-stop2)"),m(f,"offset","100%"),m(f,"stop-color","var(--gradient-stop1)"),m(n,"id","gradient"),m(n,"x1","50%"),m(n,"y1","-200%"),m(n,"x2","50%"),m(n,"y2","200%"),m(v,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(x,"x","20"),m(x,"y","1"),m(x,"width","16"),m(x,"height","37"),m(x,"rx","8"),m($,"fill","url(#gradient)"),m($,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,u){l(t,e,u),a(e,n),a(n,o),a(n,r),a(n,i),a(n,s),a(n,c),a(n,d),a(n,f),a(e,g),a(e,$),a($,v),a($,x)},d(t){t&&u(e)}}}function mt(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("rect"),m(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(r,"x","20"),m(r,"y","1"),m(r,"width","16"),m(r,"height","37"),m(r,"rx","8"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function vt(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("path"),m(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(o,"fill-rule","nonzero"),m(r,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","evenodd"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function xt(t){let e,n,o,r;return{c(){e=h("svg"),n=h("g"),o=h("path"),r=h("path"),m(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),m(r,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),m(n,"fill","var(--icon-color)"),m(n,"fill-rule","nonzero"),m(e,"class","Icon svelte-s2u2hd"),m(e,"viewBox","0 0 56 56"),m(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){l(t,e,i),a(e,n),a(n,o),a(n,r)},d(t){t&&u(e)}}}function wt(e){let n,o,r,i,s=e[0]===at.MicActive&&$t(),c=e[0]===at.Mic&&mt(),a=e[0]===at.Error&&vt(),d=e[0]===at.Denied&&xt();return{c(){s&&s.c(),n=g(),c&&c.c(),o=g(),a&&a.c(),r=g(),d&&d.c(),i=p("")},m(t,e){s&&s.m(t,e),l(t,n,e),c&&c.m(t,e),l(t,o,e),a&&a.m(t,e),l(t,r,e),d&&d.m(t,e),l(t,i,e)},p(t,[e]){t[0]===at.MicActive?s||(s=$t(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===at.Mic?c||(c=mt(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===at.Error?a||(a=vt(),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null),t[0]===at.Denied?d||(d=xt(),d.c(),d.m(i.parentNode,i)):d&&(d.d(1),d=null)},i:t,o:t,d(t){s&&s.d(t),t&&u(n),c&&c.d(t),t&&u(o),a&&a.d(t),t&&u(r),d&&d.d(t),t&&u(i)}}}function yt(t,e,n){let{icon:o=at.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]}class bt extends W{constructor(t){super(),U(this,t,yt,wt,i,{icon:0},gt)}}function kt(t){d(t,"svelte-1fpkb0k",".Fx.svelte-1fpkb0k{position:absolute;width:var(--fx-size);height:var(--fx-size);top:50%;left:50%;transform-origin:50% 50%;transform:translate(-50%, -50%) rotate(var(--fx-rotation));pointer-events:none;opacity:var(--fx-opacity)}")}function Et(e){let n,o,r,i,s,c,d,f;return{c(){n=h("svg"),o=h("defs"),r=h("linearGradient"),i=h("stop"),s=h("stop"),c=h("filter"),d=h("feGaussianBlur"),f=h("circle"),m(i,"stop-color","var(--fx-gradient-stop1)"),m(i,"offset","0%"),m(s,"stop-color","var(--fx-gradient-stop2)"),m(s,"offset","100%"),m(r,"x1","50%"),m(r,"y1","10%"),m(r,"x2","50%"),m(r,"y2","100%"),m(r,"id","a"),m(d,"stdDeviation","18"),m(d,"in","SourceGraphic"),m(c,"x","-35%"),m(c,"y","-35%"),m(c,"width","170%"),m(c,"height","170%"),m(c,"filterUnits","objectBoundingBox"),m(c,"id","b"),m(f,"filter","url(#b)"),m(f,"cx","124"),m(f,"cy","124"),m(f,"r","79"),m(f,"fill","url(#a)"),m(f,"fillrule","evenodd"),m(n,"class","Fx svelte-1fpkb0k"),m(n,"viewBox","0 0 246 246"),m(n,"xmlns","http://www.w3.org/2000/svg")},m(t,e){l(t,n,e),a(n,o),a(o,r),a(r,i),a(r,s),a(o,c),a(c,d),a(n,f)},p:t,i:t,o:t,d(t){t&&u(n)}}}class St extends W{constructor(t){super(),U(this,t,null,Et,i,{},kt)}}const{window:Ct}=P;function At(t){let e;return{c(){e=f("link"),m(e,"href",t[9]),m(e,"rel","stylesheet")},m(t,n){l(t,e,n)},p(t,n){512&n[0]&&m(e,"href",t[9])},d(t){t&&u(e)}}}function _t(e){let n,r,i,s,c,d,h,p,w,y,b,k,E=void 0!==e[9]&&At(e);return i=new St({}),c=new Y({props:{frameRadius:e[16]}}),h=new bt({props:{icon:e[15].icon}}),{c(){E&&E.c(),n=g(),r=f("main"),I(i.$$.fragment),s=g(),I(c.$$.fragment),d=g(),I(h.$$.fragment),p=g(),w=f("slot"),this.c=t,m(r,"class","HoldableButton"),v(r,"width",e[0]),v(r,"height",e[0]),v(r,"--gradient-stop1",e[5]),v(r,"--gradient-stop2",e[6]),v(r,"--fx-gradient-stop1",e[7]||e[5]),v(r,"--fx-gradient-stop2",e[8]||e[6]),v(r,"--fx-rotation",e[11][1]+"deg"),v(r,"--fx-opacity",e[14][1]),v(r,"--fx-size",e[2]),v(r,"--icon-opacity",e[13][1]),v(r,"--icon-size",e[1]),v(r,"--icon-color",e[4]),v(r,"--frame-stroke-width",e[17]),v(r,"--frame-background",e[3]),v(r,"transform","scale("+e[12][1]+")"),x(r,"pressed",e[10])},m(t,o){E&&E.m(t,o),l(t,n,o),l(t,r,o),V(i,r,null),a(r,s),V(c,r,null),a(r,d),V(h,r,null),a(r,p),a(r,w),y=!0,b||(k=[$(Ct,"mouseup",e[19]),$(Ct,"keydown",e[20]),$(Ct,"keyup",e[21]),$(r,"mousedown",e[18]),$(r,"touchstart",e[18]),$(r,"dragstart",e[18]),$(r,"mouseup",e[19]),$(r,"touchend",e[19],{passive:!0}),$(r,"dragend",e[19])],b=!0)},p(t,e){void 0!==t[9]?E?E.p(t,e):(E=At(t),E.c(),E.m(n.parentNode,n)):E&&(E.d(1),E=null);const o={};65536&e[0]&&(o.frameRadius=t[16]),c.$set(o);const i={};32768&e[0]&&(i.icon=t[15].icon),h.$set(i),(!y||1&e[0])&&v(r,"width",t[0]),(!y||1&e[0])&&v(r,"height",t[0]),(!y||32&e[0])&&v(r,"--gradient-stop1",t[5]),(!y||64&e[0])&&v(r,"--gradient-stop2",t[6]),(!y||160&e[0])&&v(r,"--fx-gradient-stop1",t[7]||t[5]),(!y||320&e[0])&&v(r,"--fx-gradient-stop2",t[8]||t[6]),(!y||2048&e[0])&&v(r,"--fx-rotation",t[11][1]+"deg"),(!y||16384&e[0])&&v(r,"--fx-opacity",t[14][1]),(!y||4&e[0])&&v(r,"--fx-size",t[2]),(!y||8192&e[0])&&v(r,"--icon-opacity",t[13][1]),(!y||2&e[0])&&v(r,"--icon-size",t[1]),(!y||16&e[0])&&v(r,"--icon-color",t[4]),(!y||131072&e[0])&&v(r,"--frame-stroke-width",t[17]),(!y||8&e[0])&&v(r,"--frame-background",t[3]),(!y||4096&e[0])&&v(r,"transform","scale("+t[12][1]+")"),(!y||1024&e[0])&&x(r,"pressed",t[10])},i(t){y||(L(i.$$.fragment,t),L(c.$$.fragment,t),L(h.$$.fragment,t),y=!0)},o(t){B(i.$$.fragment,t),B(c.$$.fragment,t),B(h.$$.fragment,t),y=!1},d(t){E&&E.d(t),t&&u(n),t&&u(r),H(i),H(c),H(h),b=!1,o(k)}}}function zt(t,e,n){let o,r,i,s,{icon:c=et.Disconnected}=e,{capturekey:a=" "}=e,{hide:d}=e,{size:l="80px"}=e,{holdscale:u="1.35"}=e,{borderscale:f="0.075"}=e,{iconsize:h="60%"}=e,{fxsize:p="250%"}=e,{backgroundcolor:g="#ffffff"}=e,{iconcolor:$="#000000"}=e,{gradientstop1:m="#15e8b5"}=e,{gradientstop2:v="#4fa1f9"}=e,{fxgradientstop1:x}=e,{fxgradientstop2:w}=e,{customcssurl:y}=e;let b=!1,E=0,S=[0,0],C=[0,0],A=[1,1],_=[0,0],z=pt[c],T=null,M=0,N=0;const O=k(),R=(t,e)=>{O.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))};var F;F=()=>{n(12,C=[1,0]);let t=null;const e=()=>{M=N,N=(new Date).getTime();const r=N-(M||N);z.effect===lt.Connecting&&n(13,A[0]=.25*Math.cos(N/2500*Math.PI*2)+.25,A),z.effect===lt.Busy&&n(13,A[0]=.25*Math.cos(N/1e3*Math.PI*2)+.25,A),n(12,C=[C[0],B(C[1],o?C[0]:0,.2,r)]),n(13,A=[A[0],B(A[1],A[0],.08,r)]),n(14,_=[_[0],B(_[1],_[0],.08,r)]),n(11,S=[S[0]+2.5,B(S[1],S[0],.05,r)]),t=requestAnimationFrame(e)};return e(),()=>cancelAnimationFrame(t)},k().$$.on_mount.push(F);const D=t=>{t.preventDefault(),t.stopPropagation(),o&&!b&&(n(10,b=!0),E=Date.now(),P(),z.triggerFx===ut.Whirl&&n(11,S[0]+=720,S),z.behaviour===dt.Click&&null===T&&(T=window.setTimeout((()=>{n(14,_[0]=0,_),T=null}),500)),O.onholdstart&&O.onholdstart(),R(ct.holdstart))},L=()=>{if(b){n(10,b=!1);const t={timeMs:Date.now()-E};P(),null!==T&&window.clearTimeout(T),O.onholdend&&O.onholdend(t),R("holdend",t)}},B=(t,e,n,o)=>t*(1-(n=Math.pow(n,1e3/60/o)))+e*n,P=(t=5)=>{void 0!==navigator.vibrate&&navigator.vibrate(t)};return t.$$set=t=>{"icon"in t&&n(22,c=t.icon),"capturekey"in t&&n(23,a=t.capturekey),"hide"in t&&n(24,d=t.hide),"size"in t&&n(0,l=t.size),"holdscale"in t&&n(25,u=t.holdscale),"borderscale"in t&&n(26,f=t.borderscale),"iconsize"in t&&n(1,h=t.iconsize),"fxsize"in t&&n(2,p=t.fxsize),"backgroundcolor"in t&&n(3,g=t.backgroundcolor),"iconcolor"in t&&n(4,$=t.iconcolor),"gradientstop1"in t&&n(5,m=t.gradientstop1),"gradientstop2"in t&&n(6,v=t.gradientstop2),"fxgradientstop1"in t&&n(7,x=t.fxgradientstop1),"fxgradientstop2"in t&&n(8,w=t.fxgradientstop2),"customcssurl"in t&&n(9,y=t.customcssurl)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&(o=void 0===d||"false"===d),67108864&t.$$.dirty[0]&&n(17,r=""+46*f),67108864&t.$$.dirty[0]&&n(16,i=46-23*f),33554432&t.$$.dirty[0]&&(s=u),4195328&t.$$.dirty[0]&&((t,e)=>{switch(n(15,z=pt[e]),n(12,C[0]=t?s:1,C),n(14,_[0]=t||e==et.Active?1:0,_),z.icon){case at.MicActive:case at.Mic:case at.Denied:case at.Error:n(13,A[0]=1,A)}})(b,c)},[l,h,p,g,$,m,v,x,w,y,b,S,C,A,_,z,i,r,D,L,t=>{a&&(t.key===a&&(document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null||(t.repeat?(t.preventDefault(),t.stopPropagation()):D(t))))},t=>{t.key===a&&L()},c,a,d,u,f,()=>b]}class Tt extends q{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{text-align:left;position:relative;pointer-events:auto;cursor:pointer;border-radius:50%;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none !important;-webkit-user-select:none !important}</style>",U(this,{target:this.shadowRoot,props:w(this.attributes),customElement:!0},zt,_t,s,{icon:22,capturekey:23,hide:24,size:0,holdscale:25,borderscale:26,iconsize:1,fxsize:2,backgroundcolor:3,iconcolor:4,gradientstop1:5,gradientstop2:6,fxgradientstop1:7,fxgradientstop2:8,customcssurl:9,isbuttonpressed:27},null,[-1,-1]),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["icon","capturekey","hide","size","holdscale","borderscale","iconsize","fxsize","backgroundcolor","iconcolor","gradientstop1","gradientstop2","fxgradientstop1","fxgradientstop2","customcssurl","isbuttonpressed"]}get icon(){return this.$$.ctx[22]}set icon(t){this.$$set({icon:t}),O()}get capturekey(){return this.$$.ctx[23]}set capturekey(t){this.$$set({capturekey:t}),O()}get hide(){return this.$$.ctx[24]}set hide(t){this.$$set({hide:t}),O()}get size(){return this.$$.ctx[0]}set size(t){this.$$set({size:t}),O()}get holdscale(){return this.$$.ctx[25]}set holdscale(t){this.$$set({holdscale:t}),O()}get borderscale(){return this.$$.ctx[26]}set borderscale(t){this.$$set({borderscale:t}),O()}get iconsize(){return this.$$.ctx[1]}set iconsize(t){this.$$set({iconsize:t}),O()}get fxsize(){return this.$$.ctx[2]}set fxsize(t){this.$$set({fxsize:t}),O()}get backgroundcolor(){return this.$$.ctx[3]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),O()}get iconcolor(){return this.$$.ctx[4]}set iconcolor(t){this.$$set({iconcolor:t}),O()}get gradientstop1(){return this.$$.ctx[5]}set gradientstop1(t){this.$$set({gradientstop1:t}),O()}get gradientstop2(){return this.$$.ctx[6]}set gradientstop2(t){this.$$set({gradientstop2:t}),O()}get fxgradientstop1(){return this.$$.ctx[7]}set fxgradientstop1(t){this.$$set({fxgradientstop1:t}),O()}get fxgradientstop2(){return this.$$.ctx[8]}set fxgradientstop2(t){this.$$set({fxgradientstop2:t}),O()}get customcssurl(){return this.$$.ctx[9]}set customcssurl(t){this.$$set({customcssurl:t}),O()}get isbuttonpressed(){return this.$$.ctx[27]}}customElements.get("holdable-button")?console.warn("Skipping re-defining customElement holdable-button"):customElements.define("holdable-button",Tt)})); | ||
//# sourceMappingURL=holdable-button.js.map |
@@ -1,4 +0,4 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e}function a(t){return 0===Object.keys(t).length}const l="undefined"!=typeof window;let u=l?()=>window.performance.now():()=>Date.now(),d=l?t=>requestAnimationFrame(t):t;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&d(h)}function f(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t){const e=b("style");return y(m(t),e),e.sheet}function y(t,e){return f(t.head||t,e),e.sheet}function v(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function b(t){return document.createElement(t)}function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(t){return document.createTextNode(t)}function C(){return x(" ")}function S(){return x("")}function E(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function T(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function A(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function _(t,e,n){t.classList[n?"add":"remove"](e)}function k(t){const e={};for(const n of t)e[n.name]=n.value;return e}const z=new Map;let N,O=0;function M(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${c}`,p=m(t),{stylesheet:h,rules:f}=z.get(p)||function(t,e){const n={stylesheet:g(e),rules:{}};return z.set(t,n),n}(p,t);f[d]||(f[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const y=t.style.animation||"";return t.style.animation=`${y?`${y}, `:""}${d} ${o}ms linear ${r}ms 1 both`,O+=1,d}function L(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),O-=r,O||d((()=>{O||(z.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&w(e)})),z.clear())})))}function P(t){N=t}function R(){if(!N)throw new Error("Function called outside component initialization");return N}const D=[],B=[],F=[],I=[],H=Promise.resolve();let V=!1;function j(t){F.push(t)}const q=new Set;let U,X=0;function W(){const t=N;do{for(;X<D.length;){const t=D[X];X++,P(t),K(t.$$)}for(P(null),D.length=0,X=0;B.length;)B.pop()();for(let t=0;t<F.length;t+=1){const e=F[t];q.has(e)||(q.add(e),e())}F.length=0}while(D.length);for(;I.length;)I.pop()();V=!1,q.clear(),P(t)}function K(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(j)}}function Y(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const G=new Set;let Z;function J(){Z={r:0,c:[],p:Z}}function Q(){Z.r||r(Z.c),Z=Z.p}function tt(t,e){t&&t.i&&(G.delete(t),t.i(e))}function et(t,e,n,o){if(t&&t.o){if(G.has(t))return;G.add(t),Z.c.push((()=>{G.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const nt={duration:0};function ot(n,o,s,c){let a=o(n,s),l=c?0:1,f=null,m=null,g=null;function y(){g&&L(n,g)}function v(t,e){const n=t.b-l;return e*=Math.abs(n),{a:l,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(o){const{delay:i=0,duration:s=300,easing:c=e,tick:w=t,css:b}=a||nt,$={start:u()+i,b:o};o||($.group=Z,Z.r+=1),f||m?m=$:(b&&(y(),g=M(n,l,o,s,i,c,b)),o&&w(0,1),f=v($,s),j((()=>Y(n,o,"start"))),function(t){let e;0===p.size&&d(h),new Promise((n=>{p.add(e={c:t,f:n})}))}((t=>{if(m&&t>m.start&&(f=v(m,s),m=null,Y(n,f.b,"start"),b&&(y(),g=M(n,l,f.b,f.duration,0,c,a.css))),f)if(t>=f.end)w(l=f.b,1-l),Y(n,f.b,"end"),m||(f.b?y():--f.group.r||r(f.group.c)),f=null;else if(t>=f.start){const e=t-f.start;l=f.a+f.d*c(e/f.duration),w(l,1-l)}return!(!f&&!m)})))}return{run(t){i(a)?(U||(U=Promise.resolve(),U.then((()=>{U=null}))),U).then((()=>{a=a(),w(t)})):w(t)},end(){y(),f=m=null}}}const rt="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function it(t,e,o,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,o),s||j((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),a.forEach(j)}function st(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ct(t,e){-1===t.$$.dirty[0]&&(D.push(t),V||(V=!0,H.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function at(e,n,i,s,c,a,l,u=[-1]){const d=N;P(e);const p=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:o(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};l&&l(p.root);let h=!1;if(p.ctx=i?i(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&c(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),h&&ct(e,t)),n})):[],p.update(),h=!0,r(p.before_update),p.fragment=!!s&&s(p.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);p.fragment&&p.fragment.l(t),t.forEach(w)}else p.fragment&&p.fragment.c();n.intro&&tt(e.$$.fragment),it(e,n.target,n.anchor,n.customElement),W()}P(d)}let lt;"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){st(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class ut{$destroy(){st(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function dt(t,{delay:n=0,duration:o=400,easing:r=e}={}){const i=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:r,css:t=>"opacity: "+t*i}}var pt,ht,ft,mt,gt;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(pt||(pt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ht||(ht={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(ft||(ft={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(mt||(mt={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(gt||(gt={})),new Map([[gt.Failed,"Failed"],[gt.Disconnected,"Disconnected"],[gt.Connected,"Connected"],[gt.Active,"Active"]]);for(var yt=[],vt=0;vt<256;++vt)yt.push((vt+256).toString(16).substr(1));var wt,bt,$t,xt,Ct,St,Et,Tt,At="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_t={exports:{}};function kt(t){!function(t,e,n){const o=m(t);if(!o.getElementById(e)){const t=b("style");t.id=e,t.textContent=n,y(o,t)}}(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function zt(t){let e,n,o,r,i,s,c,a,l,u,d,p,h;return{c(){e=$("svg"),n=$("linearGradient"),o=$("animate"),r=$("animate"),i=$("stop"),s=$("stop"),c=$("stop"),a=$("stop"),l=$("stop"),u=x(">\n "),d=$("g"),p=$("path"),h=$("rect"),T(o,"attributeName","y1"),T(o,"values","-200%; 0%;"),T(o,"dur","2s"),T(o,"repeatCount","indefinite"),T(r,"attributeName","y2"),T(r,"values","200%; 400%;"),T(r,"dur","2s"),T(r,"repeatCount","indefinite"),T(i,"offset","0%"),T(i,"stop-color","var(--gradient-stop1)"),T(s,"offset","25%"),T(s,"stop-color","var(--gradient-stop2)"),T(c,"offset","50%"),T(c,"stop-color","var(--gradient-stop1)"),T(a,"offset","75%"),T(a,"stop-color","var(--gradient-stop2)"),T(l,"offset","100%"),T(l,"stop-color","var(--gradient-stop1)"),T(n,"id","gradient"),T(n,"x1","50%"),T(n,"y1","-200%"),T(n,"x2","50%"),T(n,"y2","200%"),T(p,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(h,"x","20"),T(h,"y","1"),T(h,"width","16"),T(h,"height","37"),T(h,"rx","8"),T(d,"fill","url(#gradient)"),T(d,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,m){v(t,e,m),f(e,n),f(n,o),f(n,r),f(n,i),f(n,s),f(n,c),f(n,a),f(n,l),f(e,u),f(e,d),f(d,p),f(d,h)},d(t){t&&w(e)}}}function Nt(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("rect"),T(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(r,"x","20"),T(r,"y","1"),T(r,"width","16"),T(r,"height","37"),T(r,"rx","8"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){v(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&w(e)}}}function Ot(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("path"),T(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(o,"fill-rule","nonzero"),T(r,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){v(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&w(e)}}}function Mt(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("path"),T(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),T(r,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","nonzero"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){v(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&w(e)}}}function Lt(e){let n,o,r,i,s=e[0]===Ct.MicActive&&zt(),c=e[0]===Ct.Mic&&Nt(),a=e[0]===Ct.Error&&Ot(),l=e[0]===Ct.Denied&&Mt();return{c(){s&&s.c(),n=C(),c&&c.c(),o=C(),a&&a.c(),r=C(),l&&l.c(),i=S()},m(t,e){s&&s.m(t,e),v(t,n,e),c&&c.m(t,e),v(t,o,e),a&&a.m(t,e),v(t,r,e),l&&l.m(t,e),v(t,i,e)},p(t,[e]){t[0]===Ct.MicActive?s||(s=zt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===Ct.Mic?c||(c=Nt(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===Ct.Error?a||(a=Ot(),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null),t[0]===Ct.Denied?l||(l=Mt(),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null)},i:t,o:t,d(t){s&&s.d(t),t&&w(n),c&&c.d(t),t&&w(o),a&&a.d(t),t&&w(r),l&&l.d(t),t&&w(i)}}}function Pt(t,e,n){let{icon:o=Ct.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]} | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e}function a(t){return 0===Object.keys(t).length}const l="undefined"!=typeof window;let u=l?()=>window.performance.now():()=>Date.now(),d=l?t=>requestAnimationFrame(t):t;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&d(h)}function f(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t){const e=v("style");return y(m(t),e),e.sheet}function y(t,e){return f(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function b(t){t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function $(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(t){return document.createTextNode(t)}function C(){return x(" ")}function S(){return x("")}function E(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function T(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function A(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function _(t,e,n){t.classList[n?"add":"remove"](e)}function k(t){const e={};for(const n of t)e[n.name]=n.value;return e}const z=new Map;let N,O=0;function M(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${c}`,p=m(t),{stylesheet:h,rules:f}=z.get(p)||function(t,e){const n={stylesheet:g(e),rules:{}};return z.set(t,n),n}(p,t);f[d]||(f[d]=!0,h.insertRule(`@keyframes ${d} ${u}`,h.cssRules.length));const y=t.style.animation||"";return t.style.animation=`${y?`${y}, `:""}${d} ${o}ms linear ${r}ms 1 both`,O+=1,d}function L(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),O-=r,O||d((()=>{O||(z.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&b(e)})),z.clear())})))}function P(t){N=t}function R(){if(!N)throw new Error("Function called outside component initialization");return N}const D=[],B=[],F=[],I=[],H=Promise.resolve();let V=!1;function j(t){F.push(t)}const q=new Set;let U,X=0;function W(){if(0!==X)return;const t=N;do{try{for(;X<D.length;){const t=D[X];X++,P(t),K(t.$$)}}catch(t){throw D.length=0,X=0,t}for(P(null),D.length=0,X=0;B.length;)B.pop()();for(let t=0;t<F.length;t+=1){const e=F[t];q.has(e)||(q.add(e),e())}F.length=0}while(D.length);for(;I.length;)I.pop()();V=!1,q.clear(),P(t)}function K(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(j)}}function Y(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const G=new Set;let Z;function J(){Z={r:0,c:[],p:Z}}function Q(){Z.r||r(Z.c),Z=Z.p}function tt(t,e){t&&t.i&&(G.delete(t),t.i(e))}function et(t,e,n,o){if(t&&t.o){if(G.has(t))return;G.add(t),Z.c.push((()=>{G.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const nt={duration:0};function ot(n,o,s,c){const a={direction:"both"};let l=o(n,s,a),f=c?0:1,m=null,g=null,y=null;function w(){y&&L(n,y)}function b(t,e){const n=t.b-f;return e*=Math.abs(n),{a:f,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function v(o){const{delay:i=0,duration:s=300,easing:c=e,tick:a=t,css:v}=l||nt,$={start:u()+i,b:o};o||($.group=Z,Z.r+=1),m||g?g=$:(v&&(w(),y=M(n,f,o,s,i,c,v)),o&&a(0,1),m=b($,s),j((()=>Y(n,o,"start"))),function(t){let e;0===p.size&&d(h),new Promise((n=>{p.add(e={c:t,f:n})}))}((t=>{if(g&&t>g.start&&(m=b(g,s),g=null,Y(n,m.b,"start"),v&&(w(),y=M(n,f,m.b,m.duration,0,c,l.css))),m)if(t>=m.end)a(f=m.b,1-f),Y(n,m.b,"end"),g||(m.b?w():--m.group.r||r(m.group.c)),m=null;else if(t>=m.start){const e=t-m.start;f=m.a+m.d*c(e/m.duration),a(f,1-f)}return!(!m&&!g)})))}return{run(t){i(l)?(U||(U=Promise.resolve(),U.then((()=>{U=null}))),U).then((()=>{l=l(a),v(t)})):v(t)},end(){w(),m=g=null}}}const rt="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function it(t,e,o,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,o),s||j((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),a.forEach(j)}function st(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ct(t,e){-1===t.$$.dirty[0]&&(D.push(t),V||(V=!0,H.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function at(e,n,i,s,c,a,l,u=[-1]){const d=N;P(e);const p=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:o(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};l&&l(p.root);let h=!1;if(p.ctx=i?i(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&c(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),h&&ct(e,t)),n})):[],p.update(),h=!0,r(p.before_update),p.fragment=!!s&&s(p.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);p.fragment&&p.fragment.l(t),t.forEach(b)}else p.fragment&&p.fragment.c();n.intro&&tt(e.$$.fragment),it(e,n.target,n.anchor,n.customElement),W()}P(d)}let lt;"function"==typeof HTMLElement&&(lt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){st(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class ut{$destroy(){st(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function dt(t,{delay:n=0,duration:o=400,easing:r=e}={}){const i=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:r,css:t=>"opacity: "+t*i}}var pt,ht,ft,mt,gt;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(pt||(pt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ht||(ht={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(ft||(ft={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(mt||(mt={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(gt||(gt={})),new Map([[gt.Failed,"Failed"],[gt.Disconnected,"Disconnected"],[gt.Connected,"Connected"],[gt.Active,"Active"]]);for(var yt=[],wt=0;wt<256;++wt)yt.push((wt+256).toString(16).substr(1));var bt,vt,$t,xt,Ct,St,Et,Tt,At="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_t={exports:{}};function kt(t){!function(t,e,n){const o=m(t);if(!o.getElementById(e)){const t=v("style");t.id=e,t.textContent=n,y(o,t)}}(t,"svelte-s2u2hd",".Icon.svelte-s2u2hd{position:absolute;width:var(--icon-size);height:var(--icon-size);top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none;transition:0.25s;opacity:var(--icon-opacity)}")}function zt(t){let e,n,o,r,i,s,c,a,l,u,d,p,h;return{c(){e=$("svg"),n=$("linearGradient"),o=$("animate"),r=$("animate"),i=$("stop"),s=$("stop"),c=$("stop"),a=$("stop"),l=$("stop"),u=x(">\n "),d=$("g"),p=$("path"),h=$("rect"),T(o,"attributeName","y1"),T(o,"values","-200%; 0%;"),T(o,"dur","2s"),T(o,"repeatCount","indefinite"),T(r,"attributeName","y2"),T(r,"values","200%; 400%;"),T(r,"dur","2s"),T(r,"repeatCount","indefinite"),T(i,"offset","0%"),T(i,"stop-color","var(--gradient-stop1)"),T(s,"offset","25%"),T(s,"stop-color","var(--gradient-stop2)"),T(c,"offset","50%"),T(c,"stop-color","var(--gradient-stop1)"),T(a,"offset","75%"),T(a,"stop-color","var(--gradient-stop2)"),T(l,"offset","100%"),T(l,"stop-color","var(--gradient-stop1)"),T(n,"id","gradient"),T(n,"x1","50%"),T(n,"y1","-200%"),T(n,"x2","50%"),T(n,"y2","200%"),T(p,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(h,"x","20"),T(h,"y","1"),T(h,"width","16"),T(h,"height","37"),T(h,"rx","8"),T(d,"fill","url(#gradient)"),T(d,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,m){w(t,e,m),f(e,n),f(n,o),f(n,r),f(n,i),f(n,s),f(n,c),f(n,a),f(n,l),f(e,u),f(e,d),f(d,p),f(d,h)},d(t){t&&b(e)}}}function Nt(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("rect"),T(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(r,"x","20"),T(r,"y","1"),T(r,"width","16"),T(r,"height","37"),T(r,"rx","8"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){w(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&b(e)}}}function Ot(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("path"),T(o,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(o,"fill-rule","nonzero"),T(r,"d","M37 13.081V31a8 8 0 11-16 0v-1.919l16-16zM26 1a8 8 0 018 8v1.319L18 26.318V9a8 8 0 018-8zM37.969 7.932l3.74-7.35 3.018 2.625zM39.654 10.608l7.531-3.359.695 3.94z"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","evenodd"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){w(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&b(e)}}}function Mt(t){let e,n,o,r;return{c(){e=$("svg"),n=$("g"),o=$("path"),r=$("path"),T(o,"d","M36 14.828V30a8 8 0 01-15.961.79l15.96-15.962zM28 1a8 8 0 018 8v.172L20 25.173V9a8 8 0 018-8z"),T(r,"d","M42 26h4v4c0 9.265-7 16.895-16 17.89V55h-4v-7.11c-8.892-.982-15.833-8.444-15.997-17.56L10 30v-4h4v4c0 7.732 6.268 14 14 14 7.628 0 13.83-6.1 13.997-13.687L42 30v-4z"),T(n,"fill","var(--icon-color)"),T(n,"fill-rule","nonzero"),T(e,"class","Icon svelte-s2u2hd"),T(e,"viewBox","0 0 56 56"),T(e,"xmlns","http://www.w3.org/2000/svg")},m(t,i){w(t,e,i),f(e,n),f(n,o),f(n,r)},d(t){t&&b(e)}}}function Lt(e){let n,o,r,i,s=e[0]===Ct.MicActive&&zt(),c=e[0]===Ct.Mic&&Nt(),a=e[0]===Ct.Error&&Ot(),l=e[0]===Ct.Denied&&Mt();return{c(){s&&s.c(),n=C(),c&&c.c(),o=C(),a&&a.c(),r=C(),l&&l.c(),i=S()},m(t,e){s&&s.m(t,e),w(t,n,e),c&&c.m(t,e),w(t,o,e),a&&a.m(t,e),w(t,r,e),l&&l.m(t,e),w(t,i,e)},p(t,[e]){t[0]===Ct.MicActive?s||(s=zt(),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),t[0]===Ct.Mic?c||(c=Nt(),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null),t[0]===Ct.Error?a||(a=Ot(),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null),t[0]===Ct.Denied?l||(l=Mt(),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null)},i:t,o:t,d(t){s&&s.d(t),t&&b(n),c&&c.d(t),t&&b(o),a&&a.d(t),t&&b(r),l&&l.d(t),t&&b(i)}}}function Pt(t,e,n){let{icon:o=Ct.Mic}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon)},[o]} | ||
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ | ||
wt=_t,bt=_t.exports,function(t){var e=bt,n=wt&&wt.exports==e&&wt,o="object"==typeof At&&At;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,u=t.length-c;++l<u;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(At),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}($t||($t={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(xt||(xt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(Ct||(Ct={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(St||(St={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(Et||(Et={})),function(t){t.None="none",t.Whirl="whirl"}(Tt||(Tt={})),gt.Disconnected,gt.Connected,gt.Active,gt.Failed,pt.NoBrowserSupport,pt.NoAudioConsent;class Rt extends ut{constructor(t){super(),at(this,t,Pt,Lt,s,{icon:0},kt)}}const{window:Dt}=rt;function Bt(t){let e;return{c(){e=b("link"),T(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),T(e,"rel","stylesheet")},m(t,n){v(t,e,n)},d(t){t&&w(e)}}}function Ft(t){let e;return{c(){e=b("link"),T(e,"href",t[2]),T(e,"rel","stylesheet")},m(t,n){v(t,e,n)},p(t,n){4&n&&T(e,"href",t[2])},d(t){t&&w(e)}}}function It(t){let e,n,o,r,i,s,c,a,l,u;const d=[Ut,qt,jt,Vt,Ht],p=[];function h(t,e){return t[3]===Kt||t[3]===pt.Starting?0:t[3]===Yt?1:t[3]===pt.NoAudioConsent?2:t[3]===pt.NoBrowserSupport?3:4}return s=h(t),c=p[s]=d[s](t),{c(){e=b("modalbg"),o=C(),r=b("modalcontent"),i=b("main"),c.c(),a=C(),l=b("footer"),l.innerHTML='Voice input is automatically transcribed by <a target="_blank" href="https://speechly.com/" rel="noopener noreferrer">Speechly</a> and can be used to improve the quality of service under <a target="_blank" href="https://www.speechly.com/privacy/terms-and-conditions" rel="noopener noreferrer">terms of use</a>.',T(r,"class",t[1]),_(r,"defaultTypography",t[6])},m(t,n){v(t,e,n),v(t,o,n),v(t,r,n),f(r,i),p[s].m(i,null),f(r,a),f(r,l),u=!0},p(t,e){let n=s;s=h(t),s===n?p[s].p(t,e):(J(),et(p[n],1,1,(()=>{p[n]=null})),Q(),c=p[s],c?c.p(t,e):(c=p[s]=d[s](t),c.c()),tt(c,1),c.m(i,null)),(!u||2&e)&&T(r,"class",t[1]),(!u||66&e)&&_(r,"defaultTypography",t[6])},i(o){u||(j((()=>{n||(n=ot(e,t[7],{duration:200},!0)),n.run(1)})),tt(c),u=!0)},o(o){n||(n=ot(e,t[7],{duration:200},!1)),n.run(0),et(c),u=!1},d(t){t&&w(e),t&&n&&n.end(),t&&w(o),t&&w(r),p[s].d()}}}function Ht(e){let n,o,r,i,s,c,a,l;return{c(){n=b("h2"),n.textContent="Failed to connect to Speechly",o=C(),r=b("p"),r.textContent="Please check your internet connection. If the problem persists, please try again later.",i=C(),s=b("options"),c=b("button"),c.textContent="Ok, got it",T(c,"class","button button-primary")},m(t,u){v(t,n,u),v(t,o,u),v(t,r,u),v(t,i,u),v(t,s,u),f(s,c),a||(l=E(c,"click",e[8]),a=!0)},p:t,i:t,o:t,d(t){t&&w(n),t&&w(o),t&&w(r),t&&w(i),t&&w(s),a=!1,l()}}}function Vt(e){let n,o,r,i,s,c,a,l;return{c(){n=b("h2"),n.textContent="Unsupported browser",o=C(),r=b("p"),r.textContent="To use voice input, please visit this site using a supported browser.",i=C(),s=b("options"),c=b("button"),c.textContent="Ok, got it",T(c,"class","button button-primary")},m(t,u){v(t,n,u),v(t,o,u),v(t,r,u),v(t,i,u),v(t,s,u),f(s,c),a||(l=E(c,"click",e[8]),a=!0)},p:t,i:t,o:t,d(t){t&&w(n),t&&w(o),t&&w(r),t&&w(i),t&&w(s),a=!1,l()}}}function jt(e){let n,o,i,s,c,a,l,u,d,p;return{c(){n=b("h2"),n.textContent="Microphone blocked",o=C(),i=b("p"),i.textContent=`To use voice input, ${window.location.hostname} needs access to your microphone. Check your\n browser preferences to allow microphone access and reload the page.`,s=C(),c=b("options"),a=b("button"),a.textContent="Ok, got it",l=C(),u=b("button"),u.textContent="Reload page",T(a,"class","button button-secondary"),T(u,"class","button button-primary")},m(t,r){v(t,n,r),v(t,o,r),v(t,i,r),v(t,s,r),v(t,c,r),f(c,a),f(c,l),f(c,u),d||(p=[E(a,"click",e[8]),E(u,"click",e[18])],d=!0)},p:t,i:t,o:t,d(t){t&&w(n),t&&w(o),t&&w(i),t&&w(s),t&&w(c),d=!1,r(p)}}}function qt(e){let n,o,i,s,c,a,l,u,d,p;return{c(){n=b("h2"),n.textContent="HTTPS required",o=C(),i=b("p"),i.textContent="To use the voice interface, please visit this site using the secure\n HTTPS protocol.",s=C(),c=b("options"),a=b("button"),a.textContent="Ok, got it",l=C(),u=b("button"),u.textContent="Try with HTTPS",T(a,"class","button button-secondary"),T(u,"class","button button-primary")},m(t,r){v(t,n,r),v(t,o,r),v(t,i,r),v(t,s,r),v(t,c,r),f(c,a),f(c,l),f(c,u),d||(p=[E(a,"click",e[8]),E(u,"click",e[12])],d=!0)},p:t,i:t,o:t,d(t){t&&w(n),t&&w(o),t&&w(i),t&&w(s),t&&w(c),d=!1,r(p)}}}function Ut(t){let e,n,o,r,i,s,c,a,l,u,d,p,h,m,g,y,$,S,_,k=window.location.hostname+"";d=new Rt({});let z=t[4]&&Xt(t);return{c(){var t;e=b("h2"),e.innerHTML='<slot name="priming-title">Allow microphone</slot>',n=C(),o=b("p"),r=b("slot"),i=x("To use voice input, press "),s=b("strong"),s.textContent="Allow",c=x(" to give "),a=x(k),l=x(" access to your microphone.\n Audio is only captured when "),u=b("span"),(t=d.$$.fragment)&&t.c(),p=x(" button is pressed."),h=C(),m=b("options"),g=b("button"),g.textContent="Not now",y=C(),z&&z.c(),A(u,"display","inline-block"),A(u,"position","relative"),A(u,"color","white"),A(u,"width","20px"),A(u,"height","10px"),A(u,"--icon-color","white"),A(u,"--icon-size","20px"),T(r,"name","priming-body"),T(g,"class","button button-secondary")},m(w,b){v(w,e,b),v(w,n,b),v(w,o,b),f(o,r),f(r,i),f(r,s),f(r,c),f(r,a),f(r,l),f(r,u),it(d,u,null),f(r,p),v(w,h,b),v(w,m,b),f(m,g),f(m,y),z&&z.m(m,null),$=!0,S||(_=E(g,"click",t[8]),S=!0)},p(t,e){t[4]?z?z.p(t,e):(z=Xt(t),z.c(),z.m(m,null)):z&&(z.d(1),z=null)},i(t){$||(tt(d.$$.fragment,t),$=!0)},o(t){et(d.$$.fragment,t),$=!1},d(t){t&&w(e),t&&w(n),t&&w(o),st(d),t&&w(h),t&&w(m),z&&z.d(),S=!1,_()}}}function Xt(t){let e,n,o,r,i;return{c(){e=b("button"),n=x("Allow"),T(e,"class","button button-primary"),e.disabled=o=t[3]===pt.Starting},m(o,s){v(o,e,s),f(e,n),r||(i=E(e,"click",t[9]),r=!0)},p(t,n){8&n&&o!==(o=t[3]===pt.Starting)&&(e.disabled=o)},d(t){t&&w(e),r=!1,i()}}}function Wt(e){let n,o,i,s,c,a,l,u=e[6]&&Bt(),d=void 0!==e[2]&&Ft(e),p=e[5]&&It(e);return{c(){u&&u.c(),n=S(),o=C(),d&&d.c(),i=C(),s=b("modal"),p&&p.c(),this.c=t,A(s,"--remsize",e[0])},m(t,r){u&&u.m(document.head,null),f(document.head,n),v(t,o,r),d&&d.m(t,r),v(t,i,r),v(t,s,r),p&&p.m(s,null),c=!0,a||(l=[E(Dt,"keydown",e[10]),E(Dt,"message",e[11])],a=!0)},p(t,[e]){t[6]?u||(u=Bt(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),void 0!==t[2]?d?d.p(t,e):(d=Ft(t),d.c(),d.m(i.parentNode,i)):d&&(d.d(1),d=null),t[5]?p?(p.p(t,e),32&e&&tt(p,1)):(p=It(t),p.c(),tt(p,1),p.m(s,null)):p&&(J(),et(p,1,1,(()=>{p=null})),Q()),(!c||1&e)&&A(s,"--remsize",t[0])},i(t){c||(tt(p),c=!0)},o(t){et(p),c=!1},d(t){u&&u.d(t),w(n),t&&w(o),d&&d.d(t),t&&w(i),t&&w(s),p&&p.d(),a=!1,r(l)}}}const Kt="PagePriming",Yt="HttpsRequired";function Gt(t,e,n){let o,r;var i=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{a(o.next(t))}catch(t){i(t)}}function c(t){try{a(o.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((o=o.apply(t,e||[])).next())}))};let{hide:s="auto"}=e,{clientstate:c}=e,{microphonestate:a}=e,{remsize:l="1.0rem"}=e,{position:u="fixed"}=e,{customcssurl:d}=e,{customtypography:p}=e,h=!0;const f=(()=>{const t=R();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}})(),m=(g=dt,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return g(t,e)});var g;let y=!1,v=Kt,w=null,b=!1;var $;$=()=>{n(17,y=!0),window.postMessage({type:xt.speechlyintroready},"*")},R().$$.on_mount.push($);const x=(t={})=>{n(5,o=!1),f("speechlyintroclosed",t),window.postMessage(Object.assign({type:xt.speechlyintroclosed},t),"*")},C=t=>{var e,r;("auto"===s&&n(5,o=!0),w&&(window.clearTimeout(w),w=null),"https:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)||("localhost"===(r=window.location.hostname)||"[::1]"===r||null!==r.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)))?n(3,v=t):n(3,v=Yt)},S=t=>{switch(t){case pt.Starting:v===Kt?(n(3,v=t),w=window.setTimeout((()=>{w=null,"auto"===s&&n(5,o=!0)}),500)):n(5,o=!0);break;case pt.Started:h&&(h=!1,w?(window.clearTimeout(w),w=null,x()):x({firstrun:!0}));break;case pt.NoAudioConsent:case pt.NoBrowserSupport:C(t)}},E=t=>{if(t===gt.Failed)C(t)};return t.$$set=t=>{"hide"in t&&n(13,s=t.hide),"clientstate"in t&&n(14,c=t.clientstate),"microphonestate"in t&&n(15,a=t.microphonestate),"remsize"in t&&n(0,l=t.remsize),"position"in t&&n(1,u=t.position),"customcssurl"in t&&n(2,d=t.customcssurl),"customtypography"in t&&n(16,p=t.customtypography)},t.$$.update=()=>{16384&t.$$.dirty&&c&&E(parseInt(c)),32768&t.$$.dirty&&a&&S(a),139264&t.$$.dirty&&n(5,o=y&&"false"===s),65536&t.$$.dirty&&n(6,r=void 0===p||"false"===p)},[l,u,d,v,b,o,r,m,x,()=>i(void 0,void 0,void 0,(function*(){f(xt.requeststartmicrophone)})),t=>{y&&"Escape"===t.key&&(t.preventDefault(),x())},t=>{switch(t.data.type){case xt.speechlypoweron:"auto"===s&&n(5,o=!0),n(4,b=!0),n(3,v=Kt);break;case xt.speechstate:E(t.data.state);break;case xt.audiosourcestate:S(t.data.state);break;case xt.holdstart:switch(t.data.audioSourceState){case pt.NoAudioConsent:case pt.NoBrowserSupport:C(t.data.audioSourceState)}}},()=>{const t=window.location.href.replace("http:","https:");window.location.replace(t)},s,c,a,p,y,()=>{window.location.reload()}]}class Zt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);pointer-events:none;height:100%}modalbg{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;z-index:2000;pointer-events:auto;background-color:rgba(0,0,0,0.75);backdrop-filter:blur(3px)}modalcontent{z-index:2001;pointer-events:auto;box-sizing:border-box;width:100%;min-height:100%;padding:1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}.defaultTypography{font-family:-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;color:#fff;font-size:1rem;line-height:1.5}.defaultTypography h2{font-family:'Saira Condensed', sans-serif;padding:0;margin:0;text-transform:uppercase;color:#fff;font-size:1.5rem;line-height:1.25}main{position:relative;box-sizing:border-box;width:100%;max-width:400px;margin:auto 0;padding:1.5rem 0}options{display:flex;margin-top:2rem;gap:8px}.button{background-color:transparent;box-sizing:border-box;border:1px solid transparent;border-radius:999px;cursor:pointer;font-family:inherit;font-size:1rem;font-weight:600;line-height:1.25;min-width:7rem;padding:0.5rem 1.5rem;transition:all 0.15s ease;white-space:nowrap;-webkit-tap-highlight-color:transparent}.button[disabled],.button:disabled{cursor:auto;opacity:0.5;pointer-events:none}.button-secondary{border-color:#fff;color:#fff}.button-secondary:hover{border-color:#ccc;color:#ccc}.button-primary{background-color:#fff;border-color:#fff;color:#000}.button-primary:hover{border-color:#ccc;background-color:#ccc;color:#000}footer{box-sizing:border-box;font-size:0.75rem;color:#999;margin:0}a,a:visited{color:#999;transition:all 0.15s ease;-webkit-tap-highlight-color:transparent}a:hover{color:#ccc}</style>",at(this,{target:this.shadowRoot,props:k(this.attributes),customElement:!0},Gt,Wt,c,{hide:13,clientstate:14,microphonestate:15,remsize:0,position:1,customcssurl:2,customtypography:16},null),t&&(t.target&&v(t.target,this,t.anchor),t.props&&(this.$set(t.props),W()))}static get observedAttributes(){return["hide","clientstate","microphonestate","remsize","position","customcssurl","customtypography"]}get hide(){return this.$$.ctx[13]}set hide(t){this.$$set({hide:t}),W()}get clientstate(){return this.$$.ctx[14]}set clientstate(t){this.$$set({clientstate:t}),W()}get microphonestate(){return this.$$.ctx[15]}set microphonestate(t){this.$$set({microphonestate:t}),W()}get remsize(){return this.$$.ctx[0]}set remsize(t){this.$$set({remsize:t}),W()}get position(){return this.$$.ctx[1]}set position(t){this.$$set({position:t}),W()}get customcssurl(){return this.$$.ctx[2]}set customcssurl(t){this.$$set({customcssurl:t}),W()}get customtypography(){return this.$$.ctx[16]}set customtypography(t){this.$$set({customtypography:t}),W()}}customElements.get("intro-popup")?console.warn("Skipping re-defining customElement intro-popup"):customElements.define("intro-popup",Zt)})); | ||
bt=_t,vt=_t.exports,function(t){var e=vt,n=bt&&bt.exports==e&&bt,o="object"==typeof At&&At;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,u=t.length-c;++l<u;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(At),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}($t||($t={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(xt||(xt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(Ct||(Ct={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(St||(St={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(Et||(Et={})),function(t){t.None="none",t.Whirl="whirl"}(Tt||(Tt={})),gt.Disconnected,gt.Connected,gt.Active,gt.Failed,pt.NoBrowserSupport,pt.NoAudioConsent;class Rt extends ut{constructor(t){super(),at(this,t,Pt,Lt,s,{icon:0},kt)}}const Dt=()=>{const t=R();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}},{window:Bt}=rt;function Ft(t){let e;return{c(){e=v("link"),T(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),T(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&b(e)}}}function It(t){let e;return{c(){e=v("link"),T(e,"href",t[2]),T(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){4&n&&T(e,"href",t[2])},d(t){t&&b(e)}}}function Ht(t){let e,n,o,r,i,s,c,a,l,u;const d=[Xt,Ut,qt,jt,Vt],p=[];function h(t,e){return t[3]===Yt||t[3]===pt.Starting?0:t[3]===Gt?1:t[3]===pt.NoAudioConsent?2:t[3]===pt.NoBrowserSupport?3:4}return s=h(t),c=p[s]=d[s](t),{c(){e=v("modalbg"),o=C(),r=v("modalcontent"),i=v("main"),c.c(),a=C(),l=v("footer"),l.innerHTML='Voice input is automatically transcribed by <a target="_blank" href="https://speechly.com/" rel="noopener noreferrer">Speechly</a> and can be used to improve the quality of service under <a target="_blank" href="https://www.speechly.com/privacy/terms-and-conditions" rel="noopener noreferrer">terms of use</a>.',T(r,"class",t[1]),_(r,"defaultTypography",t[6])},m(t,n){w(t,e,n),w(t,o,n),w(t,r,n),f(r,i),p[s].m(i,null),f(r,a),f(r,l),u=!0},p(t,e){let n=s;s=h(t),s===n?p[s].p(t,e):(J(),et(p[n],1,1,(()=>{p[n]=null})),Q(),c=p[s],c?c.p(t,e):(c=p[s]=d[s](t),c.c()),tt(c,1),c.m(i,null)),(!u||2&e)&&T(r,"class",t[1]),(!u||66&e)&&_(r,"defaultTypography",t[6])},i(o){u||(j((()=>{n||(n=ot(e,t[7],{duration:200},!0)),n.run(1)})),tt(c),u=!0)},o(o){n||(n=ot(e,t[7],{duration:200},!1)),n.run(0),et(c),u=!1},d(t){t&&b(e),t&&n&&n.end(),t&&b(o),t&&b(r),p[s].d()}}}function Vt(e){let n,o,r,i,s,c,a,l;return{c(){n=v("h2"),n.textContent="Failed to connect to Speechly",o=C(),r=v("p"),r.textContent="Please check your internet connection. If the problem persists, please try again later.",i=C(),s=v("options"),c=v("button"),c.textContent="Ok, got it",T(c,"class","button button-primary")},m(t,u){w(t,n,u),w(t,o,u),w(t,r,u),w(t,i,u),w(t,s,u),f(s,c),a||(l=E(c,"click",e[8]),a=!0)},p:t,i:t,o:t,d(t){t&&b(n),t&&b(o),t&&b(r),t&&b(i),t&&b(s),a=!1,l()}}}function jt(e){let n,o,r,i,s,c,a,l;return{c(){n=v("h2"),n.textContent="Unsupported browser",o=C(),r=v("p"),r.textContent="To use voice input, please visit this site using a supported browser.",i=C(),s=v("options"),c=v("button"),c.textContent="Ok, got it",T(c,"class","button button-primary")},m(t,u){w(t,n,u),w(t,o,u),w(t,r,u),w(t,i,u),w(t,s,u),f(s,c),a||(l=E(c,"click",e[8]),a=!0)},p:t,i:t,o:t,d(t){t&&b(n),t&&b(o),t&&b(r),t&&b(i),t&&b(s),a=!1,l()}}}function qt(e){let n,o,i,s,c,a,l,u,d,p;return{c(){n=v("h2"),n.textContent="Microphone blocked",o=C(),i=v("p"),i.textContent=`To use voice input, ${window.location.hostname} needs access to your microphone. Check your\n browser preferences to allow microphone access and reload the page.`,s=C(),c=v("options"),a=v("button"),a.textContent="Ok, got it",l=C(),u=v("button"),u.textContent="Reload page",T(a,"class","button button-secondary"),T(u,"class","button button-primary")},m(t,r){w(t,n,r),w(t,o,r),w(t,i,r),w(t,s,r),w(t,c,r),f(c,a),f(c,l),f(c,u),d||(p=[E(a,"click",e[8]),E(u,"click",e[18])],d=!0)},p:t,i:t,o:t,d(t){t&&b(n),t&&b(o),t&&b(i),t&&b(s),t&&b(c),d=!1,r(p)}}}function Ut(e){let n,o,i,s,c,a,l,u,d,p;return{c(){n=v("h2"),n.textContent="HTTPS required",o=C(),i=v("p"),i.textContent="To use the voice interface, please visit this site using the secure\n HTTPS protocol.",s=C(),c=v("options"),a=v("button"),a.textContent="Ok, got it",l=C(),u=v("button"),u.textContent="Try with HTTPS",T(a,"class","button button-secondary"),T(u,"class","button button-primary")},m(t,r){w(t,n,r),w(t,o,r),w(t,i,r),w(t,s,r),w(t,c,r),f(c,a),f(c,l),f(c,u),d||(p=[E(a,"click",e[8]),E(u,"click",e[12])],d=!0)},p:t,i:t,o:t,d(t){t&&b(n),t&&b(o),t&&b(i),t&&b(s),t&&b(c),d=!1,r(p)}}}function Xt(t){let e,n,o,r,i,s,c,a,l,u,d,p,h,m,g,y,$,S,_,k=window.location.hostname+"";d=new Rt({});let z=t[4]&&Wt(t);return{c(){var t;e=v("h2"),e.innerHTML='<slot name="priming-title">Allow microphone</slot>',n=C(),o=v("p"),r=v("slot"),i=x("To use voice input, press "),s=v("strong"),s.textContent="Allow",c=x(" to give "),a=x(k),l=x(" access to your microphone.\n Audio is only captured when "),u=v("span"),(t=d.$$.fragment)&&t.c(),p=x(" button is pressed."),h=C(),m=v("options"),g=v("button"),g.textContent="Not now",y=C(),z&&z.c(),A(u,"display","inline-block"),A(u,"position","relative"),A(u,"color","white"),A(u,"width","20px"),A(u,"height","10px"),A(u,"--icon-color","white"),A(u,"--icon-size","20px"),T(r,"name","priming-body"),T(g,"class","button button-secondary")},m(b,v){w(b,e,v),w(b,n,v),w(b,o,v),f(o,r),f(r,i),f(r,s),f(r,c),f(r,a),f(r,l),f(r,u),it(d,u,null),f(r,p),w(b,h,v),w(b,m,v),f(m,g),f(m,y),z&&z.m(m,null),$=!0,S||(_=E(g,"click",t[8]),S=!0)},p(t,e){t[4]?z?z.p(t,e):(z=Wt(t),z.c(),z.m(m,null)):z&&(z.d(1),z=null)},i(t){$||(tt(d.$$.fragment,t),$=!0)},o(t){et(d.$$.fragment,t),$=!1},d(t){t&&b(e),t&&b(n),t&&b(o),st(d),t&&b(h),t&&b(m),z&&z.d(),S=!1,_()}}}function Wt(t){let e,n,o,r,i;return{c(){e=v("button"),n=x("Allow"),T(e,"class","button button-primary"),e.disabled=o=t[3]===pt.Starting},m(o,s){w(o,e,s),f(e,n),r||(i=E(e,"click",t[9]),r=!0)},p(t,n){8&n&&o!==(o=t[3]===pt.Starting)&&(e.disabled=o)},d(t){t&&b(e),r=!1,i()}}}function Kt(e){let n,o,i,s,c,a,l,u=e[6]&&Ft(),d=void 0!==e[2]&&It(e),p=e[5]&&Ht(e);return{c(){u&&u.c(),n=S(),o=C(),d&&d.c(),i=C(),s=v("modal"),p&&p.c(),this.c=t,A(s,"--remsize",e[0])},m(t,r){u&&u.m(document.head,null),f(document.head,n),w(t,o,r),d&&d.m(t,r),w(t,i,r),w(t,s,r),p&&p.m(s,null),c=!0,a||(l=[E(Bt,"keydown",e[10]),E(Bt,"message",e[11])],a=!0)},p(t,[e]){t[6]?u||(u=Ft(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),void 0!==t[2]?d?d.p(t,e):(d=It(t),d.c(),d.m(i.parentNode,i)):d&&(d.d(1),d=null),t[5]?p?(p.p(t,e),32&e&&tt(p,1)):(p=Ht(t),p.c(),tt(p,1),p.m(s,null)):p&&(J(),et(p,1,1,(()=>{p=null})),Q()),(!c||1&e)&&A(s,"--remsize",t[0])},i(t){c||(tt(p),c=!0)},o(t){et(p),c=!1},d(t){u&&u.d(t),b(n),t&&b(o),d&&d.d(t),t&&b(i),t&&b(s),p&&p.d(),a=!1,r(l)}}}const Yt="PagePriming",Gt="HttpsRequired";function Zt(t,e,n){let o,r;var i=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function s(t){try{a(o.next(t))}catch(t){i(t)}}function c(t){try{a(o.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((o=o.apply(t,e||[])).next())}))};let{hide:s="auto"}=e,{clientstate:c}=e,{microphonestate:a}=e,{remsize:l="1.0rem"}=e,{position:u="fixed"}=e,{customcssurl:d}=e,{customtypography:p}=e,h=!0;const f=Dt(),m=(g=dt,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return g(t,e)});var g;let y=!1,w=Yt,b=null,v=!1;var $;$=()=>{n(17,y=!0),window.postMessage({type:xt.speechlyintroready},"*")},R().$$.on_mount.push($);const x=(t={})=>{n(5,o=!1),f("speechlyintroclosed",t),window.postMessage(Object.assign({type:xt.speechlyintroclosed},t),"*")},C=t=>{var e,r;("auto"===s&&n(5,o=!0),b&&(window.clearTimeout(b),b=null),"https:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)||("localhost"===(r=window.location.hostname)||"[::1]"===r||null!==r.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)))?n(3,w=t):n(3,w=Gt)},S=t=>{switch(t){case pt.Starting:w===Yt?(n(3,w=t),b=window.setTimeout((()=>{b=null,"auto"===s&&n(5,o=!0)}),500)):n(5,o=!0);break;case pt.Started:h&&(h=!1,b?(window.clearTimeout(b),b=null,x()):x({firstrun:!0}));break;case pt.NoAudioConsent:case pt.NoBrowserSupport:C(t)}},E=t=>{if(t===gt.Failed)C(t)};return t.$$set=t=>{"hide"in t&&n(13,s=t.hide),"clientstate"in t&&n(14,c=t.clientstate),"microphonestate"in t&&n(15,a=t.microphonestate),"remsize"in t&&n(0,l=t.remsize),"position"in t&&n(1,u=t.position),"customcssurl"in t&&n(2,d=t.customcssurl),"customtypography"in t&&n(16,p=t.customtypography)},t.$$.update=()=>{16384&t.$$.dirty&&c&&E(parseInt(c)),32768&t.$$.dirty&&a&&S(a),139264&t.$$.dirty&&n(5,o=y&&"false"===s),65536&t.$$.dirty&&n(6,r=void 0===p||"false"===p)},[l,u,d,w,v,o,r,m,x,()=>i(void 0,void 0,void 0,(function*(){f(xt.requeststartmicrophone)})),t=>{y&&"Escape"===t.key&&(t.preventDefault(),x())},t=>{switch(t.data.type){case xt.speechlypoweron:"auto"===s&&n(5,o=!0),n(4,v=!0),n(3,w=Yt);break;case xt.speechstate:E(t.data.state);break;case xt.audiosourcestate:S(t.data.state);break;case xt.holdstart:switch(t.data.audioSourceState){case pt.NoAudioConsent:case pt.NoBrowserSupport:C(t.data.audioSourceState)}}},()=>{const t=window.location.href.replace("http:","https:");window.location.replace(t)},s,c,a,p,y,()=>{window.location.reload()}]}class Jt extends lt{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);pointer-events:none;height:100%}modalbg{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;z-index:2000;pointer-events:auto;background-color:rgba(0,0,0,0.75);backdrop-filter:blur(3px)}modalcontent{z-index:2001;pointer-events:auto;box-sizing:border-box;width:100%;min-height:100%;padding:1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}.defaultTypography{font-family:-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;color:#fff;font-size:1rem;line-height:1.5}.defaultTypography h2{font-family:'Saira Condensed', sans-serif;padding:0;margin:0;text-transform:uppercase;color:#fff;font-size:1.5rem;line-height:1.25}main{position:relative;box-sizing:border-box;width:100%;max-width:400px;margin:auto 0;padding:1.5rem 0}options{display:flex;margin-top:2rem;gap:8px}.button{background-color:transparent;box-sizing:border-box;border:1px solid transparent;border-radius:999px;cursor:pointer;font-family:inherit;font-size:1rem;font-weight:600;line-height:1.25;min-width:7rem;padding:0.5rem 1.5rem;transition:all 0.15s ease;white-space:nowrap;-webkit-tap-highlight-color:transparent}.button[disabled],.button:disabled{cursor:auto;opacity:0.5;pointer-events:none}.button-secondary{border-color:#fff;color:#fff}.button-secondary:hover{border-color:#ccc;color:#ccc}.button-primary{background-color:#fff;border-color:#fff;color:#000}.button-primary:hover{border-color:#ccc;background-color:#ccc;color:#000}footer{box-sizing:border-box;font-size:0.75rem;color:#999;margin:0}a,a:visited{color:#999;transition:all 0.15s ease;-webkit-tap-highlight-color:transparent}a:hover{color:#ccc}</style>",at(this,{target:this.shadowRoot,props:k(this.attributes),customElement:!0},Zt,Kt,c,{hide:13,clientstate:14,microphonestate:15,remsize:0,position:1,customcssurl:2,customtypography:16},null),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),W()))}static get observedAttributes(){return["hide","clientstate","microphonestate","remsize","position","customcssurl","customtypography"]}get hide(){return this.$$.ctx[13]}set hide(t){this.$$set({hide:t}),W()}get clientstate(){return this.$$.ctx[14]}set clientstate(t){this.$$set({clientstate:t}),W()}get microphonestate(){return this.$$.ctx[15]}set microphonestate(t){this.$$set({microphonestate:t}),W()}get remsize(){return this.$$.ctx[0]}set remsize(t){this.$$set({remsize:t}),W()}get position(){return this.$$.ctx[1]}set position(t){this.$$set({position:t}),W()}get customcssurl(){return this.$$.ctx[2]}set customcssurl(t){this.$$set({customcssurl:t}),W()}get customtypography(){return this.$$.ctx[16]}set customtypography(t){this.$$set({customtypography:t}),W()}}customElements.get("intro-popup")?console.warn("Skipping re-defining customElement intro-popup"):customElements.define("intro-popup",Jt)})); | ||
//# sourceMappingURL=intro-popup.js.map |
@@ -1,4 +0,4 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const h="undefined"!=typeof window;let u=h?()=>window.performance.now():()=>Date.now(),f=h?t=>requestAnimationFrame(t):t;const p=new Set;function g(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&f(g)}function m(t){let e;return 0===p.size&&f(g),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t){const e=T("style");return x(y(t),e),e.sheet}function x(t,e){return $(t.head||t,e),e.sheet}function v(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function T(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function E(t){return document.createTextNode(t)}function S(){return E(" ")}function C(){return E("")}function A(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:_(t,e,n)}function P(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function O(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function N(t,e,n){t.classList[n?"add":"remove"](e)}function R(t){const e={};for(const n of t)e[n.name]=n.value;return e}const F=new Map;let I,D=0;function M(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,h=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,u=y(t),{stylesheet:f,rules:p}=F.get(u)||function(t,e){const n={stylesheet:b(e),rules:{}};return F.set(t,n),n}(u,t);p[h]||(p[h]=!0,f.insertRule(`@keyframes ${h} ${d}`,f.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${h} ${o}ms linear ${r}ms 1 both`,D+=1,h}function B(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),D-=r,D||f((()=>{D||(F.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&w(e)})),F.clear())})))}function L(t){I=t}function j(){if(!I)throw new Error("Function called outside component initialization");return I}const H=[],U=[],V=[],W=[],q=Promise.resolve();let X=!1;function K(t){V.push(t)}const Y=new Set;let J,Z=0;function G(){const t=I;do{for(;Z<H.length;){const t=H[Z];Z++,L(t),Q(t.$$)}for(L(null),H.length=0,Z=0;U.length;)U.pop()();for(let t=0;t<V.length;t+=1){const e=V[t];Y.has(e)||(Y.add(e),e())}V.length=0}while(H.length);for(;W.length;)W.pop()();X=!1,Y.clear(),L(t)}function Q(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(K)}}function tt(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const et=new Set;function nt(t,e){t&&t.i&&(et.delete(t),t.i(e))}const ot={duration:0};function rt(n,o,r){let i,c,a=o(n,r),l=!1,d=0;function h(){i&&B(n,i)}function f(){const{delay:o=0,duration:r=300,easing:s=e,tick:f=t,css:p}=a||ot;p&&(i=M(n,0,1,r,o,s,p,d++)),f(0,1);const g=u()+o,$=g+r;c&&c.abort(),l=!0,K((()=>tt(n,!0,"start"))),c=m((t=>{if(l){if(t>=$)return f(1,0),tt(n,!0,"end"),h(),l=!1;if(t>=g){const e=s((t-g)/r);f(e,1-e)}}return l}))}let p=!1;return{start(){p||(p=!0,B(n),s(a)?(a=a(),(J||(J=Promise.resolve(),J.then((()=>{J=null}))),J).then(f)):f())},invalidate(){p=!1},end(){l&&(h(),l=!1)}}}const it="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function st(t,e,n,r){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,n),r||K((()=>{const e=t.$$.on_mount.map(o).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...e):i(e),t.$$.on_mount=[]})),a.forEach(K)}function ct(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function at(t,e){-1===t.$$.dirty[0]&&(H.push(t),X||(X=!0,q.then(G)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function lt(e,n,o,s,c,a,l,d=[-1]){const h=I;L(e);const u=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:r(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};l&&l(u.root);let f=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=r)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](r),f&&at(e,t)),n})):[],u.update(),f=!0,i(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);u.fragment&&u.fragment.l(t),t.forEach(w)}else u.fragment&&u.fragment.c();n.intro&&nt(e.$$.fragment),st(e,n.target,n.anchor,n.customElement),G()}L(h)}let dt;"function"==typeof HTMLElement&&(dt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){ct(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class ht{$destroy(){ct(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var ut,ft,pt,gt,mt;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(ut||(ut={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ft||(ft={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(pt||(pt={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(gt||(gt={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(mt||(mt={})),new Map([[mt.Failed,"Failed"],[mt.Disconnected,"Disconnected"],[mt.Connected,"Connected"],[mt.Active,"Active"]]);for(var $t=[],yt=0;yt<256;++yt)$t.push((yt+256).toString(16).substr(1));var bt,xt,vt,wt,Tt,kt,Et,St,Ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},At={exports:{}};function _t(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function zt(t){return t*t*t}function Pt(t){const e=t-1;return e*e*e+1} | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(o)}function s(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e}function l(t){return 0===Object.keys(t).length}function d(e,n,o){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const o=e.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const h="undefined"!=typeof window;let u=h?()=>window.performance.now():()=>Date.now(),f=h?t=>requestAnimationFrame(t):t;const p=new Set;function g(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&f(g)}function m(t){let e;return 0===p.size&&f(g),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function $(t,e){t.appendChild(e)}function y(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function b(t){const e=T("style");return x(y(t),e),e.sheet}function x(t,e){return $(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode&&t.parentNode.removeChild(t)}function T(t){return document.createElement(t)}function k(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function E(t){return document.createTextNode(t)}function S(){return E(" ")}function C(){return E("")}function A(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function z(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:_(t,e,n)}function P(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function O(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function N(t,e,n){t.classList[n?"add":"remove"](e)}function R(t){const e={};for(const n of t)e[n.name]=n.value;return e}const F=new Map;let I,D=0;function M(t,e,n,o,r,i,s,c=0){const a=16.666/o;let l="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const d=l+`100% {${s(n,1-n)}}\n}`,h=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(d)}_${c}`,u=y(t),{stylesheet:f,rules:p}=F.get(u)||function(t,e){const n={stylesheet:b(e),rules:{}};return F.set(t,n),n}(u,t);p[h]||(p[h]=!0,f.insertRule(`@keyframes ${h} ${d}`,f.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${h} ${o}ms linear ${r}ms 1 both`,D+=1,h}function B(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),D-=r,D||f((()=>{D||(F.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&v(e)})),F.clear())})))}function L(t){I=t}function j(){if(!I)throw new Error("Function called outside component initialization");return I}const H=[],U=[],V=[],W=[],q=Promise.resolve();let X=!1;function K(t){V.push(t)}const Y=new Set;let J,Z=0;function G(){if(0!==Z)return;const t=I;do{try{for(;Z<H.length;){const t=H[Z];Z++,L(t),Q(t.$$)}}catch(t){throw H.length=0,Z=0,t}for(L(null),H.length=0,Z=0;U.length;)U.pop()();for(let t=0;t<V.length;t+=1){const e=V[t];Y.has(e)||(Y.add(e),e())}V.length=0}while(H.length);for(;W.length;)W.pop()();X=!1,Y.clear(),L(t)}function Q(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(K)}}function tt(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const et=new Set;let nt;function ot(t,e){t&&t.i&&(et.delete(t),t.i(e))}const rt={duration:0};function it(n,o,r){const i={direction:"in"};let c,a,l=o(n,r,i),d=!1,h=0;function f(){c&&B(n,c)}function p(){const{delay:o=0,duration:r=300,easing:i=e,tick:s=t,css:p}=l||rt;p&&(c=M(n,0,1,r,o,i,p,h++)),s(0,1);const g=u()+o,$=g+r;a&&a.abort(),d=!0,K((()=>tt(n,!0,"start"))),a=m((t=>{if(d){if(t>=$)return s(1,0),tt(n,!0,"end"),f(),d=!1;if(t>=g){const e=i((t-g)/r);s(e,1-e)}}return d}))}let g=!1;return{start(){g||(g=!0,B(n),s(l)?(l=l(i),(J||(J=Promise.resolve(),J.then((()=>{J=null}))),J).then(p)):p())},invalidate(){g=!1},end(){d&&(f(),d=!1)}}}const st="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ct(t,e,n,r){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,n),r||K((()=>{const e=t.$$.on_mount.map(o).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...e):i(e),t.$$.on_mount=[]})),a.forEach(K)}function at(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function lt(t,e){-1===t.$$.dirty[0]&&(H.push(t),X||(X=!0,q.then(G)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dt(e,n,o,s,c,a,l,d=[-1]){const h=I;L(e);const u=e.$$={fragment:null,ctx:[],props:a,update:t,not_equal:c,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:r(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};l&&l(u.root);let f=!1;if(u.ctx=o?o(e,n.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return u.ctx&&c(u.ctx[t],u.ctx[t]=r)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](r),f&<(e,t)),n})):[],u.update(),f=!0,i(u.before_update),u.fragment=!!s&&s(u.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);u.fragment&&u.fragment.l(t),t.forEach(v)}else u.fragment&&u.fragment.c();n.intro&&ot(e.$$.fragment),ct(e,n.target,n.anchor,n.customElement),G()}L(h)}let ht;"function"==typeof HTMLElement&&(ht=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(o).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){at(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class ut{$destroy(){at(this,1),this.$destroy=t}$on(e,n){if(!s(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){this.$$set&&!l(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var ft,pt,gt,mt,$t;!function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(ft||(ft={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(pt||(pt={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(gt||(gt={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(mt||(mt={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}($t||($t={})),new Map([[$t.Failed,"Failed"],[$t.Disconnected,"Disconnected"],[$t.Connected,"Connected"],[$t.Active,"Active"]]);for(var yt=[],bt=0;bt<256;++bt)yt.push((bt+256).toString(16).substr(1));var xt,wt,vt,Tt,kt,Et,St,Ct,At="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},_t={exports:{}};function zt(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function Pt(t){return t*t*t}function Ot(t){const e=t-1;return e*e*e+1} | ||
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ | ||
bt=At,xt=At.exports,function(t){var e=xt,n=bt&&bt.exports==e&&bt,o="object"==typeof Ct&&Ct;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,d=t.length-c;++l<d;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(Ct),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(vt||(vt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(wt||(wt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(Tt||(Tt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(kt||(kt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(Et||(Et={})),function(t){t.None="none",t.Whirl="whirl"}(St||(St={})),mt.Disconnected,mt.Connected,mt.Active,mt.Failed,ut.NoBrowserSupport,ut.NoAudioConsent;const Ot=[];function Nt(t){return"[object Date]"===Object.prototype.toString.call(t)}function Rt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>Rt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(Nt(t)&&Nt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=Rt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function Ft(o,r={}){const i=function(e,n=t){let o;const r=new Set;function i(t){if(c(e,t)&&(e=t,o)){const t=!Ot.length;for(const t of r)t[1](),Ot.push(t,e);if(t){for(let t=0;t<Ot.length;t+=2)Ot[t][0](Ot[t+1]);Ot.length=0}}}return{set:i,update:function(t){i(t(e))},subscribe:function(s,c=t){const a=[s,c];return r.add(a),1===r.size&&(o=n(i)||t),s(e),()=>{r.delete(a),0===r.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return i.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:h=0,duration:f=400,easing:p=e,interpolate:g=Rt}=n(n({},r),c);if(0===f)return l&&(l.abort(),l=null),i.set(o=a),Promise.resolve();const $=u()+h;let y;return s=m((e=>{if(e<$)return!0;d||(y=g(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(i.set(o=t),!1):(i.set(o=y(p(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:i.subscribe}}function It(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function Dt(t,{delay:e=0,speed:n,duration:o,easing:r=_t}={}){let i=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(i+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:i/n:"function"==typeof o&&(o=o(i)),{delay:e,duration:o,easing:r,css:(t,e)=>`stroke-dasharray: ${t*i} ${e*i}`}}const Mt=[0,1];function Bt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let r=(o-n)/(t.length-1);if(r<=0)return t[0];let i=(e-n)/r,s=Math.floor(i),c=Math.ceil(i),a=i-s;return(1-a)*t[s]+a*t[c]}function Lt(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=T("style");t.id=e,t.textContent=n,x(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function jt(e){let n;return{c(){n=T("canvas"),O(n,"color",e[0]),O(n,"display","block"),O(n,"width","1.35rem"),O(n,"height","1.5rem"),O(n,"margin","0"),O(n,"padding","0 0.8rem 0 0rem"),O(n,"flex-grow","0"),O(n,"flex-shrink","0"),O(n,"flex-basis","1.35rem"),_(n,"class","svelte-1fz8oog")},m(t,o){v(t,n,o),e[3](n)},p(t,[e]){1&e&&O(n,"color",t[0])},i:t,o:t,d(t){t&&w(n),e[3](null)}}}function Ht(t,e,n){let{color:o="#60e0ff"}=e;const r=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let i,s=0,c=0,a=[0,0];const l=(t,e,n,o,r,i)=>{o<2*i&&(i=o/2),r<2*i&&(i=r/2),t.beginPath(),t.moveTo(e+i,n),t.arcTo(e+o,n,e+o,n+r,i),t.arcTo(e+o,n+r,e,n+r,i),t.arcTo(e,n+r,e,n,i),t.arcTo(e,n,e+o,n,i),t.closePath()};var d;return d=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!i)return;const e=i.getContext("2d");if(!e)return;let r=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),h=Number.parseInt(getComputedStyle(i).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(i).getPropertyValue("height").slice(0,-2));n(1,i.width=h*r,i),n(1,i.height=u*r,i),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,i.width,i.height);const p=3/o*i.width*.5,g=4/o*i.width;for(e.fillStyle=i.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*i.height;t*i.height>2*p?l(e,.5*i.width-p+f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width+f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*i.height>2*p?l(e,.5*i.width-p-f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width-f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill())}};return d(),r(1,500),()=>{cancelAnimationFrame(t)}},j().$$.on_mount.push(d),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,i,r,function(t){U[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class Ut extends ht{constructor(t){super(),lt(this,t,Ht,jt,c,{color:0,updateVU:2},Lt)}get updateVU(){return this.$$.ctx[2]}}const{window:Vt}=it;function Wt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function qt(t){let e;return{c(){e=T("div"),_(e,"class","TransscriptItemBgDiv")},m(t,n){v(t,e,n)},d(t){t&&w(e)}}}function Xt(e){let n,o;return{c(){n=T("div"),n.textContent="Listening...",_(n,"class","listening")},m(t,e){v(t,n,e)},i(t){o||K((()=>{o=rt(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&w(n)}}}function Kt(e){let n,o;return{c(){n=T("div"),_(n,"class","TransscriptItemBgDiv")},m(t,e){v(t,n,e)},p(t,n){e=t},i(t){o||K((()=>{o=rt(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&w(n)}}}function Yt(t){let e,n;return{c(){e=T("span"),_(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){v(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&_(e,"style",n)},d(t){t&&w(e)}}}function Jt(e){let n,o,r,i,s,c,a,l=e[42].word+"",d=e[16]&&Kt(e),h=e[44]<e[11].length&&Yt(e);return{c(){n=T("div"),d&&d.c(),o=S(),r=T("div"),i=E(l),s=S(),h&&h.c(),_(r,"class","TransscriptItemContent"),_(n,"class",a="TranscriptItem "+e[23](e[42])),N(n,"Entity",null!==e[42].entityType),N(n,"Final",e[42].isFinal)},m(t,e){v(t,n,e),d&&d.m(n,null),$(n,o),$(n,r),$(r,i),$(r,s),h&&h.m(r,null)},p(t,s){(e=t)[16]?d?65536&s[0]&&nt(d,1):(d=Kt(e),d.c(),nt(d,1),d.m(n,o)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l=e[42].word+"")&&P(i,l),e[44]<e[11].length?h?h.p(e,s):(h=Yt(e),h.c(),h.m(r,null)):h&&(h.d(1),h=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&_(n,"class",a),2048&s[0]&&N(n,"Entity",null!==e[42].entityType),2048&s[0]&&N(n,"Final",e[42].isFinal)},i(t){nt(d),c||K((()=>{c=rt(r,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&w(n),d&&d.d(),h&&h.d()}}}function Zt(e){let n,o,r,i,s,c,a,l;return{c(){n=T("div"),o=T("div"),r=S(),i=T("div"),s=k("svg"),c=k("path"),_(o,"class","TransscriptItemBgDiv"),O(o,"background-color",e[5]),_(c,"stroke","currentColor"),_(c,"stroke-width","3"),_(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),_(c,"fill","none"),_(c,"fill-rule","evenodd"),O(s,"width","2rem"),O(s,"height","2rem"),O(s,"position","absolute"),O(s,"transform","translate(-0.6rem, -0.5rem)"),O(s,"stroke","#eee"),_(s,"viewBox","0 0 24 24"),_(s,"xmlns","http://www.w3.org/2000/svg"),O(i,"width","1.0rem"),O(i,"height","1rem"),O(i,"position","relative"),_(n,"class","TranscriptItem")},m(t,e){v(t,n,e),$(n,o),$(n,r),$(n,i),$(i,s),$(s,c)},p(t,e){32&e[0]&&O(o,"background-color",t[5])},i(t){a||K((()=>{a=rt(c,e[20],{duration:500}),a.start()})),l||K((()=>{l=rt(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&w(n)}}}function Gt(t){let e;return{c(){e=T("link"),_(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),_(e,"rel","stylesheet")},m(t,n){v(t,e,n)},d(t){t&&w(e)}}}function Qt(t){let e;return{c(){e=T("link"),_(e,"href",t[10]),_(e,"rel","stylesheet")},m(t,n){v(t,e,n)},p(t,n){1024&n[0]&&_(e,"href",t[10])},d(t){t&&w(e)}}}function te(e){let n,o,r,i,s,c,a,l,d,h,u,f,p,g,m,y=e[16]&&qt(),b={color:e[5]};s=new Ut({props:b}),e[34](s);let x=e[17]&&Xt(e),k=e[11],E=[];for(let t=0;t<k.length;t+=1)E[t]=Jt(Wt(e,k,t));let z=e[13]&&Zt(e),P=e[15]&&Gt(),R=void 0!==e[10]&&Qt(e);return{c(){var p;n=T("main"),o=T("div"),y&&y.c(),r=S(),i=T("div"),(p=s.$$.fragment)&&p.c(),c=S(),x&&x.c(),a=S();for(let t=0;t<E.length;t+=1)E[t].c();l=S(),z&&z.c(),d=S(),P&&P.c(),h=C(),u=S(),R&&R.c(),f=C(),this.c=t,_(i,"class","TransscriptItemContent"),_(o,"class","TranscriptItem"),_(n,"class","BigTranscript"),O(n,"--voffset",e[1]),O(n,"--hoffset",e[2]),O(n,"--fontsize",e[3]),O(n,"--color",e[4]),O(n,"--highlight-color",e[5]),O(n,"--text-bg-color",e[6]),O(n,"--gradient-stop1",e[7]),O(n,"--gradient-stop2",e[8]),O(n,"--marginbottom",e[9]),O(n,"--transition",e[18].transition),O(n,"opacity",e[18].transition),O(n,"max-height",10*Bt(Mt,e[18].transition,0,.6)+"rem"),O(n,"visibility",0!==e[18].transition?"visible":"hidden"),N(n,"placementTop","top"===e[0]),N(n,"defaultTypography",e[15])},m(t,b){v(t,n,b),$(n,o),y&&y.m(o,null),$(o,r),$(o,i),st(s,i,null),$(i,c),x&&x.m(i,null),$(n,a);for(let t=0;t<E.length;t+=1)E[t].m(n,null);$(n,l),z&&z.m(n,null),v(t,d,b),P&&P.m(document.head,null),$(document.head,h),v(t,u,b),R&&R.m(t,b),v(t,f,b),p=!0,g||(m=A(Vt,"message",e[22]),g=!0)},p(t,e){t[16]?y||(y=qt(),y.c(),y.m(o,r)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?x?131072&e[0]&&nt(x,1):(x=Xt(t),x.c(),nt(x,1),x.m(i,null)):x&&(x.d(1),x=null),8464384&e[0]){let o;for(k=t[11],o=0;o<k.length;o+=1){const r=Wt(t,k,o);E[o]?(E[o].p(r,e),nt(E[o],1)):(E[o]=Jt(r),E[o].c(),nt(E[o],1),E[o].m(n,l))}for(;o<E.length;o+=1)E[o].d(1);E.length=k.length}t[13]?z?(z.p(t,e),8192&e[0]&&nt(z,1)):(z=Zt(t),z.c(),nt(z,1),z.m(n,null)):z&&(z.d(1),z=null),(!p||2&e[0])&&O(n,"--voffset",t[1]),(!p||4&e[0])&&O(n,"--hoffset",t[2]),(!p||8&e[0])&&O(n,"--fontsize",t[3]),(!p||16&e[0])&&O(n,"--color",t[4]),(!p||32&e[0])&&O(n,"--highlight-color",t[5]),(!p||64&e[0])&&O(n,"--text-bg-color",t[6]),(!p||128&e[0])&&O(n,"--gradient-stop1",t[7]),(!p||256&e[0])&&O(n,"--gradient-stop2",t[8]),(!p||512&e[0])&&O(n,"--marginbottom",t[9]),(!p||262144&e[0])&&O(n,"--transition",t[18].transition),(!p||262144&e[0])&&O(n,"opacity",t[18].transition),(!p||262144&e[0])&&O(n,"max-height",10*Bt(Mt,t[18].transition,0,.6)+"rem"),(!p||262144&e[0])&&O(n,"visibility",0!==t[18].transition?"visible":"hidden"),(!p||1&e[0])&&N(n,"placementTop","top"===t[0]),(!p||32768&e[0])&&N(n,"defaultTypography",t[15]),t[15]?P||(P=Gt(),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),void 0!==t[10]?R?R.p(t,e):(R=Qt(t),R.c(),R.m(f.parentNode,f)):R&&(R.d(1),R=null)},i(t){if(!p){nt(s.$$.fragment,t),nt(x);for(let t=0;t<k.length;t+=1)nt(E[t]);nt(z),p=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(et.has(t))return;et.add(t),(void 0).c.push((()=>{et.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}(s.$$.fragment,t),p=!1},d(t){t&&w(n),y&&y.d(),e[34](null),ct(s),x&&x.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(E,t),z&&z.d(),t&&w(d),P&&P.d(t),w(h),t&&w(u),R&&R.d(t),t&&w(f),g=!1,m()}}}function ee(t,e,n){let o,r,i,s,c,a,l,h,{placement:u}=e,{voffset:f="3rem"}=e,{hoffset:p="2rem"}=e,{fontsize:g="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:x="#ffffffcc"}=e,{marginbottom:v="0rem"}=e,{formattext:w}=e,{demomode:T}=e,{customcssurl:k}=e,{customtypography:E}=e,S=[],C=null,A=null,_=mt.Disconnected,z=!1,P=!1,O=!1,N=Ft({transition:0},{duration:200});d(t,N,(t=>n(18,l=t)));const R=j(),F=It(Dt),I=It(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Bt(Mt,t,0,1)*o}rem;\n `}))),D=t=>{n(13,O=O||t)},M=t=>{n(30,_=t),_===mt.Active&&(n(13,O=!1),n(11,S=[]),A=null)},B=t=>{if(void 0===t)return;h&&(s||_===mt.Active)&&h.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?L(S.length>0?s?3500:2e3:0):S.length>0&&(z||n(31,z=!0),L(2e3));const e=`${t.contextId}/${t.id}`;null!==A?A!==e&&(n(13,O=!1),A=e):A=e,n(11,S=[]),t.words.forEach((t=>{n(11,S[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},S)})),i?t.entities.forEach((t=>{n(11,S[t.startPosition].word=t.value,S),n(11,S[t.startPosition].entityType=t.type,S),n(11,S[t.startPosition].isFinal=t.isFinal,S),n(11,S[t.startPosition].hide=!1,S);for(let e=t.startPosition+1;e<t.endPosition;e++)S[e]&&n(11,S[e].hide=!0,S)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)S[e]&&(n(11,S[e].entityType=t.type,S),n(11,S[e].isFinal=t.isFinal,S))})),n(11,S=S.filter((t=>!t.hide)))},L=(t=0)=>{H(),C=window.setTimeout((()=>{C=null,z&&n(31,z=!1)}),t)},H=()=>{null!==C&&(window.clearTimeout(C),C=null)};return t.$$set=t=>{"placement"in t&&n(0,u=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,p=t.hoffset),"fontsize"in t&&n(3,g=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,x=t.gradientstop2),"marginbottom"in t&&n(9,v=t.marginbottom),"formattext"in t&&n(24,w=t.formattext),"demomode"in t&&n(25,T=t.demomode),"customcssurl"in t&&n(10,k=t.customcssurl),"customtypography"in t&&n(26,E=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===S.length),64&t.$$.dirty[0]&&n(16,r="none"!==y),16777216&t.$$.dirty[0]&&(i=void 0===w||"false"!==w),33554432&t.$$.dirty[0]&&n(33,s=void 0!==T&&"false"!==T),67108864&t.$$.dirty[0]&&n(15,c=void 0===E||"false"===E),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=_===mt.Active||z;t!==P&&(e="visibilitychanged",l=t,R.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,P=t),N.set({transition:P?1:0})}var e,l;4&t.$$.dirty[1]&&(s||L(0))},[u,f,p,g,m,$,y,b,x,v,k,S,h,O,a,c,r,o,l,N,F,I,t=>{switch(t.data.type){case wt.speechsegment:B(t.data.segment);break;case wt.speechhandled:D(t.data.success);break;case wt.speechstate:M(t.data.state)}},t=>t.entityType||"",w,T,E,D,M,B,_,z,P,s,function(t){U[t?"unshift":"push"]((()=>{h=t,n(12,h)}))}]}class ne extends dt{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition));height:fit-content}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",lt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},ee,te,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&v(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),G()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),G()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),G()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),G()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),G()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}function oe(t){let e;return{c(){e=T("link"),_(e,"href",t[11]),_(e,"rel","stylesheet")},m(t,n){v(t,e,n)},p(t,n){2048&n[0]&&_(e,"href",t[11])},d(t){t&&w(e)}}}function re(e){let n,o,r,s,c,a,l,d,h,u,f=void 0!==e[11]&&oe(e);return{c(){f&&f.c(),n=S(),o=T("main"),r=T("div"),s=T("div"),c=T("big-transcript"),a=S(),l=T("div"),d=E(e[13]),this.c=t,z(c,"customtypography",e[12]),z(c,"customcssurl",e[11]),z(c,"formattext",e[9]),z(c,"fontsize",e[1]),z(c,"color",e[3]),z(c,"backgroundcolor","none"),z(c,"highlightcolor",e[5]),z(c,"gradientstop1",e[7]),z(c,"gradientstop2",e[8]),z(c,"demomode",e[10]),_(l,"class","hint"),O(l,"opacity",e[18].opacity),N(l,"defaultTypography",e[15]),_(s,"class","pad"),_(r,"class","drawer"),O(r,"background-color",e[6]),O(r,"opacity",e[16].opacity),O(r,"transform","translate(0px, "+e[17].y+"rem)"),_(o,"class","placementTop"),O(o,"--height",e[0]),O(o,"--smalltextcolor",e[4]),O(o,"--hintfontsize",e[2])},m(t,i){f&&f.m(t,i),v(t,n,i),v(t,o,i),$(o,r),$(r,s),$(s,c),e[29](c),$(s,a),$(s,l),$(l,d),h||(u=[A(window,"message",e[23]),A(c,"visibilitychanged",e[22])],h=!0)},p(t,e){void 0!==t[11]?f?f.p(t,e):(f=oe(t),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),4096&e[0]&&z(c,"customtypography",t[12]),2048&e[0]&&z(c,"customcssurl",t[11]),512&e[0]&&z(c,"formattext",t[9]),2&e[0]&&z(c,"fontsize",t[1]),8&e[0]&&z(c,"color",t[3]),32&e[0]&&z(c,"highlightcolor",t[5]),128&e[0]&&z(c,"gradientstop1",t[7]),256&e[0]&&z(c,"gradientstop2",t[8]),1024&e[0]&&z(c,"demomode",t[10]),8192&e[0]&&P(d,t[13]),262144&e[0]&&O(l,"opacity",t[18].opacity),32768&e[0]&&N(l,"defaultTypography",t[15]),64&e[0]&&O(r,"background-color",t[6]),65536&e[0]&&O(r,"opacity",t[16].opacity),131072&e[0]&&O(r,"transform","translate(0px, "+t[17].y+"rem)"),1&e[0]&&O(o,"--height",t[0]),16&e[0]&&O(o,"--smalltextcolor",t[4]),4&e[0]&&O(o,"--hintfontsize",t[2])},i:t,o:t,d(t){f&&f.d(t),t&&w(n),t&&w(o),e[29](null),h=!1,i(u)}}}function ie(t,n,o){let r,i,s,c,a,{height:l="8rem"}=n,{hint:h=""}=n,{fontsize:u="1.5rem"}=n,{hintfontsize:f="0.9rem"}=n,{color:p="#ffffff"}=n,{smalltextcolor:g="#ffffff70"}=n,{highlightcolor:m="#15e8b5"}=n,{backgroundcolor:$="#202020"}=n,{gradientstop1:y="#ffffff88"}=n,{gradientstop2:b="#ffffffcc"}=n,{formattext:x}=n,{demomode:v}=n,{customcssurl:w}=n,{customtypography:T}=n,k=[],E=0,S="";const C=(t,e=!0)=>{P.set({opacity:0}),a&&e&&a.speechsegment(t),t.isFinal&&(E++,E<k.length?o(13,S=k[E]):o(13,S=k[Math.floor(Math.random()*k.length)]))},A=t=>{E=0,o(24,h=t),k=[];try{k=JSON.parse(h),("string"==typeof k||k instanceof String)&&(k=[k])}catch(t){k[0]=h||""}o(13,S=k[E])};let _=Ft({y:-1},{duration:200});d(t,_,(t=>o(17,s=t)));let z=Ft({opacity:0},{duration:200,easing:e});d(t,z,(t=>o(16,i=t)));let P=Ft({opacity:0},{duration:200,delay:200,easing:e});d(t,P,(t=>o(18,c=t)));return t.$$set=t=>{"height"in t&&o(0,l=t.height),"hint"in t&&o(24,h=t.hint),"fontsize"in t&&o(1,u=t.fontsize),"hintfontsize"in t&&o(2,f=t.hintfontsize),"color"in t&&o(3,p=t.color),"smalltextcolor"in t&&o(4,g=t.smalltextcolor),"highlightcolor"in t&&o(5,m=t.highlightcolor),"backgroundcolor"in t&&o(6,$=t.backgroundcolor),"gradientstop1"in t&&o(7,y=t.gradientstop1),"gradientstop2"in t&&o(8,b=t.gradientstop2),"formattext"in t&&o(9,x=t.formattext),"demomode"in t&&o(10,v=t.demomode),"customcssurl"in t&&o(11,w=t.customcssurl),"customtypography"in t&&o(12,T=t.customtypography)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&A(h),4096&t.$$.dirty[0]&&o(15,r=void 0===T||"false"===T)},[l,u,f,p,g,m,$,y,b,x,v,w,T,S,a,r,i,s,c,_,z,P,t=>{!1===t.detail?(_.set({y:-1},{easing:zt}),z.set({opacity:0}),P.set({opacity:0})):(_.set({y:0},{easing:Pt}),z.set({opacity:1}),P.set({opacity:1}))},t=>{switch(t.data.type){case wt.speechsegment:C(t.data.segment,!1);break;case wt.transcriptdrawerhint:A(t.data.hint)}},h,t=>{a&&a.speechhandled(t)},t=>{a&&a.speechstate(t)},C,A,function(t){U[t?"unshift":"push"]((()=>{a=t,o(14,a)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",ne);class se extends dt{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{margin-top:0.15rem}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%}</style>",lt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},ie,re,a,{height:0,hint:24,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,demomode:10,customcssurl:11,customtypography:12,speechhandled:25,speechstate:26,speechsegment:27,sethint:28},null,[-1,-1]),t&&(t.target&&v(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$$set({height:t}),G()}get hint(){return this.$$.ctx[24]}set hint(t){this.$$set({hint:t}),G()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$$set({fontsize:t}),G()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$$set({hintfontsize:t}),G()}get color(){return this.$$.ctx[3]}set color(t){this.$$set({color:t}),G()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$$set({smalltextcolor:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[10]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[11]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[12]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[25]}get speechstate(){return this.$$.ctx[26]}get speechsegment(){return this.$$.ctx[27]}get sethint(){return this.$$.ctx[28]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",se)})); | ||
xt=_t,wt=_t.exports,function(t){var e=wt,n=xt&&xt.exports==e&&xt,o="object"==typeof At&&At;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",l=-1,d=t.length-c;++l<d;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,o=t.charCodeAt(++l),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(l),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",l=-1;++l<e;)o=s.indexOf(t.charAt(l)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var l in a)a.hasOwnProperty(l)&&(e[l]=a[l]);else t.base64=a}(At),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(vt||(vt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(Tt||(Tt={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(kt||(kt={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(Et||(Et={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(St||(St={})),function(t){t.None="none",t.Whirl="whirl"}(Ct||(Ct={})),$t.Disconnected,$t.Connected,$t.Active,$t.Failed,ft.NoBrowserSupport,ft.NoAudioConsent;const Nt=[];function Rt(t){return"[object Date]"===Object.prototype.toString.call(t)}function Ft(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>Ft(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(Rt(t)&&Rt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=Ft(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function It(o,r={}){const i=function(e,n=t){let o;const r=new Set;function i(t){if(c(e,t)&&(e=t,o)){const t=!Nt.length;for(const t of r)t[1](),Nt.push(t,e);if(t){for(let t=0;t<Nt.length;t+=2)Nt[t][0](Nt[t+1]);Nt.length=0}}}return{set:i,update:function(t){i(t(e))},subscribe:function(s,c=t){const a=[s,c];return r.add(a),1===r.size&&(o=n(i)||t),s(e),()=>{r.delete(a),0===r.size&&(o(),o=null)}}}}(o);let s,a=o;function l(t,c){if(null==o)return i.set(o=t),Promise.resolve();a=t;let l=s,d=!1,{delay:h=0,duration:f=400,easing:p=e,interpolate:g=Ft}=n(n({},r),c);if(0===f)return l&&(l.abort(),l=null),i.set(o=a),Promise.resolve();const $=u()+h;let y;return s=m((e=>{if(e<$)return!0;d||(y=g(o,t),"function"==typeof f&&(f=f(o,t)),d=!0),l&&(l.abort(),l=null);const n=e-$;return n>f?(i.set(o=t),!1):(i.set(o=y(p(n/f))),!0)})),s.promise}return{set:l,update:(t,e)=>l(t(a,o),e),subscribe:i.subscribe}}function Dt(t){return function(e,n){if(!e.hasOwnProperty("ownerDocument")){Object.defineProperty(e,"ownerDocument",{get:function(){return e.parentElement}});let t=e;for(;t.parentElement;)t=t.parentElement;e.parentElement.head=t}return t(e,n)}}function Mt(t,{delay:e=0,speed:n,duration:o,easing:r=zt}={}){let i=t.getTotalLength();const s=getComputedStyle(t);return"butt"!==s.strokeLinecap&&(i+=parseInt(s.strokeWidth)),void 0===o?o=void 0===n?800:i/n:"function"==typeof o&&(o=o(i)),{delay:e,duration:o,easing:r,css:(t,e)=>`\n\t\t\tstroke-dasharray: ${i};\n\t\t\tstroke-dashoffset: ${e*i};\n\t\t`}}const Bt=[0,1];function Lt(t,e,n,o){if(e<n)return t[0];if(e>o)return t[t.length-1];let r=(o-n)/(t.length-1);if(r<=0)return t[0];let i=(e-n)/r,s=Math.floor(i),c=Math.ceil(i),a=i-s;return(1-a)*t[s]+a*t[c]}function jt(t){!function(t,e,n){const o=y(t);if(!o.getElementById(e)){const t=T("style");t.id=e,t.textContent=n,x(o,t)}}(t,"svelte-1fz8oog","canvas.svelte-1fz8oog{display:block;width:1.35rem;height:1.5rem;margin:0;padding:0 0.8rem 0 0rem;flex-grow:0;flex-shrink:0;flex-basis:1.35rem}")}function Ht(e){let n;return{c(){n=T("canvas"),O(n,"color",e[0]),O(n,"display","block"),O(n,"width","1.35rem"),O(n,"height","1.5rem"),O(n,"margin","0"),O(n,"padding","0 0.8rem 0 0rem"),O(n,"flex-grow","0"),O(n,"flex-shrink","0"),O(n,"flex-basis","1.35rem"),_(n,"class","svelte-1fz8oog")},m(t,o){w(t,n,o),e[3](n)},p(t,[e]){1&e&&O(n,"color",t[0])},i:t,o:t,d(t){t&&v(n),e[3](null)}}}function Ut(t,e,n){let{color:o="#60e0ff"}=e;const r=(t,e)=>{s=Date.now()>c?t:Math.max(s,t),c=Date.now()+e};let i,s=0,c=0,a=[0,0];const l=(t,e,n,o,r,i)=>{o<2*i&&(i=o/2),r<2*i&&(i=r/2),t.beginPath(),t.moveTo(e+i,n),t.arcTo(e+o,n,e+o,n+r,i),t.arcTo(e+o,n+r,e,n+r,i),t.arcTo(e,n+r,e,n,i),t.arcTo(e,n,e+o,n,i),t.closePath()};var d;return d=()=>{let t;const e=2*(a.length-1)+1,o=3*e+1*(e-1),d=()=>{if(t=requestAnimationFrame(d),!i)return;const e=i.getContext("2d");if(!e)return;let r=(t=>{var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e})(e),h=Number.parseInt(getComputedStyle(i).getPropertyValue("width").slice(0,-2)),u=Number.parseInt(getComputedStyle(i).getPropertyValue("height").slice(0,-2));n(1,i.width=h*r,i),n(1,i.height=u*r,i),Date.now()<c?a[0]=.15*s+.85*a[0]:a[0]=.0625+.75*a[0];let f=1;for(;f<a.length;)a[f]=.25*a[f-1]+.5*a[f]+.0625,f++;e.clearRect(0,0,i.width,i.height);const p=3/o*i.width*.5,g=4/o*i.width;for(e.fillStyle=i.style.color||"#000000",f=0;f<a.length;f++){const t=a[f]*i.height;t*i.height>2*p?l(e,.5*i.width-p+f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width+f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill(),f>0&&(t*i.height>2*p?l(e,.5*i.width-p-f*g,.5*(i.height-t),2*p,t,p):(e.beginPath(),e.arc(.5*i.width-f*g,.5*i.height,t*i.height*.5,0,2*Math.PI)),e.fill())}};return d(),r(1,500),()=>{cancelAnimationFrame(t)}},j().$$.on_mount.push(d),t.$$set=t=>{"color"in t&&n(0,o=t.color)},[o,i,r,function(t){U[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class Vt extends ut{constructor(t){super(),dt(this,t,Ut,Ht,c,{color:0,updateVU:2},jt)}get updateVU(){return this.$$.ctx[2]}}const{window:Wt}=st;function qt(t,e,n){const o=t.slice();return o[42]=e[n],o[44]=n,o}function Xt(t){let e;return{c(){e=T("div"),_(e,"class","TransscriptItemBgDiv")},m(t,n){w(t,e,n)},d(t){t&&v(e)}}}function Kt(e){let n,o;return{c(){n=T("div"),n.textContent="Listening...",_(n,"class","listening")},m(t,e){w(t,n,e)},i(t){o||K((()=>{o=it(n,e[21],{duration:400}),o.start()}))},o:t,d(t){t&&v(n)}}}function Yt(e){let n,o;return{c(){n=T("div"),_(n,"class","TransscriptItemBgDiv")},m(t,e){w(t,n,e)},p(t,n){e=t},i(t){o||K((()=>{o=it(n,e[21],{duration:e[14]}),o.start()}))},o:t,d(t){t&&v(n)}}}function Jt(t){let e,n;return{c(){e=T("span"),_(e,"style",n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")},m(t,n){w(t,e,n)},p(t,o){10240&o[0]&&n!==(n=t[44]<t[11].length-1?"width:0.25em;":t[13]?"width:1.2em;":"")&&_(e,"style",n)},d(t){t&&v(e)}}}function Zt(e){let n,o,r,i,s,c,a,l=e[42].word+"",d=e[16]&&Yt(e),h=e[44]<e[11].length&&Jt(e);return{c(){n=T("div"),d&&d.c(),o=S(),r=T("div"),i=E(l),s=S(),h&&h.c(),_(r,"class","TransscriptItemContent"),_(n,"class",a="TranscriptItem "+e[23](e[42])),N(n,"Entity",null!==e[42].entityType),N(n,"Final",e[42].isFinal)},m(t,e){w(t,n,e),d&&d.m(n,null),$(n,o),$(n,r),$(r,i),$(r,s),h&&h.m(r,null)},p(t,s){(e=t)[16]?d?65536&s[0]&&ot(d,1):(d=Yt(e),d.c(),ot(d,1),d.m(n,o)):d&&(d.d(1),d=null),2048&s[0]&&l!==(l=e[42].word+"")&&P(i,l),e[44]<e[11].length?h?h.p(e,s):(h=Jt(e),h.c(),h.m(r,null)):h&&(h.d(1),h=null),2048&s[0]&&a!==(a="TranscriptItem "+e[23](e[42]))&&_(n,"class",a),2048&s[0]&&N(n,"Entity",null!==e[42].entityType),2048&s[0]&&N(n,"Final",e[42].isFinal)},i(t){ot(d),c||K((()=>{c=it(r,e[21],{duration:e[14]}),c.start()}))},o:t,d(t){t&&v(n),d&&d.d(),h&&h.d()}}}function Gt(e){let n,o,r,i,s,c,a,l;return{c(){n=T("div"),o=T("div"),r=S(),i=T("div"),s=k("svg"),c=k("path"),_(o,"class","TransscriptItemBgDiv"),O(o,"background-color",e[5]),_(c,"stroke","currentColor"),_(c,"stroke-width","3"),_(c,"d","M7.191 11.444l4.059 6.107 7.376-12.949"),_(c,"fill","none"),_(c,"fill-rule","evenodd"),O(s,"width","2rem"),O(s,"height","2rem"),O(s,"position","absolute"),O(s,"transform","translate(-0.6rem, -0.5rem)"),O(s,"stroke","#eee"),_(s,"viewBox","0 0 24 24"),_(s,"xmlns","http://www.w3.org/2000/svg"),O(i,"width","1.0rem"),O(i,"height","1rem"),O(i,"position","relative"),_(n,"class","TranscriptItem")},m(t,e){w(t,n,e),$(n,o),$(n,r),$(n,i),$(i,s),$(s,c)},p(t,e){32&e[0]&&O(o,"background-color",t[5])},i(t){a||K((()=>{a=it(c,e[20],{duration:500}),a.start()})),l||K((()=>{l=it(n,e[21],{duration:200,maxWidth:3}),l.start()}))},o:t,d(t){t&&v(n)}}}function Qt(t){let e;return{c(){e=T("link"),_(e,"href","https://fonts.googleapis.com/css2?family=Saira+Condensed:wght@700&display=swap"),_(e,"rel","stylesheet")},m(t,n){w(t,e,n)},d(t){t&&v(e)}}}function te(t){let e;return{c(){e=T("link"),_(e,"href",t[10]),_(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){1024&n[0]&&_(e,"href",t[10])},d(t){t&&v(e)}}}function ee(e){let n,o,r,i,s,c,a,l,d,h,u,f,p,g,m,y=e[16]&&Xt(),b={color:e[5]};s=new Vt({props:b}),e[34](s);let x=e[17]&&Kt(e),k=e[11],E=[];for(let t=0;t<k.length;t+=1)E[t]=Zt(qt(e,k,t));let z=e[13]&&Gt(e),P=e[15]&&Qt(),R=void 0!==e[10]&&te(e);return{c(){var p;n=T("main"),o=T("div"),y&&y.c(),r=S(),i=T("div"),(p=s.$$.fragment)&&p.c(),c=S(),x&&x.c(),a=S();for(let t=0;t<E.length;t+=1)E[t].c();l=S(),z&&z.c(),d=S(),P&&P.c(),h=C(),u=S(),R&&R.c(),f=C(),this.c=t,_(i,"class","TransscriptItemContent"),_(o,"class","TranscriptItem"),_(n,"class","BigTranscript"),O(n,"--voffset",e[1]),O(n,"--hoffset",e[2]),O(n,"--fontsize",e[3]),O(n,"--color",e[4]),O(n,"--highlight-color",e[5]),O(n,"--text-bg-color",e[6]),O(n,"--gradient-stop1",e[7]),O(n,"--gradient-stop2",e[8]),O(n,"--marginbottom",e[9]),O(n,"--transition",e[18].transition),O(n,"opacity",e[18].transition),O(n,"max-height",10*Lt(Bt,e[18].transition,0,.6)+"rem"),O(n,"visibility",0!==e[18].transition?"visible":"hidden"),N(n,"placementTop","top"===e[0]),N(n,"defaultTypography",e[15])},m(t,b){w(t,n,b),$(n,o),y&&y.m(o,null),$(o,r),$(o,i),ct(s,i,null),$(i,c),x&&x.m(i,null),$(n,a);for(let t=0;t<E.length;t+=1)E[t].m(n,null);$(n,l),z&&z.m(n,null),w(t,d,b),P&&P.m(document.head,null),$(document.head,h),w(t,u,b),R&&R.m(t,b),w(t,f,b),p=!0,g||(m=A(Wt,"message",e[22]),g=!0)},p(t,e){t[16]?y||(y=Xt(),y.c(),y.m(o,r)):y&&(y.d(1),y=null);const c={};if(32&e[0]&&(c.color=t[5]),s.$set(c),t[17]?x?131072&e[0]&&ot(x,1):(x=Kt(t),x.c(),ot(x,1),x.m(i,null)):x&&(x.d(1),x=null),8464384&e[0]){let o;for(k=t[11],o=0;o<k.length;o+=1){const r=qt(t,k,o);E[o]?(E[o].p(r,e),ot(E[o],1)):(E[o]=Zt(r),E[o].c(),ot(E[o],1),E[o].m(n,l))}for(;o<E.length;o+=1)E[o].d(1);E.length=k.length}t[13]?z?(z.p(t,e),8192&e[0]&&ot(z,1)):(z=Gt(t),z.c(),ot(z,1),z.m(n,null)):z&&(z.d(1),z=null),(!p||2&e[0])&&O(n,"--voffset",t[1]),(!p||4&e[0])&&O(n,"--hoffset",t[2]),(!p||8&e[0])&&O(n,"--fontsize",t[3]),(!p||16&e[0])&&O(n,"--color",t[4]),(!p||32&e[0])&&O(n,"--highlight-color",t[5]),(!p||64&e[0])&&O(n,"--text-bg-color",t[6]),(!p||128&e[0])&&O(n,"--gradient-stop1",t[7]),(!p||256&e[0])&&O(n,"--gradient-stop2",t[8]),(!p||512&e[0])&&O(n,"--marginbottom",t[9]),(!p||262144&e[0])&&O(n,"--transition",t[18].transition),(!p||262144&e[0])&&O(n,"opacity",t[18].transition),(!p||262144&e[0])&&O(n,"max-height",10*Lt(Bt,t[18].transition,0,.6)+"rem"),(!p||262144&e[0])&&O(n,"visibility",0!==t[18].transition?"visible":"hidden"),(!p||1&e[0])&&N(n,"placementTop","top"===t[0]),(!p||32768&e[0])&&N(n,"defaultTypography",t[15]),t[15]?P||(P=Qt(),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),void 0!==t[10]?R?R.p(t,e):(R=te(t),R.c(),R.m(f.parentNode,f)):R&&(R.d(1),R=null)},i(t){if(!p){ot(s.$$.fragment,t),ot(x);for(let t=0;t<k.length;t+=1)ot(E[t]);ot(z),p=!0}},o(t){!function(t,e,n,o){if(t&&t.o){if(et.has(t))return;et.add(t),nt.c.push((()=>{et.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}(s.$$.fragment,t),p=!1},d(t){t&&v(n),y&&y.d(),e[34](null),at(s),x&&x.d(),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(E,t),z&&z.d(),t&&v(d),P&&P.d(t),v(h),t&&v(u),R&&R.d(t),t&&v(f),g=!1,m()}}}const ne=2e3,oe=3500;function re(t,e,n){let o,r,i,s,c,a,l,h,{placement:u}=e,{voffset:f="3rem"}=e,{hoffset:p="2rem"}=e,{fontsize:g="1.5rem"}=e,{color:m="#ffffff"}=e,{highlightcolor:$="#15e8b5"}=e,{backgroundcolor:y="#202020"}=e,{gradientstop1:b="#ffffff88"}=e,{gradientstop2:x="#ffffffcc"}=e,{marginbottom:w="0rem"}=e,{formattext:v}=e,{demomode:T}=e,{customcssurl:k}=e,{customtypography:E}=e,S=[],C=null,A=null,_=$t.Disconnected,z=!1,P=!1,O=!1,N=It({transition:0},{duration:200});d(t,N,(t=>n(18,l=t)));const R=j(),F=Dt(Mt),I=Dt(((t,{delay:e=0,duration:n=350,maxWidth:o=10})=>({delay:e,duration:n,css:t=>`\n max-width: ${Lt(Bt,t,0,1)*o}rem;\n `}))),D=t=>{n(13,O=O||t)},M=t=>{n(30,_=t),_===$t.Active&&(n(13,O=!1),n(11,S=[]),A=null)},B=t=>{if(void 0===t)return;h&&(s||_===$t.Active)&&h.updateVU(.5*Math.random()+.5,75*Math.random()+75),t.isFinal?L(S.length>0?s?oe:ne:0):S.length>0&&(z||n(31,z=!0),L(ne));const e=`${t.contextId}/${t.id}`;null!==A?A!==e&&(n(13,O=!1),A=e):A=e,n(11,S=[]),t.words.forEach((t=>{n(11,S[t.index]={word:t.value,serialNumber:t.index,entityType:null,isFinal:t.isFinal,hide:!1},S)})),i?t.entities.forEach((t=>{n(11,S[t.startPosition].word=t.value,S),n(11,S[t.startPosition].entityType=t.type,S),n(11,S[t.startPosition].isFinal=t.isFinal,S),n(11,S[t.startPosition].hide=!1,S);for(let e=t.startPosition+1;e<t.endPosition;e++)S[e]&&n(11,S[e].hide=!0,S)})):t.entities.forEach((t=>{for(let e=t.startPosition;e<t.endPosition;e++)S[e]&&(n(11,S[e].entityType=t.type,S),n(11,S[e].isFinal=t.isFinal,S))})),n(11,S=S.filter((t=>!t.hide)))},L=(t=0)=>{H(),C=window.setTimeout((()=>{C=null,z&&n(31,z=!1)}),t)},H=()=>{null!==C&&(window.clearTimeout(C),C=null)};return t.$$set=t=>{"placement"in t&&n(0,u=t.placement),"voffset"in t&&n(1,f=t.voffset),"hoffset"in t&&n(2,p=t.hoffset),"fontsize"in t&&n(3,g=t.fontsize),"color"in t&&n(4,m=t.color),"highlightcolor"in t&&n(5,$=t.highlightcolor),"backgroundcolor"in t&&n(6,y=t.backgroundcolor),"gradientstop1"in t&&n(7,b=t.gradientstop1),"gradientstop2"in t&&n(8,x=t.gradientstop2),"marginbottom"in t&&n(9,w=t.marginbottom),"formattext"in t&&n(24,v=t.formattext),"demomode"in t&&n(25,T=t.demomode),"customcssurl"in t&&n(10,k=t.customcssurl),"customtypography"in t&&n(26,E=t.customtypography)},t.$$.update=()=>{if(2048&t.$$.dirty[0]&&n(17,o=0===S.length),64&t.$$.dirty[0]&&n(16,r="none"!==y),16777216&t.$$.dirty[0]&&(i=void 0===v||"false"!==v),33554432&t.$$.dirty[0]&&n(33,s=void 0!==T&&"false"!==T),67108864&t.$$.dirty[0]&&n(15,c=void 0===E||"false"===E),4&t.$$.dirty[1]&&n(14,a=s?800:350),1073741824&t.$$.dirty[0]|3&t.$$.dirty[1]){const t=_===$t.Active||z;t!==P&&(e="visibilitychanged",l=t,R.dispatchEvent(new CustomEvent(e,{detail:l,composed:!0}))),n(32,P=t),N.set({transition:P?1:0})}var e,l;4&t.$$.dirty[1]&&(s||L(0))},[u,f,p,g,m,$,y,b,x,w,k,S,h,O,a,c,r,o,l,N,F,I,t=>{switch(t.data.type){case Tt.speechsegment:B(t.data.segment);break;case Tt.speechhandled:D(t.data.success);break;case Tt.speechstate:M(t.data.state)}},t=>t.entityType||"",v,T,E,D,M,B,_,z,P,s,function(t){U[t?"unshift":"push"]((()=>{h=t,n(12,h)}))}]}class ie extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>main{position:relative;user-select:none;display:flex;flex-direction:row;justify-content:start;flex-wrap:wrap;margin-bottom:calc(var(--marginbottom) * var(--transition));height:fit-content}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--color);font-size:var(--fontsize);line-height:135%}.TranscriptItem{position:relative;display:flex;flex-direction:row;align-items:center}.Entity{color:var(--highlight-color)}.TransscriptItemContent{z-index:1;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:center;overflow:hidden;white-space:nowrap}.TransscriptItemBgDiv{position:absolute;box-sizing:content-box;width:100%;height:100%;top:-0.2rem;left:-0.8rem;margin:0;padding:0.2rem 0.8rem;background-color:var(--text-bg-color);z-index:-1}.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;margin:var(--voffset) var(--hoffset) 0 var(--hoffset);z-index:50;pointer-events:none}.listening{animation:flow 1s linear infinite;background:linear-gradient(-60deg, var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1), var(--gradient-stop2), var(--gradient-stop1));background-size:200%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;-webkit-box-decoration-break:clone}@keyframes flow{0%{background-position:100% 50%}100%{background-position:0% 50%}}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},re,ee,a,{placement:0,voffset:1,hoffset:2,fontsize:3,color:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,marginbottom:9,formattext:24,demomode:25,customcssurl:10,customtypography:26,speechhandled:27,speechstate:28,speechsegment:29},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["placement","voffset","hoffset","fontsize","color","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","marginbottom","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment"]}get placement(){return this.$$.ctx[0]}set placement(t){this.$$set({placement:t}),G()}get voffset(){return this.$$.ctx[1]}set voffset(t){this.$$set({voffset:t}),G()}get hoffset(){return this.$$.ctx[2]}set hoffset(t){this.$$set({hoffset:t}),G()}get fontsize(){return this.$$.ctx[3]}set fontsize(t){this.$$set({fontsize:t}),G()}get color(){return this.$$.ctx[4]}set color(t){this.$$set({color:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get marginbottom(){return this.$$.ctx[9]}set marginbottom(t){this.$$set({marginbottom:t}),G()}get formattext(){return this.$$.ctx[24]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[25]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[10]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[26]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[27]}get speechstate(){return this.$$.ctx[28]}get speechsegment(){return this.$$.ctx[29]}}function se(t){let e;return{c(){e=T("link"),_(e,"href",t[11]),_(e,"rel","stylesheet")},m(t,n){w(t,e,n)},p(t,n){2048&n[0]&&_(e,"href",t[11])},d(t){t&&v(e)}}}function ce(e){let n,o,r,s,c,a,l,d,h,u,f=void 0!==e[11]&&se(e);return{c(){f&&f.c(),n=S(),o=T("main"),r=T("div"),s=T("div"),c=T("big-transcript"),a=S(),l=T("div"),d=E(e[13]),this.c=t,z(c,"customtypography",e[12]),z(c,"customcssurl",e[11]),z(c,"formattext",e[9]),z(c,"fontsize",e[1]),z(c,"color",e[3]),z(c,"backgroundcolor","none"),z(c,"highlightcolor",e[5]),z(c,"gradientstop1",e[7]),z(c,"gradientstop2",e[8]),z(c,"demomode",e[10]),_(l,"class","hint"),O(l,"opacity",e[18].opacity),N(l,"defaultTypography",e[15]),_(s,"class","pad"),_(r,"class","drawer"),O(r,"background-color",e[6]),O(r,"opacity",e[16].opacity),O(r,"transform","translate(0px, "+e[17].y+"rem)"),_(o,"class","placementTop"),O(o,"--height",e[0]),O(o,"--smalltextcolor",e[4]),O(o,"--hintfontsize",e[2])},m(t,i){f&&f.m(t,i),w(t,n,i),w(t,o,i),$(o,r),$(r,s),$(s,c),e[29](c),$(s,a),$(s,l),$(l,d),h||(u=[A(window,"message",e[23]),A(c,"visibilitychanged",e[22])],h=!0)},p(t,e){void 0!==t[11]?f?f.p(t,e):(f=se(t),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),4096&e[0]&&z(c,"customtypography",t[12]),2048&e[0]&&z(c,"customcssurl",t[11]),512&e[0]&&z(c,"formattext",t[9]),2&e[0]&&z(c,"fontsize",t[1]),8&e[0]&&z(c,"color",t[3]),32&e[0]&&z(c,"highlightcolor",t[5]),128&e[0]&&z(c,"gradientstop1",t[7]),256&e[0]&&z(c,"gradientstop2",t[8]),1024&e[0]&&z(c,"demomode",t[10]),8192&e[0]&&P(d,t[13]),262144&e[0]&&O(l,"opacity",t[18].opacity),32768&e[0]&&N(l,"defaultTypography",t[15]),64&e[0]&&O(r,"background-color",t[6]),65536&e[0]&&O(r,"opacity",t[16].opacity),131072&e[0]&&O(r,"transform","translate(0px, "+t[17].y+"rem)"),1&e[0]&&O(o,"--height",t[0]),16&e[0]&&O(o,"--smalltextcolor",t[4]),4&e[0]&&O(o,"--hintfontsize",t[2])},i:t,o:t,d(t){f&&f.d(t),t&&v(n),t&&v(o),e[29](null),h=!1,i(u)}}}function ae(t,n,o){let r,i,s,c,a,{height:l="8rem"}=n,{hint:h=""}=n,{fontsize:u="1.5rem"}=n,{hintfontsize:f="0.9rem"}=n,{color:p="#ffffff"}=n,{smalltextcolor:g="#ffffff70"}=n,{highlightcolor:m="#15e8b5"}=n,{backgroundcolor:$="#202020"}=n,{gradientstop1:y="#ffffff88"}=n,{gradientstop2:b="#ffffffcc"}=n,{formattext:x}=n,{demomode:w}=n,{customcssurl:v}=n,{customtypography:T}=n,k=[],E=0,S="";const C=(t,e=!0)=>{P.set({opacity:0}),a&&e&&a.speechsegment(t),t.isFinal&&(E++,E<k.length?o(13,S=k[E]):o(13,S=k[Math.floor(Math.random()*k.length)]))},A=t=>{E=0,o(24,h=t),k=[];try{k=JSON.parse(h),("string"==typeof k||k instanceof String)&&(k=[k])}catch(t){k[0]=h||""}o(13,S=k[E])};let _=It({y:-1},{duration:200});d(t,_,(t=>o(17,s=t)));let z=It({opacity:0},{duration:200,easing:e});d(t,z,(t=>o(16,i=t)));let P=It({opacity:0},{duration:200,delay:200,easing:e});d(t,P,(t=>o(18,c=t)));return t.$$set=t=>{"height"in t&&o(0,l=t.height),"hint"in t&&o(24,h=t.hint),"fontsize"in t&&o(1,u=t.fontsize),"hintfontsize"in t&&o(2,f=t.hintfontsize),"color"in t&&o(3,p=t.color),"smalltextcolor"in t&&o(4,g=t.smalltextcolor),"highlightcolor"in t&&o(5,m=t.highlightcolor),"backgroundcolor"in t&&o(6,$=t.backgroundcolor),"gradientstop1"in t&&o(7,y=t.gradientstop1),"gradientstop2"in t&&o(8,b=t.gradientstop2),"formattext"in t&&o(9,x=t.formattext),"demomode"in t&&o(10,w=t.demomode),"customcssurl"in t&&o(11,v=t.customcssurl),"customtypography"in t&&o(12,T=t.customtypography)},t.$$.update=()=>{16777216&t.$$.dirty[0]&&A(h),4096&t.$$.dirty[0]&&o(15,r=void 0===T||"false"===T)},[l,u,f,p,g,m,$,y,b,x,w,v,T,S,a,r,i,s,c,_,z,P,t=>{!1===t.detail?(_.set({y:-1},{easing:Pt}),z.set({opacity:0}),P.set({opacity:0})):(_.set({y:0},{easing:Ot}),z.set({opacity:1}),P.set({opacity:1}))},t=>{switch(t.data.type){case Tt.speechsegment:C(t.data.segment,!1);break;case Tt.transcriptdrawerhint:A(t.data.hint)}},h,t=>{a&&a.speechhandled(t)},t=>{a&&a.speechstate(t)},C,A,function(t){U[t?"unshift":"push"]((()=>{a=t,o(14,a)}))}]}customElements.get("big-transcript")?console.warn("Skipping re-defining customElement big-transcript"):customElements.define("big-transcript",ie);class le extends ht{constructor(t){super(),this.shadowRoot.innerHTML="<style>.placementTop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:60;pointer-events:none}.drawer{width:100%;min-height:var(--height);display:flex;flex-direction:column;justify-content:flex-end;box-shadow:0 0 0.35rem #0004}.pad{position:relative;padding:2rem 2rem 0.65rem 1.5rem}.hint{margin-top:0.15rem}.defaultTypography{font-family:'Saira Condensed', sans-serif;text-transform:uppercase;color:var(--smalltextcolor);font-size:var(--hintfontsize);line-height:135%}</style>",dt(this,{target:this.shadowRoot,props:R(this.attributes),customElement:!0},ae,ce,a,{height:0,hint:24,fontsize:1,hintfontsize:2,color:3,smalltextcolor:4,highlightcolor:5,backgroundcolor:6,gradientstop1:7,gradientstop2:8,formattext:9,demomode:10,customcssurl:11,customtypography:12,speechhandled:25,speechstate:26,speechsegment:27,sethint:28},null,[-1,-1]),t&&(t.target&&w(t.target,this,t.anchor),t.props&&(this.$set(t.props),G()))}static get observedAttributes(){return["height","hint","fontsize","hintfontsize","color","smalltextcolor","highlightcolor","backgroundcolor","gradientstop1","gradientstop2","formattext","demomode","customcssurl","customtypography","speechhandled","speechstate","speechsegment","sethint"]}get height(){return this.$$.ctx[0]}set height(t){this.$$set({height:t}),G()}get hint(){return this.$$.ctx[24]}set hint(t){this.$$set({hint:t}),G()}get fontsize(){return this.$$.ctx[1]}set fontsize(t){this.$$set({fontsize:t}),G()}get hintfontsize(){return this.$$.ctx[2]}set hintfontsize(t){this.$$set({hintfontsize:t}),G()}get color(){return this.$$.ctx[3]}set color(t){this.$$set({color:t}),G()}get smalltextcolor(){return this.$$.ctx[4]}set smalltextcolor(t){this.$$set({smalltextcolor:t}),G()}get highlightcolor(){return this.$$.ctx[5]}set highlightcolor(t){this.$$set({highlightcolor:t}),G()}get backgroundcolor(){return this.$$.ctx[6]}set backgroundcolor(t){this.$$set({backgroundcolor:t}),G()}get gradientstop1(){return this.$$.ctx[7]}set gradientstop1(t){this.$$set({gradientstop1:t}),G()}get gradientstop2(){return this.$$.ctx[8]}set gradientstop2(t){this.$$set({gradientstop2:t}),G()}get formattext(){return this.$$.ctx[9]}set formattext(t){this.$$set({formattext:t}),G()}get demomode(){return this.$$.ctx[10]}set demomode(t){this.$$set({demomode:t}),G()}get customcssurl(){return this.$$.ctx[11]}set customcssurl(t){this.$$set({customcssurl:t}),G()}get customtypography(){return this.$$.ctx[12]}set customtypography(t){this.$$set({customtypography:t}),G()}get speechhandled(){return this.$$.ctx[25]}get speechstate(){return this.$$.ctx[26]}get speechsegment(){return this.$$.ctx[27]}get sethint(){return this.$$.ctx[28]}}customElements.get("transcript-drawer")?console.warn("Skipping re-defining customElement transcript-drawer"):customElements.define("transcript-drawer",le)})); | ||
//# sourceMappingURL=transcript-drawer.js.map |
import type { Behaviour, Effect, Icon, TriggerFx } from "./constants"; | ||
export type { Segment, Intent, Word, Entity } from "@speechly/browser-client"; | ||
export declare type ITaggedWord = { | ||
export type ITaggedWord = { | ||
word: string; | ||
@@ -10,3 +10,3 @@ serialNumber: number; | ||
}; | ||
export declare type IAppearance = { | ||
export type IAppearance = { | ||
icon: Icon; | ||
@@ -17,5 +17,5 @@ behaviour: Behaviour; | ||
}; | ||
export declare type IHoldEvent = { | ||
export type IHoldEvent = { | ||
timeMs: number; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,4 +0,4 @@ | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}let s;function c(t,e){return s||(s=document.createElement("a")),s.href=e,t===s.href}function a(t,e){return t!=t?e==e:t!==e}const d="undefined"!=typeof window;let u=d?()=>window.performance.now():()=>Date.now(),l=d?t=>requestAnimationFrame(t):t;const f=new Set;function h(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&l(h)}function p(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t){const e=v("style");return function(t,e){p(t.head||t,e),e.sheet}(m(t),e),e.sheet}function b(t,e,n){t.insertBefore(e,n||null)}function $(t){t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function y(t){return document.createTextNode(t)}function w(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function x(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function S(t){const e={};for(const n of t)e[n.name]=n.value;return e}const C=new Map;let _,A=0;function T(t,e,n,o,r,i,s,c=0){const a=16.666/o;let d="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);d+=100*t+`%{${s(o,1-o)}}\n`}const u=d+`100% {${s(n,1-n)}}\n}`,l=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${c}`,f=m(t),{stylesheet:h,rules:p}=C.get(f)||function(t,e){const n={stylesheet:g(e),rules:{}};return C.set(t,n),n}(f,t);p[l]||(p[l]=!0,h.insertRule(`@keyframes ${l} ${u}`,h.cssRules.length));const b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${l} ${o}ms linear ${r}ms 1 both`,A+=1,l}function k(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),A-=r,A||l((()=>{A||(C.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)})),C.clear())})))}function z(t){_=t}function O(){if(!_)throw new Error("Function called outside component initialization");return _}const N=[],R=[],D=[],P=[],F=Promise.resolve();let L=!1;function M(t){D.push(t)}const H=new Set;let B,I=0;function j(){const t=_;do{for(;I<N.length;){const t=N[I];I++,z(t),q(t.$$)}for(z(null),N.length=0,I=0;R.length;)R.pop()();for(let t=0;t<D.length;t+=1){const e=D[t];H.has(e)||(H.add(e),e())}D.length=0}while(N.length);for(;P.length;)P.pop()();L=!1,H.clear(),z(t)}function q(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(M)}}function U(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const X=new Set;let W;function V(t,e){t&&t.i&&(X.delete(t),t.i(e))}function Y(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),W.c.push((()=>{X.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const K={duration:0};function Z(n,o,s,c){let a=o(n,s),d=c?0:1,p=null,m=null,g=null;function b(){g&&k(n,g)}function $(t,e){const n=t.b-d;return e*=Math.abs(n),{a:d,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function v(o){const{delay:i=0,duration:s=300,easing:c=e,tick:v=t,css:y}=a||K,w={start:u()+i,b:o};o||(w.group=W,W.r+=1),p||m?m=w:(y&&(b(),g=T(n,d,o,s,i,c,y)),o&&v(0,1),p=$(w,s),M((()=>U(n,o,"start"))),function(t){let e;0===f.size&&l(h),new Promise((n=>{f.add(e={c:t,f:n})}))}((t=>{if(m&&t>m.start&&(p=$(m,s),m=null,U(n,p.b,"start"),y&&(b(),g=T(n,d,p.b,p.duration,0,c,a.css))),p)if(t>=p.end)v(d=p.b,1-d),U(n,p.b,"end"),m||(p.b?b():--p.group.r||r(p.group.c)),p=null;else if(t>=p.start){const e=t-p.start;d=p.a+p.d*c(e/p.duration),v(d,1-d)}return!(!p&&!m)})))}return{run(t){i(a)?(B||(B=Promise.resolve(),B.then((()=>{B=null}))),B).then((()=>{a=a(),v(t)})):v(t)},end(){b(),p=m=null}}}const G="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function J(t,e){-1===t.$$.dirty[0]&&(N.push(t),L||(L=!0,F.then(j)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Q(e,s,c,a,d,u,l,f=[-1]){const h=_;z(e);const p=e.$$={fragment:null,ctx:[],props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};l&&l(p.root);let m=!1;if(p.ctx=c?c(e,s.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&d(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),m&&J(e,t)),n})):[],p.update(),m=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);p.fragment&&p.fragment.l(t),t.forEach($)}else p.fragment&&p.fragment.c();s.intro&&V(e.$$.fragment),function(t,e,o,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,o),s||M((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),a.forEach(M)}(e,s.target,s.anchor,s.customElement),j()}z(h)}let tt;function et(t,{delay:n=0,duration:o=400,easing:r=e}={}){const i=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:r,css:t=>"opacity: "+t*i}}var nt,ot,rt,it,st;"function"==typeof HTMLElement&&(tt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}),function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(nt||(nt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ot||(ot={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(rt||(rt={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(it||(it={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(st||(st={})),new Map([[st.Failed,"Failed"],[st.Disconnected,"Disconnected"],[st.Connected,"Connected"],[st.Active,"Active"]]);for(var ct=[],at=0;at<256;++at)ct.push((at+256).toString(16).substr(1));var dt,ut,lt,ft,ht,pt,mt,gt,bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$t={exports:{}}; | ||
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(){}const e=t=>t;function n(t){return t()}function o(){return Object.create(null)}function r(t){t.forEach(n)}function i(t){return"function"==typeof t}let s;function c(t,e){return s||(s=document.createElement("a")),s.href=e,t===s.href}function a(t,e){return t!=t?e==e:t!==e}const d="undefined"!=typeof window;let u=d?()=>window.performance.now():()=>Date.now(),l=d?t=>requestAnimationFrame(t):t;const f=new Set;function h(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&l(h)}function p(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function g(t){const e=v("style");return function(t,e){p(t.head||t,e),e.sheet}(m(t),e),e.sheet}function b(t,e,n){t.insertBefore(e,n||null)}function $(t){t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function y(t){return document.createTextNode(t)}function w(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function E(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function x(t,e,n,o){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function S(t){const e={};for(const n of t)e[n.name]=n.value;return e}const C=new Map;let _,A=0;function T(t,e,n,o,r,i,s,c=0){const a=16.666/o;let d="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*i(t);d+=100*t+`%{${s(o,1-o)}}\n`}const u=d+`100% {${s(n,1-n)}}\n}`,l=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${c}`,f=m(t),{stylesheet:h,rules:p}=C.get(f)||function(t,e){const n={stylesheet:g(e),rules:{}};return C.set(t,n),n}(f,t);p[l]||(p[l]=!0,h.insertRule(`@keyframes ${l} ${u}`,h.cssRules.length));const b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${l} ${o}ms linear ${r}ms 1 both`,A+=1,l}function k(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),A-=r,A||l((()=>{A||(C.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&$(e)})),C.clear())})))}function z(t){_=t}function O(){if(!_)throw new Error("Function called outside component initialization");return _}const N=[],R=[],D=[],P=[],F=Promise.resolve();let L=!1;function M(t){D.push(t)}const H=new Set;let B,I=0;function j(){if(0!==I)return;const t=_;do{try{for(;I<N.length;){const t=N[I];I++,z(t),q(t.$$)}}catch(t){throw N.length=0,I=0,t}for(z(null),N.length=0,I=0;R.length;)R.pop()();for(let t=0;t<D.length;t+=1){const e=D[t];H.has(e)||(H.add(e),e())}D.length=0}while(N.length);for(;P.length;)P.pop()();L=!1,H.clear(),z(t)}function q(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(M)}}function U(t,e,n){t.dispatchEvent(function(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}(`${e?"intro":"outro"}${n}`))}const X=new Set;let W;function V(t,e){t&&t.i&&(X.delete(t),t.i(e))}function Y(t,e,n,o){if(t&&t.o){if(X.has(t))return;X.add(t),W.c.push((()=>{X.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const K={duration:0};function Z(n,o,s,c){const a={direction:"both"};let d=o(n,s,a),p=c?0:1,m=null,g=null,b=null;function $(){b&&k(n,b)}function v(t,e){const n=t.b-p;return e*=Math.abs(n),{a:p,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function y(o){const{delay:i=0,duration:s=300,easing:c=e,tick:a=t,css:y}=d||K,w={start:u()+i,b:o};o||(w.group=W,W.r+=1),m||g?g=w:(y&&($(),b=T(n,p,o,s,i,c,y)),o&&a(0,1),m=v(w,s),M((()=>U(n,o,"start"))),function(t){let e;0===f.size&&l(h),new Promise((n=>{f.add(e={c:t,f:n})}))}((t=>{if(g&&t>g.start&&(m=v(g,s),g=null,U(n,m.b,"start"),y&&($(),b=T(n,p,m.b,m.duration,0,c,d.css))),m)if(t>=m.end)a(p=m.b,1-p),U(n,m.b,"end"),g||(m.b?$():--m.group.r||r(m.group.c)),m=null;else if(t>=m.start){const e=t-m.start;p=m.a+m.d*c(e/m.duration),a(p,1-p)}return!(!m&&!g)})))}return{run(t){i(d)?(B||(B=Promise.resolve(),B.then((()=>{B=null}))),B).then((()=>{d=d(a),y(t)})):y(t)},end(){$(),m=g=null}}}const G="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function J(t,e){-1===t.$$.dirty[0]&&(N.push(t),L||(L=!0,F.then(j)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Q(e,s,c,a,d,u,l,f=[-1]){const h=_;z(e);const p=e.$$={fragment:null,ctx:[],props:u,update:t,not_equal:d,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(h?h.$$.context:[])),callbacks:o(),dirty:f,skip_bound:!1,root:s.target||h.$$.root};l&&l(p.root);let m=!1;if(p.ctx=c?c(e,s.props||{},((t,n,...o)=>{const r=o.length?o[0]:n;return p.ctx&&d(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),m&&J(e,t)),n})):[],p.update(),m=!0,r(p.before_update),p.fragment=!!a&&a(p.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);p.fragment&&p.fragment.l(t),t.forEach($)}else p.fragment&&p.fragment.c();s.intro&&V(e.$$.fragment),function(t,e,o,s){const{fragment:c,after_update:a}=t.$$;c&&c.m(e,o),s||M((()=>{const e=t.$$.on_mount.map(n).filter(i);t.$$.on_destroy?t.$$.on_destroy.push(...e):r(e),t.$$.on_mount=[]})),a.forEach(M)}(e,s.target,s.anchor,s.customElement),j()}z(h)}let tt;function et(t,{delay:n=0,duration:o=400,easing:r=e}={}){const i=+getComputedStyle(t).opacity;return{delay:n,duration:o,easing:r,css:t=>"opacity: "+t*i}}var nt,ot,rt,it,st;"function"==typeof HTMLElement&&(tt=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(i);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!i(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}),function(t){t.NoAudioConsent="NoAudioConsent",t.NoBrowserSupport="NoBrowserSupport",t.Stopped="Stopped",t.Starting="Starting",t.Started="Started"}(nt||(nt={})),function(t){t.Started="started",t.Stopped="stopped",t.SegmentEnd="segment_end",t.Transcript="transcript",t.Entity="entity",t.Intent="intent",t.TentativeTranscript="tentative_transcript",t.TentativeEntities="tentative_entities",t.TentativeIntent="tentative_intent"}(ot||(ot={})),function(t){t.Opened="WEBSOCKET_OPEN",t.Closed="WEBSOCKET_CLOSED",t.AudioProcessorReady="SOURCE_SAMPLE_RATE_SET_SUCCESS",t.VadSignalHigh="VadSignalHigh",t.VadSignalLow="VadSignalLow",t.RequestContextStart="RequestContextStart"}(rt||(rt={})),function(t){t.connect="connect",t.initAudioProcessor="initAudioProcessor",t.adjustAudioProcessor="adjustAudioProcessor",t.SET_SHARED_ARRAY_BUFFERS="SET_SHARED_ARRAY_BUFFERS",t.CLOSE="CLOSE",t.START_CONTEXT="START_CONTEXT",t.SWITCH_CONTEXT="SWITCH_CONTEXT",t.STOP_CONTEXT="STOP_CONTEXT",t.AUDIO="AUDIO",t.startStream="startStream",t.stopStream="stopStream",t.setContextOptions="setContextOptions"}(it||(it={})),function(t){t[t.Failed=0]="Failed",t[t.Disconnected=1]="Disconnected",t[t.Connected=2]="Connected",t[t.Active=3]="Active"}(st||(st={})),new Map([[st.Failed,"Failed"],[st.Disconnected,"Disconnected"],[st.Connected,"Connected"],[st.Active,"Active"]]);for(var ct=[],at=0;at<256;++at)ct.push((at+256).toString(16).substr(1));var dt,ut,lt,ft,ht,pt,mt,gt,bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$t={exports:{}}; | ||
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */ | ||
dt=$t,ut=$t.exports,function(t){var e=ut,n=dt&&dt.exports==e&&dt,o="object"==typeof bt&&bt;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",d=-1,u=t.length-c;++d<u;)e=t.charCodeAt(d)<<16,n=t.charCodeAt(++d)<<8,o=t.charCodeAt(++d),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(d)<<8,n=t.charCodeAt(++d),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(d),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",d=-1;++d<e;)o=s.indexOf(t.charAt(d)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var d in a)a.hasOwnProperty(d)&&(e[d]=a[d]);else t.base64=a}(bt),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(lt||(lt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(ft||(ft={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(ht||(ht={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(pt||(pt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(mt||(mt={})),function(t){t.None="none",t.Whirl="whirl"}(gt||(gt={})),st.Disconnected,st.Connected,st.Active,st.Failed,nt.NoBrowserSupport,nt.NoAudioConsent;const{window:vt}=G;function yt(t){let e,n,o,r,i,s,a,d,u,l,f,h;return{c(){e=v("modalcontent"),n=v("animation"),o=v("button"),r=y(" "),i=v("video"),s=v("source"),d=y("\n Your browser does not support the video tag."),E(o,"class","close"),c(s.src,a=t[0])||E(s,"src",a),E(s,"type","video/mp4"),E(i,"width","100%"),E(i,"height","auto"),i.autoplay=!0,i.muted=!0,i.loop=!0,E(e,"class",t[2])},m(c,a){b(c,e,a),p(e,n),p(n,o),p(n,r),p(n,i),p(i,s),p(i,d),l=!0,f||(h=w(o,"click",t[5]),f=!0)},p(t,n){(!l||1&n&&!c(s.src,a=t[0]))&&E(s,"src",a),(!l||4&n)&&E(e,"class",t[2])},i(n){l||(M((()=>{u||(u=Z(e,t[4],{},!0)),u.run(1)})),l=!0)},o(n){u||(u=Z(e,t[4],{},!1)),u.run(0),l=!1},d(t){t&&$(e),t&&u&&u.end(),f=!1,h()}}}function wt(e){let n,o,i,s,c=e[3]&&yt(e);return{c(){n=v("modal"),c&&c.c(),this.c=t,x(n,"--remsize",e[1])},m(t,r){b(t,n,r),c&&c.m(n,null),o=!0,i||(s=w(vt,"keydown",e[6]),i=!0)},p(t,[e]){t[3]?c?(c.p(t,e),8&e&&V(c,1)):(c=yt(t),c.c(),V(c,1),c.m(n,null)):c&&(W={r:0,c:[],p:W},Y(c,1,1,(()=>{c=null})),W.r||r(W.c),W=W.p),(!o||2&e)&&x(n,"--remsize",t[1])},i(t){o||(V(c),o=!0)},o(t){Y(c),o=!1},d(t){t&&$(n),c&&c.d(),i=!1,s()}}}function Et(t,e,n){let o,{video:r=""}=e,{hide:i}=e,{remsize:s="1.0rem"}=e,{position:c="fixed"}=e;const a=(()=>{const t=O();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}})(),d=(u=et,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return u(t,e)});var u;let l=!1;var f;f=()=>{n(8,l=!0)},O().$$.on_mount.push(f);const h=()=>{n(3,o=!1),a("speechlyvideoclosed"),window.postMessage({type:"speechlyvideoclosed"},"*")};return t.$$set=t=>{"video"in t&&n(0,r=t.video),"hide"in t&&n(7,i=t.hide),"remsize"in t&&n(1,s=t.remsize),"position"in t&&n(2,c=t.position)},t.$$.update=()=>{384&t.$$.dirty&&n(3,o=l&&"false"===i)},[r,s,c,o,d,h,t=>{l&&"Escape"===t.key&&(t.preventDefault(),h())},i,l]}class xt extends tt{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);height:100%}modalcontent{z-index:2001;pointer-events:none}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}animation{position:absolute;box-sizing:border-box;width:300px;margin:1rem;top:0;right:0;border-radius:8px;pointer-events:auto}video{box-sizing:border-box;width:100%;border-radius:0.5rem;overflow:hidden;border:1px solid #0002}.close{--button-size:1.5rem;display:block;box-sizing:border-box;position:absolute;z-index:1000;top:0.25rem;right:0.25rem;margin:0;padding:0;width:var(--button-size);height:var(--button-size);border:0;color:black;border-radius:1.5rem;background:transparent;box-shadow:0 0 0 1px transparent;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close:before,.close:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:calc(var(--button-size) - 0.5rem);height:1px;background:#728195;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close:hover{background:#ffffff}.close:hover:before,.close:hover:after{height:2px;background:black}.close:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close:active{transform:scale(0.9)}.close:hover,.close:focus,.close:active{outline:none}</style>",Q(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},Et,wt,a,{video:0,hide:7,remsize:1,position:2},null),t&&(t.target&&b(t.target,this,t.anchor),t.props&&(this.$set(t.props),j()))}static get observedAttributes(){return["video","hide","remsize","position"]}get video(){return this.$$.ctx[0]}set video(t){this.$$set({video:t}),j()}get hide(){return this.$$.ctx[7]}set hide(t){this.$$set({hide:t}),j()}get remsize(){return this.$$.ctx[1]}set remsize(t){this.$$set({remsize:t}),j()}get position(){return this.$$.ctx[2]}set position(t){this.$$set({position:t}),j()}}customElements.get("video-guide")?console.warn("Skipping re-defining customElement video-guide"):customElements.define("video-guide",xt)})); | ||
dt=$t,ut=$t.exports,function(t){var e=ut,n=dt&&dt.exports==e&&dt,o="object"==typeof bt&&bt;o.global!==o&&o.window!==o||(t=o);var r=function(t){this.message=t};(r.prototype=new Error).name="InvalidCharacterError";var i=function(t){throw new r(t)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,a={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,o,r,c=t.length%3,a="",d=-1,u=t.length-c;++d<u;)e=t.charCodeAt(d)<<16,n=t.charCodeAt(++d)<<8,o=t.charCodeAt(++d),a+=s.charAt((r=e+n+o)>>18&63)+s.charAt(r>>12&63)+s.charAt(r>>6&63)+s.charAt(63&r);return 2==c?(e=t.charCodeAt(d)<<8,n=t.charCodeAt(++d),a+=s.charAt((r=e+n)>>10)+s.charAt(r>>4&63)+s.charAt(r<<2&63)+"="):1==c&&(r=t.charCodeAt(d),a+=s.charAt(r>>2)+s.charAt(r<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var n,o,r=0,a="",d=-1;++d<e;)o=s.indexOf(t.charAt(d)),n=r%4?64*n+o:o,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"0.1.0"};if(e&&!e.nodeType)if(n)n.exports=a;else for(var d in a)a.hasOwnProperty(d)&&(e[d]=a[d]);else t.base64=a}(bt),function(t){t.SpeechlyFirstConnect="SpeechlyFirstConnect"}(lt||(lt={})),function(t){t.speechlypoweron="speechlypoweron",t.holdstart="holdstart",t.holdend="holdend",t.speechstate="speechstate",t.audiosourcestate="audiosourcestate",t.speechsegment="speechsegment",t.speechhandled="speechhandled",t.showhint="showhint",t.transcriptdrawerhint="hint",t.speechlyintroready="speechlyintroready",t.speechlyintroclosed="speechlyintroclosed",t.startcontext="startcontext",t.stopcontext="stopcontext",t.requeststartmicrophone="requeststartmicrophone"}(ft||(ft={})),function(t){t.Mic="mic",t.MicActive="micactive",t.Error="error",t.Denied="denied"}(ht||(ht={})),function(t){t.Hold="hold",t.Click="click",t.Noninteractive="noninteractive"}(pt||(pt={})),function(t){t.None="none",t.Connecting="connecting",t.Busy="busy"}(mt||(mt={})),function(t){t.None="none",t.Whirl="whirl"}(gt||(gt={})),st.Disconnected,st.Connected,st.Active,st.Failed,nt.NoBrowserSupport,nt.NoAudioConsent;const vt=()=>{const t=O();return(e,n)=>{t.dispatchEvent(new CustomEvent(e,{detail:n,composed:!0}))}},{window:yt}=G;function wt(t){let e,n,o,r,i,s,a,d,u,l,f,h;return{c(){e=v("modalcontent"),n=v("animation"),o=v("button"),r=y(" "),i=v("video"),s=v("source"),d=y("\n Your browser does not support the video tag."),E(o,"class","close"),c(s.src,a=t[0])||E(s,"src",a),E(s,"type","video/mp4"),E(i,"width","100%"),E(i,"height","auto"),i.autoplay=!0,i.muted=!0,i.loop=!0,E(e,"class",t[2])},m(c,a){b(c,e,a),p(e,n),p(n,o),p(n,r),p(n,i),p(i,s),p(i,d),l=!0,f||(h=w(o,"click",t[5]),f=!0)},p(t,n){(!l||1&n&&!c(s.src,a=t[0]))&&E(s,"src",a),(!l||4&n)&&E(e,"class",t[2])},i(n){l||(M((()=>{u||(u=Z(e,t[4],{},!0)),u.run(1)})),l=!0)},o(n){u||(u=Z(e,t[4],{},!1)),u.run(0),l=!1},d(t){t&&$(e),t&&u&&u.end(),f=!1,h()}}}function Et(e){let n,o,i,s,c=e[3]&&wt(e);return{c(){n=v("modal"),c&&c.c(),this.c=t,x(n,"--remsize",e[1])},m(t,r){b(t,n,r),c&&c.m(n,null),o=!0,i||(s=w(yt,"keydown",e[6]),i=!0)},p(t,[e]){t[3]?c?(c.p(t,e),8&e&&V(c,1)):(c=wt(t),c.c(),V(c,1),c.m(n,null)):c&&(W={r:0,c:[],p:W},Y(c,1,1,(()=>{c=null})),W.r||r(W.c),W=W.p),(!o||2&e)&&x(n,"--remsize",t[1])},i(t){o||(V(c),o=!0)},o(t){Y(c),o=!1},d(t){t&&$(n),c&&c.d(),i=!1,s()}}}function xt(t,e,n){let o,{video:r=""}=e,{hide:i}=e,{remsize:s="1.0rem"}=e,{position:c="fixed"}=e;const a=vt(),d=(u=et,function(t,e){if(!t.hasOwnProperty("ownerDocument")){Object.defineProperty(t,"ownerDocument",{get:function(){return t.parentElement}});let e=t;for(;e.parentElement;)e=e.parentElement;t.parentElement.head=e}return u(t,e)});var u;let l=!1;var f;f=()=>{n(8,l=!0)},O().$$.on_mount.push(f);const h=()=>{n(3,o=!1),a("speechlyvideoclosed"),window.postMessage({type:"speechlyvideoclosed"},"*")};return t.$$set=t=>{"video"in t&&n(0,r=t.video),"hide"in t&&n(7,i=t.hide),"remsize"in t&&n(1,s=t.remsize),"position"in t&&n(2,c=t.position)},t.$$.update=()=>{384&t.$$.dirty&&n(3,o=l&&"false"===i)},[r,s,c,o,d,h,t=>{l&&"Escape"===t.key&&(t.preventDefault(),h())},i,l]}class St extends tt{constructor(t){super(),this.shadowRoot.innerHTML="<style>modal{font-size:var(--remsize);height:100%}modalcontent{z-index:2001;pointer-events:none}modalcontent.fixed{position:fixed;top:0;left:0;right:0;bottom:0;overflow-x:hidden;overflow-y:auto}modalcontent.absolute{position:absolute;top:0;left:0;right:0;height:100vh}animation{position:absolute;box-sizing:border-box;width:300px;margin:1rem;top:0;right:0;border-radius:8px;pointer-events:auto}video{box-sizing:border-box;width:100%;border-radius:0.5rem;overflow:hidden;border:1px solid #0002}.close{--button-size:1.5rem;display:block;box-sizing:border-box;position:absolute;z-index:1000;top:0.25rem;right:0.25rem;margin:0;padding:0;width:var(--button-size);height:var(--button-size);border:0;color:black;border-radius:1.5rem;background:transparent;box-shadow:0 0 0 1px transparent;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close:before,.close:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:calc(var(--button-size) - 0.5rem);height:1px;background:#728195;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close:hover{background:#ffffff}.close:hover:before,.close:hover:after{height:2px;background:black}.close:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close:active{transform:scale(0.9)}.close:hover,.close:focus,.close:active{outline:none}</style>",Q(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},xt,Et,a,{video:0,hide:7,remsize:1,position:2},null),t&&(t.target&&b(t.target,this,t.anchor),t.props&&(this.$set(t.props),j()))}static get observedAttributes(){return["video","hide","remsize","position"]}get video(){return this.$$.ctx[0]}set video(t){this.$$set({video:t}),j()}get hide(){return this.$$.ctx[7]}set hide(t){this.$$set({hide:t}),j()}get remsize(){return this.$$.ctx[1]}set remsize(t){this.$$set({remsize:t}),j()}get position(){return this.$$.ctx[2]}set position(t){this.$$set({position:t}),j()}}customElements.get("video-guide")?console.warn("Skipping re-defining customElement video-guide"):customElements.define("video-guide",St)})); | ||
//# sourceMappingURL=video-guide.js.map |
{ | ||
"name": "@speechly/browser-ui", | ||
"description": "Ready-made UI components to build a reactive voice interface to a web site or app. Uses Speechly's real-time cloud API for speech-to-text and NLU.", | ||
"version": "6.0.5", | ||
"version": "6.0.6", | ||
"scripts": { | ||
@@ -12,4 +12,13 @@ "build": "rimraf core && rollup -c --silent", | ||
"staging": "set -o allexport;. ./.env.local;set +o allexport && test -n \"$REACT_APP__DEPLOY_STAGING_URI\" && pnpm run build && rsync -avz --delete core/ $REACT_APP__DEPLOY_STAGING_URI" | ||
}, | ||
"author": "Speechly", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/speechly/ui-components.git", | ||
"directory": "browser-client" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/speechly/ui-components/issues" | ||
}, | ||
"devDependencies": { | ||
@@ -35,6 +44,7 @@ "@rollup/plugin-commonjs": "^21", | ||
"dependencies": { | ||
"@speechly/browser-client": "^2.6.2" | ||
"@speechly/browser-client": "^2.6.3" | ||
}, | ||
"files": [ | ||
"core/**/*","src/**/*" | ||
"core/**/*", | ||
"src/**/*" | ||
], | ||
@@ -41,0 +51,0 @@ "main": "./core/index.js", |
116
README.md
<div align="center" markdown="1"> | ||
<a href="https://www.speechly.com"> | ||
<img src="https://d33wubrfki0l68.cloudfront.net/f15fc952956e1952d6bd23661b7a7ee6b775faaa/c1b30/img/speechly-logo-duo-black.svg" height="48" /> | ||
</a> | ||
<br/> | ||
### Real-time automatic speech recognition and natural language understanding tools in one flexible API | ||
![speechly-logo-duo-black](https://user-images.githubusercontent.com/2579244/193574443-130d16d6-76f1-4401-90f2-0ed753b39bc0.svg) | ||
[Website](https://www.speechly.com/) | ||
 |  | ||
 ·  | ||
[Docs](https://docs.speechly.com/) | ||
 |  | ||
[Discussions](https://github.com/speechly/speechly/discussions) | ||
 |  | ||
 ·  | ||
[Support](https://github.com/speechly/speechly/discussions) | ||
 ·  | ||
[Blog](https://www.speechly.com/blog/) | ||
 |  | ||
[Podcast](https://anchor.fm/the-speechly-podcast) | ||
 ·  | ||
[Login](https://api.speechly.com/dashboard/) | ||
--- | ||
<br/> | ||
</div> | ||
# Speechly Browser UI components | ||
# Speechly Browser UI Components | ||
Ready made Speechly [UI components](https://docs.speechly.com/client-libraries/ui-components/) to build a reactive voice interface to a web site or app. See these CodePens for a preview: | ||
![build](https://img.shields.io/github/actions/workflow/status/speechly/ui-components/build.yaml?branch=main&logo=github) | ||
[![npm](https://img.shields.io/npm/v/@speechly/browser-ui?color=cb3837&logo=npm)](https://www.npmjs.com/package/@speechly/browser-ui) | ||
[![license](http://img.shields.io/:license-mit-blue.svg)](/LICENSE) | ||
- [Speech-to-text CodePen](https://codepen.io/speechly/pen/VwzoMrW) | ||
- [Sneaker Shop CodePen](https://codepen.io/speechly/pen/dyzxVzv) | ||
Ready-made UI components for building reactive voice interface using JavaScript and Speechly. | ||
> If you want to build a custom interface for you web app, you may want to check out [browser-client](https://github.com/speechly/speechly/tree/main/libraries/browser-client) ([npm](https://www.npmjs.com/package/@speechly/browser-client)) for direct access to Speechly API. | ||
> 🚧 This project is no longer actively maintained and is looking for a maintainer. If you're interested, get in touch https://www.speechly.com/contact | ||
## Introduction To Components | ||
![image](https://user-images.githubusercontent.com/2579244/220076001-fc7e3dab-da21-4909-9891-af933a91755a.png) | ||
- [Push-To-Talk Button](https://docs.speechly.com/ui-components/push-to-talk-button/) provides a button to control listening on/off. It comes integrated with [browser-client](https://github.com/speechly/speechly/tree/main/libraries/browser-client). | ||
- [Big Transcript](https://docs.speechly.com/ui-components/big-transcript/) is an overlay-style component that displays real-time speech-to-text transcript and feedback to the user. Recognized entities are highlighted. | ||
- [Transcript Drawer](https://docs.speechly.com/ui-components/big-transcript/) is an alternative to Big Transcript that slides down from the top of the viewport. It displays usage hints along with the real-time speech-to-text transcript and feedback. | ||
- [Intro Popup](https://docs.speechly.com/ui-components/intro-popup/) provides a customizable introduction to voice features, guides the user through browser mic permission setup and helps recover from common problems. | ||
## Documentation | ||
- [UI component gallery and API](https://docs.speechly.com/ui-components/) | ||
- [Basic Speechly usage](https://docs.speechly.com/client-libraries/usage/) | ||
- [Getting started with Speechly](https://docs.speechly.com/basics/getting-started) | ||
- [Speechly UI components](https://dreamy-cori-a02de1.netlify.app/ui-components/) | ||
- [API reference](./docs/index.md) | ||
## Browser Usage | ||
## Getting started | ||
You'll need a [Speechly account](https://api.speechly.com/dashboard/) and a Speechly application that's using a Conformer model. Follow our [quick start guide](https://docs.speechly.com/basics/getting-started) to get started with Speechly. | ||
## Browser usage | ||
Include the Web Components from a CDN that mirrors [`@speechly/browser-ui`](https://www.npmjs.com/package/@speechly/browser-ui) npm package. The script tags register `push-to-talk-button`, `big-transcript` and `intro-popup` with the browser's customElement registry so you can use them like regular tags. | ||
``` | ||
```html | ||
<head> | ||
@@ -59,3 +58,3 @@ <script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/push-to-talk-button.js"></script> | ||
placement="bottom" | ||
appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"> | ||
appid="YOUR-APP-ID"> | ||
</push-to-talk-button> | ||
@@ -72,8 +71,9 @@ <intro-popup> | ||
```bash | ||
npm install @speechly/browser-ui | ||
``` | ||
npm i @speechly/browser-ui | ||
``` | ||
In App.js: | ||
``` | ||
```js | ||
import "@speechly/browser-ui/core/push-to-talk-button"; | ||
@@ -83,59 +83,11 @@ import "@speechly/browser-ui/core/big-transcript"; | ||
... | ||
// ... | ||
<big-transcript placement="top"></big-transcript> | ||
<push-to-talk-button placement="bottom" appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"></push-to-talk-button> | ||
<push-to-talk-button placement="bottom" appid="YOUR-APP-ID"></push-to-talk-button> | ||
<intro-popup></intro-popup> | ||
``` | ||
## Building and developing | ||
## Contributing | ||
The build steps are needed if you want to contibute to the development of the components or need to fork them for customization. | ||
### Requirements | ||
* [Node](https://nodejs.org/) (tested with v14.16.1+) | ||
### Built With | ||
* [Typescript](https://www.typescriptlang.org/) | ||
* [Rush](https://rushjs.io/) We use Rush to build the dependencies from the monorepository. | ||
* [Svelte 3](https://svelte.dev/) | ||
* [Speechly browser-client](https://www.npmjs.com/package/@speechly/browser-client) that provides websocket connectivity and audio handling for Push-To-Talk Button component | ||
### Install Rush (one-time only) | ||
``` | ||
npm install -g @microsoft/rush | ||
``` | ||
### Running the development build | ||
``` | ||
rush update | ||
# Build dependencies | ||
rush build --to-except browser-ui | ||
# Compile the library, serve the testbench pages and watch changes | ||
rushx dev | ||
``` | ||
Open http://localhost:5000 or http://localhost:5000/extras to see the components on testbench pages. | ||
### Building for production | ||
``` | ||
rush update | ||
rush build --to browser-ui | ||
# Check build artefacts | ||
ls core/ | ||
``` | ||
## Learn more | ||
- [browser-client](https://github.com/speechly/speechly/tree/main/libraries/browser-client) library for direct access to Speechly API | ||
- [react-client](https://github.com/speechly/speechly/tree/main/libraries/react-client) library for direct access to Speechly API | ||
- [react-ui](https://github.com/speechly/speechly/tree/main/libraries/react-ui) ready made components for building reactive voice interfaces | ||
- [More integration options](https://docs.speechly.com/dev-tools/overview/) in Speechly docs | ||
- [Speechly Dashboard](https://api.speechly.com/dashboard/) for creating and configuring a Speechly app id. | ||
- [docs.speechly.com](https://docs.speechly.com) | ||
- [speechly.com](https://speechly.com) | ||
See contribution guide in [CONTRIBUTING.md](https://github.com/speechly/speechly/blob/main/CONTRIBUTING.md). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2351178
2160
0
0
90